mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 05:03:55 -07:00
Push based hoppers cleanup
This commit is contained in:
@@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ * This operation doesn't work both ways!
|
+ * This operation doesn't work both ways!
|
||||||
+ * Make sure you check if the entity's box intersects the hopper's box, not vice versa!
|
+ * Make sure you check if the entity's box intersects the hopper's box, not vice versa!
|
||||||
+ */
|
+ */
|
||||||
+ if (this.getBoundingBox().b(hopperBoundingBox)) {
|
+ if (this.getBoundingBox().intersects(hopperBoundingBox)) {
|
||||||
+ return hopper;
|
+ return hopper;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@@ -91,6 +91,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ isHopperPushBased = getBoolean("hopper.push-based", true);
|
+ isHopperPushBased = getBoolean("hopper.push-based", true);
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/AxisAlignedBB.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java
|
||||||
|
@@ -0,0 +0,0 @@ public class AxisAlignedBB {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public final boolean intersects(AxisAlignedBB intersecting) { return this.b(intersecting); }
|
||||||
|
public boolean b(AxisAlignedBB axisalignedbb) {
|
||||||
|
return this.a(axisalignedbb.a, axisalignedbb.b, axisalignedbb.c, axisalignedbb.d, axisalignedbb.e, axisalignedbb.f);
|
||||||
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||||
@@ -261,7 +273,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ private boolean mayAcceptItems = true;
|
+ private boolean mayAcceptItems = false;
|
||||||
+
|
+
|
||||||
+ public boolean canAcceptItems() {
|
+ public boolean canAcceptItems() {
|
||||||
+ return mayAcceptItems;
|
+ return mayAcceptItems;
|
||||||
@@ -307,7 +319,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Paper start - don't search for entities in push mode
|
+ // Paper start - don't search for entities in push mode
|
||||||
+ World world = getWorld();
|
+ World world = getWorld();
|
||||||
+ return getInventory(world, this.E() + (double) enumdirection.getAdjacentX(), this.F() + (double) enumdirection.getAdjacentY(), this.G() + (double) enumdirection.getAdjacentZ(), !world.paperConfig.isHopperPushBased);
|
+ return getInventory(world, this.E() + (double) enumdirection.getAdjacentX(), this.F() + (double) enumdirection.getAdjacentY(), this.G() + (double) enumdirection.getAdjacentZ(), !world.paperConfig.isHopperPushBased);
|
||||||
+ // Paper endtcon
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
|
||||||
- public static IInventory b(IHopper ihopper) {
|
- public static IInventory b(IHopper ihopper) {
|
||||||
|
@@ -35,6 +35,7 @@ function import {
|
|||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
|
import AxisAlignedBB
|
||||||
import BaseBlockPosition
|
import BaseBlockPosition
|
||||||
import BiomeBase
|
import BiomeBase
|
||||||
import BiomeMesa
|
import BiomeMesa
|
||||||
|
Reference in New Issue
Block a user