1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Missed updating one onBreak() in AFarm.java

This commit is contained in:
KyleEstein 2018-04-28 12:14:17 -04:00
parent a876301d94
commit 692904ffc3

View File

@ -117,10 +117,13 @@ public abstract class AFarm extends SlimefunItem {
@Override @Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) { public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
for (int slot: getOutputSlots()) { BlockMenu inv = BlockStorage.getInventory(b);
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) { if (inv != null) {
b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot)); for (int slot: getOutputSlots()) {
BlockStorage.getInventory(b).replaceExistingItem(slot, null); if (inv.getItemInSlot(slot) != null) {
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
inv.replaceExistingItem(slot, null);
}
} }
} }
return true; return true;