Translatable #62
@ -1054,6 +1054,14 @@ PANZERN_PROGRESS = §e{0} §7Blöcke übrig, §e{1} §7Blöcke pro Sekunde, §e{
|
|||||||
PANZERN_DONE = §aZuende gepanzert
|
PANZERN_DONE = §aZuende gepanzert
|
||||||
|
|
||||||
# UTILS
|
# UTILS
|
||||||
|
SELECT_HELP = §8/§eselect §8[§7RegionsTyp§8] §8- §7Wähle einen RegionsTyp aus
|
||||||
|
SELECT_EXTENSION_HELP = §8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Wähle einen RegionsTyp aus mit oder ohne Extension
|
||||||
|
SELECT_NO_PERMS = §cDu darfst hier nicht den Select Befehl verwenden
|
||||||
|
SELECT_GLOBAL_REGION = §cDie globale Region kannst du nicht auswählen
|
||||||
|
SELECT_NO_TYPE = §cDiese Region hat keinen {0}
|
||||||
|
SELECT_NO_EXTENSION = §cDiese Region hat keine Ausfahrmaße
|
||||||
|
SELECT_MESSAGE = §7WorldEdit auswahl auf {0}, {1}, {2} und {3}, {4}, {5} gesetzt
|
||||||
|
|
||||||
SKULL_HELP = §8/§eskull §8[§eSpieler§8] §8-§7 Gibt einen SpielerKopf
|
SKULL_HELP = §8/§eskull §8[§eSpieler§8] §8-§7 Gibt einen SpielerKopf
|
||||||
SKULL_ITEM = §e{0}§8s Kopf
|
SKULL_ITEM = §e{0}§8s Kopf
|
||||||
|
|
||||||
|
@ -8,6 +8,9 @@ import de.steamwar.bausystem.region.Point;
|
|||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
import de.steamwar.bausystem.region.utils.RegionType;
|
||||||
|
import de.steamwar.command.GuardCheckType;
|
||||||
|
import de.steamwar.command.GuardChecker;
|
||||||
|
import de.steamwar.command.GuardResult;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.core.VersionedRunnable;
|
import de.steamwar.core.VersionedRunnable;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -19,65 +22,39 @@ public class SelectCommand extends SWCommand {
|
|||||||
super("select");
|
super("select");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(help = true)
|
@Register(description = {"SELECT_HELP", "SELECT_EXTENSION_HELP"})
|
||||||
public void genericHelp(Player p, String... args) {
|
public void baurahmenCommand(@Guard Player p, RegionType regionType, @OptionalValue("NORMAL") RegionExtensionType regionExtensionType) {
|
||||||
p.sendMessage("§8/§eselect §8[§7RegionsTyp§8] §8- §7Wähle einen RegionsTyp aus");
|
|
||||||
p.sendMessage("§8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Wähle einen RegionsTyp aus mit oder ohne Extension");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register
|
|
||||||
public void baurahmenCommand(Player p, RegionType regionType) {
|
|
||||||
if (!permissionCheck(p)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Region region = Region.getRegion(p.getLocation());
|
Region region = Region.getRegion(p.getLocation());
|
||||||
|
|
||||||
if (region.isGlobal()) {
|
if (region.isGlobal()) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cDie globale Region kannst du nicht auswählen");
|
BauSystem.MESSAGE.send("SELECT_GLOBAL_REGION", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!region.hasType(regionType)) {
|
if (!region.hasType(regionType)) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cDiese Region hat keinen " + BauSystem.MESSAGE.parse(regionType.getChatValue(), p));
|
BauSystem.MESSAGE.send("SELECT_NO_TYPE", p, BauSystem.MESSAGE.parse(regionType.getChatValue(), p));
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setSelection(regionType, RegionExtensionType.NORMAL, region, p);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register
|
|
||||||
public void baurahmenCommand(Player p, RegionType regionType, RegionExtensionType regionExtensionType) {
|
|
||||||
if (!permissionCheck(p)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Region region = Region.getRegion(p.getLocation());
|
|
||||||
|
|
||||||
if (region.isGlobal()) {
|
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cDie globale Region kannst du nicht auswählen");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!region.hasType(regionType)) {
|
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cDiese Region hat keinen " + BauSystem.MESSAGE.parse(regionType.getChatValue(), p));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (regionExtensionType == RegionExtensionType.EXTENSION && !region.hasExtensionType(regionType)) {
|
if (regionExtensionType == RegionExtensionType.EXTENSION && !region.hasExtensionType(regionType)) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cDiese Region hat keine Ausfahrmaße");
|
BauSystem.MESSAGE.send("SELECT_NO_EXTENSION", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setSelection(regionType, regionExtensionType, region, p);
|
setSelection(regionType, regionExtensionType, region, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ClassGuard(value = Player.class, local = true)
|
||||||
private boolean permissionCheck(Player player) {
|
public GuardChecker guardChecker() {
|
||||||
|
return (commandSender, guardCheckType, strings, s) -> {
|
||||||
|
Player player = (Player) commandSender;
|
||||||
if (Permission.hasPermission(player, Permission.WORLDEDIT)) {
|
if (Permission.hasPermission(player, Permission.WORLDEDIT)) {
|
||||||
return true;
|
return GuardResult.ALLOWED;
|
||||||
}
|
}
|
||||||
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Select Befehl verwenden");
|
if (guardCheckType != GuardCheckType.TAB_COMPLETE) {
|
||||||
return false;
|
BauSystem.MESSAGE.send("SELECT_NO_PERMS", player);
|
||||||
|
}
|
||||||
|
return GuardResult.DENIED;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSelection(RegionType regionType, RegionExtensionType regionExtensionType, Region region, Player p) {
|
private void setSelection(RegionType regionType, RegionExtensionType regionExtensionType, Region region, Player p) {
|
||||||
@ -85,7 +62,6 @@ public class SelectCommand extends SWCommand {
|
|||||||
Point maxPoint = region.getMaxPoint(regionType, regionExtensionType);
|
Point maxPoint = region.getMaxPoint(regionType, regionExtensionType);
|
||||||
|
|
||||||
VersionedRunnable.call(new VersionedRunnable(() -> SelectCommand_15.setSelection(p, minPoint, maxPoint), 15));
|
VersionedRunnable.call(new VersionedRunnable(() -> SelectCommand_15.setSelection(p, minPoint, maxPoint), 15));
|
||||||
p.sendMessage(BauSystem.PREFIX + "WorldEdit auswahl auf " + minPoint.getX() + ", " + minPoint.getY() + ", " + minPoint.getZ() + " und " + maxPoint.getX() + ", " + maxPoint.getY() + ", " + maxPoint.getZ() + " gesetzt");
|
BauSystem.MESSAGE.send("SELECT_MESSAGE", p, minPoint.getX(), minPoint.getY(), minPoint.getZ(), maxPoint.getX(), maxPoint.getY(), maxPoint.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren