Added ColorConfig for SimulatorCommand & TraceCommand
Dieser Commit ist enthalten in:
Ursprung
4da8f2f60e
Commit
9ea8b741b5
@ -32,4 +32,5 @@ public class ColorConfig {
|
|||||||
public final ChatColor ENABLE = ChatColor.GREEN;
|
public final ChatColor ENABLE = ChatColor.GREEN;
|
||||||
public final ChatColor DISABLE = ChatColor.RED;
|
public final ChatColor DISABLE = ChatColor.RED;
|
||||||
|
|
||||||
}
|
public final ChatColor ERROR = ChatColor.RED;
|
||||||
|
}
|
@ -23,6 +23,7 @@ package de.steamwar.bausystem.features.simulator;
|
|||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
|
import de.steamwar.bausystem.config.ColorConfig;
|
||||||
import de.steamwar.bausystem.linkage.LinkageType;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
@ -37,10 +38,10 @@ public class SimulatorCommand extends SWCommand {
|
|||||||
|
|
||||||
@Register(help = true)
|
@Register(help = true)
|
||||||
public void genericHelp(Player p, String... args) {
|
public void genericHelp(Player p, String... args) {
|
||||||
p.sendMessage("§8/§esimulator §8- §7Legt dir den Simulatorstab ins Inventar");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "simulator" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Legt dir den Simulatorstab ins Inventar");
|
||||||
p.sendMessage("§8/§esimulator start §8- §7Startet die Simulation");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "simulator start" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Startet die Simulation");
|
||||||
p.sendMessage("§8/§esimulator gui §8- §7Öffnet die GUI");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "simulator gui" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Öffnet die GUI");
|
||||||
p.sendMessage("§8/§esimulator delete §8- §7Löscht alle TNT");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "simulator delete" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Löscht alle TNT");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
|
@ -42,13 +42,13 @@ public class TraceCommand extends SWCommand {
|
|||||||
|
|
||||||
@Register(help = true)
|
@Register(help = true)
|
||||||
public void genericHelp(Player p, String... args) {
|
public void genericHelp(Player p, String... args) {
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace start " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Startet die Aufnahme aller TNT-Positionen");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace start" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Startet die Aufnahme aller TNT-Positionen");
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace stop " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Stoppt den TNT-Tracer");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace stop" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Stoppt den TNT-Tracer");
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace toggleauto " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Automatischer Aufnahmenstart");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace toggleauto" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Automatischer Aufnahmenstart");
|
||||||
// p.sendMessage("§8/§etrace show gui §8- §7Zeigt die Trace show gui");
|
// p.sendMessage("§8/§etrace show gui §8- §7Zeigt die Trace show gui");
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace show " + ColorConfig.OTHER + "<" + ColorConfig.HIGHLIGHT + "-water" + ColorConfig.OTHER + "|" + ColorConfig.HIGHLIGHT + "-interpolate-xz" + ColorConfig.OTHER + "|" + ColorConfig.HIGHLIGHT + "-interpolate-y" + ColorConfig.OTHER + "> " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Zeigt alle TNT-Positionen");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace show " + ColorConfig.OTHER + "<" + ColorConfig.HIGHLIGHT + "-water" + ColorConfig.OTHER + "|" + ColorConfig.HIGHLIGHT + "-interpolate-xz" + ColorConfig.OTHER + "|" + ColorConfig.HIGHLIGHT + "-interpolate-y" + ColorConfig.OTHER + "> " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Zeigt alle TNT-Positionen");
|
||||||
p.sendMessage("§8/§etrace hide §8- §7Versteckt alle TNT-Positionen");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace hide" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Versteckt alle TNT-Positionen");
|
||||||
p.sendMessage("§8/§etrace delete §8- §7Löscht alle TNT-Positionen");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace delete" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Löscht alle TNT-Positionen");
|
||||||
// p.sendMessage("§8/§etrace list §8<§7FRAME-ID§8> §8- §7Listet alle TNT auf");
|
// p.sendMessage("§8/§etrace list §8<§7FRAME-ID§8> §8- §7Listet alle TNT auf");
|
||||||
// p.sendMessage("§8/§etrace gui §8- §7Zeigt die Trace Oberfläche an");
|
// p.sendMessage("§8/§etrace gui §8- §7Zeigt die Trace Oberfläche an");
|
||||||
// p.sendMessage("§7Optionale Parameter mit §8<>§7, Benötigte Parameter mit §8[]");
|
// p.sendMessage("§7Optionale Parameter mit §8<>§7, Benötigte Parameter mit §8[]");
|
||||||
@ -58,14 +58,14 @@ public class TraceCommand extends SWCommand {
|
|||||||
public void startCommand(Player p) {
|
public void startCommand(Player p) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
RecordStateMachine.commandStart();
|
RecordStateMachine.commandStart();
|
||||||
p.sendMessage(BauSystem.PREFIX + "§aTNT-Tracer gestartet");
|
p.sendMessage(BauSystem.PREFIX + ColorConfig.ENABLE + "TNT-Tracer gestartet");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register({"stop"})
|
@Register({"stop"})
|
||||||
public void stopCommand(Player p) {
|
public void stopCommand(Player p) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
RecordStateMachine.commandStop();
|
RecordStateMachine.commandStop();
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cTNT-Tracer gestoppt");
|
p.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + "TNT-Tracer gestoppt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register({"toggleauto"})
|
@Register({"toggleauto"})
|
||||||
@ -89,14 +89,14 @@ public class TraceCommand extends SWCommand {
|
|||||||
public void deleteCommand(Player p) {
|
public void deleteCommand(Player p) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
StoredRecords.clear();
|
StoredRecords.clear();
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cAlle TNT-Positionen gelöscht");
|
p.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + "Alle TNT-Positionen gelöscht");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register({"show"})
|
@Register({"show"})
|
||||||
public void showCommand(Player p) {
|
public void showCommand(Player p) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
TraceShowManager.show(p, new TraceEntityShowMode(p, new ShowModeParameter()));
|
TraceShowManager.show(p, new TraceEntityShowMode(p, new ShowModeParameter()));
|
||||||
p.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt");
|
p.sendMessage(BauSystem.PREFIX + ColorConfig.ENABLE + "Alle TNT-Positionen angezeigt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register({"show"})
|
@Register({"show"})
|
||||||
@ -107,7 +107,7 @@ public class TraceCommand extends SWCommand {
|
|||||||
showModeParameterType.getShowModeParameterConsumer().accept(showModeParameter);
|
showModeParameterType.getShowModeParameterConsumer().accept(showModeParameter);
|
||||||
}
|
}
|
||||||
TraceShowManager.show(p, new TraceEntityShowMode(p, showModeParameter));
|
TraceShowManager.show(p, new TraceEntityShowMode(p, showModeParameter));
|
||||||
p.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt");
|
p.sendMessage(BauSystem.PREFIX + ColorConfig.ENABLE + "Alle TNT-Positionen angezeigt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register({"show", "gui"})
|
@Register({"show", "gui"})
|
||||||
@ -120,13 +120,13 @@ public class TraceCommand extends SWCommand {
|
|||||||
public void hideCommand(Player p) {
|
public void hideCommand(Player p) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
TraceShowManager.hide(p);
|
TraceShowManager.hide(p);
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cAlle TNT-Positionen ausgeblendet");
|
p.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + "Alle TNT-Positionen ausgeblendet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private boolean permissionCheck(Player player) {
|
private boolean permissionCheck(Player player) {
|
||||||
if (!Permission.hasPermission(player, Permission.WORLD)) {
|
if (!Permission.hasPermission(player, Permission.WORLD)) {
|
||||||
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den TNT-Tracer nutzen");
|
player.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + "Du darfst hier nicht den TNT-Tracer nutzen");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren