mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
fix import
This commit is contained in:
@@ -5,18 +5,12 @@ Subject: [PATCH] Update version fetcher repo
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
index ece77f5ea4b14bbed7c070131b3251ea86764538..102232306e7ee9922258e38e8a449a92173f074a 100644
|
||||
index ece77f5ea4b14bbed7c070131b3251ea86764538..9f6ec8d4880672d4e767959700d4e167db32e0cd 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
@@ -3,16 +3,20 @@ package com.destroystokyo.paper;
|
||||
import com.destroystokyo.paper.util.VersionFetcher;
|
||||
import com.google.common.base.Charsets;
|
||||
@@ -5,10 +5,9 @@ import com.google.common.base.Charsets;
|
||||
import com.google.common.io.Resources;
|
||||
-import com.google.gson.*;
|
||||
+import com.google.gson.Gson;
|
||||
+import com.google.gson.JsonArray;
|
||||
+import com.google.gson.JsonObject;
|
||||
+import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.*;
|
||||
import net.kyori.adventure.text.Component;
|
||||
-import net.kyori.adventure.text.event.ClickEvent;
|
||||
+import net.kyori.adventure.text.TextComponent;
|
||||
@@ -26,25 +20,20 @@ index ece77f5ea4b14bbed7c070131b3251ea86764538..102232306e7ee9922258e38e8a449a92
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
-import java.io.*;
|
||||
+import java.io.BufferedReader;
|
||||
+import java.io.IOException;
|
||||
+import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.stream.StreamSupport;
|
||||
@@ -31,8 +35,8 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@@ -31,8 +30,10 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Component getVersionMessage(@Nonnull String serverVersion) {
|
||||
- String[] parts = serverVersion.substring("git-Paper-".length()).split("[-\\s]");
|
||||
- final Component updateMessage = getUpdateStatusMessage("PaperMC/Paper", GITHUB_BRANCH_NAME, parts[0]);
|
||||
+ // Leaves start - we dont have jenkins setup
|
||||
+ String[] parts = serverVersion.substring("git-Leaves-".length()).split("[-\\s]");
|
||||
+ final Component updateMessage = getUpdateStatusMessage("LeavesMC/Leaves", GITHUB_BRANCH_NAME, parts[0]);
|
||||
+ // Leaves end - we dont have jenkins setup
|
||||
final Component history = getHistory();
|
||||
|
||||
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
|
||||
@@ -56,14 +60,12 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@@ -56,14 +57,12 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
|
||||
private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {
|
||||
int distance;
|
||||
@@ -64,7 +53,7 @@ index ece77f5ea4b14bbed7c070131b3251ea86764538..102232306e7ee9922258e38e8a449a92
|
||||
switch (distance) {
|
||||
case -1:
|
||||
return Component.text("Error obtaining version information", NamedTextColor.YELLOW);
|
||||
@@ -72,12 +74,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@@ -72,12 +71,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
case -2:
|
||||
return Component.text("Unknown version", NamedTextColor.YELLOW);
|
||||
default:
|
||||
|
||||
@@ -122,17 +122,21 @@ index 34c2ca3571438d84c13fd5a4562ee49ecceb95cb..909f0e1ff837bac4d3213214adee01a1
|
||||
.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..3a7a390f06577720f713e98eb78cc1b6e59548d3
|
||||
index 0000000000000000000000000000000000000000..47a17f5086a2dc4eb9a72ef9a8ab51e09b273e21
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -0,0 +1,283 @@
|
||||
@@ -0,0 +1,285 @@
|
||||
+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.configuration.ConfigurationSection;
|
||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.lang.reflect.InvocationTargetException;
|
||||
+import java.lang.reflect.Method;
|
||||
+import java.lang.reflect.Modifier;
|
||||
+import java.util.List;
|
||||
@@ -154,7 +158,7 @@ index 0000000000000000000000000000000000000000..3a7a390f06577720f713e98eb78cc1b6
|
||||
+
|
||||
+ public static void init(final File file) {
|
||||
+ LeavesConfig.configFile = file;
|
||||
+ final YamlConfiguration config = new YamlConfiguration();
|
||||
+ config = new YamlConfiguration();
|
||||
+ config.options().header(CONFIG_HEADER);
|
||||
+ config.options().copyDefaults(true);
|
||||
+
|
||||
@@ -173,29 +177,27 @@ index 0000000000000000000000000000000000000000..3a7a390f06577720f713e98eb78cc1b6
|
||||
+ throw new RuntimeException(ex); // unreachable
|
||||
+ }
|
||||
+ }
|
||||
+ LeavesConfig.configVersion = LeavesConfig.getInt("config-version-please-do-not-modify-me", CURRENT_CONFIG_VERSION);
|
||||
+ LeavesConfig.set("config-version-please-do-not-modify-me", CURRENT_CONFIG_VERSION);
|
||||
+
|
||||
+ LeavesConfig.load(config);
|
||||
+ LeavesConfig.load(config);
|
||||
+ }
|
||||
+
|
||||
+ public static void load(final YamlConfiguration config) {
|
||||
+ LeavesConfig.config = config;
|
||||
+ LeavesConfig.configVersion = LeavesConfig.getInt("config-version-please-do-not-modify-me", CURRENT_CONFIG_VERSION);
|
||||
+ LeavesConfig.set("config-version-please-do-not-modify-me", CURRENT_CONFIG_VERSION);
|
||||
+
|
||||
+ for (final Method method : LeavesConfig.class.getDeclaredMethods()) {
|
||||
+ if (method.getReturnType() != void.class || method.getParameterCount() != 0 ||
|
||||
+ !Modifier.isPrivate(method.getModifiers()) || !Modifier.isStatic(method.getModifiers())) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ method.setAccessible(true);
|
||||
+ method.invoke(null, EMPTY);
|
||||
+ } catch (final Exception ex) {
|
||||
+ SneakyThrow.sneaky(ex); /* Rethrow, this is critical */
|
||||
+ throw new RuntimeException(ex); // unreachable
|
||||
+ }
|
||||
+ }
|
||||
+ 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 {
|
||||
@@ -409,4 +411,3 @@ index 0000000000000000000000000000000000000000..3a7a390f06577720f713e98eb78cc1b6
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
|
||||
@@ -40,19 +40,10 @@ 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 3a7a390f06577720f713e98eb78cc1b6e59548d3..2f8969d20a17ee307f9881da5211b00292ecbb15 100644
|
||||
index 47a17f5086a2dc4eb9a72ef9a8ab51e09b273e21..db6cac634120fee0ffc5dbc5c8f06b40aa294ad3 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -56,7 +56,7 @@ public final class LeavesConfig {
|
||||
|
||||
for (final Method method : LeavesConfig.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;
|
||||
}
|
||||
|
||||
@@ -81,6 +81,11 @@ public final class LeavesConfig {
|
||||
@@ -83,6 +83,11 @@ public final class LeavesConfig {
|
||||
LeavesConfig.config.set(path, value);
|
||||
}
|
||||
|
||||
@@ -64,7 +55,7 @@ index 3a7a390f06577720f713e98eb78cc1b6e59548d3..2f8969d20a17ee307f9881da5211b002
|
||||
static boolean getBoolean(final String path, final boolean dfl) {
|
||||
LeavesConfig.config.addDefault(path, Boolean.valueOf(dfl));
|
||||
return LeavesConfig.config.getBoolean(path, dfl);
|
||||
@@ -139,7 +144,7 @@ public final class LeavesConfig {
|
||||
@@ -141,7 +146,7 @@ public final class LeavesConfig {
|
||||
public void load() {
|
||||
for (final Method method : LeavesConfig.WorldConfig.class.getDeclaredMethods()) {
|
||||
if (method.getReturnType() != void.class || method.getParameterCount() != 0 ||
|
||||
@@ -73,10 +64,3 @@ index 3a7a390f06577720f713e98eb78cc1b6e59548d3..2f8969d20a17ee307f9881da5211b002
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -280,4 +285,4 @@ public final class LeavesConfig {
|
||||
return config == null ? this.worldDefaults.getList(path, dfl) : config.getList(path, this.worldDefaults.getList(path, dfl));
|
||||
}
|
||||
}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
|
||||
@@ -49,10 +49,10 @@ 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 2f8969d20a17ee307f9881da5211b00292ecbb15..3350a80d8790a17b19155425a53291fc3be9b886 100644
|
||||
index db6cac634120fee0ffc5dbc5c8f06b40aa294ad3..34501df6372f40840208671953f7912ccc29e459 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -86,6 +86,11 @@ public final class LeavesConfig {
|
||||
@@ -88,6 +88,11 @@ public final class LeavesConfig {
|
||||
playerCanEditSign = getBoolean("settings.player-can-edit-sign", playerCanEditSign);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ index e92b98177189df1b162b648c0e259035c7ec2263..4f0d97c51db4313a73e46878546ca4c1
|
||||
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 85aec3b017e11ab94cc0846be019fb5d632127f9..d71577feb77a67d8a1e048b1fdd6d8ac276a6473 100644
|
||||
index 3fb3fc5b30d3cb171047cfb9caebf064a83f02bc..5b33ca9c6e97dfb8cd60e08272c6bc8022ede687 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -988,6 +988,7 @@ public final class CraftServer implements Server {
|
||||
@@ -29,20 +29,19 @@ index 85aec3b017e11ab94cc0846be019fb5d632127f9..d71577feb77a67d8a1e048b1fdd6d8ac
|
||||
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 3350a80d8790a17b19155425a53291fc3be9b886..a73c79e57f51a6ab0f0d0b37fa6c87ff9bd69325 100644
|
||||
index 34501df6372f40840208671953f7912ccc29e459..85a24dd51762b7590cc8116fb51b742174b85e7e 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -1,13 +1,18 @@
|
||||
package top.leavesmc.leaves;
|
||||
|
||||
import com.destroystokyo.paper.util.SneakyThrow;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
@@ -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;
|
||||
+
|
||||
import java.io.File;
|
||||
|
||||
@@ -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;
|
||||
@@ -51,7 +50,7 @@ index 3350a80d8790a17b19155425a53291fc3be9b886..a73c79e57f51a6ab0f0d0b37fa6c87ff
|
||||
import java.util.logging.Level;
|
||||
|
||||
// Copy form Tuinity(https://github.com/Tuinity/Tuinity)
|
||||
@@ -23,6 +28,7 @@ public final class LeavesConfig {
|
||||
@@ -27,6 +30,7 @@ public final class LeavesConfig {
|
||||
public static YamlConfiguration config;
|
||||
private static int configVersion;
|
||||
public static boolean createWorldSections = true;
|
||||
@@ -59,16 +58,16 @@ index 3350a80d8790a17b19155425a53291fc3be9b886..a73c79e57f51a6ab0f0d0b37fa6c87ff
|
||||
|
||||
public static void init(final File file) {
|
||||
LeavesConfig.configFile = file;
|
||||
@@ -46,6 +52,8 @@ public final class LeavesConfig {
|
||||
}
|
||||
}
|
||||
@@ -53,6 +57,8 @@ public final class LeavesConfig {
|
||||
LeavesConfig.set("config-version-please-do-not-modify-me", CURRENT_CONFIG_VERSION);
|
||||
|
||||
+ commands = new HashMap<>();
|
||||
LeavesConfig.load(config);
|
||||
+
|
||||
LeavesConfig.load(config);
|
||||
+ commands = new HashMap<>();
|
||||
}
|
||||
|
||||
@@ -91,6 +99,12 @@ public final class LeavesConfig {
|
||||
public static void load(final YamlConfiguration config) {
|
||||
@@ -93,6 +99,12 @@ public final class LeavesConfig {
|
||||
snowballAndEggCanKnockback = getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,51 +5,10 @@ Subject: [PATCH] Allow vanilla properties def
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index 61ea1c9881ea30c05580044af9496a65fe95d94e..ca0126efaf661af129dac965a091e9029c672df7 100644
|
||||
index 2becc9a274eddb1a01655f24f54d5cf72470580d..175d9f2e655af98875e7ac2a30c21435caaaffb1 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -1,8 +1,20 @@
|
||||
package com.destroystokyo.paper;
|
||||
|
||||
+import co.aikar.timings.Timings;
|
||||
+import co.aikar.timings.TimingsManager;
|
||||
import com.destroystokyo.paper.io.chunk.ChunkTaskManager;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.base.Throwables;
|
||||
+import com.google.common.collect.Lists;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.ChatColor;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.configuration.ConfigurationSection;
|
||||
+import org.bukkit.configuration.InvalidConfigurationException;
|
||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+import org.spigotmc.SpigotConfig;
|
||||
+import org.spigotmc.WatchdogThread;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -17,19 +29,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
-import com.google.common.collect.Lists;
|
||||
-import net.minecraft.server.MinecraftServer;
|
||||
-import org.bukkit.Bukkit;
|
||||
-import org.bukkit.ChatColor;
|
||||
-import org.bukkit.command.Command;
|
||||
-import org.bukkit.configuration.ConfigurationSection;
|
||||
-import org.bukkit.configuration.InvalidConfigurationException;
|
||||
-import org.bukkit.configuration.file.YamlConfiguration;
|
||||
-import co.aikar.timings.Timings;
|
||||
-import co.aikar.timings.TimingsManager;
|
||||
-import org.spigotmc.SpigotConfig;
|
||||
-import org.spigotmc.WatchdogThread;
|
||||
-
|
||||
public class PaperConfig {
|
||||
|
||||
private static File CONFIG_FILE;
|
||||
@@ -470,10 +469,10 @@ public class PaperConfig {
|
||||
@@ -470,10 +470,10 @@ public class PaperConfig {
|
||||
deobfuscateStacktraces = getBoolean("settings.loggers.deobfuscate-stacktraces", deobfuscateStacktraces);
|
||||
}
|
||||
|
||||
@@ -62,7 +21,7 @@ index 61ea1c9881ea30c05580044af9496a65fe95d94e..ca0126efaf661af129dac965a091e902
|
||||
config.set("allow-perm-block-break-exploits", null);
|
||||
}
|
||||
|
||||
@@ -486,10 +485,10 @@ public class PaperConfig {
|
||||
@@ -486,10 +486,10 @@ public class PaperConfig {
|
||||
consoleHasAllPermissions = getBoolean("settings.console-has-all-permissions", consoleHasAllPermissions);
|
||||
}
|
||||
|
||||
@@ -75,7 +34,7 @@ index 61ea1c9881ea30c05580044af9496a65fe95d94e..ca0126efaf661af129dac965a091e902
|
||||
set("settings.unsupported-settings.allow-tnt-duplication", null);
|
||||
}
|
||||
|
||||
@@ -510,10 +509,10 @@ public class PaperConfig {
|
||||
@@ -510,10 +510,10 @@ public class PaperConfig {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,33 +59,29 @@ index 02dc93c394d37c9a84aa4a58d80615c403c54fb9..d93311c3a60e54378b97286bbe7dc73e
|
||||
|
||||
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index a73c79e57f51a6ab0f0d0b37fa6c87ff9bd69325..4b8d05838bd70a2932a36a5919436861b8e41c0b 100644
|
||||
index 85a24dd51762b7590cc8116fb51b742174b85e7e..7c67667a16262f28655b5413d748cca781683717 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -6,6 +6,7 @@ import org.bukkit.Bukkit;
|
||||
@@ -7,6 +7,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+import top.leavesmc.leaves.bot.BotCommand;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -51,10 +52,12 @@ public final class LeavesConfig {
|
||||
throw new RuntimeException(ex); // unreachable
|
||||
}
|
||||
}
|
||||
+ LeavesConfig.load(config);
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -59,6 +60,10 @@ public final class LeavesConfig {
|
||||
LeavesConfig.load(config);
|
||||
|
||||
commands = new HashMap<>();
|
||||
-
|
||||
- LeavesConfig.load(config);
|
||||
commands = new HashMap<>();
|
||||
+
|
||||
+ if (top.leavesmc.leaves.LeavesConfig.fakeplayerSupport) {
|
||||
+ commands.put("bot", new BotCommand("bot"));
|
||||
+ }
|
||||
}
|
||||
|
||||
public static void load(final YamlConfiguration config) {
|
||||
@@ -99,6 +102,11 @@ public final class LeavesConfig {
|
||||
@@ -99,6 +104,11 @@ public final class LeavesConfig {
|
||||
snowballAndEggCanKnockback = getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ index 9c767096ca950d55d6002282c7a3fe2884bcd630..dcae420f13a03c6ec0f8d8cb414dc283
|
||||
|
||||
if (itemstack.getItem() instanceof SwordItem) {
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 4b8d05838bd70a2932a36a5919436861b8e41c0b..def8ab8bf0537e648751b200de01607191426d56 100644
|
||||
index 7c67667a16262f28655b5413d748cca781683717..d4000ba0a8cce6f3da43e813a283665c5c8ba8ab 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -57,6 +57,7 @@ public final class LeavesConfig {
|
||||
commands = new HashMap<>();
|
||||
@@ -63,6 +63,7 @@ public final class LeavesConfig {
|
||||
|
||||
if (top.leavesmc.leaves.LeavesConfig.fakeplayerSupport) {
|
||||
commands.put("bot", new BotCommand("bot"));
|
||||
+ top.leavesmc.leaves.bot.agent.Actions.registerAll();
|
||||
|
||||
@@ -5,31 +5,9 @@ Subject: [PATCH] Make shears in dispenser can unlimited use
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
index 2366d411bf64f88c7296e888cd3bf584825ae4a9..f8bc12bf746b1e32735081cb330b31d0c36d4c1d 100644
|
||||
index 2366d411bf64f88c7296e888cd3bf584825ae4a9..7da29029038d5a007735dcb2be0114581d85d098 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
@@ -1,7 +1,5 @@
|
||||
package net.minecraft.core.dispenser;
|
||||
|
||||
-import java.util.Iterator;
|
||||
-import java.util.List;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockSource;
|
||||
import net.minecraft.core.Direction;
|
||||
@@ -22,10 +20,12 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
-// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.event.block.BlockDispenseEvent;
|
||||
+
|
||||
+import java.util.Iterator;
|
||||
+import java.util.List;
|
||||
// CraftBukkit end
|
||||
|
||||
public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
|
||||
@@ -63,7 +63,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
|
||||
BlockPos blockposition = pointer.getPos().relative((Direction) pointer.getBlockState().getValue(DispenserBlock.FACING));
|
||||
|
||||
@@ -40,10 +18,10 @@ index 2366d411bf64f88c7296e888cd3bf584825ae4a9..f8bc12bf746b1e32735081cb330b31d0
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index def8ab8bf0537e648751b200de01607191426d56..1cfe6ab144d11e36b9a4c982f05077ebc2c653a7 100644
|
||||
index d4000ba0a8cce6f3da43e813a283665c5c8ba8ab..766d2bb1eceb570f6ebdfec81bc88c6b4d4620b1 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -93,27 +93,6 @@ public final class LeavesConfig {
|
||||
@@ -95,27 +95,6 @@ public final class LeavesConfig {
|
||||
LeavesConfig.config.set(path, value);
|
||||
}
|
||||
|
||||
@@ -71,7 +49,7 @@ index def8ab8bf0537e648751b200de01607191426d56..1cfe6ab144d11e36b9a4c982f05077eb
|
||||
static boolean getBoolean(final String path, final boolean dfl) {
|
||||
LeavesConfig.config.addDefault(path, Boolean.valueOf(dfl));
|
||||
return LeavesConfig.config.getBoolean(path, dfl);
|
||||
@@ -139,6 +118,32 @@ public final class LeavesConfig {
|
||||
@@ -141,6 +120,32 @@ public final class LeavesConfig {
|
||||
return LeavesConfig.config.getString(path, dfl);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user