Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
4cb314dbee
Commit
157b787e41
@ -209,6 +209,294 @@ GUI_EDITOR_ITEM_TRASH_LORE=§7Item hier rein Legen
|
|||||||
GUI_EDITOR_ITEM_MORE=§eMehr Items
|
GUI_EDITOR_ITEM_MORE=§eMehr Items
|
||||||
GUI_EDITOR_TITLE_MORE=Item auswählen
|
GUI_EDITOR_TITLE_MORE=Item auswählen
|
||||||
|
|
||||||
|
# Script
|
||||||
|
|
||||||
|
## Errors
|
||||||
|
SCRIPT_SLEEP_ERROR = §cFüge ein sleep in dein Script ein
|
||||||
|
SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR = §cDas erste Argument fehlt und sollte eine Variable sein
|
||||||
|
SCRIPT_COMMAND_ERROR_FIRST_ARG_NONUMER = §cDas erste Argument fehlt und sollte eine Zahl sein
|
||||||
|
SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR_OR_VALUE = §cDas erste Argument fehlt und sollte eine Variable oder ein Wert sein
|
||||||
|
SCRIPT_COMMAND_ERROR_FIRST_ARG_NOJUMPPOINT = §cDas erste Argument fehlt und sollte ein Jump-Point sein
|
||||||
|
SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR = §cDas zweite Argument fehlt und sollte eine Variable sein
|
||||||
|
SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR_OR_VALUE = §cDas zweite Argument fehlt und sollte eine Variable oder ein Wert sein
|
||||||
|
SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVALUE = §cDas zweite Argument fehlt und sollte ein Wert sein
|
||||||
|
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVAR = §cDas dritte Argument fehlt und sollte eine Variable sein
|
||||||
|
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVALUE = §cDas dritte Argument fehlt und sollte ein Wert sein
|
||||||
|
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVAR_OR_NUMBER = §cDas dritte Argument fehlt und sollte eine Variable/Zahl sein
|
||||||
|
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOJUMPPOINT = §cDas dritte Argument fehlt und sollte ein Jump-Point sein
|
||||||
|
SCRIPT_COMMAND_ERROR_FOURTH_ARG_NOVALUE = §cDas vierte Argument fehlt und sollte ein Wert sein
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_ERROR_BOOLEAN_COMPARE = §cNur Booleans können verglichen werden
|
||||||
|
SCRIPT_COMMAND_ERROR_NUMBER_COMPARE = §cNur Zahlen können verglichen werden
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED = §cNur Strings können verwendet werden
|
||||||
|
SCRIPT_COMMAND_ERROR_ONLY_NUMBERS_ALLOWED = §cNur Zahlen können verwendet werden
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_ADD_HELP_1 = §eadd §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_ADD_HELP_2 = §eadd §8<§7Variable§8> §8<§7Variable§8§8|§7Wert> §8<§7Variable§8|§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_ADD_HELP_3 = Addition zwischen den letzten beiden Variablen und schreibt es in die erste.
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_ADD_ERROR = §cNur Zahlen können addiert werden
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_DIV_HELP_1 = §ediv §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_DIV_HELP_2 = §ediv §8<§7Variable§8> §8<§7Variable§8§8|§7Wert> §8<§7Variable§8|§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_DIV_HELP_3 = Division zwischen den letzten beiden Variablen und schreibt es in die erste.
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_DIV_ERROR = §cNur Zahlen können dividiert werden
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_MUL_HELP_1 = §emul §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_MUL_HELP_2 = §emul §8<§7Variable§8> §8<§7Variable§8§8|§7Wert> §8<§7Variable§8|§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_MUL_HELP_3 = Multiplikation zwischen den letzten beiden Variablen und schreibt es in die erste.
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_MUL_ERROR = §cNur Zahlen können multipliziert werden
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_SUB_HELP_1 = §esub §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_SUB_HELP_2 = §esub §8<§7Variable§8> §8<§7Variable§8§8|§7Wert> §8<§7Variable§8|§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_SUB_HELP_3 = Subtraktion zwischen den letzten beiden Variablen und schreibt es in die erste.
|
||||||
|
SCRIPT_COMMAND_ARITHMETIC_SUB_ERROR = §cNur Zahlen können subtrahiert werden
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_IO_ECHO_HELP_1 = §eecho §8<§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_IO_ECHO_HELP_2 = §7Schreibe etwas dem Spieler. Wenn kein Wert angegeben wurde ist die Nachricht leer.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_IO_ECHOACTIONBAR_HELP_1 = §eechoactionbar §8<§7Wert§8>
|
||||||
|
SCRIPT_COMMAND_IO_ECHOACTIONBAR_HELP_2 = §7Schreibe etwas dem Spieler in der ActionBar. Wenn kein Wert angegeben wurde ist die Nachricht leer.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_IO_INPUT_HELP_1 = §einput §8<§7Variable§8> §8<§7Text§8>
|
||||||
|
SCRIPT_COMMAND_IO_INPUT_HELP_2 = §7Fordere eine Eingabe von dem Spieler, welche in die Variable geschrieben wird. Der Text ist optional.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_LOGIC_AND_HELP_1 = §eand §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_AND_HELP_2 = §eand §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_AND_HELP_3 = Das logische Und zwischen den letzten beiden Variablen und schreibt es in die erste.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_LOGIC_EQUAL_HELP_1 = §eequal §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_EQUAL_HELP_2 = §eequal §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_EQUAL_HELP_3 = Vergleiche die letzten beiden Variablen und schreibt es in die erste.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_LOGIC_GREATER_HELP_1 = §egreater §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_GREATER_HELP_2 = §egreater §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_GREATER_HELP_3 = Vergleiche die letzten beiden Variablen und schreibt es in die erste.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_LOGIC_LESS_HELP_1 = §eless §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_LESS_HELP_2 = §eless §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_LESS_HELP_3 = Vergleiche die letzten beiden Variablen und schreibt es in die erste.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_LOGIC_NOT_HELP_1 = §enot §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_NOT_HELP_2 = §enot §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_NOT_HELP_3 = Das logische Nicht von der letzten Variable und schreibt es in die erste.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_LOGIC_OR_HELP_1 = §eor §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_OR_HELP_2 = §eor §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_LOGIC_OR_HELP_3 = Das logische Oder zwischen den letzten beiden Variablen und schreibt es in die erste.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_STRING_INSERT_HELP_1 = §einsert §8<§7Variable§8> §8<§7Variable§8> §8<§7Zahl§8>
|
||||||
|
SCRIPT_COMMAND_STRING_INSERT_HELP_2 = §einsert §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8> §8<§7Zahl§8>
|
||||||
|
SCRIPT_COMMAND_STRING_INSERT_HELP_3 = Füge etwas in einen String an einer Stelle ein. Die Zahl ist für die Position und die Variable davor für was. Schreibe optional dies in eine neue oder andere Variable.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_STRING_LENGTH_HELP_1 = §elength §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_STRING_LENGTH_HELP_2 = §elength §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_STRING_LENGTH_HELP_3 = Ermittle die Länge eines Textes.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_STRING_REMOVE_HELP_1 = §eremove §8<§7Variable§8> §8<§7Von Variable§8>
|
||||||
|
SCRIPT_COMMAND_STRING_REMOVE_HELP_2 = §eremove §8<§7Variable§8> §8<§7Variable§8> §8<§7Von Variable§8>
|
||||||
|
SCRIPT_COMMAND_STRING_REMOVE_HELP_3 = Lösche eine Zeichenkette aus dem Ursprung. Dies ersetzt nicht nur die erste Stelle sondern alle.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_STRING_REPLACE_HELP_1 = §ereplace §8<§7Variable§8> §8<§7Von Variable§8> §8<§7Zu Variable§8>
|
||||||
|
SCRIPT_COMMAND_STRING_REPLACE_HELP_2 = §ereplace §8<§7Variable§8> §8<§7Variable§8> §8<§7Von Variable§8> §8<§7Zu Variable§8>
|
||||||
|
SCRIPT_COMMAND_STRING_REPLACE_HELP_3 = Ersetzte eine Zeichenkette aus dem Ursprung mit einer neuen Zeichenkette. Dies ersetzt nicht nur die erste Stelle sondern alle.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_STRING_SUBSTRING_HELP_1 = §esubstring §8<§7Variable§8> §8<§7Zahl§8>
|
||||||
|
SCRIPT_COMMAND_STRING_SUBSTRING_HELP_2 = §esubstring §8<§7Variable§8> §8<§7Variable§8> §8<§7Zahl§8>
|
||||||
|
SCRIPT_COMMAND_STRING_SUBSTRING_HELP_3 = Kürze einen String entweder vorne oder hinter, je nachdem ob die Zahl positiv (vorne) oder negativ (hinten) ist.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_VARIABLE_CONST_HELP_1 = §econst §8<§7Variable§8> §8[§7Value§8(§7s§8)§8]
|
||||||
|
SCRIPT_COMMAND_VARIABLE_CONST_HELP_2 = Schreibt in eine Konstante einen Wert rein, welcher eine Zahl sein kann, ein Boolscher Wert oder ein Text.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_VARIABLE_CONVERT_HELP_1 = §econvert §8<§7Variable§8> §8<§7Value§8>
|
||||||
|
SCRIPT_COMMAND_VARIABLE_CONVERT_HELP_2 = Konvertiere den Value zu 'number' wenn es eine Zahl ist, oder zu 'boolean' bei 'true' oder 'false' und behalte 'text' bei wenn nichts zutrifft.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_VARIABLE_GLOBAL_HELP_1 = §eglobal §8<§7Variable§8> §8[§7Value§8(§7s§8)§8]
|
||||||
|
SCRIPT_COMMAND_VARIABLE_GLOBAL_HELP_2 = Schreibt in eine Variable einen Wert rein, welcher eine Zahl sein kann, ein Boolscher Wert oder ein Text.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_VARIABLE_ISSET_HELP_1 = §eisset §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_VARIABLE_ISSET_HELP_2 = Schreibt in eine Variable true/false rein, ob in die zweiten Variable existiert.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_VARIABLE_UNGLOBAL_HELP_1 = §eunglobal §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_VARIABLE_UNGLOBAL_HELP_2 = Lösche eine Globale variable.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_VARIABLE_UNVAR_HELP_1 = §eunvar §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_VARIABLE_UNVAR_HELP_2 = Lösche eine Locale variable.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_VARIABLE_VAR_HELP_1 = §evar §8<§7Variable§8> §8[§7Value§8(§7s§8)§8]
|
||||||
|
SCRIPT_COMMAND_VARIABLE_VAR_HELP_2 = Schreibt in eine Variable einen Wert rein, welcher eine Zahl sein kann, ein Boolscher Wert oder ein Text.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_VARIABLE_VARTYPE_HELP_1 = §evartype §8<§7Variable§8> §8<§7Variable§8>
|
||||||
|
SCRIPT_COMMAND_VARIABLE_VARTYPE_HELP_2 = Schreibt in eine Variable den Type der zweiten Variable rein. Wenn die zweite Variable nicht gesetzt ist wird false in die erste geschrieben. Ansonsten gibt es die Werte: 'text', 'number' und 'boolean'
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_WORLD_GETMATERIAL_HELP_1 = §egetmaterial §8<§7Variable§8> §8<§7Value§8(§7s§8)§8> §8<§7Value§8(§7s§8)§8> §8[§7Value§8(§7s§8)§8]
|
||||||
|
SCRIPT_COMMAND_WORLD_GETMATERIAL_HELP_2 = Schreibt das material von einem Block in der Welt in die Variable.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_WORLD_SETMATERIAL_HELP_1 = §esetmaterial §8<§7Variable§8> §8<§7Value§8(§7s§8)§8> §8<§7Value§8(§7s§8)§8> §8[§7Value§8(§7s§8)§8]
|
||||||
|
SCRIPT_COMMAND_WORLD_SETMATERIAL_HELP_2 = Setzt an einem Block in der Welt das Material der ersten Variable.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_EXIT_HELP_1 = §eexit
|
||||||
|
SCRIPT_COMMAND_EXIT_HELP_2 = Beendet das ausführen des Scripts.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_IF_HELP_1 = §eif §8<§7Variable§8/§7Wert§8> §8<§7Variable§8/§7Wert§8> §8<§7Jump-Point§8>
|
||||||
|
SCRIPT_COMMAND_IF_HELP_2 = §eif §8<§7Variable§8/§7Wert§8> §8<§7Variable§8/§7Wert§8> §8<§7Jump-Point§8> §8<§7Jump-Point§8>
|
||||||
|
SCRIPT_COMMAND_IF_HELP_3 = §7Springe zu einer Stelle, wenn zwei Werte gleich sind. Oder zu einer anderen, wenn dies nicht der fall ist.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_JUMP_HELP_1 = §ejump §8<§7Jump-Point§8>
|
||||||
|
SCRIPT_COMMAND_JUMP_HELP_2 = §7Springe zu einer anderen Zeile. Hierbei ist ein Jump-Point eine Zeile mit §8'§7.§8'§7 vor.
|
||||||
|
SCRIPT_COMMAND_JUMP_ERROR = §cDer Jump-Point ({0}) ist nicht definiert.
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_SLEEP_HELP_1 = §esleep §8<§7Time§8>
|
||||||
|
SCRIPT_COMMAND_SLEEP_HELP_2 = Pausiert das Ausführen des Scripts. Das erste Argument ist in GameTicks.
|
||||||
|
SCRIPT_COMMAND_SLEEP_ERROR = §cDie Zeit muss eine Zahl großer 0 sein.
|
||||||
|
|
||||||
|
## GUI
|
||||||
|
SCRIPT_GUI_ITEM_NAME = §eScript Hilfe
|
||||||
|
|
||||||
|
## CustomScript
|
||||||
|
SCRIPT_EVENT_ITEM_NAME = §7Event§8: §e{0} §8-§7 {1}
|
||||||
|
SCRIPT_COMMAND_ITEM_NAME = §7Command§8: §e{0}
|
||||||
|
|
||||||
|
## Script Menu GUI
|
||||||
|
SCRIPT_MENU_GUI_ITEM_LORE_1 = §7Klicke zum rausnehmen
|
||||||
|
SCRIPT_MENU_GUI_ITEM_LORE_2 = §7Middle Klicke zum kopieren
|
||||||
|
SCRIPT_MENU_GUI_NAME = §eScript Commands {0}{1}§7%
|
||||||
|
SCRIPT_MENU_GUI_ITEM_ADD_NAME = §eHinzufügen
|
||||||
|
SCRIPT_MENU_GUI_ITEM_ADD_LORE = §7Klicke mit einem Buch zum hinzufügen
|
||||||
|
|
||||||
|
SCRIPT_MENU_GUI_DUPLICATE_COMMAND = §cCommand '{0}' bereits definiert
|
||||||
|
SCRIPT_MENU_GUI_UNKNOWN_EVENT = §cEvent '{0}' ist nicht definierbar
|
||||||
|
SCRIPT_MENU_GUI_LIMIT = §cScript-Buch Limit erreicht
|
||||||
|
|
||||||
|
## ScriptCommand
|
||||||
|
SCRIPT_COMMAND_HELP_1 = §8/§escript §8- §7Öffnet die ScriptGUI
|
||||||
|
SCRIPT_COMMAND_HELP_2 = §8/§escript menu §8- §7Öffnet die ScriptMenuGUI für Custom Command b auübergreifend
|
||||||
|
|
||||||
|
## Script GUI
|
||||||
|
SCRIPT_GUI_NAME = Script Elements
|
||||||
|
SCRIPT_GUI_COMMAND_CHAT = §eScript Command§8: §e{0}
|
||||||
|
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS = §eCustom Commands
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_1 = §7Schreibe§8: §7#!CMD 'COMMAND'
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_2 = §7an den Anfang eines Script Buches um
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_3 = §7ein Custom Command zu nutzen. Der
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_4 = §7Befehl startet immer mit / und kann dann so
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_5 = §7aufgebaut sein wie du willst. Alles was in Spitzen
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_6 = §7Klammern steht '<>' wird als Parameter und somit
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_7 = §7als Variable gewertet.
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_8 = §7Parameter, welche in runden Klammern
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_9 = §7stehen sind Optional. Einfache
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_10 = §7Texte als Parameter bekommen
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_11 = §7eine gleichnamige Variable mit
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_12 = §7true/false als Wert je nachdem
|
||||||
|
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_13 = §7ob dieser angegeben wurde oder nicht
|
||||||
|
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS = §eCustom Events
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_1 = §7Schreibe§8: §7#!EVENT 'EventName'
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_2 = §7an den Anfang eines Script Buches um
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_3 = §7ein Custom Event zu nutzen. Jedes Event kann durch
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_4 = §7'var cancel true' gecancelt werden.
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_5 = §7Hinter dem Event Namen stehen die Variablen,
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_6 = §7welche im Script durch das Event nutztbar sind.
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_7 = §7Nutzbare Events sind:
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_8 = §eFF
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_9 = §ePlaceBlock §8-§7 blockX, blockY, blockZ, blockType
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_10 = §eBreakBlock §8-§7 blockX, blockY, blockZ, blockType
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_11 = §eRightClick §8-§7 blockInHand
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_12 = §eLeftClick §8-§7 blockInHand
|
||||||
|
SCRIPT_GUI_CUSTOM_EVENTS_LORE_13 = §eTNTSpawn
|
||||||
|
|
||||||
|
SCRIPT_GUI_OTHER = §eOther
|
||||||
|
SCRIPT_GUI_OTHER_LORE_1 = §7Kommentare fangen mit §e#§7 an.
|
||||||
|
SCRIPT_GUI_OTHER_LORE_2 = §7Jump_Points fangen mit §e.§7 an.
|
||||||
|
SCRIPT_GUI_OTHER_LORE_3 = §7Eine Variablen Namen in '<>'
|
||||||
|
SCRIPT_GUI_OTHER_LORE_4 = §7eingeschlossen wird ersetzt, bis zu zwei mal.
|
||||||
|
SCRIPT_GUI_OTHER_LORE_5 = §7Eine Variable in '<>' kann mit 'const.'
|
||||||
|
SCRIPT_GUI_OTHER_LORE_6 = §7oder 'local.' oder 'global.' prefixed werden
|
||||||
|
SCRIPT_GUI_OTHER_LORE_7 = §7für den genauen type wo nach geguckt werden soll
|
||||||
|
|
||||||
|
SCRIPT_GUI_COMMAND_NAME = §7Command: §e{0}
|
||||||
|
|
||||||
|
SCRIPT_GUI_CUSTOM_VARIABLES = §eCustom Variables
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_OVERRIDEABLE = §eÜberschreibbar
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_TRACE_NAME = §7Constant §etrace
|
||||||
|
SCRIPT_GUI_CONSTANT_TRACE_LORE = §etrue§7 wenn gerade der Tracer an ist.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_AUTO_TRACE_NAME = §7Constant §eautotrace
|
||||||
|
SCRIPT_GUI_CONSTANT_AUTO_TRACE_LORE = §etrue§7 wenn gerade der AutoTracer an ist.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_TNT_NAME = §7Constant §etnt
|
||||||
|
SCRIPT_GUI_CONSTANT_TNT_LORE = §etrue§7 wenn TNT nicht ausgeschaltet ist.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_ONLY_TB_NAME = §7Constant §etnt-onlytb
|
||||||
|
SCRIPT_GUI_CONSTANT_ONLY_TB_LORE = §etrue§7 wenn TNT Nur Testblock an ist.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_FREEZE_NAME = §7Constant §efreeze
|
||||||
|
SCRIPT_GUI_CONSTANT_FREEZE_LORE = §etrue§7 wenn Freeze nicht ausgeschaltet ist.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_FIRE_NAME = §7Constant §efire
|
||||||
|
SCRIPT_GUI_CONSTANT_FIRE_LORE = §etrue§7 wenn Fire nicht ausgeschaltet ist.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_PROTECT_NAME = §7Constant §eprotect
|
||||||
|
SCRIPT_GUI_CONSTANT_PROTECT_LORE = §etrue§7 wenn Protect angeschaltet ist.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_DAMAGE_NAME = §7Constant §edamage
|
||||||
|
SCRIPT_GUI_CONSTANT_DAMAGE_LORE = §etrue§7 wenn Damage angeschaltet ist.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_X_NAME = §7Constant §ex
|
||||||
|
SCRIPT_GUI_CONSTANT_X_LORE = §ex§7 Position des Spielers.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_Y_NAME = §7Constant §ey
|
||||||
|
SCRIPT_GUI_CONSTANT_Y_LORE = §ey§7 Position des Spielers.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_Z_NAME = §7Constant §ez
|
||||||
|
SCRIPT_GUI_CONSTANT_Z_LORE = §ez§7 Position des Spielers.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_NAME_NAME = §7Constant §ename
|
||||||
|
SCRIPT_GUI_CONSTANT_NAME_LORE = §eDisplay§7 Name des Spielers.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_SNEAK_NAME = §7Constant §esneak
|
||||||
|
SCRIPT_GUI_CONSTANT_SNEAK_LORE = §etrue§7 wenn der Spieler gerade sneakt.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_SPRINTING_NAME = §7Constant §esprinting
|
||||||
|
SCRIPT_GUI_CONSTANT_SPRINTING_LORE = §etrue§7 wenn der Spieler gerade rennt.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_SLOT_NAME = §7Constant §eslot
|
||||||
|
SCRIPT_GUI_CONSTANT_SLOT_LORE = §e0-8§7 für den ausgewählten slot.
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_NAME = §7Constant §eslotmaterial
|
||||||
|
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_LORE = §eMaterial§7 des Items im Slot
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_NAME = §7Constant §eoffhandmaterial
|
||||||
|
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_LORE = §eMaterial§7 des Items in der Off Hand
|
||||||
|
|
||||||
|
SCRIPT_GUI_CONSTANT_REGION_TYPE_NAME = §7Constant §eregion-type
|
||||||
|
SCRIPT_GUI_CONSTANT_REGION_TYPE_LORE = §eRegionstype§7 der jetztigen Region
|
||||||
|
|
||||||
|
## Script Vars
|
||||||
|
SCRIPT_COMMAND_VARS_HELP_1 = §8/§escriptvars §8- §7Zähle alle globalen Variablen auf
|
||||||
|
SCRIPT_COMMAND_VARS_HELP_2 = §8/§escriptvars §8[§7Variable§8] §8- §7Gebe den Wert der Variable zurück
|
||||||
|
SCRIPT_COMMAND_VARS_HELP_3 = §8/§escriptvars §8[§7Variable§8] §8[§7Value§8] §8- §7Setzte eine Variable auf einen Wert
|
||||||
|
SCRIPT_COMMAND_VARS_HELP_4 = §8/§escriptvars §8[§7Variable§8] §8<§7remove§8|§7delete§8|§7clear§8> §8- §7Lösche eine Variable
|
||||||
|
|
||||||
|
SCRIPT_COMMAND_VARS_NO_VARS = §cKeine globalen Variablen definiert
|
||||||
|
SCRIPT_COMMAND_VARS_ONE_VAR = eine Variable
|
||||||
|
SCRIPT_COMMAND_VARS_MANY_VARS = {0} Variablen
|
||||||
|
SCRIPT_COMMAND_VARS_UNKNOWN_VARS = §cUnbekannte Variable
|
||||||
|
SCRIPT_COMMAND_VARS_ELEMENT_WITH_DASH = - {0}={1}
|
||||||
|
SCRIPT_COMMAND_VARS_ELEMENT = {0}={1}
|
||||||
|
SCRIPT_COMMAND_VARS_SET_VALUE = {0} auf {1} gesetzt
|
||||||
|
SCRIPT_COMMAND_VARS_REMOVE_VALUE = Variable {0} gelöscht
|
||||||
|
|
||||||
|
# Unsign Book
|
||||||
|
UNSIGN_HELP_1=§8/§eunsign §8- §7Mache ein Buch beschreibbar
|
||||||
|
|
||||||
|
# Simulator
|
||||||
|
SIMULATOR_GUI_ITEM_NAME = §eTNT Simulator
|
||||||
|
|
||||||
# SmartPlace
|
# SmartPlace
|
||||||
SMART_PLACE_HELP = §8/§esmartplace §8-§7 Toggled SmartPlace
|
SMART_PLACE_HELP = §8/§esmartplace §8-§7 Toggled SmartPlace
|
||||||
SMART_PLACE_INFO = §7Plaziert rotierbare Blöcke beim §esneaken§7 von dir §eweg§7.
|
SMART_PLACE_INFO = §7Plaziert rotierbare Blöcke beim §esneaken§7 von dir §eweg§7.
|
||||||
@ -537,8 +825,6 @@ REGION_TNT_ON=§aTNT-Schaden aktiviert
|
|||||||
REGION_TNT_OFF=§cTNT-Schaden deaktiviert
|
REGION_TNT_OFF=§cTNT-Schaden deaktiviert
|
||||||
REGION_TNT_TB=§aTNT-Schaden außerhalb Baurahmen aktiviert
|
REGION_TNT_TB=§aTNT-Schaden außerhalb Baurahmen aktiviert
|
||||||
REGION_TNT_BUILD=§cEine Explosion hätte Blöcke im Baubereich zerstört
|
REGION_TNT_BUILD=§cEine Explosion hätte Blöcke im Baubereich zerstört
|
||||||
# Unsign Book
|
|
||||||
UNSIGN_HELP_1=§8/§eunsign §8- §7Mache ein Buch beschreibbar
|
|
||||||
# Team
|
# Team
|
||||||
LOCK_SCHEM_NO_USER=§7Dieser Spieler existiert nicht!
|
LOCK_SCHEM_NO_USER=§7Dieser Spieler existiert nicht!
|
||||||
LOCK_SCHEM_NO_SCHEM=§7Dieser Spieler besitzt keine Schematic mit diesem Namen!
|
LOCK_SCHEM_NO_SCHEM=§7Dieser Spieler besitzt keine Schematic mit diesem Namen!
|
||||||
|
@ -23,6 +23,7 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
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 org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -45,7 +46,11 @@ public class ObserverTracerListener implements Listener {
|
|||||||
|
|
||||||
public ObserverTracerListener() {
|
public ObserverTracerListener() {
|
||||||
Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> {
|
Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> {
|
||||||
observerTracerMap.forEach((player, observerTracer) -> observerTracer.show());
|
observerTracerMap.forEach((player, observerTracer) -> {
|
||||||
|
if (player.getGameMode() == GameMode.SPECTATOR) {
|
||||||
|
observerTracer.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
}, 15L, 15L);
|
}, 15L, 15L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ import de.steamwar.bausystem.linkage.LinkageType;
|
|||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.utils.ProtocolAPI;
|
import de.steamwar.bausystem.utils.ProtocolAPI;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.core.Core;
|
|
||||||
import de.steamwar.core.VersionedRunnable;
|
import de.steamwar.core.VersionedRunnable;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.script;
|
package de.steamwar.bausystem.features.script;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.features.script.variables.Value;
|
import de.steamwar.bausystem.features.script.variables.Value;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -43,7 +44,7 @@ public class CustomScript {
|
|||||||
|
|
||||||
public interface MenuScript {
|
public interface MenuScript {
|
||||||
void toYAPION(YAPIONMap yapionMap);
|
void toYAPION(YAPIONMap yapionMap);
|
||||||
SWItem toItem();
|
SWItem toItem(Player p);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface CustomEvent extends Script {
|
public interface CustomEvent extends Script {
|
||||||
@ -92,16 +93,14 @@ public class CustomScript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SWItem toItem() {
|
public SWItem toItem(Player p) {
|
||||||
StringBuilder st = new StringBuilder();
|
StringBuilder st = new StringBuilder();
|
||||||
for (int i = 0; i < args.length; i++) {
|
for (int i = 1; i < args.length; i++) {
|
||||||
if (i != 0) st.append(" ");
|
if (i != 1) st.append(" ");
|
||||||
if (i == 0) st.append("§e");
|
|
||||||
st.append(args[i]);
|
st.append(args[i]);
|
||||||
if (i == 0) st.append("§8 -§7");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWItem swItem = new SWItem(Material.WRITABLE_BOOK, "§7Event§8: " + st);
|
SWItem swItem = new SWItem(Material.WRITABLE_BOOK, BauSystem.MESSAGE.parse("SCRIPT_EVENT_ITEM_NAME", p, args[0], st.toString()));
|
||||||
BookMeta bookMeta = (BookMeta) swItem.getItemMeta();
|
BookMeta bookMeta = (BookMeta) swItem.getItemMeta();
|
||||||
bookMeta.setPages(pages.toArray(new String[0]));
|
bookMeta.setPages(pages.toArray(new String[0]));
|
||||||
swItem.setItemMeta(bookMeta);
|
swItem.setItemMeta(bookMeta);
|
||||||
@ -110,6 +109,8 @@ public class CustomScript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface CustomCommand extends Script {
|
public interface CustomCommand extends Script {
|
||||||
|
String[] command();
|
||||||
|
|
||||||
default Map<String, Value> check(String[] args, String[] command) {
|
default Map<String, Value> check(String[] args, String[] command) {
|
||||||
if (args.length < command.length) {
|
if (args.length < command.length) {
|
||||||
return null;
|
return null;
|
||||||
@ -172,6 +173,11 @@ public class CustomScript {
|
|||||||
public final BookMeta bookMeta;
|
public final BookMeta bookMeta;
|
||||||
public final String[] args;
|
public final String[] args;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] command() {
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean execute(String[] command, PlayerCommandPreprocessEvent e) {
|
public boolean execute(String[] command, PlayerCommandPreprocessEvent e) {
|
||||||
Map<String, Value> arguments = check(args, command);
|
Map<String, Value> arguments = check(args, command);
|
||||||
if (arguments == null) {
|
if (arguments == null) {
|
||||||
@ -189,6 +195,11 @@ public class CustomScript {
|
|||||||
public final List<String> pages;
|
public final List<String> pages;
|
||||||
public final String[] args;
|
public final String[] args;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] command() {
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean execute(String[] command, PlayerCommandPreprocessEvent e) {
|
public boolean execute(String[] command, PlayerCommandPreprocessEvent e) {
|
||||||
Map<String, Value> arguments = check(args, command);
|
Map<String, Value> arguments = check(args, command);
|
||||||
if (arguments == null) {
|
if (arguments == null) {
|
||||||
@ -232,8 +243,8 @@ public class CustomScript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SWItem toItem() {
|
public SWItem toItem(Player p) {
|
||||||
SWItem swItem = new SWItem(Material.WRITABLE_BOOK, "§7Command§8: §e" + String.join(" ", args));
|
SWItem swItem = new SWItem(Material.WRITABLE_BOOK, BauSystem.MESSAGE.parse("SCRIPT_COMMAND_ITEM_NAME", p, String.join(" ", args)));
|
||||||
BookMeta bookMeta = (BookMeta) swItem.getItemMeta();
|
BookMeta bookMeta = (BookMeta) swItem.getItemMeta();
|
||||||
bookMeta.setPages(pages.toArray(new String[0]));
|
bookMeta.setPages(pages.toArray(new String[0]));
|
||||||
swItem.setItemMeta(bookMeta);
|
swItem.setItemMeta(bookMeta);
|
||||||
|
@ -29,7 +29,6 @@ import de.steamwar.core.VersionedCallable;
|
|||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.inventory.SWListInv;
|
import de.steamwar.inventory.SWListInv;
|
||||||
import de.steamwar.sql.UserConfig;
|
import de.steamwar.sql.UserConfig;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -62,7 +61,7 @@ import java.util.stream.Collectors;
|
|||||||
@Linked(LinkageType.LISTENER)
|
@Linked(LinkageType.LISTENER)
|
||||||
public class CustomScriptListener implements Listener {
|
public class CustomScriptListener implements Listener {
|
||||||
|
|
||||||
private Map<Player, List<CustomScript.Script>> playerMap = new HashMap<>();
|
private final Map<Player, List<CustomScript.Script>> playerMap = Collections.synchronizedMap(new HashMap<>()); // new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private void updateInventory(Player p) {
|
private void updateInventory(Player p) {
|
||||||
playerMap.computeIfPresent(p, (player, customCommands) -> {
|
playerMap.computeIfPresent(p, (player, customCommands) -> {
|
||||||
@ -92,7 +91,10 @@ public class CustomScriptListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||||
Player p = e.getPlayer();
|
load(e.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void load(Player p) {
|
||||||
updateInventory(p);
|
updateInventory(p);
|
||||||
|
|
||||||
String s = UserConfig.getConfig(p.getUniqueId(), "bausystem-scripts");
|
String s = UserConfig.getConfig(p.getUniqueId(), "bausystem-scripts");
|
||||||
@ -103,13 +105,13 @@ public class CustomScriptListener implements Listener {
|
|||||||
YAPIONObject yapionObject;
|
YAPIONObject yapionObject;
|
||||||
if (s == null) {
|
if (s == null) {
|
||||||
yapionObject = new YAPIONObject();
|
yapionObject = new YAPIONObject();
|
||||||
yapionObject.getYAPIONMapOrSetDefault("events", new YAPIONMap()).add("FF", new YAPIONArray().add("#!EVENT FF /gui Kürzel\ngui"));
|
yapionObject.getYAPIONMapOrSetDefault("events", new YAPIONMap()).add("FF", new YAPIONArray().add("#!EVENT FF /gui Script\ngui"));
|
||||||
} else {
|
} else {
|
||||||
yapionObject = YAPIONParser.parse(s);
|
yapionObject = YAPIONParser.parse(s);
|
||||||
if (yapionObject.containsKey("")) {
|
if (yapionObject.containsKey("")) {
|
||||||
yapionObject.add("commands", yapionObject.getMap(""));
|
yapionObject.add("commands", yapionObject.getMap(""));
|
||||||
yapionObject.remove("");
|
yapionObject.remove("");
|
||||||
yapionObject.getYAPIONMapOrSetDefault("events", new YAPIONMap()).add("FF", new YAPIONArray().add("#!EVENT FF /gui Kürzel\ngui"));
|
yapionObject.getYAPIONMapOrSetDefault("events", new YAPIONMap()).add("FF", new YAPIONArray().add("#!EVENT FF /gui Script\ngui"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +177,7 @@ public class CustomScriptListener implements Listener {
|
|||||||
public void openCommandsMenu(Player p) {
|
public void openCommandsMenu(Player p) {
|
||||||
List<SWListInv.SWListEntry<CustomScript.MenuScript>> menuCommands = new ArrayList<>();
|
List<SWListInv.SWListEntry<CustomScript.MenuScript>> menuCommands = new ArrayList<>();
|
||||||
playerMap.getOrDefault(p, new ArrayList<>()).stream().filter(CustomScript.MenuScript.class::isInstance).map(CustomScript.MenuScript.class::cast).forEach(menuItem -> {
|
playerMap.getOrDefault(p, new ArrayList<>()).stream().filter(CustomScript.MenuScript.class::isInstance).map(CustomScript.MenuScript.class::cast).forEach(menuItem -> {
|
||||||
SWItem swItem = menuItem.toItem();
|
SWItem swItem = menuItem.toItem(p);
|
||||||
ItemStack itemStack = swItem.getItemStack();
|
ItemStack itemStack = swItem.getItemStack();
|
||||||
if (menuItem instanceof CustomScript.MenuEvent) {
|
if (menuItem instanceof CustomScript.MenuEvent) {
|
||||||
itemStack.setType(Material.REPEATING_COMMAND_BLOCK);
|
itemStack.setType(Material.REPEATING_COMMAND_BLOCK);
|
||||||
@ -183,33 +185,24 @@ public class CustomScriptListener implements Listener {
|
|||||||
itemStack.setType(Material.COMMAND_BLOCK);
|
itemStack.setType(Material.COMMAND_BLOCK);
|
||||||
}
|
}
|
||||||
swItem.setItemStack(itemStack);
|
swItem.setItemStack(itemStack);
|
||||||
swItem.setLore(Arrays.asList("§7Klicke zum rausnehmen", "§7Middle Klicke zum kopieren"));
|
swItem.setLore(Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_MENU_GUI_ITEM_LORE_1", p), BauSystem.MESSAGE.parse("SCRIPT_MENU_GUI_ITEM_LORE_2", p)));
|
||||||
|
|
||||||
menuCommands.add(new SWListInv.SWListEntry<>(swItem, menuItem));
|
menuCommands.add(new SWListInv.SWListEntry<>(swItem, menuItem));
|
||||||
});
|
});
|
||||||
|
|
||||||
int length = (int) output(p).toYAPION(new LengthOutput()).getLength();
|
int length = (int) output(p).toYAPION(new LengthOutput()).getLength();
|
||||||
StringBuilder menuName = new StringBuilder();
|
|
||||||
menuName.append("§eScript Commands ");
|
|
||||||
double percentage = ((int) ((length / 655336.0) * 1000)) / 10.0;
|
double percentage = ((int) ((length / 655336.0) * 1000)) / 10.0;
|
||||||
if (percentage > 99) {
|
String menuName = BauSystem.MESSAGE.parse("SCRIPT_MENU_GUI_NAME", p, percentage > 99 ? "§c" : (percentage >= 75 ? "§6" : "§a"), percentage);
|
||||||
menuName.append("§c");
|
|
||||||
} else if (percentage >= 75) {
|
|
||||||
menuName.append("§6");
|
|
||||||
} else {
|
|
||||||
menuName.append("§a");
|
|
||||||
}
|
|
||||||
menuName.append(percentage).append("§7%");
|
|
||||||
|
|
||||||
SWListInv<CustomScript.MenuScript> menuCommandSWListInv = new SWListInv<>(p, menuName.toString(), false, menuCommands, (clickType, menuCommand) -> {
|
SWListInv<CustomScript.MenuScript> menuCommandSWListInv = new SWListInv<>(p, menuName, false, menuCommands, (clickType, menuCommand) -> {
|
||||||
if (!clickType.isCreativeAction()) {
|
if (!clickType.isCreativeAction()) {
|
||||||
playerMap.get(p).removeIf(customCommand -> customCommand == menuCommand);
|
playerMap.get(p).removeIf(customCommand -> customCommand == menuCommand);
|
||||||
}
|
}
|
||||||
SWUtils.giveItemToPlayer(p, menuCommand.toItem().getItemStack());
|
SWUtils.giveItemToPlayer(p, menuCommand.toItem(p).getItemStack());
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
save(p);
|
save(p);
|
||||||
});
|
});
|
||||||
menuCommandSWListInv.setItem(49, new SWItem(Material.HOPPER, "§eHinzufügen", Arrays.asList("§7Klicke mit einem Buch zum hinzufügen"), false, clickType -> {
|
menuCommandSWListInv.setItem(49, new SWItem(Material.HOPPER, BauSystem.MESSAGE.parse("SCRIPT_MENU_GUI_ITEM_ADD_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_MENU_GUI_ITEM_ADD_LORE", p)), false, clickType -> {
|
||||||
ItemStack item = p.getItemOnCursor();
|
ItemStack item = p.getItemOnCursor();
|
||||||
if (item.getType().isAir()) {
|
if (item.getType().isAir()) {
|
||||||
return;
|
return;
|
||||||
@ -233,7 +226,7 @@ public class CustomScriptListener implements Listener {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (((CustomScript.MenuCommand) script).equals(menuCommand)) {
|
if (((CustomScript.MenuCommand) script).equals(menuCommand)) {
|
||||||
p.sendMessage("§cCommand '" + (String.join(" ", menuCommand.args)) + "' bereits definiert");
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_MENU_GUI_DUPLICATE_COMMAND", p, String.join(" ", menuCommand.args));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -243,7 +236,7 @@ public class CustomScriptListener implements Listener {
|
|||||||
try {
|
try {
|
||||||
EventType.valueOf(menuEvent.eventName());
|
EventType.valueOf(menuEvent.eventName());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
p.sendMessage("§cEvent '" + menuEvent.eventName() + "' ist nicht definierbar");
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_MENU_GUI_UNKNOWN_EVENT", p, menuEvent.eventName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
scriptBookLimit(p, menuEvent);
|
scriptBookLimit(p, menuEvent);
|
||||||
@ -259,7 +252,7 @@ public class CustomScriptListener implements Listener {
|
|||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
SWUtils.giveItemToPlayer(p, p.getItemOnCursor());
|
SWUtils.giveItemToPlayer(p, p.getItemOnCursor());
|
||||||
save(p);
|
save(p);
|
||||||
p.sendMessage("§cScript-Buch Limit erreicht");
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_MENU_GUI_LIMIT", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p.setItemOnCursor(null);
|
p.setItemOnCursor(null);
|
||||||
@ -351,6 +344,64 @@ public class CustomScriptListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
final Class<?> packetPlayOutCommands = Reflection.getClass("{nms}.PacketPlayOutCommands");
|
||||||
|
final Reflection.FieldAccessor<RootCommandNode> playerInfoData = Reflection.getField(packetPlayOutCommands, RootCommandNode.class, 0);
|
||||||
|
|
||||||
|
ProtocolAPI.setOutgoingHandler(packetPlayOutCommands, (player, packet) -> {
|
||||||
|
PacketPlayOutCommands commands = (PacketPlayOutCommands) packet;
|
||||||
|
RootCommandNode rootCommandNode = playerInfoData.get(commands);
|
||||||
|
if (!playerMap.containsKey(player)) {
|
||||||
|
load(player);
|
||||||
|
}
|
||||||
|
// rootCommandNode.addChild(new LiteralCommandNode<Player>("Hello", null, t -> true, null, null, false));
|
||||||
|
List<CustomScript.CustomCommand> customCommands;
|
||||||
|
synchronized (playerMap) {
|
||||||
|
customCommands = playerMap.getOrDefault(player, new ArrayList<>()).stream().filter(CustomScript.CustomCommand.class::isInstance).map(CustomScript.CustomCommand.class::cast).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
for (CustomScript.CustomCommand customCommand : customCommands) {
|
||||||
|
System.out.println("ADDING: " + customCommand);
|
||||||
|
String[] args = customCommand.command();
|
||||||
|
|
||||||
|
List<CommandNode<?>> commandNodes = new ArrayList<>();
|
||||||
|
for (int i = args.length - 1; i >= 0; i--) {
|
||||||
|
if (i == 0) {
|
||||||
|
CommandNode current = new LiteralCommandNode<Player>(args[i].substring(1), null, currentPlayer -> currentPlayer.getUniqueId().equals(player.getUniqueId()), null, null, false);
|
||||||
|
commandNodes.forEach(current::addChild);
|
||||||
|
rootCommandNode.addChild(current);
|
||||||
|
} else {
|
||||||
|
String arg = args[i];
|
||||||
|
if (arg.startsWith("<") && arg.endsWith(">")) {
|
||||||
|
CommandNode current = new ArgumentCommandNode<Player, String>(arg.substring(1, arg.length() - 1), StringArgumentType.word(), null, currentPlayer -> currentPlayer.getUniqueId().equals(player.getUniqueId()), null, null, false, (commandContext, suggestionsBuilder) -> suggestionsBuilder.buildFuture());
|
||||||
|
commandNodes.forEach(current::addChild);
|
||||||
|
commandNodes.clear();
|
||||||
|
commandNodes.add(current);
|
||||||
|
} else if (arg.startsWith("(<") && arg.endsWith(">)")) {
|
||||||
|
// CommandNode current = new ArgumentCommandNode<Player, String>(arg, StringArgumentType.word(), null, currentPlayer -> currentPlayer.getUniqueId().equals(player.getUniqueId()), null, null, false, (commandContext, suggestionsBuilder) -> suggestionsBuilder.buildFuture());
|
||||||
|
// commandNodes.forEach(current::addChild);
|
||||||
|
// commandNodes.add(current);
|
||||||
|
CommandNode current = new LiteralCommandNode<Player>(arg, null, currentPlayer -> currentPlayer.getUniqueId().equals(player.getUniqueId()), null, null, false);
|
||||||
|
commandNodes.forEach(current::addChild);
|
||||||
|
commandNodes.add(current);
|
||||||
|
} else if (arg.startsWith("(") && arg.endsWith(")")) {
|
||||||
|
CommandNode current = new LiteralCommandNode<Player>(arg.substring(1, arg.length() - 1), null, currentPlayer -> currentPlayer.getUniqueId().equals(player.getUniqueId()), null, null, false);
|
||||||
|
commandNodes.forEach(current::addChild);
|
||||||
|
commandNodes.add(current);
|
||||||
|
} else {
|
||||||
|
CommandNode current = new LiteralCommandNode<Player>(arg, null, currentPlayer -> currentPlayer.getUniqueId().equals(player.getUniqueId()), null, null, false);
|
||||||
|
commandNodes.forEach(current::addChild);
|
||||||
|
commandNodes.clear();
|
||||||
|
commandNodes.add(current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return packet;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Event FF
|
// Event FF
|
||||||
private static final Set<Player> LAST_FS = new HashSet<>();
|
private static final Set<Player> LAST_FS = new HashSet<>();
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package de.steamwar.bausystem.features.script;
|
package de.steamwar.bausystem.features.script;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
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.bausystem.linkage.LinkedInstance;
|
import de.steamwar.bausystem.linkage.LinkedInstance;
|
||||||
@ -30,8 +31,9 @@ public class ScriptCommand 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/§escript §8- §7Öffnet die ScriptGUI");
|
BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", p, "script");
|
||||||
p.sendMessage("§8/§escript menu §8- §7Öffnet die ScriptMenuGUI für Custom Command b auübergreifend");
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_COMMAND_HELP_1", p);
|
||||||
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_COMMAND_HELP_2", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
@ -41,11 +43,11 @@ public class ScriptCommand extends SWCommand {
|
|||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
}
|
}
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, "§eCustom Commands", Arrays.asList("§7Schreibe§8: §7#!CMD 'COMMAND'", "§7an den Anfang eines Script Buches um", "§7ein Custom Command zu nutzen. Der", "§7Befehl startet immer mit / und kann dann so", "§7aufgebaut sein wie du willst. Alles was in Spitzen", "§7Klammern steht '<>' wird als Parameter und somit", "§7als Variable gewertet.", "§7Parameter, welche in runden Klammern", "§7stehen sind Optional. Einfache", "§7Texte als Parameter bekommen", "§7eine gleichnamige Variable mit", "§7true/false als Wert je nachdem", "§7ob dieser angegeben wurde oder nicht"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_1", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_2", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_3", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_4", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_5", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_6", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_7", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_8", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_9", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_10", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_11", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_12", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_13", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, "§eCustom Events", Arrays.asList("§7Schreibe§8: §7#!EVENT 'EventName'", "§7an den Anfang eines Script Buches um", "§7ein Custom Event zu nutzen. Jedes Event kann durch", "§7'var cancel true' gecancelt werden.", "§7Hinter dem Event Namen stehen die Variablen,", "§7welche im Script durch das Event nutztbar sind.", "§7Nutzbare Events sind:", "§eFF", "§ePlaceBlock §8-§7 blockX, blockY, blockZ, blockType", "§eBreakBlock §8-§7 blockX, blockY, blockZ, blockType", "§eRightClick §8-§7 blockInHand", "§eLeftClick §8-§7 blockInHand", "§eTNTSpawn"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_1", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_2", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_3", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_4", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_5", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_6", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_7", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_8", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_9", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_10", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_11", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_12", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_13", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, "§eOther", Arrays.asList("§7Kommentare fangen mit §e#§7 an.", "§7Jump_Points fangen mit §e.§7 an.", "§7Eine Variablen Namen in '<>'", "§7eingeschlossen wird ersetzt, bis zu zwei mal.", "§7Eine Variable in '<>' kann mit 'const.'", "§7oder 'local.' oder 'global.' prefixed werden", "§7für den genauen type wo nach geguckt werden soll"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_1", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_2", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_3", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_4", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_5", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_6", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_7", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
||||||
@ -59,7 +61,10 @@ public class ScriptCommand extends SWCommand {
|
|||||||
for (String s : specialCommand.description()) {
|
for (String s : specialCommand.description()) {
|
||||||
if (s.isEmpty()) {
|
if (s.isEmpty()) {
|
||||||
b = true;
|
b = true;
|
||||||
|
strings.add("");
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
s = BauSystem.MESSAGE.parse(s, p);
|
||||||
while (b && s.length() > 50) {
|
while (b && s.length() > 50) {
|
||||||
int index = s.indexOf(' ', 50);
|
int index = s.indexOf(' ', 50);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
@ -76,7 +81,7 @@ public class ScriptCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SWItem swItem = new SWItem(specialCommand.material(), "§7Command: §e" + specialCommand.command(), strings, false, clickType -> {
|
SWItem swItem = new SWItem(specialCommand.material(), BauSystem.MESSAGE.parse("SCRIPT_GUI_COMMAND_NAME", p, specialCommand.command()), strings, false, clickType -> {
|
||||||
});
|
});
|
||||||
swItems.add(new SWListInv.SWListEntry<>(swItem, specialCommand));
|
swItems.add(new SWListInv.SWListEntry<>(swItem, specialCommand));
|
||||||
});
|
});
|
||||||
@ -84,57 +89,59 @@ public class ScriptCommand extends SWCommand {
|
|||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
}
|
}
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, "§eCustom Variables", new ArrayList<>(), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_VARIABLES", p), new ArrayList<>(), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
}
|
}
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.TNT_MINECART, "§7Constant §etrace", Arrays.asList("§etrue§7 wenn gerade der Tracer an ist."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.TNT_MINECART, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_TRACE_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_TRACE_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.TNT_MINECART, "§7Constant §eautotrace", Arrays.asList("§etrue§7 wenn gerade der AutoTracer an ist."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.TNT_MINECART, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_AUTO_TRACE_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_AUTO_TRACE_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.TNT, "§7Constant §etnt", Arrays.asList("§etrue§7 wenn TNT nicht ausgeschaltet ist."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_TNT_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_TNT_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.TNT, "§7Constant §etnt-onlytb", Arrays.asList("§etrue§7 wenn TNT Nur Testblock an ist."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_ONLY_TB_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_ONLY_TB_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GUNPOWDER, "§7Constant §efreeze", Arrays.asList("§etrue§7 wenn Freeze nicht ausgeschaltet ist."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GUNPOWDER, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_FREEZE_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_FREEZE_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.FIRE_CHARGE, "§7Constant §efire", Arrays.asList("§etrue§7 wenn Fire nicht ausgeschaltet ist."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.FIRE_CHARGE, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_FIRE_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_FIRE_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.OBSIDIAN, "§7Constant §eprotect", Arrays.asList("§etrue§7 wenn Protect angeschaltet ist."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.OBSIDIAN, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_PROTECT_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_PROTECT_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.PLAYER_HEAD, "§7Constant §ex", Arrays.asList("§ex§7 Position des Spielers.", "§eÜberschreibbar"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.IRON_SWORD, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_DAMAGE_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_DAMAGE_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.PLAYER_HEAD, "§7Constant §ey", Arrays.asList("§ey§7 Position des Spielers.", "§eÜberschreibbar"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.PLAYER_HEAD, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_X_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_X_LORE", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_OVERRIDEABLE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.PLAYER_HEAD, "§7Constant §ez", Arrays.asList("§ez§7 Position des Spielers.", "§eÜberschreibbar"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.PLAYER_HEAD, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_Y_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_Y_LORE", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_OVERRIDEABLE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.NAME_TAG, "§7Constant §ename", Arrays.asList("§eDisplay§7 Name des Spielers."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.PLAYER_HEAD, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_Z_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_Z_LORE", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_OVERRIDEABLE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.IRON_BOOTS, "§7Constant §esneak", Arrays.asList("§etrue§7 wenn der Spieler gerade sneakt."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.NAME_TAG, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_NAME_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_NAME_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.DIAMOND_BOOTS, "§7Constant §esprinting", Arrays.asList("§etrue§7 wenn der Spieler gerade rennt."), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.IRON_BOOTS, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_SNEAK_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_SNEAK_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.ARROW, "§7Constant §eslot", Arrays.asList("§e0-8§7 für den ausgewählten slot.", "§eÜberschreibbar"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.DIAMOND_BOOTS, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_SPRINTING_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_SPRINTING_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRASS_BLOCK, "§7Constant §eslotmaterial", Arrays.asList("§eMaterial§7 des Items im Slot"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_SLOT_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_SLOT_LORE", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_OVERRIDEABLE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.IRON_BLOCK, "§7Constant §eoffhandmaterial", Arrays.asList("§eMaterial§7 des Items in oder Off Hand"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRASS_BLOCK, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.MAP, "§7Constant §eregion-type", Arrays.asList("§eRegionstype§7 der jetztigen Region"), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.IRON_BLOCK, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_LORE", p)), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
for (int i = 0; i < 1 + 2 * 9; i++) {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.MAP, BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_REGION_TYPE_NAME", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CONSTANT_REGION_TYPE_LORE", p)), false, clickType -> {
|
||||||
|
}), null));
|
||||||
|
for (int i = 0; i < 2 * 9; i++) {
|
||||||
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
|
||||||
}), null));
|
}), null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SWListInv<SpecialCommand> swListInv = new SWListInv<>(p, "Script Elements", swItems, (clickType, o) -> {
|
SWListInv<SpecialCommand> swListInv = new SWListInv<>(p, BauSystem.MESSAGE.parse("SCRIPT_GUI_NAME", p), swItems, (clickType, o) -> {
|
||||||
if (o != null) {
|
if (o != null) {
|
||||||
p.sendMessage("§eScript Command§8: §e" + o.command());
|
BauSystem.MESSAGE.send("SCRIPT_GUI_COMMAND_CHAT", p, o.command());
|
||||||
for (String s : o.description()) {
|
for (String s : o.description()) {
|
||||||
p.sendMessage("§7" + s);
|
BauSystem.MESSAGE.send(s, p);
|
||||||
}
|
}
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ public final class ScriptExecutor {
|
|||||||
while (index < commands.size()) {
|
while (index < commands.size()) {
|
||||||
String command = commands.get(index++);
|
String command = commands.get(index++);
|
||||||
if (executionPoints++ > 200) {
|
if (executionPoints++ > 200) {
|
||||||
player.sendMessage(BauSystem.PREFIX + "§cFüge ein sleep in dein Script ein");
|
BauSystem.MESSAGE.send("SCRIPT_SLEEP_ERROR", player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,5 +239,4 @@ public final class ScriptExecutor {
|
|||||||
}
|
}
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,24 +40,29 @@ public class ScriptVarsCommand 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/§escriptvars §8- §7Zähle alle globalen Variablen auf");
|
BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", p, "Scriptvars");
|
||||||
p.sendMessage("§8/§escriptvars §8[§7Variable§8] §8- §7Gebe den Wert der Variable zurück");
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_COMMAND_VARS_HELP_1", p);
|
||||||
p.sendMessage("§8/§escriptvars §8[§7Variable§8] §8[§7Value§8] §8- §7Setzte eine Variable auf einen Wert");
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_COMMAND_VARS_HELP_2", p);
|
||||||
p.sendMessage("§8/§escriptvars §8[§7Variable§8] §8<§7remove§8|§7delete§8|§7clear§8> §8- §7Lösche eine Variable");
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_COMMAND_VARS_HELP_3", p);
|
||||||
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_COMMAND_VARS_HELP_4", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
public void genericCommand(Player p) {
|
public void genericCommand(Player p) {
|
||||||
Context context = ScriptListener.getGlobalContext(p);
|
Context context = ScriptListener.getGlobalContext(p);
|
||||||
if (context.allVariables().isEmpty()) {
|
if (context.allVariables().isEmpty()) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cKeine globalen Variablen definiert");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_NO_VARS", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int i = 0;
|
int i = 0;
|
||||||
p.sendMessage(BauSystem.PREFIX + context.allVariables().size() + " Variable(n)");
|
if (context.allVariables().size() == 1) {
|
||||||
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_ONE_VAR", p);
|
||||||
|
} else {
|
||||||
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_MANY_VARS", p, context.allVariables().size());
|
||||||
|
}
|
||||||
for (Map.Entry<String, Value> var : context.entrySet()) {
|
for (Map.Entry<String, Value> var : context.entrySet()) {
|
||||||
if (i++ >= 40) break;
|
if (i++ >= 40) break;
|
||||||
p.sendMessage("- " + var.getKey() + "=" + var.getValue().asString());
|
BauSystem.MESSAGE.sendPrefixless("SCRIPT_COMMAND_VARS_ELEMENT_WITH_DASH", p, var.getKey(), var.getValue().asString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,28 +70,28 @@ public class ScriptVarsCommand extends SWCommand {
|
|||||||
public void getCommand(Player p, String varName) {
|
public void getCommand(Player p, String varName) {
|
||||||
Context context = ScriptListener.getGlobalContext(p);
|
Context context = ScriptListener.getGlobalContext(p);
|
||||||
if (context.allVariables().isEmpty()) {
|
if (context.allVariables().isEmpty()) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cKeine globalen Variablen definiert");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_NO_VARS", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!context.hasValue(varName)) {
|
if (!context.hasValue(varName)) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cUnbekannte Variable");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_UNKNOWN_VARS", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p.sendMessage(BauSystem.PREFIX + varName + "=" + context.getValue(varName).asString());
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_ELEMENT", p, varName, context.getValue(varName).asString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
public void setValueCommand(Player p, String varName, int value) {
|
public void setValueCommand(Player p, String varName, int value) {
|
||||||
Context context = ScriptListener.getGlobalContext(p);
|
Context context = ScriptListener.getGlobalContext(p);
|
||||||
context.putValue(varName, new Value.LongValue(value));
|
context.putValue(varName, new Value.LongValue(value));
|
||||||
p.sendMessage(BauSystem.PREFIX + varName + " auf " + value + " gesetzt");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_SET_VALUE", p, varName, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
public void setValueCommand(Player p, String varName, boolean value) {
|
public void setValueCommand(Player p, String varName, boolean value) {
|
||||||
Context context = ScriptListener.getGlobalContext(p);
|
Context context = ScriptListener.getGlobalContext(p);
|
||||||
context.putValue(varName, new Value.BooleanValue(value));
|
context.putValue(varName, new Value.BooleanValue(value));
|
||||||
p.sendMessage(BauSystem.PREFIX + varName + " auf " + value + " gesetzt");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_SET_VALUE", p, varName, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
@ -94,18 +99,18 @@ public class ScriptVarsCommand extends SWCommand {
|
|||||||
Context context = ScriptListener.getGlobalContext(p);
|
Context context = ScriptListener.getGlobalContext(p);
|
||||||
String s = String.join(" ", value);
|
String s = String.join(" ", value);
|
||||||
context.putValue(varName, new Value.StringValue(s));
|
context.putValue(varName, new Value.StringValue(s));
|
||||||
p.sendMessage(BauSystem.PREFIX + varName + " auf " + s + " gesetzt");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_SET_VALUE", p, varName, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
public void removeCommand(Player p, String varName, @Mapper(value = "Delete") String remove) {
|
public void removeCommand(Player p, String varName, @Mapper(value = "Delete") String remove) {
|
||||||
Context context = ScriptListener.getGlobalContext(p);
|
Context context = ScriptListener.getGlobalContext(p);
|
||||||
if (context.allVariables().isEmpty()) {
|
if (context.allVariables().isEmpty()) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cKeine globalen Variablen definiert");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_NO_VARS", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
context.removeValue(varName);
|
context.removeValue(varName);
|
||||||
p.sendMessage(BauSystem.PREFIX + "Variable " + varName + " gelöscht");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_VARS_REMOVE_VALUE", p, varName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ClassMapper(value = String.class, local = true)
|
@ClassMapper(value = String.class, local = true)
|
||||||
|
@ -12,9 +12,9 @@ public class Exit implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eexit",
|
"SCRIPT_COMMAND_EXIT_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Beendet das ausführen des Scripts."
|
"SCRIPT_COMMAND_EXIT_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ public class If implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eif §8<§7Variable§8/§7Wert§8> §8<§7Variable§8/§7Wert§8> §8<§7Jump-Point§8>",
|
"SCRIPT_COMMAND_IF_HELP_1",
|
||||||
"§eif §8<§7Variable§8/§7Wert§8> §8<§7Variable§8/§7Wert§8> §8<§7Jump-Point§8> §8<§7Jump-Point§8>",
|
"SCRIPT_COMMAND_IF_HELP_2",
|
||||||
"",
|
"",
|
||||||
"§7Springe zu einer Stelle, wenn zwei Werte gleich sind. Oder zu einer anderen, wenn dies nicht der fall ist."
|
"SCRIPT_COMMAND_IF_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,15 +34,15 @@ public class If implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable oder ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR_OR_VALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable oder ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR_OR_VALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 3) {
|
if (command.length <= 3) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas dritte Argument fehlt und sollte ein Jump-Point sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_THIRD_ARG_NOJUMPPOINT", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ public class Jump implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§ejump §8<§7Jump-Point§8>",
|
"SCRIPT_COMMAND_JUMP_HELP_1",
|
||||||
"",
|
"",
|
||||||
"§7Springe zu einer anderen Zeile. Hierbei ist ein Jump-Point eine Zeile mit §8'§7.§8'§7 vor."
|
"SCRIPT_COMMAND_JUMP_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,10 +32,10 @@ public class Jump implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOJUMPPOINT", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
jumpToIndexWithMessage(scriptExecutor, command[1], BauSystem.PREFIX + "§cDer Jump-Point (" + command[1] + ") ist nicht definiert.");
|
jumpToIndexWithMessage(scriptExecutor, command[1], BauSystem.MESSAGE.parse("SCRIPT_COMMAND_JUMP_ERROR", scriptExecutor.getPlayer(), command[1]));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,9 @@ public class Sleep implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§esleep §8<§7Time§8>",
|
"SCRIPT_COMMAND_SLEEP_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Pausiert das Ausführen des Scripts. Das erste Argument ist in GameTicks."
|
"SCRIPT_COMMAND_SLEEP_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,12 +33,12 @@ public class Sleep implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NONUMER", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
long sleepTime = asLong(command[1]);
|
long sleepTime = asLong(command[1]);
|
||||||
if (sleepTime < 0) {
|
if (sleepTime < 0) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDie Zeit muss eine Zahl großer 0 sein.");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_SLEEP_ERROR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (sleepTime == 0) {
|
if (sleepTime == 0) {
|
||||||
|
@ -14,10 +14,10 @@ public class Add implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eadd §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>",
|
"SCRIPT_COMMAND_ARITHMETIC_ADD_HELP_1",
|
||||||
"§eadd §8<§7Variable§8> §8<§7Variable§8§8|§7Wert> §8<§7Variable§8|§7Wert§8>",
|
"SCRIPT_COMMAND_ARITHMETIC_ADD_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Addition zwischen den letzten beiden Variablen und schreibt es in die erste."
|
"SCRIPT_COMMAND_ARITHMETIC_ADD_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,22 +34,22 @@ public class Add implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
if (!(v1 instanceof Value.LongValue)) {
|
if (!(v1 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können addiert werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ARITHMETIC_ADD_ERROR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.LongValue)) {
|
if (!(v2 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können addiert werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ARITHMETIC_ADD_ERROR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ public class Div implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§ediv §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>",
|
"SCRIPT_COMMAND_ARITHMETIC_DIV_HELP_1",
|
||||||
"§ediv §8<§7Variable§8> §8<§7Variable§8|§7Wert§8> §8<§7Variable§8|§7Wert§8>",
|
"SCRIPT_COMMAND_ARITHMETIC_DIV_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Division zwischen den letzten beiden Variablen und schreibt es in die erste."
|
"SCRIPT_COMMAND_ARITHMETIC_DIV_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,22 +34,22 @@ public class Div implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
if (!(v1 instanceof Value.LongValue)) {
|
if (!(v1 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können dividiert werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ARITHMETIC_DIV_ERROR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.LongValue)) {
|
if (!(v2 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können dividiert werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ARITHMETIC_DIV_ERROR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ public class Mul implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§emul §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>",
|
"SCRIPT_COMMAND_ARITHMETIC_MUL_HELP_1",
|
||||||
"§emul §8<§7Variable§8> §8<§7Variable§8|§7Wert§8> §8<§7Variable§8|§7Wert§8>",
|
"SCRIPT_COMMAND_ARITHMETIC_MUL_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Multiplikation zwischen den letzten beiden Variablen und schreibt es in die erste."
|
"SCRIPT_COMMAND_ARITHMETIC_MUL_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,22 +34,22 @@ public class Mul implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
if (!(v1 instanceof Value.LongValue)) {
|
if (!(v1 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können multipliziert werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ARITHMETIC_MUL_ERROR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.LongValue)) {
|
if (!(v2 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können multipliziert werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ARITHMETIC_MUL_ERROR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ public class Sub implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§esub §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>",
|
"SCRIPT_COMMAND_ARITHMETIC_SUB_HELP_1",
|
||||||
"§esub §8<§7Variable§8> §8<§7Variable§8|§7Wert§8> §8<§7Variable§8|§7Wert§8>",
|
"SCRIPT_COMMAND_ARITHMETIC_SUB_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Subtraktion zwischen den letzten beiden Variablen und schreibt es in die erste."
|
"SCRIPT_COMMAND_ARITHMETIC_SUB_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,22 +34,22 @@ public class Sub implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
if (!(v1 instanceof Value.LongValue)) {
|
if (!(v1 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können subtrahiert werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ARITHMETIC_SUB_ERROR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.LongValue)) {
|
if (!(v2 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können subtrahiert werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ARITHMETIC_SUB_ERROR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@ public class Echo implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eecho §8<§7Wert§8>",
|
"SCRIPT_COMMAND_IO_ECHO_HELP_1",
|
||||||
"",
|
"",
|
||||||
"§7Schreibe etwas dem Spieler. Wenn kein Wert angegeben wurde ist die Nachricht leer."
|
"SCRIPT_COMMAND_IO_ECHO_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package de.steamwar.bausystem.features.script.command.io;
|
package de.steamwar.bausystem.features.script.command.io;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.features.script.ScriptExecutor;
|
import de.steamwar.bausystem.features.script.ScriptExecutor;
|
||||||
import de.steamwar.bausystem.features.script.SpecialCommand;
|
import de.steamwar.bausystem.features.script.SpecialCommand;
|
||||||
@ -15,9 +14,9 @@ public class Echoactionbar implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eechoactionbar §8<§7Wert§8>",
|
"SCRIPT_COMMAND_IO_ECHOACTIONBAR_HELP_1",
|
||||||
"",
|
"",
|
||||||
"§7Schreibe etwas dem Spieler in der ActionBar. Wenn kein Wert angegeben wurde ist die Nachricht leer."
|
"SCRIPT_COMMAND_IO_ECHOACTIONBAR_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ public class Input implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§einput §8<§7Variable§8> §8<§7Text§8>",
|
"SCRIPT_COMMAND_IO_INPUT_HELP_1",
|
||||||
"",
|
"",
|
||||||
"§7Fordere eine Eingabe von dem Spieler, welche in die Variable geschrieben wird. Der Text ist optional."
|
"SCRIPT_COMMAND_IO_INPUT_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ public class Input implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
StringBuilder st = new StringBuilder();
|
StringBuilder st = new StringBuilder();
|
||||||
|
@ -14,10 +14,10 @@ public class And implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eand §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_AND_HELP_1",
|
||||||
"§eand §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_AND_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Das logische Und zwischen den letzten beiden Variablen und schreibt es in die erste."
|
"SCRIPT_COMMAND_LOGIC_AND_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,22 +34,22 @@ public class And implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
if (!(v1 instanceof Value.BooleanValue)) {
|
if (!(v1 instanceof Value.BooleanValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Booleans können verglichen werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_BOOLEAN_COMPARE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.BooleanValue)) {
|
if (!(v2 instanceof Value.BooleanValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Booleans können verglichen werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_BOOLEAN_COMPARE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Value result;
|
Value result;
|
||||||
|
@ -14,10 +14,10 @@ public class Equal implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eequal §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_EQUAL_HELP_1",
|
||||||
"§eequal §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_EQUAL_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Vergleiche die letzten beiden Variablen und schreibt es in die erste."
|
"SCRIPT_COMMAND_LOGIC_EQUAL_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,11 +34,11 @@ public class Equal implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ public class Greater implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§egreater §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_GREATER_HELP_1",
|
||||||
"§egreater §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_GREATER_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Vergleiche die letzten beiden Variablen und schreibt es in die erste."
|
"SCRIPT_COMMAND_LOGIC_GREATER_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,22 +34,22 @@ public class Greater implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
if (!(v1 instanceof Value.LongValue)) {
|
if (!(v1 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können verglichen werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_NUMBER_COMPARE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.LongValue)) {
|
if (!(v2 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können verglichen werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_NUMBER_COMPARE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Value result;
|
Value result;
|
||||||
|
@ -14,10 +14,10 @@ public class Less implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eless §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_LESS_HELP_1",
|
||||||
"§eless §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_LESS_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Vergleiche die letzten beiden Variablen und schreibt es in die erste."
|
"SCRIPT_COMMAND_LOGIC_LESS_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,22 +34,22 @@ public class Less implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
if (!(v1 instanceof Value.LongValue)) {
|
if (!(v1 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können verglichen werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_NUMBER_COMPARE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.LongValue)) {
|
if (!(v2 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können verglichen werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_NUMBER_COMPARE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Value result;
|
Value result;
|
||||||
|
@ -14,10 +14,10 @@ public class Not implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§enot §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_NOT_HELP_1",
|
||||||
"§enot §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_NOT_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Das logische Nicht von der letzten Variable und schreibt es in die erste."
|
"SCRIPT_COMMAND_LOGIC_NOT_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,13 +34,13 @@ public class Not implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
if (!(v1 instanceof Value.BooleanValue)) {
|
if (!(v1 instanceof Value.BooleanValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Booleans können genichtet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_BOOLEAN_COMPARE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
scriptExecutor.getLocalVariables().putValue(command[1], new Value.BooleanValue(!v1.asBoolean()));
|
scriptExecutor.getLocalVariables().putValue(command[1], new Value.BooleanValue(!v1.asBoolean()));
|
||||||
|
@ -14,10 +14,10 @@ public class Or implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eor §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_OR_HELP_1",
|
||||||
"§eor §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_LOGIC_OR_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Das logische Oder zwischen den letzten beiden Variablen und schreibt es in die erste."
|
"SCRIPT_COMMAND_LOGIC_OR_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,22 +34,22 @@ public class Or implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]);
|
||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
if (!(v1 instanceof Value.BooleanValue)) {
|
if (!(v1 instanceof Value.BooleanValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Booleans können verglichen werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_BOOLEAN_COMPARE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.BooleanValue)) {
|
if (!(v2 instanceof Value.BooleanValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Booleans können verglichen werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_BOOLEAN_COMPARE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Value result;
|
Value result;
|
||||||
|
@ -33,10 +33,10 @@ public class Insert implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§einsert §8<§7Variable§8> §8<§7Variable§8> §8<§7Zahl§8>",
|
"SCRIPT_COMMAND_STRING_INSERT_HELP_1",
|
||||||
"§einsert §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8> §8<§7Zahl§8>",
|
"SCRIPT_COMMAND_STRING_INSERT_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Füge etwas in einen String an einer Stelle ein. Die Zahl ist für die Position und die Variable davor für was. Schreibe optional dies in eine neue oder andere Variable."
|
"SCRIPT_COMMAND_STRING_INSERT_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,15 +53,15 @@ public class Insert implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 3) {
|
if (command.length <= 3) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas dritte Argument fehlt und sollte eine Variable/Zahl sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVAR_OR_NUMBER", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,15 +71,15 @@ public class Insert implements SpecialCommand {
|
|||||||
Value v3 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v3 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
|
|
||||||
if (!(v1 instanceof Value.StringValue)) {
|
if (!(v1 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Strings können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.StringValue)) {
|
if (!(v2 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Strings können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v3 instanceof Value.StringValue)) {
|
if (!(v3 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_NUMBERS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,10 +33,10 @@ public class Length implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§elength §8<§7Variable§8>",
|
"SCRIPT_COMMAND_STRING_LENGTH_HELP_1",
|
||||||
"§elength §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_STRING_LENGTH_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Ermittle die Länge eines Textes."
|
"SCRIPT_COMMAND_STRING_LENGTH_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,11 +53,11 @@ public class Length implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ public class Length implements SpecialCommand {
|
|||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
|
|
||||||
if (!(v2 instanceof Value.StringValue)) {
|
if (!(v2 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Strings können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,10 +33,10 @@ public class Remove implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eremove §8<§7Variable§8> §8<§7Von Variable§8>",
|
"SCRIPT_COMMAND_STRING_REMOVE_HELP_1",
|
||||||
"§eremove §8<§7Variable§8> §8<§7Variable§8> §8<§7Von Variable§8>",
|
"SCRIPT_COMMAND_STRING_REMOVE_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Lösche eine Zeichenkette aus dem Ursprung. Dies ersetzt nicht nur die erste Stelle sondern alle.",
|
"SCRIPT_COMMAND_STRING_REMOVE_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,11 +53,11 @@ public class Remove implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,11 +66,11 @@ public class Remove implements SpecialCommand {
|
|||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
|
|
||||||
if (!(v1 instanceof Value.StringValue)) {
|
if (!(v1 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Strings können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.StringValue)) {
|
if (!(v2 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Strings können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,10 +33,10 @@ public class Replace implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§ereplace §8<§7Variable§8> §8<§7Von Variable§8> §8<§7Zu Variable§8>",
|
"SCRIPT_COMMAND_STRING_REPLACE_HELP_1",
|
||||||
"§ereplace §8<§7Variable§8> §8<§7Variable§8> §8<§7Von Variable§8> §8<§7Zu Variable§8>",
|
"SCRIPT_COMMAND_STRING_REPLACE_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Ersetzte eine Zeichenkette aus dem Ursprung mit einer neuen Zeichenkette. Dies ersetzt nicht nur die erste Stelle sondern alle.",
|
"SCRIPT_COMMAND_STRING_REPLACE_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,15 +53,15 @@ public class Replace implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 3) {
|
if (command.length <= 3) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas dritte Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,15 +71,15 @@ public class Replace implements SpecialCommand {
|
|||||||
Value v3 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v3 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
|
|
||||||
if (!(v1 instanceof Value.StringValue)) {
|
if (!(v1 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Strings können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.StringValue)) {
|
if (!(v2 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Strings können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v3 instanceof Value.StringValue)) {
|
if (!(v3 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Strings können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,10 +33,10 @@ public class Substring implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§esubstring §8<§7Variable§8> §8<§7Zahl§8>",
|
"SCRIPT_COMMAND_STRING_SUBSTRING_HELP_1",
|
||||||
"§esubstring §8<§7Variable§8> §8<§7Variable§8> §8<§7Zahl§8>",
|
"SCRIPT_COMMAND_STRING_SUBSTRING_HELP_2",
|
||||||
"",
|
"",
|
||||||
"Kürze einen String entweder vorne oder hinter, je nachdem ob die Zahl positiv (vorne) oder negativ (hinten) ist."
|
"SCRIPT_COMMAND_STRING_SUBSTRING_HELP_3"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,11 +53,11 @@ public class Substring implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,11 +66,11 @@ public class Substring implements SpecialCommand {
|
|||||||
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]);
|
||||||
|
|
||||||
if (!(v1 instanceof Value.StringValue)) {
|
if (!(v1 instanceof Value.StringValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Strings können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(v2 instanceof Value.LongValue)) {
|
if (!(v2 instanceof Value.LongValue)) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cNur Zahlen können verwendet werden");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_ONLY_NUMBERS_ALLOWED", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,9 +33,9 @@ public class Const implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§econst §8<§7Variable§8> §8[§7Value§8(§7s§8)§8]",
|
"SCRIPT_COMMAND_VARIABLE_CONST_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Schreibt in eine Konstante einen Wert rein, welcher eine Zahl sein kann, ein Boolscher Wert oder ein Text."
|
"SCRIPT_COMMAND_VARIABLE_CONST_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,11 +52,11 @@ public class Const implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
String varName = command[1];
|
String varName = command[1];
|
||||||
|
@ -32,9 +32,9 @@ public class Convert implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§econvert §8<§7Variable§8> §8<§7Value§8>",
|
"SCRIPT_COMMAND_VARIABLE_CONVERT_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Konvertiere den Value zu 'number' wenn es eine Zahl ist, oder zu 'boolean' bei 'true' oder 'false' und behalte 'text' bei wenn nichts zutrifft.",
|
"SCRIPT_COMMAND_VARIABLE_CONVERT_HELP_2",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,11 +51,11 @@ public class Convert implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ public class Global implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eglobal §8<§7Variable§8> §8[§7Value§8(§7s§8)§8]",
|
"SCRIPT_COMMAND_VARIABLE_GLOBAL_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Schreibt in eine Variable einen Wert rein, welcher eine Zahl sein kann, ein Boolscher Wert oder ein Text."
|
"SCRIPT_COMMAND_VARIABLE_GLOBAL_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,11 +32,11 @@ public class Global implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
String varName = command[1];
|
String varName = command[1];
|
||||||
|
@ -33,9 +33,9 @@ public class Isset implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eisset §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_VARIABLE_ISSET_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Schreibt in eine Variable true/false rein, ob in die zweiten Variable existiert."
|
"SCRIPT_COMMAND_VARIABLE_ISSET_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,11 +52,11 @@ public class Isset implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ public class Unglobal implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eunglobal §8<§7Variable§8>",
|
"SCRIPT_COMMAND_VARIABLE_UNGLOBAL_HELP_1",
|
||||||
"",
|
"",
|
||||||
"§7Lösche eine Globale variable."
|
"SCRIPT_COMMAND_VARIABLE_UNGLOBAL_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class Unglobal implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
scriptExecutor.getGlobalVariables().removeValue(command[1]);
|
scriptExecutor.getGlobalVariables().removeValue(command[1]);
|
||||||
|
@ -13,9 +13,9 @@ public class Unvar implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§eunvar §8<§7Variable§8>",
|
"SCRIPT_COMMAND_VARIABLE_UNVAR_HELP_1",
|
||||||
"",
|
"",
|
||||||
"§7Lösche eine Locale variable."
|
"SCRIPT_COMMAND_VARIABLE_UNVAR_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class Unvar implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
scriptExecutor.getLocalVariables().removeValue(command[1]);
|
scriptExecutor.getLocalVariables().removeValue(command[1]);
|
||||||
|
@ -3,8 +3,6 @@ package de.steamwar.bausystem.features.script.command.variable;
|
|||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.features.script.ScriptExecutor;
|
import de.steamwar.bausystem.features.script.ScriptExecutor;
|
||||||
import de.steamwar.bausystem.features.script.SpecialCommand;
|
import de.steamwar.bausystem.features.script.SpecialCommand;
|
||||||
import de.steamwar.bausystem.features.script.variables.Constants;
|
|
||||||
import de.steamwar.bausystem.features.script.variables.Value;
|
|
||||||
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 org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -15,9 +13,9 @@ public class Var implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§evar §8<§7Variable§8> §8[§7Value§8(§7s§8)§8]",
|
"SCRIPT_COMMAND_VARIABLE_VAR_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Schreibt in eine Variable einen Wert rein, welcher eine Zahl sein kann, ein Boolscher Wert oder ein Text."
|
"SCRIPT_COMMAND_VARIABLE_VAR_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,11 +32,11 @@ public class Var implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
String varName = command[1];
|
String varName = command[1];
|
||||||
|
@ -33,9 +33,9 @@ public class Vartype implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§evartype §8<§7Variable§8> §8<§7Variable§8>",
|
"SCRIPT_COMMAND_VARIABLE_VARTYPE_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Schreibt in eine Variable den Type der zweiten Variable rein. Wenn die zweite Variable nicht gesetzt ist wird false in die erste geschrieben. Ansonsten gibt es die Werte: 'text', 'number' und 'boolean'",
|
"SCRIPT_COMMAND_VARIABLE_VARTYPE_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,11 +52,11 @@ public class Vartype implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ public class GetMaterial implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§egetmaterial §8<§7Variable§8> §8<§7Value§8(§7s§8)§8> §8<§7Value§8(§7s§8)§8> §8[§7Value§8(§7s§8)§8]",
|
"SCRIPT_COMMAND_WORLD_GETMATERIAL_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Schreibt das material von einem Block in der Welt in die Variable."
|
"SCRIPT_COMMAND_WORLD_GETMATERIAL_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,19 +56,19 @@ public class GetMaterial implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 3) {
|
if (command.length <= 3) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 4) {
|
if (command.length <= 4) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FOURTH_ARG_NOVALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,9 +36,9 @@ public class SetMaterial implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"§esetmaterial §8<§7Variable§8> §8<§7Value§8(§7s§8)§8> §8<§7Value§8(§7s§8)§8> §8[§7Value§8(§7s§8)§8]",
|
"SCRIPT_COMMAND_WORLD_SETMATERIAL_HELP_1",
|
||||||
"",
|
"",
|
||||||
"Setzt an einem Block in der Welt das Material der ersten Variable."
|
"SCRIPT_COMMAND_WORLD_SETMATERIAL_HELP_2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,19 +55,19 @@ public class SetMaterial implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
if (command.length <= 1) {
|
if (command.length <= 1) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas erste Argument fehlt und sollte eine Variable sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 2) {
|
if (command.length <= 2) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 3) {
|
if (command.length <= 3) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.length <= 4) {
|
if (command.length <= 4) {
|
||||||
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "§cDas zweite Argument fehlt und sollte ein Wert sein");
|
BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_FOURTH_ARG_NOVALUE", scriptExecutor.getPlayer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,11 +19,11 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.script.items;
|
package de.steamwar.bausystem.features.script.items;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
|
||||||
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.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -39,7 +39,7 @@ public class ScriptMenuBauGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItem(Player player) {
|
public ItemStack getItem(Player player) {
|
||||||
return new SWItem(Material.WRITTEN_BOOK, ColorConfig.HIGHLIGHT + "Script Hilfe").getItemStack();
|
return new SWItem(Material.WRITTEN_BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_ITEM_NAME", player)).getItemStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -19,11 +19,11 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.simulator;
|
package de.steamwar.bausystem.features.simulator;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
|
||||||
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.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -39,7 +39,7 @@ public class SimulatorBauGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItem(Player player) {
|
public ItemStack getItem(Player player) {
|
||||||
return new SWItem(Material.REDSTONE_TORCH, ColorConfig.HIGHLIGHT + "TNT Simulator").getItemStack();
|
return new SWItem(Material.REDSTONE_TORCH, BauSystem.MESSAGE.parse("SIMULATOR_GUI_ITEM_NAME", player)).getItemStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -57,5 +57,4 @@ public class SimulatorEntityShowMode implements ShowMode<Position> {
|
|||||||
entityMap.forEach((roundedPosition, abstractTraceEntity) -> abstractTraceEntity.hide(player, true));
|
entityMap.forEach((roundedPosition, abstractTraceEntity) -> abstractTraceEntity.hide(player, true));
|
||||||
entityMap.clear();
|
entityMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren