mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-14 05:33:56 +01:00
Push based hoppers cleanup
This commit is contained in:
parent
359f9ad8cf
commit
96e8a799b4
2 changed files with 16 additions and 3 deletions
|
@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ * This operation doesn't work both ways!
|
||||
+ * 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;
|
||||
+ }
|
||||
+ }
|
||||
|
@ -91,6 +91,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ 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
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
|
@ -261,7 +273,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
+ // Paper start
|
||||
+ private boolean mayAcceptItems = true;
|
||||
+ private boolean mayAcceptItems = false;
|
||||
+
|
||||
+ public boolean canAcceptItems() {
|
||||
+ return mayAcceptItems;
|
||||
|
@ -307,7 +319,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper start - don't search for entities in push mode
|
||||
+ World world = getWorld();
|
||||
+ 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) {
|
||||
|
|
|
@ -35,6 +35,7 @@ function import {
|
|||
fi
|
||||
)
|
||||
|
||||
import AxisAlignedBB
|
||||
import BaseBlockPosition
|
||||
import BiomeBase
|
||||
import BiomeMesa
|
||||
|
|
Loading…
Reference in a new issue