Easier handling of meta blocks
This commit is contained in:
parent
fb94914b91
commit
9035f800e2
16 changed files with 436 additions and 277 deletions
|
@ -5,7 +5,7 @@ import net.minecraft.world.World;
|
|||
|
||||
public interface IRitualStone {
|
||||
|
||||
boolean isRuneType(World world, BlockPos pos, int meta, EnumRuneType runeType);
|
||||
boolean isRuneType(World world, BlockPos pos, EnumRuneType runeType);
|
||||
|
||||
interface Tile {
|
||||
boolean isRuneType(EnumRuneType runeType);
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
package WayofTime.bloodmagic.api.ritual;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
public class PropertyRuneType extends PropertyEnum
|
||||
{
|
||||
protected PropertyRuneType(String name, Collection values)
|
||||
{
|
||||
super(name, EnumRuneType.class, values);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new PropertyRuneType with the given name
|
||||
*/
|
||||
public static PropertyRuneType create(String name)
|
||||
{
|
||||
/**
|
||||
* Create a new PropertyRuneType with all directions that match the given Predicate
|
||||
*/
|
||||
return create(name, Predicates.alwaysTrue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new PropertyRuneType with all directions that match the given Predicate
|
||||
*/
|
||||
public static PropertyRuneType create(String name, Predicate filter)
|
||||
{
|
||||
/**
|
||||
* Create a new PropertyRuneType for the given direction values
|
||||
*/
|
||||
return create(name, Collections2.filter(Lists.newArrayList(EnumRuneType.values()), filter));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new PropertyRuneType for the given direction values
|
||||
*/
|
||||
public static PropertyRuneType create(String name, Collection values)
|
||||
{
|
||||
return new PropertyRuneType(name, values);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue