Don't set the count on already empty items in hopper moves (Fixes #2735)

This commit is contained in:
Shane Freeder 2019-12-13 20:11:45 +00:00
parent 58d8fb0b05
commit 4d3571d073

View File

@ -80,7 +80,7 @@ index 958279249..a8e64dfda 100644
this.world.b(this.position, this);
if (!this.c.isAir()) {
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index e08faf538..15588103b 100644
index e08faf538..e7cf14d10 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
@ -118,7 +118,9 @@ index e08faf538..15588103b 100644
+ final int remaining = itemstack2.getCount();
+ if (remaining != moved) {
+ origItemStack = origItemStack.cloneItemStack(true);
+ origItemStack.setCount(origCount - moved + remaining);
+ if (!origItemStack.isEmpty()) {
+ origItemStack.setCount(origCount - moved + remaining);
+ }
+ this.setItem(i, origItemStack);
+ iinventory.update();
+ return true;
@ -155,7 +157,9 @@ index e08faf538..15588103b 100644
+ final int remaining = itemstack2.getCount();
+ if (remaining != moved) {
+ origItemStack = origItemStack.cloneItemStack(true);
+ origItemStack.setCount(origCount - moved + remaining);
+ if (!origItemStack.isEmpty()) {
+ origItemStack.setCount(origCount - moved + remaining);
+ }
+ IGNORE_TILE_UPDATES = true;
+ iinventory.setItem(i, origItemStack);
+ IGNORE_TILE_UPDATES = false;