Add Echo
Dieser Commit ist enthalten in:
Ursprung
1b0c15cf8b
Commit
5a8bf318e3
@ -1,4 +1,43 @@
|
|||||||
package de.steamwar.bausystem.features.script.command.io;
|
package de.steamwar.bausystem.features.script.command.io;
|
||||||
|
|
||||||
public class Echo {
|
import de.steamwar.bausystem.BauSystem;
|
||||||
|
import de.steamwar.bausystem.features.script.ScriptExecutor;
|
||||||
|
import de.steamwar.bausystem.features.script.SpecialCommand;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
|
import net.md_5.bungee.api.ChatColor;
|
||||||
|
|
||||||
|
@Linked(LinkageType.SCRIPT_COMMAND)
|
||||||
|
public class Echo implements SpecialCommand {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] description() {
|
||||||
|
return new String[]{
|
||||||
|
"§eecho §8<§7Wert§8>",
|
||||||
|
"",
|
||||||
|
"§7Schreibe etwas dem Spieler. Wenn kein Wert angegeben wurde ist die Nachricht leer."
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String command() {
|
||||||
|
return "echo";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean execute(String[] command, ScriptExecutor scriptExecutor) {
|
||||||
|
if (command.length <= 1) {
|
||||||
|
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + "");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
StringBuilder st = new StringBuilder();
|
||||||
|
for (int i = 1; i < command.length; i++) {
|
||||||
|
if (i != 1) {
|
||||||
|
st.append(" ");
|
||||||
|
}
|
||||||
|
st.append(command[i]);
|
||||||
|
}
|
||||||
|
scriptExecutor.getPlayer().sendMessage(BauSystem.PREFIX + ChatColor.translateAlternateColorCodes('&', st.toString()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,9 @@ public class Unglobal implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"unglobal §8<§7Name§8>",
|
"§eunglobal §8<§7Name§8>",
|
||||||
"",
|
"",
|
||||||
"Lösche eine Globale variable"
|
"§7Lösche eine Globale variable."
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@ public class Unvar implements SpecialCommand {
|
|||||||
@Override
|
@Override
|
||||||
public String[] description() {
|
public String[] description() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"unvar §8<§7Name§8>",
|
"§eunvar §8<§7Name§8>",
|
||||||
"",
|
"",
|
||||||
"Lösche eine Locale variable"
|
"§7Lösche eine Locale variable."
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package de.steamwar.bausystem.features.script.variables;
|
package de.steamwar.bausystem.features.script.variables;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.features.tracer.record.RecordStateMachine;
|
import de.steamwar.bausystem.features.tracer.record.RecordStateMachine;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
@ -44,6 +45,9 @@ public class Constants {
|
|||||||
CONSTANTS.put("z", player -> {
|
CONSTANTS.put("z", player -> {
|
||||||
return new Value.LongValue(player.getLocation().getBlockZ());
|
return new Value.LongValue(player.getLocation().getBlockZ());
|
||||||
});
|
});
|
||||||
|
CONSTANTS.put("name", player -> {
|
||||||
|
return new Value.StringValue(player.getDisplayName());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> allVariables() {
|
public Set<String> allVariables() {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren