public class TemperatureRange
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TemperatureRange.TemperatureScale |
| Modifier and Type | Method and Description |
|---|---|
static TemperatureRange |
any()
Special "don't care" temperature range which always accepts any temperature.
|
java.lang.String |
asString(TemperatureRange.TemperatureScale scale) |
static TemperatureRange |
fromJson(com.google.gson.JsonObject json) |
int |
getMax()
Get the maximum temperature for this range.
|
int |
getMin()
Get the minimum temperature for this range.
|
boolean |
hasMax() |
boolean |
hasMin() |
boolean |
inRange(double temp)
Check if the given temperature is valid for this range object.
|
boolean |
inRange(int temp)
Check if the given temperature is valid for this range object.
|
static TemperatureRange |
invalid()
Get a temperature range which never accepts any temperature as valid.
|
boolean |
isAny()
Check if this temperature is the special "don't care" temperature, as returned by
any(). |
static TemperatureRange |
max(int maxTemp)
Get a temperature range which accepts temperatures lower than or equal to the supplied value.
|
static TemperatureRange |
min(int minTemp)
Get a temperature range which accepts temperatures higher than or equal to the supplied value.
|
static TemperatureRange |
of(int minTemp,
int maxTemp)
Get a specific temperature range.
|
static TemperatureRange |
read(net.minecraft.network.PacketBuffer buffer)
Read a temperature range from packet buffer, as written by
write(PacketBuffer) |
com.google.gson.JsonObject |
toJson() |
void |
write(net.minecraft.network.PacketBuffer buffer) |
public int getMin()
public int getMax()
public static TemperatureRange of(int minTemp, int maxTemp)
minTemp - an inclusive minimum temperaturemaxTemp - an inclusive maximum temperaturepublic static TemperatureRange any()
public static TemperatureRange min(int minTemp)
minTemp - an inclusive minimum temperaturepublic static TemperatureRange max(int maxTemp)
maxTemp - an inclusive maximum temperaturepublic static TemperatureRange read(net.minecraft.network.PacketBuffer buffer)
write(PacketBuffer)buffer - the bufferpublic boolean inRange(int temp)
temp - the temperaturepublic boolean inRange(double temp)
temp - the temperaturepublic static TemperatureRange invalid()
public boolean isAny()
any().public boolean hasMin()
public boolean hasMax()
public void write(net.minecraft.network.PacketBuffer buffer)
public com.google.gson.JsonObject toJson()
public static TemperatureRange fromJson(com.google.gson.JsonObject json)
public java.lang.String asString(TemperatureRange.TemperatureScale scale)