Skip to content

Commit

Permalink
Fakeplayer regen amount config (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Oct 25, 2023
1 parent 4022332 commit ba2e042
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 25 deletions.
6 changes: 4 additions & 2 deletions patches/server/0005-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ index a6e72d29f3168cbc252f7013b15b3678e65ae38d..c42d7526b37d0e11ce8f2b16fa03061d
.withRequiredArg()
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..ce9855b560ee6602983b2d05c9f80902674f248f
index 0000000000000000000000000000000000000000..e2b4cdf549f66ccc243442a239b3a94ed1429cd0
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,1047 @@
@@ -0,0 +1,1049 @@
+package top.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -341,6 +341,7 @@ index 0000000000000000000000000000000000000000..ce9855b560ee6602983b2d05c9f80902
+ public static boolean openFakeplayerInventory = false;
+ public static boolean fakeplayerSkipSleep = false;
+ public static boolean fakeplayerSpawnPhantom = false;
+ public static float fakeplayerRegenAmount = 0.010f;
+ private static void fakeplayer() {
+ fakeplayerSupport = getBoolean("settings.modify.fakeplayer.enable", fakeplayerSupport);
+ unableFakeplayerNames = getList("settings.modify.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames);
Expand All @@ -352,6 +353,7 @@ index 0000000000000000000000000000000000000000..ce9855b560ee6602983b2d05c9f80902
+ openFakeplayerInventory = getBoolean("settings.modify.fakeplayer.open-fakeplayer-inventory", openFakeplayerInventory);
+ fakeplayerSkipSleep = getBoolean("settings.modify.fakeplayer.skip-sleep-check", fakeplayerSkipSleep);
+ fakeplayerSpawnPhantom = getBoolean("settings.modify.fakeplayer.spawn-phantom", fakeplayerSpawnPhantom);
+ fakeplayerRegenAmount = (float) getDouble("settings.modify.fakeplayer.regen-amount", fakeplayerRegenAmount);
+ }
+
+ public static boolean shearsInDispenserCanZeroAmount = false;
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ index c993fde1c026a270f370c437edba9e679aefb44f..342fd19005b8cfd8e9ca0d5bbbf2b070
* The start ID for the counter.
*/
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index ce9855b560ee6602983b2d05c9f80902674f248f..7963e2233d3ff3a511927109b5a35f511dcca2a6 100644
index e2b4cdf549f66ccc243442a239b3a94ed1429cd0..b3675ab0b40862993efb71ff9bda6ec82830312d 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -8,6 +8,9 @@ import org.bukkit.command.Command;
Expand Down Expand Up @@ -1209,7 +1209,7 @@ index 0000000000000000000000000000000000000000..daaece30b2a3983f1cc9ee9a851e8f37
+}
diff --git a/src/main/java/top/leavesmc/leaves/bot/ServerBot.java b/src/main/java/top/leavesmc/leaves/bot/ServerBot.java
new file mode 100644
index 0000000000000000000000000000000000000000..70d67422cce02bffd3f9a40f574b50c067356757
index 0000000000000000000000000000000000000000..8c41c8034135d575d9f62847ba5894e84b5b0d21
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/bot/ServerBot.java
@@ -0,0 +1,710 @@
Expand Down Expand Up @@ -1526,7 +1526,7 @@ index 0000000000000000000000000000000000000000..70d67422cce02bffd3f9a40f574b50c0
+
+ float health = getHealth();
+ float maxHealth = getMaxHealth();
+ float regenAmount = 0.010f;
+ float regenAmount = LeavesConfig.fakeplayerRegenAmount;
+ float amount;
+
+ if (health < maxHealth - regenAmount) {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0019-Optimize-mob-spawning.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize mob spawning
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 7963e2233d3ff3a511927109b5a35f511dcca2a6..c6f0a6e9c6fa5706e514e054e393a080dddeb8e2 100644
index b3675ab0b40862993efb71ff9bda6ec82830312d..989af2131f10e7e0301df668856d9246e95cf7b9 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -255,7 +255,7 @@ public final class LeavesConfig {
@@ -257,7 +257,7 @@ public final class LeavesConfig {
noChatSign = getBoolean("settings.misc.no-chat-sign", noChatSign);
}

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0021-Multithreaded-Tracker.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Multithreaded Tracker
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index c6f0a6e9c6fa5706e514e054e393a080dddeb8e2..67e85a55e2a58848d0a9a253fd40ae559f7eb532 100644
index 989af2131f10e7e0301df668856d9246e95cf7b9..6a39a8a3add22d2fc5caa6bd8420f7dfa4ab3c92 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -269,7 +269,7 @@ public final class LeavesConfig {
@@ -271,7 +271,7 @@ public final class LeavesConfig {
dontSendUselessEntityPackets = getBoolean("settings.performance.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
}

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0036-Async-Pathfinding.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
But Pufferfish patch was ported downstream from the Petal fork

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 67e85a55e2a58848d0a9a253fd40ae559f7eb532..d0c7d3883723bcc0c4753170ddff766ef908250e 100644
index 6a39a8a3add22d2fc5caa6bd8420f7dfa4ab3c92..407abf0fe642e4b8aa0f1faa3ab030b557c40e25 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -370,7 +370,7 @@ public final class LeavesConfig {
@@ -372,7 +372,7 @@ public final class LeavesConfig {
// only config now
public static boolean asyncPathfinding = false;
private static boolean asyncPathfindingLock = false;
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0051-MC-Technical-Survival-Mode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ index 5eded2322d604c3a304194926a740818631f36de..797725f7472ed36bf5a1369a7dfe600a
entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
continue;
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index d0c7d3883723bcc0c4753170ddff766ef908250e..b5065d533c4fa0610bf936e036dc0d5ba37f63cf 100644
index 407abf0fe642e4b8aa0f1faa3ab030b557c40e25..ac3642af48056698686d0784bb483f99d3f84fa3 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -2,6 +2,7 @@ package top.leavesmc.leaves;
Expand All @@ -120,7 +120,7 @@ index d0c7d3883723bcc0c4753170ddff766ef908250e..b5065d533c4fa0610bf936e036dc0d5b
import net.minecraft.server.MinecraftServer;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
@@ -490,6 +491,14 @@ public final class LeavesConfig {
@@ -492,6 +493,14 @@ public final class LeavesConfig {

public static void doMcTechnicalMode() {
if (mcTechnicalMode) {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0055-Leaves-Extra-Yggdrasil-Service.patch
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ index 3f4b4d905ff440eaf4a66b10ad85933c0b07dc58..7dec27260fce938f5d1e5c437f564ed9
public final Thread serverThread;
private long nextTickTime;
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index b5065d533c4fa0610bf936e036dc0d5ba37f63cf..db6b7ff06bf646aa50afadc354b381821cb5b1a9 100644
index ac3642af48056698686d0784bb483f99d3f84fa3..50403436dbe22328c7099c1d04b2a87d4f55aab6 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -11,6 +11,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
Expand All @@ -68,7 +68,7 @@ index b5065d533c4fa0610bf936e036dc0d5ba37f63cf..db6b7ff06bf646aa50afadc354b38182
import top.leavesmc.leaves.util.MathUtils;

import java.io.File;
@@ -527,6 +528,9 @@ public final class LeavesConfig {
@@ -529,6 +530,9 @@ public final class LeavesConfig {
extraYggdrasilLoginProtect = getBoolean("settings.misc.extra-yggdrasil-service.login-protect", extraYggdrasilLoginProtect);
extraYggdrasilServiceList = getList("settings.misc.extra-yggdrasil-service.urls", extraYggdrasilServiceList);
if (extraYggdrasilService) {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0060-Syncmatica-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ index 79a236ec2b7e9bab6c9a6c25b3b9f08152891c34..5fe844179c66204ec3eacc1bbfe6128a
public void tick() {
if (this.ackBlockChangesUpTo > -1) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index db6b7ff06bf646aa50afadc354b381821cb5b1a9..7a1fae214f7ed5c664459665f43011c84e6b6259 100644
index 50403436dbe22328c7099c1d04b2a87d4f55aab6..21dfdd30a5d0629cc78139ab74b3aa14e67778f4 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -12,6 +12,7 @@ import top.leavesmc.leaves.command.LeavesCommand;
Expand All @@ -38,7 +38,7 @@ index db6b7ff06bf646aa50afadc354b381821cb5b1a9..7a1fae214f7ed5c664459665f43011c8
import top.leavesmc.leaves.util.MathUtils;

import java.io.File;
@@ -565,6 +566,7 @@ public final class LeavesConfig {
@@ -567,6 +568,7 @@ public final class LeavesConfig {
syncmaticaQuota = getBoolean("settings.protocol.syncmatica.quota", syncmaticaQuota);
syncmaticaQuotaLimit = getInt("settings.protocol.syncmatica.quota-limit", syncmaticaQuotaLimit);
if (syncmaticaProtocol) {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0067-Leaves-carpet-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Leaves carpet support


diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 7a1fae214f7ed5c664459665f43011c84e6b6259..79e3e4ae09d29134219485800d8d9efc91d9ce6b 100644
index 21dfdd30a5d0629cc78139ab74b3aa14e67778f4..dbb780dcb7e803a34a7638a8f0c40a5a615a3148 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -14,6 +14,8 @@ import top.leavesmc.leaves.bot.agent.Actions;
Expand All @@ -17,7 +17,7 @@ index 7a1fae214f7ed5c664459665f43011c84e6b6259..79e3e4ae09d29134219485800d8d9efc

import java.io.File;
import java.lang.reflect.InvocationTargetException;
@@ -609,6 +611,8 @@ public final class LeavesConfig {
@@ -611,6 +613,8 @@ public final class LeavesConfig {
}

public static void registerCarpetRules() {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0080-Bladeren-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Bladeren Protocol


diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index f378005cafe92f57e8264757b17eeb9d43b177aa..38e6a4299e7664608b288ec4fff29f4979337544 100644
index a9d1d2a304bc96ae7993f7a8302cc6602474c6aa..01514c0948c4705f7cee872ddd4686741feabefe 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -17,6 +17,8 @@ import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
Expand All @@ -25,7 +25,7 @@ index f378005cafe92f57e8264757b17eeb9d43b177aa..38e6a4299e7664608b288ec4fff29f49

commands = new HashMap<>();
commands.put("leaves", new LeavesCommand("leaves"));
@@ -853,6 +856,10 @@ public final class LeavesConfig {
@@ -855,6 +858,10 @@ public final class LeavesConfig {
}

public static void registerLeavesFeatures() {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0110-Add-Leaves-Auto-Update.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Add Leaves Auto Update


diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 38e6a4299e7664608b288ec4fff29f4979337544..99192e8c41613fee3bbd432e55ac24f1178f3edc 100644
index 01514c0948c4705f7cee872ddd4686741feabefe..204718256522b0bcfb2f71754fe737876bcd60bd 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -17,6 +17,7 @@ import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
Expand All @@ -16,7 +16,7 @@ index 38e6a4299e7664608b288ec4fff29f4979337544..99192e8c41613fee3bbd432e55ac24f1
import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeatureSet;
import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeature;

@@ -825,6 +826,7 @@ public final class LeavesConfig {
@@ -827,6 +828,7 @@ public final class LeavesConfig {
private static void autoUpdate() {
autoUpdate = getBoolean("settings.misc.auto-update.enable", autoUpdate);
autoUpdateTime = getList("settings.misc.auto-update.time", autoUpdateTime);
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0122-Villager-infinite-discounts.patch
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ index c3d1d7b525a6f2b708144ebe9bc28dfadcfe11fa..55b4386fc57286548161f9ee91e19e22

private GossipType(String key, int multiplier, int maxReputation, int decay, int shareDecrement) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 99192e8c41613fee3bbd432e55ac24f1178f3edc..9a320d0452b9059614e7a58fdf86ec4bf8e02e50 100644
index 204718256522b0bcfb2f71754fe737876bcd60bd..ea9791925fa0e942c912b0548c9bd054cbf0e951 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -20,6 +20,7 @@ import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
Expand All @@ -32,7 +32,7 @@ index 99192e8c41613fee3bbd432e55ac24f1178f3edc..9a320d0452b9059614e7a58fdf86ec4b

import java.io.File;
import java.lang.reflect.InvocationTargetException;
@@ -898,6 +899,9 @@ public final class LeavesConfig {
@@ -900,6 +901,9 @@ public final class LeavesConfig {
private static void villagerInfiniteDiscounts() {
villagerInfiniteDiscounts = getBoolean("settings.modify.minecraft-old.villager-infinite-discounts", villagerInfiniteDiscounts);
if (villagerInfiniteDiscounts) {
Expand Down

0 comments on commit ba2e042

Please sign in to comment.