3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-17 03:50:08 +01:00

Fix broken hopper logic when moving more than one item in a stack

Dieser Commit ist enthalten in:
Thinkofdeath 2014-04-24 20:07:39 +01:00
Ursprung 74c275f71c
Commit 3139af91dc

Datei anzeigen

@ -1,4 +1,4 @@
From 4abf7241f8d31fc5a9aa42f461c996f435f7c171 Mon Sep 17 00:00:00 2001 From 0467adc477c07485d63c96122b135c5b4ab5602b Mon Sep 17 00:00:00 2001
From: erocs <github@erocs.org> From: erocs <github@erocs.org>
Date: Sun, 8 Sep 2013 12:06:15 -0700 Date: Sun, 8 Sep 2013 12:06:15 -0700
Subject: [PATCH] Hopper Customisations Subject: [PATCH] Hopper Customisations
@ -6,7 +6,7 @@ Subject: [PATCH] Hopper Customisations
Allows editing hopper cooldowns and amount transferred per tick. Allows editing hopper cooldowns and amount transferred per tick.
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index 48a882a..e661462 100644 index 48a882a..ba015aa 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java --- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -189,12 +189,18 @@ public class TileEntityHopper extends TileEntity implements IHopper { @@ -189,12 +189,18 @@ public class TileEntityHopper extends TileEntity implements IHopper {
@ -47,6 +47,15 @@ index 48a882a..e661462 100644
return false; return false;
} }
ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), i); ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), i);
@@ -275,7 +281,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
return true;
}
- this.setItem(j, itemstack);
+ this.setItem(j, itemstack1); // Spigot
}
}
@@ -379,7 +385,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { @@ -379,7 +385,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
if (itemstack != null && canTakeItemFromInventory(iinventory, itemstack, i, j)) { if (itemstack != null && canTakeItemFromInventory(iinventory, itemstack, i, j)) {
ItemStack itemstack1 = itemstack.cloneItemStack(); ItemStack itemstack1 = itemstack.cloneItemStack();
@ -67,6 +76,15 @@ index 48a882a..e661462 100644
+ ((EntityMinecartHopper) ihopper).l(ihopper.getWorld().spigotConfig.hopperTransfer / 2); // Spigot + ((EntityMinecartHopper) ihopper).l(ihopper.getWorld().spigotConfig.hopperTransfer / 2); // Spigot
} }
return false;
@@ -416,7 +422,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
return true;
}
- iinventory.setItem(i, itemstack1);
+ iinventory.setItem(i, itemstack2); // Spigot
}
return false; return false;
@@ -502,7 +508,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { @@ -502,7 +508,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {