Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
9cc26634c9
Commit
6a6907bb43
@ -30,8 +30,11 @@ import de.steamwar.command.SWCommandUtils;
|
|||||||
import de.steamwar.command.TypeMapper;
|
import de.steamwar.command.TypeMapper;
|
||||||
import net.md_5.bungee.api.ChatMessageType;
|
import net.md_5.bungee.api.ChatMessageType;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
import net.minecraft.server.v1_15_R1.WorldServer;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import yapion.utils.ReflectionsUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -86,10 +89,11 @@ public class TPSLimitCommand extends SWCommand implements Enable {
|
|||||||
@ClassMapper(value = double.class, local = true)
|
@ClassMapper(value = double.class, local = true)
|
||||||
public TypeMapper<Double> doubleTypeMapper() {
|
public TypeMapper<Double> doubleTypeMapper() {
|
||||||
return SWCommandUtils.createMapper(s -> {
|
return SWCommandUtils.createMapper(s -> {
|
||||||
|
if (s.equalsIgnoreCase("nan")) return -1D;
|
||||||
try {
|
try {
|
||||||
return Double.parseDouble(s.replace(',', '.'));
|
return Double.parseDouble(s.replace(',', '.'));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
return 0D;
|
return -1D;
|
||||||
}
|
}
|
||||||
}, s -> tabCompletions);
|
}, s -> tabCompletions);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren