Update VirtualCraftingHolder.java

Hoppers now respect their redstone behaviour when under an AutoCrafter.
This commit is contained in:
jameslfc19 2020-07-14 19:26:53 +01:00
parent c71c8d6214
commit e8e84c8dde

View File

@ -217,7 +217,12 @@ public class VirtualCraftingHolder implements InventoryHolder {
Inventory output;
if(blockBelow.getState() instanceof Hopper){
Bukkit.broadcastMessage("Below is hopper!");
Hopper hopper = (Hopper) blockBelow.getState();
if(blockBelow.isBlockPowered() || blockBelow.isBlockIndirectlyPowered()){
Bukkit.broadcastMessage("Hopper is powered!");
continue; //If hopper is powered no crafting should happen.
}
output = hopper.getInventory();
} else {
output = getInventory(blockBelow);