mirror of
https://github.com/JamesPeters98/ChestsPlusPlus.git
synced 2024-11-14 22:56:27 +01:00
Fixed Hopper Behaviour
Virtual Hoppers were ignoring redstone locking of Hoppers
This commit is contained in:
parent
bc6b57d8ed
commit
18e865d63e
@ -31,6 +31,9 @@ public class HopperListener implements Listener {
|
||||
public void onHopperMoveEvent(InventoryMoveItemEvent event) {
|
||||
//TO HOPPER
|
||||
if(event.getDestination().getHolder() instanceof Hopper){
|
||||
if(event.getDestination().getLocation() != null){
|
||||
if(event.getDestination().getLocation().getBlock().isBlockPowered()) return;
|
||||
}
|
||||
event.setCancelled(!isItemInFilter(event.getDestination().getLocation().getBlock(),event.getItem()));
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,9 @@ public class VirtualChestToHopper extends BukkitRunnable {
|
||||
Location below = location.clone().subtract(0, 1, 0);
|
||||
if (below.getBlock().getState() instanceof Hopper) {
|
||||
Hopper hopper = (Hopper) below.getBlock().getState();
|
||||
if(below.getBlock().isBlockIndirectlyPowered()|| below.getBlock().isBlockPowered()){
|
||||
continue;
|
||||
}
|
||||
Utils.moveToOtherInventory(storage.getInventory(), 1, hopper.getInventory(), Utils.getHopperFilters(below.getBlock()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user