diff options
Diffstat (limited to 'patches/server/1027-Optimize-Hoppers.patch')
-rw-r--r-- | patches/server/1027-Optimize-Hoppers.patch | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/patches/server/1027-Optimize-Hoppers.patch b/patches/server/1027-Optimize-Hoppers.patch index 74069c3d7c..14afff5a29 100644 --- a/patches/server/1027-Optimize-Hoppers.patch +++ b/patches/server/1027-Optimize-Hoppers.patch @@ -105,10 +105,10 @@ index 20201430ee8f28245aa845acb172d0f5d80458ff..9ea74d37cd951e0dc76d20ed8234b587 } diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea11feebfb2 100644 +index 4dda44608320c2a872b23053a1c3de63b79741c2..757edf74751dc7183454656fda9cecc4eb601e4c 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -151,6 +151,43 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -152,6 +152,43 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen } @@ -152,7 +152,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 private static boolean tryMoveItems(Level world, BlockPos pos, BlockState state, HopperBlockEntity blockEntity, BooleanSupplier booleansupplier) { if (world.isClientSide) { return false; -@@ -158,11 +195,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -159,11 +196,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (!blockEntity.isOnCooldown() && (Boolean) state.getValue(HopperBlock.ENABLED)) { boolean flag = false; @@ -168,7 +168,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 flag |= booleansupplier.getAsBoolean(); } -@@ -193,6 +232,202 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -194,6 +233,202 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen return false; } @@ -371,7 +371,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 private static boolean ejectItems(Level world, BlockPos blockposition, BlockState iblockdata, Container iinventory, HopperBlockEntity hopper) { // CraftBukkit Container iinventory1 = HopperBlockEntity.getAttachedContainer(world, blockposition, iblockdata); -@@ -204,46 +439,49 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -205,46 +440,49 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (HopperBlockEntity.isFullContainer(iinventory1, enumdirection)) { return false; } else { @@ -457,7 +457,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 } } } -@@ -253,17 +491,29 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -254,17 +492,29 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen } private static boolean isFullContainer(Container inventory, Direction direction) { @@ -495,7 +495,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 } public static boolean suckInItems(Level world, Hopper hopper) { -@@ -272,9 +522,33 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -273,9 +523,33 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (iinventory != null) { Direction enumdirection = Direction.DOWN; @@ -532,7 +532,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 } else { Iterator iterator = HopperBlockEntity.getItemsAtAndAbove(world, hopper).iterator(); -@@ -292,48 +566,52 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -293,48 +567,52 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen } } @@ -624,7 +624,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 } return false; -@@ -342,12 +620,14 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -343,12 +621,14 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen public static boolean addItem(Container inventory, ItemEntity itemEntity) { boolean flag = false; // CraftBukkit start @@ -640,7 +640,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 ItemStack itemstack = itemEntity.getItem().copy(); ItemStack itemstack1 = HopperBlockEntity.addItem((Container) null, inventory, itemstack, (Direction) null); -@@ -443,7 +723,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -444,7 +724,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen stack = stack.split(to.getMaxStackSize()); } // Spigot end @@ -650,7 +650,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 stack = leftover; // Paper - Make hoppers respect inventory max stack size flag = true; } else if (HopperBlockEntity.canMergeItems(itemstack1, stack)) { -@@ -517,19 +799,47 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -518,19 +800,47 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen // CraftBukkit end } @@ -702,7 +702,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 Object object = null; BlockPos blockposition = BlockPos.containing(x, y, z); if ( !world.spigotConfig.hopperCanLoadChunks && !world.hasChunkAt( blockposition ) ) return null; // Spigot -@@ -549,8 +859,8 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -550,8 +860,8 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen } } @@ -713,7 +713,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 if (!list.isEmpty()) { object = (Container) list.get(world.random.nextInt(list.size())); -@@ -561,7 +871,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -562,7 +872,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen } private static boolean canMergeItems(ItemStack first, ItemStack second) { @@ -723,7 +723,7 @@ index 321d30f1c0d3838b9c3d210eedb03aa59e0761d8..a61d7cd2b078fe511ff00344197b6ea1 @Override diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java -index 7cbd403f9e96e7ce35475c8102cd9f9c04819c27..a94300a457b25f0e33a8eeabba6dd5720ca9ab1e 100644 +index e4e827a57c2913c719282cc0d5da33586607677b..f52ccd4f3e062af3c7cc6eaea5b074a3bbd21690 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java @@ -93,12 +93,19 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc |