mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 04:09:51 +00:00
Added fluid renderer.
This commit is contained in:
1 parent
f59b0a2932
commit
07038f8342
13 files changed
+773
-387
No files matched your search
@@ -0,0 +1,41 @@
|
||||
package net.minecraftforge.common.property;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
public class PropertyFloat implements IUnlistedProperty<Float>
|
||||
{
|
||||
private final String name;
|
||||
private final Predicate<Float> validator;
|
||||
|
||||
public PropertyFloat(String name)
|
||||
{
|
||||
this(name, Predicates.<Float>alwaysTrue());
|
||||
}
|
||||
|
||||
public PropertyFloat(String name, Predicate<Float> validator)
|
||||
{
|
||||
this.name = name;
|
||||
this.validator = validator;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public boolean isValid(Float value)
|
||||
{
|
||||
return validator.apply(value);
|
||||
}
|
||||
|
||||
public Class<Float> getType()
|
||||
{
|
||||
return Float.class;
|
||||
}
|
||||
|
||||
public String valueToString(Float value)
|
||||
{
|
||||
return value.toString();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user