Made buttons work as offline input levers, closes #64

This commit is contained in:
Stijn Bannink 2023-08-13 18:19:31 +02:00
parent c03a7ee5b7
commit d6ca0d4bec

View file

@ -63,10 +63,7 @@ public class PlayerInteractListener implements Listener {
for (LiftInput li : lift.getOfflineInputs()) {
Block b = Bukkit.getWorld(li.getWorld()).getBlockAt(li.getX(), li.getY(), li.getZ());
BlockData bd = b.getBlockData();
if (!(bd instanceof Powerable)) {
Bukkit.getLogger().warning("[V10Lift] Block at " + li.getX() + ", " + li.getY() + ", " + li.getZ() + " is not powerable, while it should be an offline input of " + entry.getKey() + "!");
continue;
}
if (!(bd instanceof Powerable)) continue;
((Powerable) bd).setPowered(newState);
b.setBlockData(bd);
}