Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
b04ab92a78
Commit
364249b192
@ -1117,7 +1117,7 @@ PANZERN_PROGRESS = §e{0} §7Blöcke übrig, §e{1} §7Blöcke pro Sekunde, §e{
|
|||||||
PANZERN_DONE = §aZuende gepanzert
|
PANZERN_DONE = §aZuende gepanzert
|
||||||
|
|
||||||
# Laufbau
|
# Laufbau
|
||||||
LAUFBAU_HELP = §8/§elaufbau §8[§7Block§8] §8[§7Slab§8] §8- §7Baue einen Lauf in deiner WorldEdit Auswahl mit den Traces
|
LAUFBAU_HELP = §8/§elaufbau §8[§7smallest§8|§7blastresistant§8] §8- §7Baue einen Lauf in deiner WorldEdit Auswahl mit den Traces
|
||||||
LAUFBAU_PREPARE1 = §71. Trace die Kanonen so oft wie nötig, in allen Modi.
|
LAUFBAU_PREPARE1 = §71. Trace die Kanonen so oft wie nötig, in allen Modi.
|
||||||
LAUFBAU_PREPARE2 = §72. Versuche alle Fails aus dem Trace zu löschen.
|
LAUFBAU_PREPARE2 = §72. Versuche alle Fails aus dem Trace zu löschen.
|
||||||
LAUFBAU_NO_PERM = §cDu darfst hier nicht das Laufbau System verwenden
|
LAUFBAU_NO_PERM = §cDu darfst hier nicht das Laufbau System verwenden
|
||||||
@ -1125,11 +1125,11 @@ LAUFBAU_NO_WORLDEDIT = §cDu hast keine WorldEdit Selection
|
|||||||
LAUFBAU_STATE_FILTERING_TRACES = Traces filtern
|
LAUFBAU_STATE_FILTERING_TRACES = Traces filtern
|
||||||
LAUFBAU_STATE_PROCESSING_TRACES = Traces verbinden
|
LAUFBAU_STATE_PROCESSING_TRACES = Traces verbinden
|
||||||
LAUFBAU_STATE_EXPANDING_TRACES = Traces aufblähen
|
LAUFBAU_STATE_EXPANDING_TRACES = Traces aufblähen
|
||||||
LAUFBAU_STATE_SPLITTING_POINTS = Punkte aufteilen
|
LAUFBAU_STATE_SPLITTING_POINTS = Punkte trennen
|
||||||
LAUFBAU_STATE_SHRINKING_POINTS = Punkte ausdünnen
|
LAUFBAU_STATE_SHRINKING_POINTS = Punkte ausdünnen
|
||||||
LAUFBAU_STATE_CREATING_INNER_BLOCKS = Innenraum füllen
|
LAUFBAU_STATE_CREATING_INNER_BLOCKS = Innenraum füllen
|
||||||
LAUFBAU_STATE_CREATING_OUTER_BLOCKS = Mantel bauen
|
LAUFBAU_STATE_CREATING_OUTER_BLOCKS = Mantel bauen
|
||||||
LAUFBAU_SIMPLE_PROGRESS = §e{0}§8: §e{1}§8/§7{2}
|
LAUFBAU_SIMPLE_PROGRESS = §e{0}§8: §e{1}§8/§e{2}
|
||||||
LAUFBAU_DONE = §aZuende gebaut
|
LAUFBAU_DONE = §aZuende gebaut
|
||||||
|
|
||||||
# UTILS
|
# UTILS
|
||||||
|
@ -27,18 +27,11 @@ import de.steamwar.bausystem.linkage.LinkageType;
|
|||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.shared.Pair;
|
import de.steamwar.bausystem.shared.Pair;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.command.TypeMapper;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Linked(LinkageType.COMMAND)
|
@Linked(LinkageType.COMMAND)
|
||||||
public class LaufbauCommand extends SWCommand {
|
public class LaufbauCommand extends SWCommand {
|
||||||
|
|
||||||
@ -54,16 +47,8 @@ public class LaufbauCommand extends SWCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(help = true)
|
@Register(description = {"LAUFBAU_HELP", "LAUFBAU_PREPARE1", "LAUFBAU_PREPARE2"})
|
||||||
public void genericHelp(Player player, String... args) {
|
public void laufbauSelection(Player player, @StaticValue(value = {"smallest", "blastresistant"}, allowISE = true) boolean preferingBlastResistance) {
|
||||||
BauSystem.MESSAGE.send("COMMAND_HELP_HEAD", player, "laufbau");
|
|
||||||
BauSystem.MESSAGE.send("LAUFBAU_HELP", player);
|
|
||||||
BauSystem.MESSAGE.send("LAUFBAU_PREPARE1", player);
|
|
||||||
BauSystem.MESSAGE.send("LAUFBAU_PREPARE2", player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register
|
|
||||||
public void laufbauSelection(Player player, /*@Mapper("block") Material blockMaterial, @Mapper("slab") Material slabMaterial*/ boolean preferingBlastResistance) {
|
|
||||||
if (!permissionCheck(player, Permission.WORLDEDIT)) {
|
if (!permissionCheck(player, Permission.WORLDEDIT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -91,60 +76,10 @@ public class LaufbauCommand extends SWCommand {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SWUtils.sendToActionbar(player, laufbau.actionBarMessage(player));
|
Bukkit.getOnlinePlayers().forEach(p -> {
|
||||||
|
SWUtils.sendToActionbar(p, laufbau.actionBarMessage(p));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}.runTaskTimer(BauSystem.getInstance(), 1, 1);
|
}.runTaskTimer(BauSystem.getInstance(), 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Mapper(value = "block", local = true)
|
|
||||||
private TypeMapper<Material> blockMapper() {
|
|
||||||
Set<String> strings = new HashSet<>();
|
|
||||||
for (Material material : Material.values()) {
|
|
||||||
if (!material.isBlock()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
strings.add(material.name().toLowerCase());
|
|
||||||
}
|
|
||||||
return new TypeMapper<Material>() {
|
|
||||||
@Override
|
|
||||||
public List<String> tabCompletes(CommandSender commandSender, String[] ignored, String s) {
|
|
||||||
return new ArrayList<>(strings);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Material map(CommandSender commandSender, String[] previousArguments, String s) {
|
|
||||||
if (strings.contains(s.toLowerCase())) {
|
|
||||||
return Material.valueOf(s.toUpperCase());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Mapper(value = "slab", local = true)
|
|
||||||
private TypeMapper<Material> slabMapper() {
|
|
||||||
Set<String> strings = new HashSet<>();
|
|
||||||
for (Material material : Material.values()) {
|
|
||||||
if (!material.isBlock()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (material.name().contains("STAIRS") || material.name().contains("SLAB")) {
|
|
||||||
strings.add(material.name().toLowerCase());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new TypeMapper<Material>() {
|
|
||||||
@Override
|
|
||||||
public List<String> tabCompletes(CommandSender commandSender, String[] ignored, String s) {
|
|
||||||
return new ArrayList<>(strings);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Material map(CommandSender commandSender, String[] previousArguments, String s) {
|
|
||||||
if (strings.contains(s.toLowerCase())) {
|
|
||||||
return Material.valueOf(s.toUpperCase());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import de.steamwar.bausystem.linkage.LinkageType;
|
|||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.shared.Pair;
|
import de.steamwar.bausystem.shared.Pair;
|
||||||
import de.steamwar.command.*;
|
import de.steamwar.command.*;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -79,7 +80,10 @@ public class PanzernCommand extends SWCommand {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SWUtils.sendToActionbar(player, BauSystem.MESSAGE.parse("PANZERN_PROGRESS", player, panzern.blocksLeft(), blocks * 20, panzern.blocksLeft() - blockLeft));
|
long finalBlocks = blocks;
|
||||||
|
Bukkit.getOnlinePlayers().forEach(p -> {
|
||||||
|
SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("PANZERN_PROGRESS", p, panzern.blocksLeft(), finalBlocks * 20, panzern.blocksLeft() - blockLeft));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}.runTaskTimer(BauSystem.getInstance(), 1, 1);
|
}.runTaskTimer(BauSystem.getInstance(), 1, 1);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren