SteamWar/BauSystem
Archiviert
13
0
Dieser Commit ist enthalten in:
jojo 2021-02-12 17:06:53 +01:00
Ursprung 3f39066209
Commit b523747394

Datei anzeigen

@ -58,18 +58,23 @@ public class TNTSimulatorListener implements Listener {
return; return;
} }
if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_AIR) { switch (event.getAction()) {
case LEFT_CLICK_BLOCK:
case LEFT_CLICK_AIR:
startSimulation(event.getPlayer()); startSimulation(event.getPlayer());
return; break;
} case RIGHT_CLICK_BLOCK:
if (event.getClickedBlock() == null) {
openSimulator(event.getPlayer());
return;
}
Vector location = event.getClickedBlock().getLocation().toVector().add(event.getBlockFace().getDirection()).add(HALF); Vector location = event.getClickedBlock().getLocation().toVector().add(event.getBlockFace().getDirection()).add(HALF);
TNTSpawn tntSpawn = new TNTSpawn(location); TNTSpawn tntSpawn = new TNTSpawn(location);
addTNT(event.getPlayer(), tntSpawn); addTNT(event.getPlayer(), tntSpawn);
editTNT(event.getPlayer(), tntSpawn); editTNT(event.getPlayer(), tntSpawn);
break;
case RIGHT_CLICK_AIR:
openSimulator(event.getPlayer());
break;
default:
break;
}
} }
@EventHandler @EventHandler