mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-22 00:19:33 +00:00
Add Fakeplayer limit and list command
And Format Patches
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Fri, 29 Oct 2021 16:52:57 +0800
|
||||
Subject: [PATCH] Leaves Server Config
|
||||
Subject: [PATCH] Leaves Server Config And Command
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -31,15 +31,16 @@ index 7301c552ab695b81560eeefa44b2f29d4f4ac258..35fef03d2825d9e7f5ee324384ea8270
|
||||
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
|
||||
Arrays.fill( recentTps, 20 );
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index bdd6560fe85950b0a857a949cb38c044da44ca6b..7ad3569628fd6c6ac0038394e7d88979b29935a0 100644
|
||||
index bdd6560fe85950b0a857a949cb38c044da44ca6b..d27f115b74fe00623985255d1027656166c1c459 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -226,6 +226,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -226,6 +226,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
|
||||
// Paper end
|
||||
+
|
||||
+ top.leavesmc.leaves.LeavesConfig.init((java.io.File) options.valueOf("leaves-settings")); // Leaves - Server Config
|
||||
+ top.leavesmc.leaves.LeavesConfig.registerCommands(); // Leaves - Server Command
|
||||
|
||||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
@@ -64,7 +65,7 @@ index 5a2a1d394852d39ea576624586f7fa736dec807c..fd18fb454263893d404979a9c9af860e
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b64c470234c8f50f1cfb83bf6d2efb5038eae45b..599ad9516e9642f774c4f8b1d60b453a775b172a 100644
|
||||
index b64c470234c8f50f1cfb83bf6d2efb5038eae45b..9e21aa4d6464b86923f4ccc4cdec9e3b663dd268 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -959,6 +959,7 @@ public final class CraftServer implements Server {
|
||||
@@ -83,7 +84,15 @@ index b64c470234c8f50f1cfb83bf6d2efb5038eae45b..599ad9516e9642f774c4f8b1d60b453a
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -2723,6 +2725,14 @@ public final class CraftServer implements Server {
|
||||
@@ -989,6 +991,7 @@ public final class CraftServer implements Server {
|
||||
this.reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
+ top.leavesmc.leaves.LeavesConfig.registerCommands(); // Leaves - Server Command
|
||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -2723,6 +2726,14 @@ public final class CraftServer implements Server {
|
||||
{
|
||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||
}
|
||||
@@ -119,16 +128,17 @@ index 95f296ef42cb9f1d486962a0a31da9aa436967c7..e40978698bd76132b56d5a1bc9791f05
|
||||
.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..ec35e33ecbba6f2cb1dcc2e739841b7e6612c9ea
|
||||
index 0000000000000000000000000000000000000000..4c290eb2d4abf9e9b923b8d0878f319328b7cf8c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -0,0 +1,289 @@
|
||||
@@ -0,0 +1,309 @@
|
||||
+package top.leavesmc.leaves;
|
||||
+
|
||||
+import com.destroystokyo.paper.util.SneakyThrow;
|
||||
+import com.google.common.base.Throwables;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.configuration.ConfigurationSection;
|
||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+
|
||||
@@ -136,7 +146,9 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+import java.lang.reflect.InvocationTargetException;
|
||||
+import java.lang.reflect.Method;
|
||||
+import java.lang.reflect.Modifier;
|
||||
+import java.util.HashMap;
|
||||
+import java.util.List;
|
||||
+import java.util.Map;
|
||||
+import java.util.logging.Level;
|
||||
+
|
||||
+// Powered by Tuinity(https://github.com/Tuinity/Tuinity)
|
||||
@@ -144,7 +156,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+public final class LeavesConfig {
|
||||
+
|
||||
+ public static final String CONFIG_HEADER = "Configuration file for Leaves.";
|
||||
+ public static final int CURRENT_CONFIG_VERSION = 1;
|
||||
+ public static final int CURRENT_CONFIG_VERSION = 2;
|
||||
+
|
||||
+ private static final Object[] EMPTY = new Object[0];
|
||||
+
|
||||
@@ -152,6 +164,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+ public static YamlConfiguration config;
|
||||
+ private static int configVersion;
|
||||
+ public static boolean createWorldSections = true;
|
||||
+ static Map<String, Command> commands;
|
||||
+
|
||||
+ public static void init(final File file) {
|
||||
+ LeavesConfig.configFile = file;
|
||||
@@ -181,7 +194,11 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+ LeavesConfig.configVersion = LeavesConfig.getInt("config-version", CURRENT_CONFIG_VERSION);
|
||||
+ LeavesConfig.set("config-version", CURRENT_CONFIG_VERSION);
|
||||
+
|
||||
+ updateConfigVersion(config);
|
||||
+
|
||||
+ LeavesConfig.load(config);
|
||||
+
|
||||
+ commands = new HashMap<>();
|
||||
+ }
|
||||
+
|
||||
+ public static void load(final YamlConfiguration config) {
|
||||
@@ -208,10 +225,22 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static void updateConfigVersion(final YamlConfiguration config) {
|
||||
+ if (configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ static void set(final String path, final Object value) {
|
||||
+ LeavesConfig.config.set(path, value);
|
||||
+ }
|
||||
+
|
||||
+ public static void registerCommands() {
|
||||
+ for (Map.Entry<String, Command> entry : commands.entrySet()) {
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Leaves", entry.getValue());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ static boolean getBoolean(final String path, final boolean dfl) {
|
||||
+ LeavesConfig.config.addDefault(path, Boolean.valueOf(dfl));
|
||||
+ return LeavesConfig.config.getBoolean(path, dfl);
|
||||
@@ -254,7 +283,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+ this.worldDefaults = LeavesConfig.config.createSection("world-settings.default");
|
||||
+ }
|
||||
+
|
||||
+ String worldSectionPath = LeavesConfig.configVersion < 0 ? this.worldName : "world-settings.".concat(this.worldName);
|
||||
+ String worldSectionPath = LeavesConfig.configVersion < CURRENT_CONFIG_VERSION ? this.worldName : "world-settings.".concat(this.worldName);
|
||||
+ ConfigurationSection section = LeavesConfig.config.getConfigurationSection(worldSectionPath);
|
||||
+ this.configPath = worldSectionPath;
|
||||
+ if (LeavesConfig.createWorldSections) {
|
||||
@@ -283,7 +312,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ ConfigurationSection oldSection = LeavesConfig.config.getConfigurationSection(this.worldName);
|
||||
+ LeavesConfig.config.set("world-settings.".concat(this.worldName), oldSection);
|
||||
+ LeavesConfig.config.set(this.worldName, null);
|
||||
@@ -308,7 +337,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+ boolean getBoolean(final String path, final boolean dfl) {
|
||||
+ final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
+ this.worldDefaults.addDefault(path, Boolean.valueOf(dfl));
|
||||
+ if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ if (config != null && config.getBoolean(path) == dfl) {
|
||||
+ config.set(path, null);
|
||||
+ }
|
||||
@@ -318,7 +347,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+
|
||||
+ boolean getBooleanRaw(final String path, final boolean dfl) {
|
||||
+ final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
+ if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ if (config != null && config.getBoolean(path) == dfl) {
|
||||
+ config.set(path, null);
|
||||
+ }
|
||||
@@ -329,7 +358,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+ int getInt(final String path, final int dfl) {
|
||||
+ final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
+ this.worldDefaults.addDefault(path, Integer.valueOf(dfl));
|
||||
+ if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ if (config != null && config.getInt(path) == dfl) {
|
||||
+ config.set(path, null);
|
||||
+ }
|
||||
@@ -339,7 +368,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+
|
||||
+ int getIntRaw(final String path, final int dfl) {
|
||||
+ final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
+ if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ if (config != null && config.getInt(path) == dfl) {
|
||||
+ config.set(path, null);
|
||||
+ }
|
||||
@@ -350,7 +379,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+ long getLong(final String path, final long dfl) {
|
||||
+ final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
+ this.worldDefaults.addDefault(path, Long.valueOf(dfl));
|
||||
+ if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ if (config != null && config.getLong(path) == dfl) {
|
||||
+ config.set(path, null);
|
||||
+ }
|
||||
@@ -360,7 +389,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+
|
||||
+ long getLongRaw(final String path, final long dfl) {
|
||||
+ final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
+ if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ if (config != null && config.getLong(path) == dfl) {
|
||||
+ config.set(path, null);
|
||||
+ }
|
||||
@@ -371,7 +400,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+ double getDouble(final String path, final double dfl) {
|
||||
+ final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
+ this.worldDefaults.addDefault(path, Double.valueOf(dfl));
|
||||
+ if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ if (config != null && config.getDouble(path) == dfl) {
|
||||
+ config.set(path, null);
|
||||
+ }
|
||||
@@ -381,7 +410,7 @@ index 0000000000000000000000000000000000000000..ec35e33ecbba6f2cb1dcc2e739841b7e
|
||||
+
|
||||
+ double getDoubleRaw(final String path, final double dfl) {
|
||||
+ final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
+ if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ if (config != null && config.getDouble(path) == dfl) {
|
||||
+ config.set(path, null);
|
||||
+ }
|
||||
@@ -40,27 +40,28 @@ index ed3d78494735ceda14ad0ea23adeadc374f3b35e..d0e9fd987687d6a0642a9e312668697f
|
||||
if (bl4) {
|
||||
boolean bl6;
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 1f6bba371f827c1151984f8dc89cc461973988b9..d5cc421b0fb4739ccaa57ae8b7bc2b7a27f2f391 100644
|
||||
index 4c290eb2d4abf9e9b923b8d0878f319328b7cf8c..d6abf25f70f6f5a19787c72e87fddd2801b47def 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -112,6 +112,11 @@ public final class LeavesConfig {
|
||||
@@ -93,7 +93,9 @@ public final class LeavesConfig {
|
||||
|
||||
private static void updateConfigVersion(final YamlConfiguration config) {
|
||||
if (configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ playerCanEditSign = config.getBoolean("settings.player-can-edit-sign", playerCanEditSign);
|
||||
|
||||
+ config.set("settings.player-can-edit-sign", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +134,11 @@ public final class LeavesConfig {
|
||||
return LeavesConfig.config.getString(path, dfl);
|
||||
}
|
||||
|
||||
+ public static boolean playerCanEditSign = true;
|
||||
+ private static void playerCanEditSign() {
|
||||
+ playerCanEditSign = getBoolean("settings.player-can-edit-sign", playerCanEditSign);
|
||||
+ playerCanEditSign = getBoolean("settings.modify.player-can-edit-sign", playerCanEditSign);
|
||||
+ }
|
||||
+
|
||||
public static final class WorldConfig {
|
||||
|
||||
public final String worldName;
|
||||
@@ -145,7 +150,7 @@ public final class LeavesConfig {
|
||||
public void load() {
|
||||
for (final Method method : LeavesConfig.WorldConfig.class.getDeclaredMethods()) {
|
||||
if (method.getReturnType() != void.class || method.getParameterCount() != 0 ||
|
||||
- !Modifier.isPrivate(method.getModifiers()) || Modifier.isStatic(method.getModifiers())) {
|
||||
+ !Modifier.isPrivate(method.getModifiers()) || Modifier.isStatic(method.getModifiers())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,16 +49,26 @@ index 77941e3981e49cf5662b3e3c86a9c419080b17c8..bc9ef36f989f06acac07aa15c8fc624a
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index d5cc421b0fb4739ccaa57ae8b7bc2b7a27f2f391..8999a852440c5c15dec5adf892eb60674500f70e 100644
|
||||
index d6abf25f70f6f5a19787c72e87fddd2801b47def..1fb25e8a21b568864974cc81b452ba062890d593 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -117,6 +117,11 @@ public final class LeavesConfig {
|
||||
playerCanEditSign = getBoolean("settings.player-can-edit-sign", playerCanEditSign);
|
||||
@@ -94,7 +94,9 @@ public final class LeavesConfig {
|
||||
private static void updateConfigVersion(final YamlConfiguration config) {
|
||||
if (configVersion < CURRENT_CONFIG_VERSION) {
|
||||
playerCanEditSign = config.getBoolean("settings.player-can-edit-sign", playerCanEditSign);
|
||||
+ snowballAndEggCanKnockback = config.getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
|
||||
+ config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
config.set("settings.player-can-edit-sign", null);
|
||||
}
|
||||
}
|
||||
@@ -139,6 +141,11 @@ public final class LeavesConfig {
|
||||
playerCanEditSign = getBoolean("settings.modify.player-can-edit-sign", playerCanEditSign);
|
||||
}
|
||||
|
||||
+ public static boolean snowballAndEggCanKnockback = true;
|
||||
+ private static void snowballAndEggCanKnockback() {
|
||||
+ snowballAndEggCanKnockback = getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
+ snowballAndEggCanKnockback = getBoolean("settings.modify.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
+ }
|
||||
+
|
||||
public static final class WorldConfig {
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Sat, 29 Jan 2022 18:04:46 +0800
|
||||
Subject: [PATCH] Add Leaves Command
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 7ad3569628fd6c6ac0038394e7d88979b29935a0..d27f115b74fe00623985255d1027656166c1c459 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -228,6 +228,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
// Paper end
|
||||
|
||||
top.leavesmc.leaves.LeavesConfig.init((java.io.File) options.valueOf("leaves-settings")); // Leaves - Server Config
|
||||
+ top.leavesmc.leaves.LeavesConfig.registerCommands(); // Leaves - Server Command
|
||||
|
||||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 599ad9516e9642f774c4f8b1d60b453a775b172a..9e21aa4d6464b86923f4ccc4cdec9e3b663dd268 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -991,6 +991,7 @@ public final class CraftServer implements Server {
|
||||
this.reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
+ top.leavesmc.leaves.LeavesConfig.registerCommands(); // Leaves - Server Command
|
||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index b82efc14c0e7aa33260cffcfc20fa42d24e61192..393ced680a790cb6e6abf448a6c60f413ac97551 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -4,6 +4,7 @@ import com.destroystokyo.paper.util.SneakyThrow;
|
||||
import com.google.common.base.Throwables;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import org.bukkit.Bukkit;
|
||||
+import org.bukkit.command.Command;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@@ -11,7 +12,9 @@ import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
+import java.util.HashMap;
|
||||
import java.util.List;
|
||||
+import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
// Powered by Tuinity(https://github.com/Tuinity/Tuinity)
|
||||
@@ -27,6 +30,7 @@ public final class LeavesConfig {
|
||||
public static YamlConfiguration config;
|
||||
private static int configVersion;
|
||||
public static boolean createWorldSections = true;
|
||||
+ static Map<String, Command> commands;
|
||||
|
||||
public static void init(final File file) {
|
||||
LeavesConfig.configFile = file;
|
||||
@@ -57,6 +61,8 @@ public final class LeavesConfig {
|
||||
LeavesConfig.set("config-version", CURRENT_CONFIG_VERSION);
|
||||
|
||||
LeavesConfig.load(config);
|
||||
+
|
||||
+ commands = new HashMap<>();
|
||||
}
|
||||
|
||||
public static void load(final YamlConfiguration config) {
|
||||
@@ -87,6 +93,12 @@ public final class LeavesConfig {
|
||||
LeavesConfig.config.set(path, value);
|
||||
}
|
||||
|
||||
+ public static void registerCommands() {
|
||||
+ for (Map.Entry<String, Command> entry : commands.entrySet()) {
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Leaves", entry.getValue());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
static boolean getBoolean(final String path, final boolean dfl) {
|
||||
LeavesConfig.config.addDefault(path, Boolean.valueOf(dfl));
|
||||
return LeavesConfig.config.getBoolean(path, dfl);
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Allow vanilla properties def
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 3e7086d31b2f101b2d6e982f3935922886cadc77..f16fa127406b6f48af21913e0b76d8dde6ed2a4b 100644
|
||||
index 456595e4b7e0c7f50617aa2694b0d2dfc368ab81..c8901ca493f33881850346d2bc21fcd11863c017 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -136,12 +136,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -83,10 +83,18 @@ index 6cbd839cc7529eb0095485c4ef4a0d81a3cd9b19..0a4edeed3e6c4813e7ef3cf847ccbbe1
|
||||
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
|
||||
this.level.getCraftServer().getPluginManager().callEvent(changeEvent);
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index d63bfd9d3194a2972a984ec3a817767a683a940d..f3c3c530d9ae974c9b35e1a12f60e5bad014b42a 100644
|
||||
index d63bfd9d3194a2972a984ec3a817767a683a940d..e9da6bc1f553d0d1fdebff9e58204c7a9563bc17 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -96,6 +96,7 @@ import net.minecraft.world.scores.Objective;
|
||||
@@ -76,6 +76,7 @@ import net.minecraft.server.ServerScoreboard;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.TagNetworkSerialization;
|
||||
import net.minecraft.util.Mth;
|
||||
+import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
@@ -96,6 +97,7 @@ import net.minecraft.world.scores.Objective;
|
||||
import net.minecraft.world.scores.PlayerTeam;
|
||||
import net.minecraft.world.scores.Scoreboard; // Paper
|
||||
import net.minecraft.world.scores.Team;
|
||||
@@ -94,7 +102,7 @@ index d63bfd9d3194a2972a984ec3a817767a683a940d..f3c3c530d9ae974c9b35e1a12f60e5ba
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -113,7 +114,6 @@ import org.bukkit.Location;
|
||||
@@ -113,7 +115,6 @@ import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
@@ -102,7 +110,7 @@ index d63bfd9d3194a2972a984ec3a817767a683a940d..f3c3c530d9ae974c9b35e1a12f60e5ba
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
@@ -369,6 +369,18 @@ public abstract class PlayerList {
|
||||
@@ -369,6 +370,18 @@ public abstract class PlayerList {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -110,7 +118,7 @@ index d63bfd9d3194a2972a984ec3a817767a683a940d..f3c3c530d9ae974c9b35e1a12f60e5ba
|
||||
+ if (top.leavesmc.leaves.LeavesConfig.fakeplayerSupport) {
|
||||
+ ServerBot bot = ServerBot.getBot(player.getName().getString());
|
||||
+ if (bot != null) {
|
||||
+ bot.kill(); // Leaves - remove bot with the same name
|
||||
+ bot.die(DamageSource.OUT_OF_WORLD); // Leaves - remove bot with the same name
|
||||
+ }
|
||||
+
|
||||
+ ServerBot.getBots().forEach(bot1 ->
|
||||
@@ -162,7 +170,7 @@ index 6549ade8e19807c523e5a1dc68b66585aad438b1..b58a4fb6563554c8a5a10eada110125f
|
||||
}
|
||||
// Water Animals
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index a85a5de7d85cf6c5e19c0245c40e6106e6623007..4d6d025c78086f186da710ae46f65eda5426464d 100644
|
||||
index 1fb25e8a21b568864974cc81b452ba062890d593..73d11bfb7e602909e283458e6cc5b545874305a1 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -7,11 +7,13 @@ import org.bukkit.Bukkit;
|
||||
@@ -179,7 +187,7 @@ index a85a5de7d85cf6c5e19c0245c40e6106e6623007..4d6d025c78086f186da710ae46f65eda
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -63,6 +65,11 @@ public final class LeavesConfig {
|
||||
@@ -65,6 +67,11 @@ public final class LeavesConfig {
|
||||
LeavesConfig.load(config);
|
||||
|
||||
commands = new HashMap<>();
|
||||
@@ -191,7 +199,20 @@ index a85a5de7d85cf6c5e19c0245c40e6106e6623007..4d6d025c78086f186da710ae46f65eda
|
||||
}
|
||||
|
||||
public static void load(final YamlConfiguration config) {
|
||||
@@ -124,6 +131,12 @@ public final class LeavesConfig {
|
||||
@@ -95,9 +102,12 @@ public final class LeavesConfig {
|
||||
if (configVersion < CURRENT_CONFIG_VERSION) {
|
||||
playerCanEditSign = config.getBoolean("settings.player-can-edit-sign", playerCanEditSign);
|
||||
snowballAndEggCanKnockback = config.getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
+ fakeplayerSupport = config.getBoolean("settings.fakeplayer.enable", fakeplayerSupport);
|
||||
+ unableFakeplayerNames = (List<String>) config.getList("settings.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames);
|
||||
|
||||
config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
config.set("settings.player-can-edit-sign", null);
|
||||
+ config.set("settings.fakeplayer", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,6 +146,12 @@ public final class LeavesConfig {
|
||||
return LeavesConfig.config.getString(path, dfl);
|
||||
}
|
||||
|
||||
@@ -203,23 +224,19 @@ index a85a5de7d85cf6c5e19c0245c40e6106e6623007..4d6d025c78086f186da710ae46f65eda
|
||||
+
|
||||
public static boolean playerCanEditSign = true;
|
||||
private static void playerCanEditSign() {
|
||||
playerCanEditSign = getBoolean("settings.player-can-edit-sign", playerCanEditSign);
|
||||
@@ -134,6 +147,20 @@ public final class LeavesConfig {
|
||||
snowballAndEggCanKnockback = getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
playerCanEditSign = getBoolean("settings.modify.player-can-edit-sign", playerCanEditSign);
|
||||
@@ -146,6 +162,16 @@ public final class LeavesConfig {
|
||||
snowballAndEggCanKnockback = getBoolean("settings.modify.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
}
|
||||
|
||||
+ public static boolean fakeplayerSupport = true;
|
||||
+ private static void fakeplayerSupport() {
|
||||
+ if (config.contains("settings.fakeplayer-support")) {
|
||||
+ fakeplayerSupport = LeavesConfig.config.getBoolean("settings.fakeplayer-support", fakeplayerSupport);
|
||||
+ LeavesConfig.config.set("settings.fakeplayer-support", null);
|
||||
+ }
|
||||
+ fakeplayerSupport = getBoolean("settings.fakeplayer.enable", fakeplayerSupport);
|
||||
+ fakeplayerSupport = getBoolean("settings.modify.fakeplayer.enable", fakeplayerSupport);
|
||||
+ }
|
||||
+
|
||||
+ public static List<String> unableFakeplayerNames;
|
||||
+ public static List<String> unableFakeplayerNames = List.of("player-name");
|
||||
+ private static void unableFakeplayerNames() {
|
||||
+ unableFakeplayerNames = getList("settings.fakeplayer.unable-fakeplayer-names", Arrays.asList("player-name"));
|
||||
+ unableFakeplayerNames = getList("settings.modify.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames);
|
||||
+ }
|
||||
+
|
||||
public static final class WorldConfig {
|
||||
@@ -227,50 +244,58 @@ index a85a5de7d85cf6c5e19c0245c40e6106e6623007..4d6d025c78086f186da710ae46f65eda
|
||||
public final String worldName;
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/bot/BotCommand.java b/src/main/java/top/leavesmc/leaves/bot/BotCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..1055994d1d211294a5a0044a292b614821aad194
|
||||
index 0000000000000000000000000000000000000000..970b109b150b9909edac217f54cddfcbd1a4d5da
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/bot/BotCommand.java
|
||||
@@ -0,0 +1,194 @@
|
||||
@@ -0,0 +1,253 @@
|
||||
+package top.leavesmc.leaves.bot;
|
||||
+
|
||||
+import net.minecraft.world.damagesource.DamageSource;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.ChatColor;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.World;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import top.leavesmc.leaves.bot.agent.Actions;
|
||||
+import top.leavesmc.leaves.bot.agent.BotAction;
|
||||
+import top.leavesmc.leaves.entity.Bot;
|
||||
+import top.leavesmc.leaves.util.MathUtils;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.HashMap;
|
||||
+import java.util.List;
|
||||
+import java.util.Map;
|
||||
+
|
||||
+public class BotCommand extends Command {
|
||||
+
|
||||
+ public BotCommand(String name) {
|
||||
+ super(name);
|
||||
+ this.description = "FakePlayer Command";
|
||||
+ this.usageMessage = "/bot [create | remove | action]";
|
||||
+ this.usageMessage = "/bot [create | remove | action | list]";
|
||||
+ this.setPermission("bukkit.command.bot");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
|
||||
+ public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, String @NotNull [] args, Location location) throws IllegalArgumentException {
|
||||
+ var list = new ArrayList<String>();
|
||||
+
|
||||
+ if (args.length <= 1) {
|
||||
+ list.add("create");
|
||||
+ list.add("remove");
|
||||
+ list.add("action");
|
||||
+ list.add("list");
|
||||
+ }
|
||||
+
|
||||
+ if (args.length == 2) {
|
||||
+ switch (args[0]) {
|
||||
+ case "create" -> list.add("<BotName>");
|
||||
+ case "remove", "action" -> list.addAll(ServerBot.getBots().stream().map(e -> e.getName().getString()).toList());
|
||||
+ case "remove", "action" ->
|
||||
+ list.addAll(ServerBot.getBots().stream().map(e -> e.getName().getString()).toList());
|
||||
+ case "list" -> list.addAll(Bukkit.getWorlds().stream().map(e -> e.getName()).toList());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -311,7 +336,7 @@ index 0000000000000000000000000000000000000000..1055994d1d211294a5a0044a292b6148
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
+ public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, String[] args) {
|
||||
+ if (!testPermission(sender)) return true;
|
||||
+
|
||||
+ if (args.length == 0) {
|
||||
@@ -326,6 +351,8 @@ index 0000000000000000000000000000000000000000..1055994d1d211294a5a0044a292b6148
|
||||
+
|
||||
+ case "action" -> this.onAction(sender, args);
|
||||
+
|
||||
+ case "list" -> this.onList(sender, args);
|
||||
+
|
||||
+ default -> {
|
||||
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
||||
+ return false;
|
||||
@@ -335,7 +362,7 @@ index 0000000000000000000000000000000000000000..1055994d1d211294a5a0044a292b6148
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ private void onCreate(CommandSender sender, String[] args) {
|
||||
+ private void onCreate(CommandSender sender, String @NotNull [] args) {
|
||||
+ if (args.length < 2) {
|
||||
+ sender.sendMessage(ChatColor.RED + "Use /bot create <name> to create a fakeplayer");
|
||||
+ return;
|
||||
@@ -361,10 +388,14 @@ index 0000000000000000000000000000000000000000..1055994d1d211294a5a0044a292b6148
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (ServerBot.getBots().size() >= top.leavesmc.leaves.LeavesConfig.fakeplayerLimit) {
|
||||
+ sender.sendMessage(ChatColor.RED + "Fakeplayer limit is full");
|
||||
+ }
|
||||
+
|
||||
+ ServerBot.createBot(((Player) sender).getLocation(), args[1]);
|
||||
+ }
|
||||
+
|
||||
+ private void onRemove(CommandSender sender, String[] args) {
|
||||
+ private void onRemove(CommandSender sender, String @NotNull [] args) {
|
||||
+ if (args.length < 2) {
|
||||
+ sender.sendMessage(ChatColor.RED + "Use /bot remove <name> to remove a fakeplayer");
|
||||
+ return;
|
||||
@@ -380,7 +411,7 @@ index 0000000000000000000000000000000000000000..1055994d1d211294a5a0044a292b6148
|
||||
+ bot.die(DamageSource.OUT_OF_WORLD);
|
||||
+ }
|
||||
+
|
||||
+ private void onAction(CommandSender sender, String[] args) {
|
||||
+ private void onAction(CommandSender sender, String @NotNull [] args) {
|
||||
+ if (args.length < 3) {
|
||||
+ sender.sendMessage(ChatColor.RED + "Use /bot action <name> <action> to make fakeplayer do action");
|
||||
+ return;
|
||||
@@ -424,6 +455,51 @@ index 0000000000000000000000000000000000000000..1055994d1d211294a5a0044a292b6148
|
||||
+ bot.setBotAction(action.getNew(tickDelay, number, ((CraftPlayer) sender).getHandle()));
|
||||
+ sender.sendMessage(action.getName() + " set");
|
||||
+ }
|
||||
+
|
||||
+ private void onList(CommandSender sender, String @NotNull [] args) {
|
||||
+ if (args.length < 2) {
|
||||
+ Map<World, List<String>> botMap = new HashMap<>();
|
||||
+ for (World world : Bukkit.getWorlds()) {
|
||||
+ botMap.put(world, new ArrayList<>());
|
||||
+ }
|
||||
+
|
||||
+ for (ServerBot bot : ServerBot.getBots()) {
|
||||
+ Bot bukkitBot = bot.getBukkitPlayer();
|
||||
+ botMap.get(bukkitBot.getWorld()).add(bukkitBot.getName());
|
||||
+ }
|
||||
+
|
||||
+ sender.sendMessage("Total number: (" + ServerBot.getBots().size() + "/" + top.leavesmc.leaves.LeavesConfig.fakeplayerLimit + ")");
|
||||
+ for (World world : botMap.keySet()) {
|
||||
+ sender.sendMessage(world.getName() + "(" + botMap.get(world).size() + "): " + formatPlayerNameList(botMap.get(world)));
|
||||
+ }
|
||||
+ } else {
|
||||
+ World world = Bukkit.getWorld(args[2]);
|
||||
+
|
||||
+ if (world == null) {
|
||||
+ sender.sendMessage(ChatColor.RED + "Unknown world");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ List<String> botList = new ArrayList<>();
|
||||
+ for (ServerBot bot : ServerBot.getBots()) {
|
||||
+ Bot bukkitBot = bot.getBukkitPlayer();
|
||||
+ if (bukkitBot.getWorld() == world) {
|
||||
+ botList.add(bukkitBot.getName());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ sender.sendMessage(world.getName() + "(" + botList.size() + "): " + formatPlayerNameList(botList));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ private static String formatPlayerNameList(@NotNull List<String> list) {
|
||||
+ if (list.isEmpty()) {
|
||||
+ return "";
|
||||
+ }
|
||||
+ String string = list.toString();
|
||||
+ return string.substring(1, string.length() - 2);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/bot/MojangAPI.java b/src/main/java/top/leavesmc/leaves/bot/MojangAPI.java
|
||||
new file mode 100644
|
||||
@@ -474,10 +550,10 @@ 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..548ffd470aff81ca430e1c01fef0fc52e7d0de43
|
||||
index 0000000000000000000000000000000000000000..821d456d11b6f49ea8eba59e79d09980b494fa66
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/bot/ServerBot.java
|
||||
@@ -0,0 +1,702 @@
|
||||
@@ -0,0 +1,727 @@
|
||||
+package top.leavesmc.leaves.bot;
|
||||
+
|
||||
+import com.google.common.collect.Lists;
|
||||
@@ -566,7 +642,7 @@ index 0000000000000000000000000000000000000000..548ffd470aff81ca430e1c01fef0fc52
|
||||
+ private static final Set<ServerBot> bots = new HashSet<>();
|
||||
+ private static final Plugin MINECRAFT_PLUGIN = new MinecraftInternalPlugin();
|
||||
+
|
||||
+ public ServerBot(MinecraftServer server, ServerLevel world, GameProfile profile) {
|
||||
+ private ServerBot(MinecraftServer server, ServerLevel world, GameProfile profile) {
|
||||
+ super(server, world, profile, null);
|
||||
+ this.entityData.set(new EntityDataAccessor<>(16, EntityDataSerializers.INT), 0xFF);
|
||||
+
|
||||
@@ -581,6 +657,10 @@ index 0000000000000000000000000000000000000000..548ffd470aff81ca430e1c01fef0fc52
|
||||
+ }
|
||||
+
|
||||
+ public static void createBot(Location loc, String name) {
|
||||
+ if (!checkCreateLegal(name)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ Bukkit.getScheduler().runTaskAsynchronously(MINECRAFT_PLUGIN, () -> {
|
||||
+ String[] skin = MojangAPI.getSkin(name);
|
||||
+ Bukkit.getScheduler().runTask(MINECRAFT_PLUGIN, () -> createBot(loc, name, skin));
|
||||
@@ -589,6 +669,10 @@ index 0000000000000000000000000000000000000000..548ffd470aff81ca430e1c01fef0fc52
|
||||
+
|
||||
+ @Nullable
|
||||
+ public static ServerBot createBot(@NotNull Location loc, @NotNull String name, String[] skin) {
|
||||
+ if (!checkCreateLegal(name)) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ MinecraftServer server = MinecraftServer.getServer();
|
||||
+
|
||||
+ BotCreateEvent event = new BotCreateEvent(name, loc, ChatColor.YELLOW + name + " joined the game");
|
||||
@@ -630,6 +714,22 @@ index 0000000000000000000000000000000000000000..548ffd470aff81ca430e1c01fef0fc52
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ public static boolean checkCreateLegal(@NotNull String name) {
|
||||
+ if (!name.matches("^[a-zA-Z0-9_]{4,16}$")) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (Bukkit.getPlayer(name) != null || ServerBot.getBot(name) != null) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (top.leavesmc.leaves.LeavesConfig.unableFakeplayerNames.contains(name)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return ServerBot.getBots().size() < top.leavesmc.leaves.LeavesConfig.fakeplayerLimit;
|
||||
+ }
|
||||
+
|
||||
+ private void renderAll() {
|
||||
+ Packet<?>[] packets = getRenderPackets();
|
||||
+ Bukkit.getOnlinePlayers().forEach(p ->
|
||||
@@ -819,7 +919,7 @@ index 0000000000000000000000000000000000000000..548ffd470aff81ca430e1c01fef0fc52
|
||||
+
|
||||
+ float health = getHealth();
|
||||
+ float maxHealth = getMaxHealth();
|
||||
+ float regenAmount = 0.025f;
|
||||
+ float regenAmount = 0.010f;
|
||||
+ float amount;
|
||||
+
|
||||
+ if (health < maxHealth - regenAmount) {
|
||||
@@ -898,6 +998,7 @@ index 0000000000000000000000000000000000000000..548ffd470aff81ca430e1c01fef0fc52
|
||||
+ }
|
||||
+
|
||||
+ private ItemStack lastItem = new ItemStack(Material.AIR);
|
||||
+
|
||||
+ public void updateItemInMainHand() {
|
||||
+ ItemStack item = this.getInventory().getSelected().asBukkitCopy();
|
||||
+
|
||||
@@ -18,16 +18,29 @@ index 2366d411bf64f88c7296e888cd3bf584825ae4a9..7da29029038d5a007735dcb2be011458
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 4d6d025c78086f186da710ae46f65eda5426464d..3a682ee9fced138f4759b829ba2dbeeb658f71d1 100644
|
||||
index 73d11bfb7e602909e283458e6cc5b545874305a1..fbd6f9a799e2bdb3b7dc0731ef447163ce04e392 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -161,6 +161,11 @@ public final class LeavesConfig {
|
||||
unableFakeplayerNames = getList("settings.fakeplayer.unable-fakeplayer-names", Arrays.asList("player-name"));
|
||||
@@ -104,10 +104,12 @@ public final class LeavesConfig {
|
||||
snowballAndEggCanKnockback = config.getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
fakeplayerSupport = config.getBoolean("settings.fakeplayer.enable", fakeplayerSupport);
|
||||
unableFakeplayerNames = (List<String>) config.getList("settings.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames);
|
||||
+ shearsInDispenserCanZeroAmount = config.getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
|
||||
config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
config.set("settings.player-can-edit-sign", null);
|
||||
config.set("settings.fakeplayer", null);
|
||||
+ config.set("settings.shears-in-dispenser-can-zero-amount", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +174,11 @@ public final class LeavesConfig {
|
||||
unableFakeplayerNames = getList("settings.modify.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames);
|
||||
}
|
||||
|
||||
+ public static boolean shearsInDispenserCanZeroAmount = false;
|
||||
+ private static void shearsInDispenserCanZeroAmount() {
|
||||
+ shearsInDispenserCanZeroAmount = getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
+ shearsInDispenserCanZeroAmount = getBoolean("settings.modify.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
+ }
|
||||
+
|
||||
public static final class WorldConfig {
|
||||
@@ -98,16 +98,30 @@ index e77af779c77de6d5580c13699df3e7d890fe7aba..c9310e88b3a967cb9cacb80288e74757
|
||||
+ // Leaves end - shears wrench
|
||||
}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 3a682ee9fced138f4759b829ba2dbeeb658f71d1..ac1dbdab5e7c3cdbacf50c640ccd59eb9eaa530c 100644
|
||||
index fbd6f9a799e2bdb3b7dc0731ef447163ce04e392..c2b04f86ae1041a61cb9623d80da29cc8369a72d 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -166,6 +166,11 @@ public final class LeavesConfig {
|
||||
shearsInDispenserCanZeroAmount = getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
@@ -105,11 +105,13 @@ public final class LeavesConfig {
|
||||
fakeplayerSupport = config.getBoolean("settings.fakeplayer.enable", fakeplayerSupport);
|
||||
unableFakeplayerNames = (List<String>) config.getList("settings.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames);
|
||||
shearsInDispenserCanZeroAmount = config.getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
+ redstoneShearsWrench = config.getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench);
|
||||
|
||||
config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
config.set("settings.player-can-edit-sign", null);
|
||||
config.set("settings.fakeplayer", null);
|
||||
config.set("settings.shears-in-dispenser-can-zero-amount", null);
|
||||
+ config.set("settings.redstone-shears-wrench", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,6 +181,11 @@ public final class LeavesConfig {
|
||||
shearsInDispenserCanZeroAmount = getBoolean("settings.modify.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
}
|
||||
|
||||
+ public static boolean redstoneShearsWrench = true;
|
||||
+ private static void redstoneShearsWrench() {
|
||||
+ redstoneShearsWrench = getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench);
|
||||
+ redstoneShearsWrench = getBoolean("settings.modify.redstone-shears-wrench", redstoneShearsWrench);
|
||||
+ }
|
||||
+
|
||||
public static final class WorldConfig {
|
||||
@@ -21,16 +21,31 @@ index bedccb8717d08d5a60058445b04ddff149e7d36c..2b452ae8d26107973f503451164f65de
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index ac1dbdab5e7c3cdbacf50c640ccd59eb9eaa530c..af924f19ca0c77484ae3cdeb2994547b63213767 100644
|
||||
index c2b04f86ae1041a61cb9623d80da29cc8369a72d..b05d0f133484d017e8e7f0a10f76257433d25c8d 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -171,6 +171,11 @@ public final class LeavesConfig {
|
||||
redstoneShearsWrench = getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench);
|
||||
@@ -106,12 +106,14 @@ public final class LeavesConfig {
|
||||
unableFakeplayerNames = (List<String>) config.getList("settings.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames);
|
||||
shearsInDispenserCanZeroAmount = config.getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
redstoneShearsWrench = config.getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench);
|
||||
+ buddingAmethystCanPushByPiston = config.getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
|
||||
config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
config.set("settings.player-can-edit-sign", null);
|
||||
config.set("settings.fakeplayer", null);
|
||||
config.set("settings.shears-in-dispenser-can-zero-amount", null);
|
||||
config.set("settings.redstone-shears-wrench", null);
|
||||
+ config.set("settings.budding-amethyst-can-push-by-piston", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,6 +188,11 @@ public final class LeavesConfig {
|
||||
redstoneShearsWrench = getBoolean("settings.modify.redstone-shears-wrench", redstoneShearsWrench);
|
||||
}
|
||||
|
||||
+ public static boolean buddingAmethystCanPushByPiston = false;
|
||||
+ private static void buddingAmethystCanPushByPiston() {
|
||||
+ buddingAmethystCanPushByPiston = getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
+ buddingAmethystCanPushByPiston = getBoolean("settings.modify.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
+ }
|
||||
+
|
||||
public static final class WorldConfig {
|
||||
@@ -29,17 +29,33 @@ index 8873e12cbd3d6f9071efedb35ea3c69c78033d78..1fdaa8a9993dd6881877a3b00b02487a
|
||||
AdvancementProgress advancementprogress = this.getOrStartProgress(advancement);
|
||||
boolean flag1 = advancementprogress.isDone();
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index af924f19ca0c77484ae3cdeb2994547b63213767..17f5bc4b4197868bf571c3bb53525dd21e6d0a46 100644
|
||||
index b05d0f133484d017e8e7f0a10f76257433d25c8d..33004482584e7880ce94f0c4ca63ffb828073417 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -175,6 +175,11 @@ public final class LeavesConfig {
|
||||
@@ -107,6 +107,7 @@ public final class LeavesConfig {
|
||||
shearsInDispenserCanZeroAmount = config.getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
redstoneShearsWrench = config.getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench);
|
||||
buddingAmethystCanPushByPiston = config.getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
+ spectatorDontGetAdvancement = config.getBoolean("settings.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
|
||||
config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
config.set("settings.player-can-edit-sign", null);
|
||||
@@ -114,6 +115,7 @@ public final class LeavesConfig {
|
||||
config.set("settings.shears-in-dispenser-can-zero-amount", null);
|
||||
config.set("settings.redstone-shears-wrench", null);
|
||||
config.set("settings.budding-amethyst-can-push-by-piston", null);
|
||||
+ config.set("settings.spectator-dont-get-advancement", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,6 +194,11 @@ public final class LeavesConfig {
|
||||
private static void buddingAmethystCanPushByPiston() {
|
||||
buddingAmethystCanPushByPiston = getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
buddingAmethystCanPushByPiston = getBoolean("settings.modify.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
}
|
||||
+
|
||||
+ public static boolean spectatorDontGetAdvancement = false;
|
||||
+ private static void spectatorDontGetAdvancement() {
|
||||
+ spectatorDontGetAdvancement = getBoolean("settings.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
+ spectatorDontGetAdvancement = getBoolean("settings.modify.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
+ }
|
||||
|
||||
public static final class WorldConfig {
|
||||
@@ -22,17 +22,33 @@ index 150afceb491cfd254c0f1b84800e6df14cf26676..e108e757a6dab69784324625e9be00af
|
||||
return InteractionResult.FAIL;
|
||||
}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 17f5bc4b4197868bf571c3bb53525dd21e6d0a46..6b5551df69952d57006c2303e5f13224b22c5d95 100644
|
||||
index 33004482584e7880ce94f0c4ca63ffb828073417..ea0679ab805df83dc2c5fe93f18f457d056f488f 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -180,6 +180,11 @@ public final class LeavesConfig {
|
||||
@@ -108,6 +108,7 @@ public final class LeavesConfig {
|
||||
redstoneShearsWrench = config.getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench);
|
||||
buddingAmethystCanPushByPiston = config.getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
spectatorDontGetAdvancement = config.getBoolean("settings.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
+ stickChangeArmorStandArmStatus = config.getBoolean("settings.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
|
||||
config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
config.set("settings.player-can-edit-sign", null);
|
||||
@@ -116,6 +117,7 @@ public final class LeavesConfig {
|
||||
config.set("settings.redstone-shears-wrench", null);
|
||||
config.set("settings.budding-amethyst-can-push-by-piston", null);
|
||||
config.set("settings.spectator-dont-get-advancement", null);
|
||||
+ config.set("settings.stick-change-armorstand-arm-status", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,6 +201,11 @@ public final class LeavesConfig {
|
||||
private static void spectatorDontGetAdvancement() {
|
||||
spectatorDontGetAdvancement = getBoolean("settings.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
spectatorDontGetAdvancement = getBoolean("settings.modify.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
}
|
||||
+
|
||||
+ public static boolean stickChangeArmorStandArmStatus = true;
|
||||
+ private static void stickChangeArmorStandHasArm() {
|
||||
+ stickChangeArmorStandArmStatus = getBoolean("settings.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
+ stickChangeArmorStandArmStatus = getBoolean("settings.modify.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
+ }
|
||||
|
||||
public static final class WorldConfig {
|
||||
@@ -100,10 +100,10 @@ index 2fab929b6775238d031ca3305b61af3cbe920a06..ccd8fd62a824566ffd44083177280701
|
||||
String s = playerchatmessage.signedContent().plain();
|
||||
if (s.isEmpty()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index f3c3c530d9ae974c9b35e1a12f60e5bad014b42a..25ecac92dc77f33964dff7cf00bd522606366b0e 100644
|
||||
index e9da6bc1f553d0d1fdebff9e58204c7a9563bc17..8c040cf1f4a5e063e796d0decf6bdeb5ddd272b4 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1445,7 +1445,7 @@ public abstract class PlayerList {
|
||||
@@ -1446,7 +1446,7 @@ public abstract class PlayerList {
|
||||
// Paper end
|
||||
boolean flag = this.verifyChatTrusted(playerchatmessage, chatsender);
|
||||
|
||||
@@ -132,17 +132,37 @@ index e2305caf0b3ce21810a31e05c943a6d859870bd5..ee8bc19a049a9f0235d959d41e412486
|
||||
this.containerMenu = this.inventoryMenu;
|
||||
this.moveTo((double) pos.getX() + 0.5D, (double) (pos.getY() + 1), (double) pos.getZ() + 0.5D, yaw, 0.0F);
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 6b5551df69952d57006c2303e5f13224b22c5d95..0c341dc3a27f7a20ba4e87fd84a84c31df772d00 100644
|
||||
index ea0679ab805df83dc2c5fe93f18f457d056f488f..5665b792dff1e6ddf2d5f92a9391a244453851c0 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -185,6 +185,11 @@ public final class LeavesConfig {
|
||||
@@ -109,6 +109,7 @@ public final class LeavesConfig {
|
||||
buddingAmethystCanPushByPiston = config.getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
spectatorDontGetAdvancement = config.getBoolean("settings.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
stickChangeArmorStandArmStatus = config.getBoolean("settings.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
+ noChatSign = config.getBoolean("settings.no-chat-sign", noChatSign);
|
||||
|
||||
config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
config.set("settings.player-can-edit-sign", null);
|
||||
@@ -118,6 +119,7 @@ public final class LeavesConfig {
|
||||
config.set("settings.budding-amethyst-can-push-by-piston", null);
|
||||
config.set("settings.spectator-dont-get-advancement", null);
|
||||
config.set("settings.stick-change-armorstand-arm-status", null);
|
||||
+ config.set("settings.no-chat-sign", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,6 +208,15 @@ public final class LeavesConfig {
|
||||
private static void stickChangeArmorStandHasArm() {
|
||||
stickChangeArmorStandArmStatus = getBoolean("settings.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
stickChangeArmorStandArmStatus = getBoolean("settings.modify.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
}
|
||||
+
|
||||
+ public static boolean noChatSign = true;
|
||||
+ private static void noChatSign() {
|
||||
+ noChatSign = getBoolean("settings.no-chat-sign", noChatSign);
|
||||
+ if (LeavesConfig.config.contains("settings.modify.no-chat-sign")) {
|
||||
+ noChatSign = LeavesConfig.config.getBoolean("settings.modify.no-chat-sign");
|
||||
+ LeavesConfig.config.set("settings.modify.no-chat-sign", null);
|
||||
+ }
|
||||
+ noChatSign = getBoolean("settings.misc.no-chat-sign", noChatSign);
|
||||
+ }
|
||||
|
||||
public static final class WorldConfig {
|
||||
@@ -151,12 +151,12 @@ index 4cdfc433df67afcd455422e9baf56f167dd712ae..a6e0f5dab21d806e0c7744b2a337cded
|
||||
private void ensureActiveIsNotIterated() {
|
||||
// Paper - replace with better logic, do not delay removals
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index bc16e5f273d570002dd6bdfb152c5a08658e47a7..01ee69ff4ca6230d01836a175dd898242f3dc656 100644
|
||||
index 5665b792dff1e6ddf2d5f92a9391a244453851c0..b7fae62f76059a0b8e8f3670cd3429b64c906de9 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -190,7 +190,12 @@ public final class LeavesConfig {
|
||||
private static void noChatSign() {
|
||||
noChatSign = getBoolean("settings.no-chat-sign", noChatSign);
|
||||
@@ -217,7 +217,12 @@ public final class LeavesConfig {
|
||||
}
|
||||
noChatSign = getBoolean("settings.misc.no-chat-sign", noChatSign);
|
||||
}
|
||||
-
|
||||
+
|
||||
@@ -69,10 +69,10 @@ index 3b144c820531122eb37d41be06c182b5f5dc0724..8eb4a062489b42b26076d5f3bdfbff36
|
||||
this.entity.stopSeenByPlayer(player);
|
||||
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index d745eb663c0d7dec73202a842d9e0fa2c255a828..3aa7f416662a65d535b445c5a61fc6672bba4319 100644
|
||||
index b7fae62f76059a0b8e8f3670cd3429b64c906de9..035bb5a6924e817ed9ef681e5f2656462076224a 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -218,6 +218,11 @@ public final class LeavesConfig {
|
||||
@@ -223,6 +223,11 @@ public final class LeavesConfig {
|
||||
asyncMobSpawning = getBoolean("settings.performance.async-mob-spawning", asyncMobSpawning);
|
||||
}
|
||||
|
||||
@@ -1,258 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Sat, 13 Aug 2022 17:54:19 +0800
|
||||
Subject: [PATCH] LeavesConfig V2
|
||||
|
||||
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 01ee69ff4ca6230d01836a175dd898242f3dc656..d745eb663c0d7dec73202a842d9e0fa2c255a828 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -24,7 +24,7 @@ import java.util.logging.Level;
|
||||
public final class LeavesConfig {
|
||||
|
||||
public static final String CONFIG_HEADER = "Configuration file for Leaves.";
|
||||
- public static final int CURRENT_CONFIG_VERSION = 1;
|
||||
+ public static final int CURRENT_CONFIG_VERSION = 2;
|
||||
|
||||
private static final Object[] EMPTY = new Object[0];
|
||||
|
||||
@@ -59,12 +59,13 @@ public final class LeavesConfig {
|
||||
if (config.contains("config-version-please-do-not-modify-me")) {
|
||||
LeavesConfig.set("config-version-please-do-not-modify-me", null);
|
||||
}
|
||||
- LeavesConfig.configVersion = LeavesConfig.getInt("config-version", CURRENT_CONFIG_VERSION);
|
||||
+ LeavesConfig.configVersion = LeavesConfig.getInt("config-version", CURRENT_CONFIG_VERSION);
|
||||
LeavesConfig.set("config-version", CURRENT_CONFIG_VERSION);
|
||||
|
||||
- LeavesConfig.load(config);
|
||||
+ updateConfigVersion(config);
|
||||
+ LeavesConfig.load(config);
|
||||
|
||||
- commands = new HashMap<>();
|
||||
+ commands = new HashMap<>();
|
||||
|
||||
if (top.leavesmc.leaves.LeavesConfig.fakeplayerSupport) {
|
||||
commands.put("bot", new BotCommand("bot"));
|
||||
@@ -73,20 +74,20 @@ public final class LeavesConfig {
|
||||
}
|
||||
|
||||
public static void load(final YamlConfiguration config) {
|
||||
- for (Method method : LeavesConfig.class.getDeclaredMethods()) {
|
||||
- if (Modifier.isPrivate(method.getModifiers())) {
|
||||
- if (method.getParameterTypes().length == 0 && method.getReturnType() == Void.TYPE) {
|
||||
- try {
|
||||
- method.setAccessible(true);
|
||||
- method.invoke(null);
|
||||
- } catch (InvocationTargetException ex) {
|
||||
- throw Throwables.propagate(ex.getCause());
|
||||
- } catch (Exception ex) {
|
||||
- Bukkit.getLogger().log(Level.SEVERE, "Error invoking " + method, ex);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ for (Method method : LeavesConfig.class.getDeclaredMethods()) {
|
||||
+ if (Modifier.isPrivate(method.getModifiers())) {
|
||||
+ if (method.getParameterTypes().length == 0 && method.getReturnType() == Void.TYPE) {
|
||||
+ try {
|
||||
+ method.setAccessible(true);
|
||||
+ method.invoke(null);
|
||||
+ } catch (InvocationTargetException ex) {
|
||||
+ throw Throwables.propagate(ex.getCause());
|
||||
+ } catch (Exception ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Error invoking " + method, ex);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* We re-save to add new options */
|
||||
try {
|
||||
@@ -137,58 +138,79 @@ public final class LeavesConfig {
|
||||
return (List<T>) LeavesConfig.config.getList(path, config.getList(path));
|
||||
}
|
||||
|
||||
+ private static void updateConfigVersion(final YamlConfiguration config) {
|
||||
+ if (configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ playerCanEditSign = config.getBoolean("settings.player-can-edit-sign", playerCanEditSign);
|
||||
+ snowballAndEggCanKnockback = config.getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
+ fakeplayerSupport = config.getBoolean("settings.fakeplayer.enable", fakeplayerSupport);
|
||||
+ unableFakeplayerNames = (List<String>) config.getList("settings.fakeplayer.unable-fakeplayer-names", Arrays.asList("player-name"));
|
||||
+ shearsInDispenserCanZeroAmount = config.getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
+ redstoneShearsWrench = config.getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench);
|
||||
+ buddingAmethystCanPushByPiston = config.getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
+ spectatorDontGetAdvancement = config.getBoolean("settings.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
+ stickChangeArmorStandArmStatus = config.getBoolean("settings.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
+ noChatSign = config.getBoolean("settings.no-chat-sign", noChatSign);
|
||||
+
|
||||
+ config.set("settings.player-can-edit-sign", null);
|
||||
+ config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
+ config.set("settings.fakeplayer", null);
|
||||
+ config.set("settings.shears-in-dispenser-can-zero-amount", null);
|
||||
+ config.set("settings.redstone-shears-wrench", null);
|
||||
+ config.set("settings.budding-amethyst-can-push-by-piston", null);
|
||||
+ config.set("settings.spectator-dont-get-advancement", null);
|
||||
+ config.set("settings.stick-change-armorstand-arm-status", null);
|
||||
+ config.set("settings.no-chat-sign", null);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public static boolean playerCanEditSign = true;
|
||||
private static void playerCanEditSign() {
|
||||
- playerCanEditSign = getBoolean("settings.player-can-edit-sign", playerCanEditSign);
|
||||
+ playerCanEditSign = getBoolean("settings.modify.player-can-edit-sign", playerCanEditSign);
|
||||
}
|
||||
|
||||
public static boolean snowballAndEggCanKnockback = true;
|
||||
private static void snowballAndEggCanKnockback() {
|
||||
- snowballAndEggCanKnockback = getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
+ snowballAndEggCanKnockback = getBoolean("settings.modify.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
}
|
||||
|
||||
public static boolean fakeplayerSupport = true;
|
||||
private static void fakeplayerSupport() {
|
||||
- if (config.contains("settings.fakeplayer-support")) {
|
||||
- fakeplayerSupport = LeavesConfig.config.getBoolean("settings.fakeplayer-support", fakeplayerSupport);
|
||||
- LeavesConfig.config.set("settings.fakeplayer-support", null);
|
||||
- }
|
||||
- fakeplayerSupport = getBoolean("settings.fakeplayer.enable", fakeplayerSupport);
|
||||
+ fakeplayerSupport = getBoolean("settings.modify.fakeplayer.enable", fakeplayerSupport);
|
||||
}
|
||||
|
||||
- public static List<String> unableFakeplayerNames;
|
||||
+ public static List<String> unableFakeplayerNames = List.of("player-name");
|
||||
private static void unableFakeplayerNames() {
|
||||
- unableFakeplayerNames = getList("settings.fakeplayer.unable-fakeplayer-names", Arrays.asList("player-name"));
|
||||
+ unableFakeplayerNames = getList("settings.modify.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames);
|
||||
}
|
||||
|
||||
public static boolean shearsInDispenserCanZeroAmount = false;
|
||||
private static void shearsInDispenserCanZeroAmount() {
|
||||
- shearsInDispenserCanZeroAmount = getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
+ shearsInDispenserCanZeroAmount = getBoolean("settings.modify.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
}
|
||||
|
||||
public static boolean redstoneShearsWrench = true;
|
||||
private static void redstoneShearsWrench() {
|
||||
- redstoneShearsWrench = getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench);
|
||||
+ redstoneShearsWrench = getBoolean("settings.modify.redstone-shears-wrench", redstoneShearsWrench);
|
||||
}
|
||||
|
||||
public static boolean buddingAmethystCanPushByPiston = false;
|
||||
private static void buddingAmethystCanPushByPiston() {
|
||||
- buddingAmethystCanPushByPiston = getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
+ buddingAmethystCanPushByPiston = getBoolean("settings.modify.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
}
|
||||
|
||||
public static boolean spectatorDontGetAdvancement = false;
|
||||
- private static void spectatorDontGetAdvancement() {
|
||||
- spectatorDontGetAdvancement = getBoolean("settings.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
+ private static void spectatorDontGetAdvancement() {
|
||||
+ spectatorDontGetAdvancement = getBoolean("settings.modify.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
}
|
||||
|
||||
public static boolean stickChangeArmorStandArmStatus = true;
|
||||
- private static void stickChangeArmorStandHasArm() {
|
||||
- stickChangeArmorStandArmStatus = getBoolean("settings.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
+ private static void stickChangeArmorStandHasArm() {
|
||||
+ stickChangeArmorStandArmStatus = getBoolean("settings.modify.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
}
|
||||
|
||||
public static boolean noChatSign = true;
|
||||
private static void noChatSign() {
|
||||
- noChatSign = getBoolean("settings.no-chat-sign", noChatSign);
|
||||
+ noChatSign = getBoolean("settings.modify.no-chat-sign", noChatSign);
|
||||
}
|
||||
|
||||
public static boolean asyncMobSpawning = false;
|
||||
@@ -213,7 +235,7 @@ public final class LeavesConfig {
|
||||
this.worldDefaults = LeavesConfig.config.createSection("world-settings.default");
|
||||
}
|
||||
|
||||
- String worldSectionPath = LeavesConfig.configVersion < 0 ? this.worldName : "world-settings.".concat(this.worldName);
|
||||
+ String worldSectionPath = LeavesConfig.configVersion < CURRENT_CONFIG_VERSION ? this.worldName : "world-settings.".concat(this.worldName);
|
||||
ConfigurationSection section = LeavesConfig.config.getConfigurationSection(worldSectionPath);
|
||||
this.configPath = worldSectionPath;
|
||||
if (LeavesConfig.createWorldSections) {
|
||||
@@ -242,7 +264,7 @@ public final class LeavesConfig {
|
||||
}
|
||||
}
|
||||
|
||||
- if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
ConfigurationSection oldSection = LeavesConfig.config.getConfigurationSection(this.worldName);
|
||||
LeavesConfig.config.set("world-settings.".concat(this.worldName), oldSection);
|
||||
LeavesConfig.config.set(this.worldName, null);
|
||||
@@ -267,7 +289,7 @@ public final class LeavesConfig {
|
||||
boolean getBoolean(final String path, final boolean dfl) {
|
||||
final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
this.worldDefaults.addDefault(path, Boolean.valueOf(dfl));
|
||||
- if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
if (config != null && config.getBoolean(path) == dfl) {
|
||||
config.set(path, null);
|
||||
}
|
||||
@@ -277,7 +299,7 @@ public final class LeavesConfig {
|
||||
|
||||
boolean getBooleanRaw(final String path, final boolean dfl) {
|
||||
final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
- if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
if (config != null && config.getBoolean(path) == dfl) {
|
||||
config.set(path, null);
|
||||
}
|
||||
@@ -288,7 +310,7 @@ public final class LeavesConfig {
|
||||
int getInt(final String path, final int dfl) {
|
||||
final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
this.worldDefaults.addDefault(path, Integer.valueOf(dfl));
|
||||
- if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
if (config != null && config.getInt(path) == dfl) {
|
||||
config.set(path, null);
|
||||
}
|
||||
@@ -298,7 +320,7 @@ public final class LeavesConfig {
|
||||
|
||||
int getIntRaw(final String path, final int dfl) {
|
||||
final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
- if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
if (config != null && config.getInt(path) == dfl) {
|
||||
config.set(path, null);
|
||||
}
|
||||
@@ -309,7 +331,7 @@ public final class LeavesConfig {
|
||||
long getLong(final String path, final long dfl) {
|
||||
final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
this.worldDefaults.addDefault(path, Long.valueOf(dfl));
|
||||
- if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
if (config != null && config.getLong(path) == dfl) {
|
||||
config.set(path, null);
|
||||
}
|
||||
@@ -319,7 +341,7 @@ public final class LeavesConfig {
|
||||
|
||||
long getLongRaw(final String path, final long dfl) {
|
||||
final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
- if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
if (config != null && config.getLong(path) == dfl) {
|
||||
config.set(path, null);
|
||||
}
|
||||
@@ -330,7 +352,7 @@ public final class LeavesConfig {
|
||||
double getDouble(final String path, final double dfl) {
|
||||
final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
this.worldDefaults.addDefault(path, Double.valueOf(dfl));
|
||||
- if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
if (config != null && config.getDouble(path) == dfl) {
|
||||
config.set(path, null);
|
||||
}
|
||||
@@ -340,7 +362,7 @@ public final class LeavesConfig {
|
||||
|
||||
double getDoubleRaw(final String path, final double dfl) {
|
||||
final ConfigurationSection config = LeavesConfig.config.getConfigurationSection(this.configPath);
|
||||
- if (LeavesConfig.configVersion < 1) {
|
||||
+ if (LeavesConfig.configVersion < CURRENT_CONFIG_VERSION) {
|
||||
if (config != null && config.getDouble(path) == dfl) {
|
||||
config.set(path, null);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ index ca42c2642a729b90d22b968af7258f3aee72e14b..464678e973513b5c9e0cf0910cac1b3b
|
||||
public boolean visible = true;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index a38114acf2d960e9dccf6a65ea8e39cfaef9f9ee..30a5c786b4714a1a9cb05db7eb6d474b99e33ce2 100644
|
||||
index 8eb4a062489b42b26076d5f3bdfbff368c1a199b..441edf3dbd34c8d15b7b1ba02c92e8f10ccda59e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -271,14 +271,18 @@ public class ServerEntity {
|
||||
@@ -186,10 +186,10 @@ index a38114acf2d960e9dccf6a65ea8e39cfaef9f9ee..30a5c786b4714a1a9cb05db7eb6d474b
|
||||
|
||||
set.clear();
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 3aa7f416662a65d535b445c5a61fc6672bba4319..c47adc2d9d98dd08798cc26b3293d6153a7080ec 100644
|
||||
index 035bb5a6924e817ed9ef681e5f2656462076224a..015b012d6aa31719dc24381cb2460100b4b75301 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -223,6 +223,11 @@ public final class LeavesConfig {
|
||||
@@ -228,6 +228,11 @@ public final class LeavesConfig {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.performance.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ index 26bf383caea68834c654b25653ced9017f1b1b22..71e3c7fc5c071e83dfeca6954771e559
|
||||
this.blockPos = mutableBlockPos;
|
||||
setTargetPosition(mutableBlockPos.immutable()); // Paper
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index c47adc2d9d98dd08798cc26b3293d6153a7080ec..c7dff544ec7fa3d4737c731efba70de170ef7d68 100644
|
||||
index 015b012d6aa31719dc24381cb2460100b4b75301..29257079b209b0bd04f24d512bbcfca4bff9b860 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -228,6 +228,11 @@ public final class LeavesConfig {
|
||||
@@ -233,6 +233,11 @@ public final class LeavesConfig {
|
||||
asyncEntityTracker = getBoolean("settings.performance.async-entity-tracker", asyncEntityTracker);
|
||||
}
|
||||
|
||||
@@ -38,10 +38,10 @@ index eda98b85fb00fe7787d2f7a643c3854aa4b02fbf..1f1bed78e8d003cfd85bc5cf38014c3d
|
||||
private Vec3 deltaMovement;
|
||||
public float yRot; // Paper - private->public
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index c7dff544ec7fa3d4737c731efba70de170ef7d68..a3c400bc3ba55e286d05ad543d5bcb24008d5346 100644
|
||||
index 29257079b209b0bd04f24d512bbcfca4bff9b860..fc218fbbe670020e3dd180901e0ba7b048ccbbed 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -233,6 +233,11 @@ public final class LeavesConfig {
|
||||
@@ -238,6 +238,11 @@ public final class LeavesConfig {
|
||||
fixPaper6045 = getBoolean("settings.performance.fix.fix-paper-6045", fixPaper6045);
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ index 2dee51917888e20768f434b8232430094028b516..8f9bbe88827b6697762f4d43dce1da39
|
||||
public boolean hurt(DamageSource source, float amount) {
|
||||
if (this.isInvulnerableTo(source)) {
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index a3c400bc3ba55e286d05ad543d5bcb24008d5346..aa598fdf938889eb55c00bcbd733858890788d76 100644
|
||||
index fc218fbbe670020e3dd180901e0ba7b048ccbbed..f1bd791583046c1f9fe21b6f008e04063317b3f4 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -238,6 +238,11 @@ public final class LeavesConfig {
|
||||
@@ -243,6 +243,11 @@ public final class LeavesConfig {
|
||||
optimizeEntityCoordinateKey = getBoolean("settings.performance.optimize-entity-coordinate-key", optimizeEntityCoordinateKey);
|
||||
}
|
||||
|
||||
@@ -142,10 +142,10 @@ index fd18fb454263893d404979a9c9af860ee2ba9a3a..1bd4a181ccf82c687f58b8033683f15a
|
||||
return pos.isInsideBuildHeightAndWorldBoundsHorizontal(this); // Paper - use better/optimized check
|
||||
}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index aa598fdf938889eb55c00bcbd733858890788d76..c37308f2973b09f0efc3d4ccb012c2792e63f939 100644
|
||||
index f1bd791583046c1f9fe21b6f008e04063317b3f4..dbd10a355d1ac5deb064b278b209251224cf0fe5 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -243,6 +243,11 @@ public final class LeavesConfig {
|
||||
@@ -248,6 +248,11 @@ public final class LeavesConfig {
|
||||
enableSuffocationOptimization = getBoolean("settings.performance.enable-suffocation-optimization", enableSuffocationOptimization);
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ index 50d4595b81f24949011c7565c5e3fc8c26c86019..8de1653e3fbf29e9de550a1976344bd8
|
||||
@Override
|
||||
protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) {
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index c37308f2973b09f0efc3d4ccb012c2792e63f939..89623a5cd22b57733342a5b03cc4a21dca4eac33 100644
|
||||
index dbd10a355d1ac5deb064b278b209251224cf0fe5..afc36b8f55a203d888fdae08cccf4ed732888c56 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -248,6 +248,11 @@ public final class LeavesConfig {
|
||||
@@ -253,6 +253,11 @@ public final class LeavesConfig {
|
||||
entityStripRaytracing = getBoolean("settings.performance.strip-raytracing-for-entity", entityStripRaytracing);
|
||||
}
|
||||
|
||||
@@ -93,10 +93,10 @@ index 2292cb0e0c1a3e0ed34b941f028136bfb0bff13e..a6ea5fd73cb1f6b3c6c35d0cde331b6c
|
||||
|
||||
public org.bukkit.Chunk bukkitChunk;
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 89623a5cd22b57733342a5b03cc4a21dca4eac33..15d78e6fcc58a06f5d89c06ed1b87772f8b59eed 100644
|
||||
index afc36b8f55a203d888fdae08cccf4ed732888c56..287a2eca46745972bd31ba21c8e84b638272f364 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -253,6 +253,11 @@ public final class LeavesConfig {
|
||||
@@ -258,6 +258,11 @@ public final class LeavesConfig {
|
||||
checkSpookySeasonOnceAnHour = getBoolean("settings.performance.check-spooky-season-once-an-hour", checkSpookySeasonOnceAnHour);
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ index 43243537b765a2d270be6de3f053fea77ff67d18..7d8a137068ab2b33690c369f4da46e90
|
||||
this.batchCache.long2ObjectEntrySet().removeIf((entry) -> {
|
||||
return !entry.getValue().isStillValid(time);
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 15d78e6fcc58a06f5d89c06ed1b87772f8b59eed..f2591cdffad6ecd17aa192337be6d83cec7dbff2 100644
|
||||
index 287a2eca46745972bd31ba21c8e84b638272f364..a99a3337113471e5da9d9813343920412653aead 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -258,6 +258,11 @@ public final class LeavesConfig {
|
||||
@@ -263,6 +263,11 @@ public final class LeavesConfig {
|
||||
optimizeChunkTicking = getBoolean("settings.performance.optimize-chunk-ticking", optimizeChunkTicking);
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ index a7575b5ef56af6f53448d391abb4956e130148ca..e2764cbc888be39943728ff810e1e44b
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index f2591cdffad6ecd17aa192337be6d83cec7dbff2..aa84bb020997abc34f855d45f348a9d69da99575 100644
|
||||
index a99a3337113471e5da9d9813343920412653aead..cf4a8898a254a35517bf822fade2161e2f3656af 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -262,6 +262,11 @@ public final class LeavesConfig {
|
||||
@@ -267,6 +267,11 @@ public final class LeavesConfig {
|
||||
private static void skipPOIFindingInVehicle() {
|
||||
skipPOIFindingInVehicle = getBoolean("settings.performance.skip-poi-find-in-vehicle", skipPOIFindingInVehicle);
|
||||
}
|
||||
@@ -38,10 +38,10 @@ index e31a2eea9a62ab2c0bed1a97dab6bae231b8cd8b..cc851e1a9c5b23269c53206a7f1e14f3
|
||||
|
||||
public static boolean isValidEmptySpawnBlock(BlockGetter blockView, BlockPos pos, BlockState state, FluidState fluidState, EntityType<?> entityType) {
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index aa84bb020997abc34f855d45f348a9d69da99575..740695bc8b8c456d12699473d7e27e7b7b38442e 100644
|
||||
index cf4a8898a254a35517bf822fade2161e2f3656af..09666251f45c5943e1fc68c2c6850854f5c99934 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -268,6 +268,11 @@ public final class LeavesConfig {
|
||||
@@ -273,6 +273,11 @@ public final class LeavesConfig {
|
||||
entityTargetFindingOptimization = getBoolean("settings.performance.entity-target-find-optimization", entityTargetFindingOptimization);
|
||||
}
|
||||
|
||||
@@ -38,10 +38,10 @@ index 6832efb59d9efdfbc3ec38a219193b503f57cabe..7b2ec2afb29f4141a1cc2736e3d6c07d
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 740695bc8b8c456d12699473d7e27e7b7b38442e..4018421f7569c600b8762a7af0bb453619b8e682 100644
|
||||
index 09666251f45c5943e1fc68c2c6850854f5c99934..95e3c3c6e7d17d3fe0200e63fb339c207e0f9c2d 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -273,6 +273,11 @@ public final class LeavesConfig {
|
||||
@@ -278,6 +278,11 @@ public final class LeavesConfig {
|
||||
useMoreThreadUnsafeRandom = getBoolean("settings.performance.use-more-thread-unsafe-random", useMoreThreadUnsafeRandom);
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ index 3646b969fa51b9683ab4137e530c3a6f6fc6c465..ed06eaa8bcd8246483115d2dfcb1de23
|
||||
}
|
||||
if (this.targetSelector.inactiveTick()) {
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 4018421f7569c600b8762a7af0bb453619b8e682..4196247c08a9694e92e1ff1d364445f9e67710f8 100644
|
||||
index 95e3c3c6e7d17d3fe0200e63fb339c207e0f9c2d..0b36af04f9f7c5b97af6d682842de8eedd0cf878 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -278,6 +278,11 @@ public final class LeavesConfig {
|
||||
@@ -283,6 +283,11 @@ public final class LeavesConfig {
|
||||
disableMethodProfiler = getBoolean("settings.misc.disable-method-profiler", disableMethodProfiler);
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ index 35f9b11a3a61976c952a2c1c64bb2a932538f54f..5d678cfca0a39aeed0881c3a38828fdc
|
||||
|
||||
public boolean hasParam(LootContextParam<?> parameter) {
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 4196247c08a9694e92e1ff1d364445f9e67710f8..f94b4d4a18ca1fe290ff9f901f8e3a3723bd86fe 100644
|
||||
index 0b36af04f9f7c5b97af6d682842de8eedd0cf878..ae0b2e4a242366316684535766f673b70c2c79e8 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -283,6 +283,11 @@ public final class LeavesConfig {
|
||||
@@ -288,6 +288,11 @@ public final class LeavesConfig {
|
||||
throttleInactiveGoalSelectorTick = getBoolean("settings.performance.inactive-goal-selector-disable", throttleInactiveGoalSelectorTick);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user