fix for furnaces

This commit is contained in:
Brianna O'Keefe 2018-11-29 00:35:12 -05:00
parent 5c2868ad59
commit e6e37529bb

View File

@ -229,15 +229,22 @@ public class HopHandler {
boolean isFuel = item.getType().isFuel();
ItemStack output = isFuel ? furnaceInventory.getFuel() : furnaceInventory.getSmelting();
if (!output.isSimilar(newItem)) return 4;
int maxSize = output.getMaxStackSize();
int currentOutputAmount = output.getAmount();
if (output != null && !output.isSimilar(newItem)) return 4;
int maxSize = newItem.getMaxStackSize();
int currentOutputAmount = output == null ? 0 : output.getAmount();
if (currentOutputAmount + newItem.getAmount() <= maxSize) {
if (!ovoid.contains(it.getType())) {
output.setAmount(currentOutputAmount + newItem.getAmount());
furnaceInventory.setFuel(output);
if (output != null) {
output.setAmount(currentOutputAmount + newItem.getAmount());
} else {
output = newItem.clone();
}
if (isFuel) {
furnaceInventory.setFuel(output);
} else {
furnaceInventory.setSmelting(output);
}
isS[place] = is;
hopperBlock.getInventory().setContents(isS);
}