SteamWar/BauSystem
Archiviert
13
0

Fix Loader Redstone

Dieser Commit ist enthalten in:
Chaoscaot 2020-08-29 01:15:19 +02:00
Ursprung e18b2c77d8
Commit d4535ff36d

Datei anzeigen

@ -30,10 +30,28 @@ class AutoLoader_15 {
Powerable powerable = (Powerable) data;
powerable.setPowered(active);
block.setBlockData(powerable);
block.getState().update(true);
updateBlock(block.getLocation());
return true;
}
static void updateBlock(Location location) {
Location[] locations = new Location[] {
location.clone(),
location.clone().add(1, 0,0),
location.clone().add(-1, 0,0),
location.clone().add(0, 1,0),
location.clone().add(0, -1,0),
location.clone().add(0, 0,1),
location.clone().add(0, 0,-1)
};
for (Location value : locations) {
if (value.getBlock().getType().toString().contains("SIGN")) continue;
BlockData data = value.getBlock().getBlockData();
value.getBlock().setType(Material.BARRIER, true);
value.getBlock().setBlockData(data, true);
}
}
static void onPlayerInteract(IAutoLoader loader, PlayerInteractEvent event) {
if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.PHYSICAL)
return;