From e4a5ddd929826f1e609cbcbc1b5f4c051c808c81 Mon Sep 17 00:00:00 2001 From: Shane Freeder <theboyetronic@gmail.com> Date: Thu, 25 Oct 2018 21:27:54 +0100 Subject: [PATCH] fix "avoid hopper searches" and make it use an obfhelper --- ...oid-hopper-searches-if-there-are-no-items.patch | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch index ef02d4d07a..3c88ebb1d4 100644 --- a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch +++ b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch @@ -63,7 +63,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 + * Make sure the inventory selector stays in sync. + * It should be the one that checks `var1 instanceof IInventory && var1.isAlive()` + */ -+ if (predicate == IEntitySelector.c && inventoryEntityCounts[k] <= 0) continue; ++ if (predicate == IEntitySelector.isInventory() && inventoryEntityCounts[k] <= 0) continue; + // Paper end while (iterator.hasNext()) { Entity entity1 = (Entity) iterator.next(); @@ -87,4 +87,16 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 Iterator iterator = this.entitySlices[k].iterator(); // Spigot while (iterator.hasNext()) { +diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java +index 7ac07ac07ac0..7ac07ac07ac0 100644 +--- a/src/main/java/net/minecraft/server/IEntitySelector.java ++++ b/src/main/java/net/minecraft/server/IEntitySelector.java +@@ -0,0 +0,0 @@ public final class IEntitySelector { + public static final Predicate<Entity> c = (entity) -> { + return entity.isAlive() && !entity.isVehicle() && !entity.isPassenger(); + }; ++ public static final Predicate<Entity> isInventory() { return d; } // Paper - OBFHELPER + public static final Predicate<Entity> d = (entity) -> { + return entity instanceof IInventory && entity.isAlive(); + }; -- \ No newline at end of file