net.minestom.server.command.builder.arguments.minecraft.ArgumentFloatRange Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.command.builder.arguments.minecraft;
import net.minestom.server.utils.math.FloatRange;
/**
* Represents an argument which will give you an {@link FloatRange}.
*
* Example: ..3, 3.., 5..10, 15
*/
public class ArgumentFloatRange extends ArgumentRange {
public ArgumentFloatRange(String id) {
super(id, -Float.MAX_VALUE, Float.MAX_VALUE, Float::parseFloat, FloatRange::new);
}
@Override
public String parser() {
return "minecraft:float_range";
}
@Override
public String toString() {
return String.format("FloatRange<%s>", getId());
}
}