|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Dexuby <PxLz@web.de> |
| 3 | +Date: Sun, 18 Feb 2024 01:16:30 +0100 |
| 4 | +Subject: [PATCH] Fixed bee count payload crash exploit. |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java |
| 8 | +index 3fea9b69f4cfc94e7f01d4e3ca4ce7506a8e5d5c..856af119c348e8fed503549aa48dfcb555f63f1f 100644 |
| 9 | +--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java |
| 10 | ++++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java |
| 11 | +@@ -215,7 +215,14 @@ public class PufferfishConfig { |
| 12 | + enableAsyncMobSpawning = temp; |
| 13 | + } |
| 14 | + } |
| 15 | +- |
| 16 | ++ |
| 17 | ++ public static boolean enableBeeCountPayload; |
| 18 | ++ private static void beeCountLoading() { |
| 19 | ++ enableBeeCountPayload = getBoolean("enable-bee-count-payload", true, |
| 20 | ++ "Whether or not players should be able to fetch the bee count from beehives", |
| 21 | ++ "using custom payload packets."); |
| 22 | ++ } |
| 23 | ++ |
| 24 | + public static int maxProjectileLoadsPerTick; |
| 25 | + public static int maxProjectileLoadsPerProjectile; |
| 26 | + private static void projectileLoading() { |
| 27 | +diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java |
| 28 | +index 3a57462e7945fd55e00448f6625d287d97cc93ec..18783e440cf41f4d4eb30fe7fcb6f481bc8d9da4 100644 |
| 29 | +--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java |
| 30 | ++++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java |
| 31 | +@@ -378,7 +378,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface |
| 32 | + |
| 33 | + if (gg.pufferfish.pufferfish.PufferfishConfig.enableAsyncMobSpawning) mobSpawnExecutor.start(); // Pufferfish |
| 34 | + org.purpurmc.purpur.task.BossBarTask.startAll(); // Purpur |
| 35 | +- org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur |
| 36 | ++ if (gg.pufferfish.pufferfish.PufferfishConfig.enableBeeCountPayload) org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur |
| 37 | + return true; |
| 38 | + } |
| 39 | + } |
| 40 | +diff --git a/src/main/java/org/purpurmc/purpur/task/BeehiveTask.java b/src/main/java/org/purpurmc/purpur/task/BeehiveTask.java |
| 41 | +index 8a5faed6c1ac6850b87405e774e4393877d61c92..bb46c84007cd4435a0ebd978650156869bfbb2a0 100644 |
| 42 | +--- a/src/main/java/org/purpurmc/purpur/task/BeehiveTask.java |
| 43 | ++++ b/src/main/java/org/purpurmc/purpur/task/BeehiveTask.java |
| 44 | +@@ -56,6 +56,7 @@ public class BeehiveTask implements PluginMessageListener { |
| 45 | + |
| 46 | + ServerPlayer serverPlayer = ((CraftPlayer) player).getHandle(); |
| 47 | + |
| 48 | ++ if (serverPlayer.level().getChunkIfLoaded(pos) == null) return; |
| 49 | + BlockEntity blockEntity = serverPlayer.level().getBlockEntity(pos); |
| 50 | + if (!(blockEntity instanceof BeehiveBlockEntity beehive)) { |
| 51 | + return; |
0 commit comments