From 94ddedf9028e92a9e35de192088f41bfa0e289a1 Mon Sep 17 00:00:00 2001 From: DoctaEnkoda Date: Sat, 11 Jan 2025 18:17:59 -0800 Subject: [PATCH] Config to change max number of bees --- ...-Config-to-change-max-number-of-bees.patch | 39 ------------------- .../entity/BeehiveBlockEntity.java.patch | 11 ++++++ .../org/purpurmc/purpur/PurpurConfig.java | 2 + 3 files changed, 13 insertions(+), 39 deletions(-) delete mode 100644 patches/server/0150-Config-to-change-max-number-of-bees.patch create mode 100644 purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch diff --git a/patches/server/0150-Config-to-change-max-number-of-bees.patch b/patches/server/0150-Config-to-change-max-number-of-bees.patch deleted file mode 100644 index 1b9c4d57e..000000000 --- a/patches/server/0150-Config-to-change-max-number-of-bees.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: DoctaEnkoda -Date: Thu, 29 Apr 2021 19:37:48 +0200 -Subject: [PATCH] Config to change max number of bees - - -diff --git a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -index 65a85b4a4e159cfe55e435ed342a87bcc07b21d5..7f0e37e23ff4c64355fdc822c0ac683959b8588a 100644 ---- a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -+++ b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -@@ -60,7 +60,7 @@ public class BeehiveBlockEntity extends BlockEntity { - private List stored = Lists.newArrayList(); - @Nullable - public BlockPos savedFlowerPos; -- public int maxBees = 3; // CraftBukkit - allow setting max amount of bees a hive can hold -+ public int maxBees = org.purpurmc.purpur.PurpurConfig.beeInsideBeeHive; // CraftBukkit - allow setting max amount of bees a hive can hold // Purpur - - public BeehiveBlockEntity(BlockPos pos, BlockState state) { - super(BlockEntityType.BEEHIVE, pos, state); -diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index eb9e18e2b71559ed945c40d489618ac3bf976e35..3310fb33efdf129c424503eb07055ddb4c3a200b 100644 ---- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java -+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -253,6 +253,7 @@ public class PurpurConfig { - public static boolean enderChestSixRows = false; - public static boolean enderChestPermissionRows = false; - public static boolean cryingObsidianValidForPortalFrame = false; -+ public static int beeInsideBeeHive = 3; - private static void blockSettings() { - if (version < 3) { - boolean oldValue = getBoolean("settings.barrel.packed-barrels", true); -@@ -284,6 +285,7 @@ public class PurpurConfig { - org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27); - enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows); - cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame); -+ beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive); - } - - public static boolean allowInapplicableEnchants = false; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch new file mode 100644 index 000000000..1d9ee23fd --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java ++++ b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +@@ -76,7 +_,7 @@ + "leash", + "UUID" + ); +- public static final int MAX_OCCUPANTS = 3; ++ public static final int MAX_OCCUPANTS = org.purpurmc.purpur.PurpurConfig.beeInsideBeeHive; // Purpur - Config to change max number of bees + private static final int MIN_TICKS_BEFORE_REENTERING_HIVE = 400; + private static final int MIN_OCCUPATION_TICKS_NECTAR = 2400; + public static final int MIN_OCCUPATION_TICKS_NECTARLESS = 600; diff --git a/purpur-server/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/purpur-server/src/main/java/org/purpurmc/purpur/PurpurConfig.java index 8733172b5..980b3a7d4 100644 --- a/purpur-server/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/purpur-server/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -238,6 +238,7 @@ public class PurpurConfig { public static boolean enderChestSixRows = false; public static boolean enderChestPermissionRows = false; public static boolean cryingObsidianValidForPortalFrame = false; + public static int beeInsideBeeHive = 3; private static void blockSettings() { if (version < 3) { boolean oldValue = getBoolean("settings.barrel.packed-barrels", true); @@ -269,6 +270,7 @@ public class PurpurConfig { org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27); enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows); cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame); + beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive); } public static boolean allowInapplicableEnchants = false;