Update DepthCounter
Update DepthCounterCommand Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
794be6cdf9
Commit
ebe4d638f6
@ -607,7 +607,20 @@ BLOCK_COUNTER_ENABLE = §7BlockCounter angemacht
|
|||||||
BLOCK_COUNTER_DISABLE = §7BlockCounter ausgemacht
|
BLOCK_COUNTER_DISABLE = §7BlockCounter ausgemacht
|
||||||
|
|
||||||
# DepthCounter
|
# DepthCounter
|
||||||
|
DEPTH_COUNTER_COMMAND_ENABLE_HELP = §8/§edepthcounter enable §8- §7Aktiviere den Tiefenzähler
|
||||||
|
DEPTH_COUNTER_COMMAND_DISABLE_HELP = §8/§edepthcounter disable §8- §7Deaktiviere den Tiefenzähler
|
||||||
|
DEPTH_COUNTER_COMMAND_INFO_HELP = §8/§edepthcounter info §8- §7Zähle aktive Zählmodi auf
|
||||||
|
DEPTH_COUNTER_COMMAND_TOGGLE_HELP = §8/§edepthcounter toggle §8<§7CountMode§8> §8- §7Stelle einzelne Zählmodi ein
|
||||||
|
DEPTH_COUNTER_ENABLE_MESSAGE = §7Du hast den Tiefenzähler aktiviert.
|
||||||
|
DEPTH_COUNTER_DISABLE_MESSAGE = §7Du hast den Tiefenzähler deaktiviert.
|
||||||
|
DEPTH_COUNTER_ACTIVE_MESSAGE = §7Aktive Zählmodi: §e{0}§8.
|
||||||
|
DEPTH_COUNTER_MESSAGE = §7Schaden §8> §7
|
||||||
|
DEPTH_COUNTER_HIGHLIGHT = §e
|
||||||
|
DEPTH_COUNTER_SEPARATOR = §7 §7
|
||||||
|
DEPTH_COUNTER_X = X: {0}
|
||||||
|
DEPTH_COUNTER_Y = Y: {0}
|
||||||
|
DEPTH_COUNTER_Z = Z: {0}
|
||||||
|
DEPTH_COUNTER_TNT = §7TNT§8: §e{0}
|
||||||
|
|
||||||
# TPSLimit
|
# TPSLimit
|
||||||
TICK_STEP_HELP = §8/§etick step §8<§7Ticks§8> §8- §7Spule n Ticks vor
|
TICK_STEP_HELP = §8/§etick step §8<§7Ticks§8> §8- §7Spule n Ticks vor
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
package de.steamwar.bausystem.features.testblock.depthcounter;
|
package de.steamwar.bausystem.features.testblock.depthcounter;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
|
||||||
import de.steamwar.bausystem.configplayer.Config;
|
import de.steamwar.bausystem.configplayer.Config;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
@ -105,8 +104,6 @@ public class DepthCounter {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final StringBuilder result = new StringBuilder(BauSystem.PREFIX).append("Schaden ").append(ColorConfig.OTHER).append("> ").append(ColorConfig.BASE);
|
|
||||||
|
|
||||||
final Set<Integer> dimensions = new HashSet<>();
|
final Set<Integer> dimensions = new HashSet<>();
|
||||||
if (xActive) {
|
if (xActive) {
|
||||||
dimensions.add(x);
|
dimensions.add(x);
|
||||||
@ -120,31 +117,26 @@ public class DepthCounter {
|
|||||||
|
|
||||||
int max = getMax(dimensions);
|
int max = getMax(dimensions);
|
||||||
|
|
||||||
|
StringBuilder st = new StringBuilder();
|
||||||
if (xActive) {
|
if (xActive) {
|
||||||
if (x == max) {
|
st.append(x == max ? BauSystem.MESSAGE.parse("DEPTH_COUNTER_HIGHLIGHT", player) : "")
|
||||||
result.append(ColorConfig.HIGHLIGHT).append("X: ").append(x).append(ColorConfig.BASE).append(" ");
|
.append(BauSystem.MESSAGE.parse("DEPTH_COUNTER_X", player, x))
|
||||||
} else {
|
.append(BauSystem.MESSAGE.parse("DEPTH_COUNTER_SEPARATOR", player));
|
||||||
result.append("X: ").append(x).append(" ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (yActive) {
|
if (yActive) {
|
||||||
if (y == max) {
|
st.append(y == max ? BauSystem.MESSAGE.parse("DEPTH_COUNTER_HIGHLIGHT", player) : "")
|
||||||
result.append(ColorConfig.HIGHLIGHT).append("Y: ").append(y).append(ColorConfig.BASE).append(" ");
|
.append(BauSystem.MESSAGE.parse("DEPTH_COUNTER_Y", player, y))
|
||||||
} else {
|
.append(BauSystem.MESSAGE.parse("DEPTH_COUNTER_SEPARATOR", player));
|
||||||
result.append("Y: ").append(y).append(" ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zActive) {
|
if (zActive) {
|
||||||
if (z == max) {
|
st.append(z == max ? BauSystem.MESSAGE.parse("DEPTH_COUNTER_HIGHLIGHT", player) : "")
|
||||||
result.append(ColorConfig.HIGHLIGHT).append("Z: ").append(z).append(ColorConfig.BASE).append(" ");
|
.append(BauSystem.MESSAGE.parse("DEPTH_COUNTER_Z", player, z))
|
||||||
} else {
|
.append(BauSystem.MESSAGE.parse("DEPTH_COUNTER_SEPARATOR", player));
|
||||||
result.append("Z: ").append(z).append(" ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result.append(ColorConfig.BASE).append("TNT").append(ColorConfig.OTHER).append(": ").append(ColorConfig.HIGHLIGHT).append(tntCount);
|
st.append(BauSystem.MESSAGE.parse("DEPTH_COUNTER_TNT", player, tntCount));
|
||||||
return result.toString();
|
return BauSystem.MESSAGE.parse("DEPTH_COUNTER_MESSAGE", player, st.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -26,7 +26,6 @@ import de.steamwar.bausystem.linkage.Linked;
|
|||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|
||||||
@Linked(LinkageType.COMMAND)
|
@Linked(LinkageType.COMMAND)
|
||||||
public class DepthCounterCommand extends SWCommand {
|
public class DepthCounterCommand extends SWCommand {
|
||||||
|
|
||||||
@ -34,35 +33,27 @@ public class DepthCounterCommand extends SWCommand {
|
|||||||
super("depthcounter", "depthcount", "dcounter", "dcount");
|
super("depthcounter", "depthcount", "dcounter", "dcount");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register(value = "toggle", description = "DEPTH_COUNTER_COMMAND_TOGGLE_HELP")
|
||||||
public void genericHelp(Player p, String... args) {
|
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "depthcounter enable" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Aktiviere den Tiefenzähler");
|
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "depthcounter disable" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Deaktiviere den Tiefenzähler");
|
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "depthcounter info" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Zähle aktive Zählmodi auf");
|
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "depthcounter toggle " + ColorConfig.OTHER + "<" + ColorConfig.BASE + "CountMode" + ColorConfig.OTHER + ">" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Stelle einzelne Zählmodi ein");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register("toggle")
|
|
||||||
public void toggleCommand(Player p, CountMode countMode) {
|
public void toggleCommand(Player p, CountMode countMode) {
|
||||||
DepthCounter.toggleMode(p, countMode);
|
DepthCounter.toggleMode(p, countMode);
|
||||||
p.sendMessage(BauSystem.PREFIX + "Aktive Zählmodi: " + ColorConfig.HIGHLIGHT + DepthCounter.getModes(p) + ColorConfig.BASE + ".");
|
p.sendMessage(BauSystem.PREFIX + "Aktive Zählmodi: " + ColorConfig.HIGHLIGHT + DepthCounter.getModes(p) + ColorConfig.BASE + ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register("enable")
|
@Register(value = "enable", description = "DEPTH_COUNTER_COMMAND_ENABLE_HELP")
|
||||||
public void enableCommand(Player p) {
|
public void enableCommand(Player p) {
|
||||||
DepthCounter.setModes(p, CountMode.ALL());
|
DepthCounter.setModes(p, CountMode.ALL());
|
||||||
p.sendMessage(BauSystem.PREFIX + "Du hast den Tiefenzähler aktiviert.");
|
BauSystem.MESSAGE.send("DEPTH_COUNTER_ENABLE_MESSAGE", p);
|
||||||
p.sendMessage(BauSystem.PREFIX + "Aktive Zählmodi: " + ColorConfig.HIGHLIGHT + DepthCounter.getModes(p) + ColorConfig.BASE + ".");
|
BauSystem.MESSAGE.send("DEPTH_COUNTER_ACTIVE_MESSAGE", p, DepthCounter.getModes(p).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register("disable")
|
@Register(value = "disable", description = "DEPTH_COUNTER_COMMAND_DISABLE_HELP")
|
||||||
public void disableCommand(Player p) {
|
public void disableCommand(Player p) {
|
||||||
DepthCounter.removePlayer(p);
|
DepthCounter.removePlayer(p);
|
||||||
p.sendMessage(BauSystem.PREFIX + "Du hast den Tiefenzähler deaktiviert.");
|
BauSystem.MESSAGE.send("DEPTH_COUNTER_DISABLE_MESSAGE", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register("info")
|
@Register(value = "info", description = "DEPTH_COUNTER_COMMAND_INFO_HELP")
|
||||||
public void infoCommand(Player p) {
|
public void infoCommand(Player p) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "Aktive Zählmodi: " + ColorConfig.HIGHLIGHT + DepthCounter.getModes(p) + ColorConfig.BASE + ".");
|
BauSystem.MESSAGE.send("DEPTH_COUNTER_ACTIVE_MESSAGE", p, DepthCounter.getModes(p).toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.util;
|
package de.steamwar.bausystem.features.util;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.linkage.LinkageType;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
@ -39,5 +38,4 @@ public class DebugStickCommand extends SWCommand {
|
|||||||
public void genericCommand(Player p) {
|
public void genericCommand(Player p) {
|
||||||
SWUtils.giveItemToPlayer(p, new ItemStack(Material.DEBUG_STICK));
|
SWUtils.giveItemToPlayer(p, new ItemStack(Material.DEBUG_STICK));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren