SteamWar/BauSystem2.0
Archiviert
12
0

Fix some MultiReplaceCommand stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-09-11 21:24:23 +02:00
Ursprung 3ef7812aa7
Commit 3e2b22be02
2 geänderte Dateien mit 2 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -61,7 +61,7 @@ public class MultiReplaceCommand extends SWCommand {
Map<String, String> stringReplacements = new HashMap<>();
for (Replacement replacement : replacements) {
stringReplacements.put(replacement.from.name(), replacement.to.name());
stringReplacements.put("minecraft:" + replacement.from.name().toLowerCase(), "minecraft:" + replacement.to.name().toLowerCase());
}
Region region = WorldEditUtils.getRegion(player);
@ -96,7 +96,7 @@ public class MultiReplaceCommand extends SWCommand {
public Collection<String> tabCompletes(CommandSender commandSender, String[] strings, String s) {
int index = s.indexOf(":");
if (index != -1 && index == s.lastIndexOf(":")) {
return materials.stream().map(Material::name).map(t -> s + t).collect(Collectors.toList());
return materials.stream().map(Material::name).map(t -> s.substring(0, index + 1) + t).collect(Collectors.toList());
} else if (index == -1) {
return materials.stream().map(Material::name).collect(Collectors.toList());
}

Datei anzeigen

@ -30,8 +30,6 @@ import org.bukkit.Bukkit;
import javax.annotation.Nullable;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
public class SpecialReplace implements Mask, Pattern {