Skip to content

Commit

Permalink
Update Bladeren Protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china authored and Lumine1909 committed Sep 15, 2024
1 parent a15e0f3 commit c899cea
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 53 deletions.
13 changes: 11 additions & 2 deletions patches/server/0069-Leaves-carpet-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ index 6d527cdb75e767182dce5b338322a9c27b21d5b8..7634fc05f7e1bd12c9c6aa9204af6133
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
this.disconnect("Invalid custom payload!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index fed72c6fef684758be756602f57393d088bac50d..13356860e13374227ac5559daf77fc4dc60e378d 100644
index c81d0a6e534d54db00c5f4595df0478a8342dfaf..d07442bc4a3abf00aac17375628cd1ae0eae28f1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -364,6 +364,7 @@ public abstract class PlayerList {
Expand All @@ -31,7 +31,7 @@ index fed72c6fef684758be756602f57393d088bac50d..13356860e13374227ac5559daf77fc4d
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 8049827ffba47ef1a617e17f5d7efc1a08869d3d..50b1574c090a6762a6c94aeb40abebd184b210b8 100644
index 01b542a393d81bf1df61fcfa78dab8ea66ae77ab..944a4bac0042d43dd5da809ce9feef56b9f6c0ed 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -14,6 +14,8 @@ import top.leavesmc.leaves.bot.agent.Actions;
Expand All @@ -43,6 +43,15 @@ index 8049827ffba47ef1a617e17f5d7efc1a08869d3d..50b1574c090a6762a6c94aeb40abebd1

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

public static void registerCarpetRules() {
+ CarpetRules.register(CarpetRule.of("carpet", "creativeNoClip", creativeNoClip));
+ CarpetRules.register(CarpetRule.of("pca", "avoidAnvilTooExpensive", avoidAnvilTooExpensive));
}

public static boolean creativeNoClip = false;
diff --git a/src/main/java/top/leavesmc/leaves/protocol/CarpetServerProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/CarpetServerProtocol.java
new file mode 100644
index 0000000000000000000000000000000000000000..9c13a3b7d2321dc59beec6e220790d1df0728c16
Expand Down
12 changes: 0 additions & 12 deletions patches/server/0070-Creative-fly-no-clip.patch
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,3 @@ index 1ec80f9c901dff1c9f29befa5a8e3c3f6f37aaf7..f26e5626c0823c041eeb388cbcd78e52
}

public boolean isSpawning() {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 3616400f69d41d3c7bf46f490f24e65af541c336..279dd789dc4ef7e6824a171b652c07a730391a2b 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -611,6 +611,7 @@ public final class LeavesConfig {
}

public static void registerCarpetRules() {
+ CarpetRules.register(CarpetRule.of("carpet", "creativeNoClip", creativeNoClip));
}

public static boolean creativeNoClip = false;
14 changes: 1 addition & 13 deletions patches/server/0077-Bladeren-mspt-sync-protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ index 5c09e2164a045346e0e2d4ce64408ac9209cf501..d47e29850462356e843591deba7e8a83
MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper
for (int i = 0; i < this.tickables.size(); ++i) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 13356860e13374227ac5559daf77fc4dc60e378d..163827eb405e407bca16b890c4ae3f8a4a927320 100644
index d07442bc4a3abf00aac17375628cd1ae0eae28f1..dde9803e5163b4bba99831ab09f4283c0d748a79 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -618,6 +618,7 @@ public abstract class PlayerList {
Expand All @@ -40,18 +40,6 @@ index 47b27712c6ed11fc5c2cd7de04482870207545e7..93054a59f14fee933a908944e93b462b
}

public boolean getCommandBlockOverride(String command) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 279dd789dc4ef7e6824a171b652c07a730391a2b..94b946b7d2586d6db874f6e70d36800766ae9523 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -857,6 +857,7 @@ public final class LeavesConfig {
}

public static void registerLeavesFeatures() {
+ LeavesFeatureSet.register(LeavesFeature.of("mspt_sync", msptSyncProtocol));
}

public static boolean hopperCounter = false;
diff --git a/src/main/java/top/leavesmc/leaves/protocol/bladeren/MsptSyncProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/bladeren/MsptSyncProtocol.java
new file mode 100644
index 0000000000000000000000000000000000000000..5c206ecc6aba1ef632467f85ea83f909486ced29
Expand Down
15 changes: 13 additions & 2 deletions patches/server/0080-Leaves-protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ index 3d7e2654d67b9b61cf783e234e33576a03351413..f5e16e9f144824a78ccd4a9fa0a5c0f3
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
this.disconnect("Invalid custom payload!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 163827eb405e407bca16b890c4ae3f8a4a927320..bf0d945a6faa6346276e7a9bdd16dd1964bf03a4 100644
index dde9803e5163b4bba99831ab09f4283c0d748a79..a1629559dc62adbd8918727bde2a65574d26f3ac 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -365,6 +365,7 @@ public abstract class PlayerList {
Expand All @@ -31,7 +31,7 @@ index 163827eb405e407bca16b890c4ae3f8a4a927320..bf0d945a6faa6346276e7a9bdd16dd19
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index a89cb107ed8c405548172f720b4481c2bf6950a8..1ce04475e600d527aaf31fab6cfa6bdb1a5ac2fb 100644
index 944a4bac0042d43dd5da809ce9feef56b9f6c0ed..ee079956d675a51a18b1ad3382d0b70ad19a4b8e 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -16,6 +16,8 @@ import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
Expand All @@ -51,6 +51,17 @@ index a89cb107ed8c405548172f720b4481c2bf6950a8..1ce04475e600d527aaf31fab6cfa6bdb

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

public static void registerLeavesFeatures() {
+ LeavesFeatureSet.register(LeavesFeature.of("lava_riptide", lavaRiptide));
+ LeavesFeatureSet.register(LeavesFeature.of("mspt_sync", msptSyncProtocol));
+ LeavesFeatureSet.register(LeavesFeature.of("loot_world_random", lootWorldRandom));
+ LeavesFeatureSet.register(LeavesFeature.of("use_vanilla_random", useVanillaRandom));
}

public static boolean hopperCounter = false;
diff --git a/src/main/java/top/leavesmc/leaves/protocol/bladeren/LeavesProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/bladeren/LeavesProtocol.java
new file mode 100644
index 0000000000000000000000000000000000000000..54553afa6a6a81d29bcbc6b502ce2d93cb7061c7
Expand Down
12 changes: 0 additions & 12 deletions patches/server/0081-Lava-riptide.patch
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,3 @@ index 8078f127ff4b6e0aafb5804b9c02e237f79445b5..801f066878d6ffe5dabe01d20513db90
return InteractionResultHolder.fail(itemstack);
} else {
user.startUsingItem(hand);
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 7db8506c5c6bca2a1cbd1abf4c0d65f93f45a52f..a95ee1dbad7dc689def803f55cb9a62ed821a789 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -861,6 +861,7 @@ public final class LeavesConfig {

public static void registerLeavesFeatures() {
LeavesFeatureSet.register(LeavesFeature.of("mspt_sync", msptSyncProtocol));
+ LeavesFeatureSet.register(LeavesFeature.of("lava_riptide", lavaRiptide));
}

public static boolean hopperCounter = false;
12 changes: 0 additions & 12 deletions patches/server/0110-Avoid-anvil-too-expensive.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,3 @@ index e0c3a4ba27e21c3692e601acd0af60873bcbb84c..b9fcf49ed88c62265d9aa8926c1228b9
itemstack1 = ItemStack.EMPTY;
}

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 0d43652e2ac7a0680aa50c212c75ff6b9496e9f3..63ddd86a124b27e128dbf1cef60eab1b4750e251 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -620,6 +620,7 @@ public final class LeavesConfig {

public static void registerCarpetRules() {
CarpetRules.register(CarpetRule.of("carpet", "creativeNoClip", creativeNoClip));
+ CarpetRules.register(CarpetRule.of("pca", "avoidAnvilTooExpensive", avoidAnvilTooExpensive));
}

public static boolean creativeNoClip = false;

0 comments on commit c899cea

Please sign in to comment.