Skip to content

Commit

Permalink
Add mc-old hopper suck-in behavior (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumine1909 authored Jan 15, 2025
1 parent 41476d8 commit 88819fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 5 additions & 2 deletions patches/server/0006-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ index a41e6f5dc2d5516f081d7340e2dacffaf5663485..8f1230fcfa4fc27b513a4eb1023f107c
.withRequiredArg()
diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..248536658e094ce5b035c16da54658b80e967829
index 0000000000000000000000000000000000000000..a3b637eeb8022e1ad7d9dda945ea37651a0aa3fe
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,961 @@
@@ -0,0 +1,964 @@
+package org.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -346,6 +346,9 @@ index 0000000000000000000000000000000000000000..248536658e094ce5b035c16da54658b8
+ @GlobalConfig("old-block-entity-behaviour")
+ public boolean oldBlockEntityBehaviour = false;
+
+ @GlobalConfig("old-hopper-suck-in-behavior")
+ public boolean oldHopperSuckInBehavior = false;
+
+ public RaidConfig raid = new RaidConfig();
+
+ @GlobalConfigCategory("revert-raid-changes")
Expand Down
11 changes: 10 additions & 1 deletion patches/server/0111-Vanilla-hopper.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Vanilla hopper
This is a temporary solution designed to attempt to restore the vanilla behavior of the funnel while preserving optimizations as much as possible. It should ultimately be replaced by the optimization solution provided by lithium.

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 af3846dbb29d4738d0cce20c85d2f40c7ccf4f70..a20fcf4211f92dba56c5343bb2c0c7d0db7751b7 100644
index af3846dbb29d4738d0cce20c85d2f40c7ccf4f70..1a2a7e100ad56d00e98844f4fa7f44cede6fa1d8 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
@@ -305,36 +305,49 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
Expand Down Expand Up @@ -83,3 +83,12 @@ index af3846dbb29d4738d0cce20c85d2f40c7ccf4f70..a20fcf4211f92dba56c5343bb2c0c7d0

if (level.paperConfig().hopper.cooldownWhenFull && !org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode) { // Leaves
cooldownHopper(hopper);
@@ -605,7 +618,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen

return false;
} else {
- boolean flag = hopper.isGridAligned() && iblockdata.isCollisionShapeFullBlock(world, blockposition) && !iblockdata.is(BlockTags.DOES_NOT_BLOCK_HOPPERS);
+ boolean flag = hopper.isGridAligned() && (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldHopperSuckInBehavior || iblockdata.isCollisionShapeFullBlock(world, blockposition)) && !iblockdata.is(BlockTags.DOES_NOT_BLOCK_HOPPERS);

if (!flag) {
Iterator iterator = HopperBlockEntity.getItemsAtAndAbove(world, hopper).iterator();

0 comments on commit 88819fe

Please sign in to comment.