fix: move down container.setChanged() to fix cud
Shiroha CI / build (push) Canceled after 0s
Shiroha CI / Event File (push) Canceled after 0s

This commit is contained in:
2026-08-22 19:53:17 +08:00
parent 20c4112564
commit c1c62df3df
2 changed files with 3 additions and 3 deletions
@@ -11,7 +11,7 @@ Original project: https://github.com/LeavesMC/Leaves
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. 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/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index a858cb658af70f07614fa1f4d9e8a3435d5c161f..b418d11d5bff749c3eaf1b34c5727bfa8c295dbd 100644 index a858cb658af70f07614fa1f4d9e8a3435d5c161f..5ab92e215c41f02c2a8260071f64dddae35dd15f 100644
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -281,36 +281,67 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -281,36 +281,67 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -23,7 +23,6 @@ index a858cb658af70f07614fa1f4d9e8a3435d5c161f..b418d11d5bff749c3eaf1b34c5727bfa
+ // Leaves start - Vanilla hopper + // Leaves start - Vanilla hopper
+ if (movedItemCount == 1) { + if (movedItemCount == 1) {
+ movedItem.setCount(movedItemCount); + movedItem.setCount(movedItemCount);
+ container.setChanged();
+ if (!worldData.skipPullModeEventFire) { + if (!worldData.skipPullModeEventFire) {
+ movedItem = callPullMoveEvent(hopper, container, movedItem); + movedItem = callPullMoveEvent(hopper, container, movedItem);
+ if (movedItem == null) { // cancelled + if (movedItem == null) { // cancelled
@@ -51,6 +50,7 @@ index a858cb658af70f07614fa1f4d9e8a3435d5c161f..b418d11d5bff749c3eaf1b34c5727bfa
+ if (remainingItem.getCount() != itemCountToMove) { + if (remainingItem.getCount() != itemCountToMove) {
+ origItemStack.setCount(removeOriginalItem ? originalItemCount - movedItemCount : originalItemCount); + origItemStack.setCount(removeOriginalItem ? originalItemCount - movedItemCount : originalItemCount);
+ container.setItem(i, origItemStack); + container.setItem(i, origItemStack);
+ container.setChanged();
return true; return true;
} }
- } - }
@@ -1573,7 +1573,7 @@ index 6109d8da984b398bb1eb6cd6ab9a55f0511a615c..d3d6b3aeb24da7f3bf92c327095a9dc9
+ // Leaves end - Lithium Sleeping Block Entity + // Leaves end - Lithium Sleeping Block Entity
} }
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index b418d11d5bff749c3eaf1b34c5727bfa8c295dbd..5772a2d86343f3a82f0f3fd6ad01ecc823560377 100644 index 5ab92e215c41f02c2a8260071f64dddae35dd15f..a847bcf24b7ac1ed702027b43438e28037daba84 100644
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -27,8 +27,29 @@ import net.minecraft.world.level.storage.ValueInput; @@ -27,8 +27,29 @@ import net.minecraft.world.level.storage.ValueInput;