Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
2e86324544
Commit
8d6014cd01
@ -83,7 +83,7 @@ public class SimulatorCommand extends SWCommand {
|
||||
BauSystem.MESSAGE.send("SIMULATOR_NOT_EXISTS", p);
|
||||
return;
|
||||
}
|
||||
tntSimulator.start();
|
||||
tntSimulator.start(p);
|
||||
}
|
||||
|
||||
@Mapper("simulators")
|
||||
|
@ -28,6 +28,9 @@ import de.steamwar.bausystem.features.simulator.tnt.SimulatorElement;
|
||||
import de.steamwar.bausystem.features.simulator.tnt.TNTElement;
|
||||
import de.steamwar.bausystem.features.simulator.tnt.TNTGroup;
|
||||
import de.steamwar.bausystem.features.tracer.record.RecordStateMachine;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.region.flags.Flag;
|
||||
import de.steamwar.bausystem.region.flags.flagvalues.FreezeMode;
|
||||
import de.steamwar.bausystem.shared.Pair;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -209,7 +212,23 @@ public class TNTSimulator {
|
||||
});
|
||||
}
|
||||
|
||||
public void start() {
|
||||
public void start(Player p) {
|
||||
for (SimulatorElement element : tntElementList) {
|
||||
if (element instanceof TNTElement) {
|
||||
if (Region.getRegion(element.getPosition().toLocation(SimulatorStorage.WORLD)).get(Flag.FREEZE) == FreezeMode.ACTIVE) {
|
||||
BauSystem.MESSAGE.send("SIMULATOR_REGION_FREEZED", p);
|
||||
return;
|
||||
}
|
||||
} else if (element instanceof TNTGroup) {
|
||||
for (TNTElement tntElement : ((TNTGroup) element).getElements()) {
|
||||
if (Region.getRegion(tntElement.getPosition().toLocation(SimulatorStorage.WORLD)).get(Flag.FREEZE) == FreezeMode.ACTIVE) {
|
||||
BauSystem.MESSAGE.send("SIMULATOR_REGION_FREEZED", p);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<Integer, Map<Integer, Set<Pair<Runnable, Integer>>>> result = new HashMap<>();
|
||||
for (SimulatorElement element : tntElementList) {
|
||||
element.locations(result);
|
||||
|
@ -139,7 +139,7 @@ public class TNTSimulatorListener implements Listener {
|
||||
if (simulator == null) {
|
||||
return;
|
||||
}
|
||||
simulator.start();
|
||||
simulator.start(event.getPlayer());
|
||||
break;
|
||||
case RIGHT_CLICK_BLOCK:
|
||||
case RIGHT_CLICK_AIR:
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren