SteamWar/BauSystem2.0
Archiviert
12
0

Fix TPSLimitCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-12-13 11:55:22 +01:00
Ursprung 9cc26634c9
Commit 6a6907bb43

Datei anzeigen

@ -30,8 +30,11 @@ import de.steamwar.command.SWCommandUtils;
import de.steamwar.command.TypeMapper;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import net.minecraft.server.v1_15_R1.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
import org.bukkit.entity.Player;
import yapion.utils.ReflectionsUtils;
import java.util.ArrayList;
import java.util.Arrays;
@ -86,10 +89,11 @@ public class TPSLimitCommand extends SWCommand implements Enable {
@ClassMapper(value = double.class, local = true)
public TypeMapper<Double> doubleTypeMapper() {
return SWCommandUtils.createMapper(s -> {
if (s.equalsIgnoreCase("nan")) return -1D;
try {
return Double.parseDouble(s.replace(',', '.'));
} catch (NumberFormatException e) {
return 0D;
return -1D;
}
}, s -> tabCompletions);
}