Add PanzernCommand Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
6b463b4a76
Commit
423f6247c0
@ -521,6 +521,10 @@ AFK_WARNING_MESSAGE=§cDieser Server wird bei weiterer Inaktivität in einer Min
|
||||
|
||||
# Panzern
|
||||
PANZERN_HELP = §8/§epanzern §8[§7Block§8] §8[§7Slab§8] §8- §7Panzer deine WorldEdit Auswahl
|
||||
PANZERN_PREPARE1 = §71. Gucke nochmal nach, ob Läufe auch bis zur Panzergrenze führen.
|
||||
PANZERN_PREPARE2 = §72. Teppich in Gänge auf dem Boden vereinfacht das panzern.
|
||||
PANZERN_PREPARE3 = §73. Schildtechnik sollte explizit eingeschlossen sein.
|
||||
PANZERN_PREPARE4 = §74. Innerhalb der zu panzernden Region zu stehen, beim Befehlausführen kann das Panzern verbessern.
|
||||
PANZERN_NO_PERM = §cDu darfst hier nicht das Panzern System verwenden
|
||||
PANZERN_NO_WORLDEDIT = §cDu hast keine WorldEdit Selection
|
||||
PANZERN_PROGRESS = §e{0} §7Blöcke übrig
|
||||
|
@ -44,12 +44,16 @@ public class Panzern {
|
||||
private Material blockMaterial;
|
||||
private Material slabMaterial;
|
||||
|
||||
public Panzern(Location pos1, Location pos2, Material blockMaterial, Material slabMaterial) {
|
||||
public Panzern(Location pos1, Location pos2, Location possibleSource, Material blockMaterial, Material slabMaterial) {
|
||||
this.world = pos1.getWorld();
|
||||
this.pos1 = new Location(world, Math.min(pos1.getBlockX(), pos2.getBlockX()), Math.min(pos1.getBlockY(), pos2.getBlockY()), Math.min(pos1.getBlockZ(), pos2.getBlockZ()));
|
||||
this.pos2 = new Location(world, Math.max(pos1.getBlockX(), pos2.getBlockX()), Math.max(pos1.getBlockY(), pos2.getBlockY()), Math.max(pos1.getBlockZ(), pos2.getBlockZ()));
|
||||
if (inRegion(possibleSource)) {
|
||||
current.add(possibleSource);
|
||||
} else {
|
||||
current.add(this.pos1);
|
||||
current.add(this.pos2);
|
||||
}
|
||||
this.blockMaterial = blockMaterial;
|
||||
this.slabMaterial = slabMaterial;
|
||||
}
|
||||
|
@ -56,6 +56,10 @@ public class PanzernCommand extends SWCommand {
|
||||
public void genericHelp(Player player, String... args) {
|
||||
BauSystem.MESSAGE.send("COMMAND_HELP_HEAD", player, "panzern");
|
||||
BauSystem.MESSAGE.send("PANZERN_HELP", player);
|
||||
BauSystem.MESSAGE.send("PANZERN_PREPARE1", player);
|
||||
BauSystem.MESSAGE.send("PANZERN_PREPARE2", player);
|
||||
BauSystem.MESSAGE.send("PANZERN_PREPARE3", player);
|
||||
BauSystem.MESSAGE.send("PANZERN_PREPARE4", player);
|
||||
}
|
||||
|
||||
@Register
|
||||
@ -68,7 +72,7 @@ public class PanzernCommand extends SWCommand {
|
||||
BauSystem.MESSAGE.send("PANZERN_NO_WORLDEDIT", player);
|
||||
return;
|
||||
}
|
||||
Panzern panzern = new Panzern(selection.getKey(), selection.getValue(), blockMaterial, slabMaterial);
|
||||
Panzern panzern = new Panzern(selection.getKey(), selection.getValue(), player.getLocation(), blockMaterial, slabMaterial);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren