Java 类net.minecraft.block.properties.PropertyDirection 实例源码

项目:NeptuneCommon    文件:NeptuneBlockProperty.java   
public static BlockProperty of(IProperty property) {
    if (property instanceof PropertyBool) {
        return new NeptuneBlockBooleanProperty((PropertyBool) property);
    } else if (property instanceof PropertyDirection) {
        return new NeptuneBlockDirectionProperty((PropertyDirection) property);
    } else if (property instanceof PropertyEnum) {
        return new NeptuneBlockEnumProperty((PropertyEnum) property);
    } else if (property instanceof PropertyInteger) {
        return new NeptuneBlockIntegerProperty((PropertyInteger) property);
    }
    return new NeptuneBlockProperty(property);
}
项目:NeptuneMod    文件:NeptuneBlockProperty.java   
public static BlockProperty of(IProperty property) {
    if (property instanceof PropertyBool) {
        return new NeptuneBlockBooleanProperty((PropertyBool) property);
    } else if (property instanceof PropertyDirection) {
        return new NeptuneBlockDirectionProperty((PropertyDirection) property);
    } else if (property instanceof PropertyEnum) {
        return new NeptuneBlockEnumProperty((PropertyEnum) property);
    } else if (property instanceof PropertyInteger) {
        return new NeptuneBlockIntegerProperty((PropertyInteger) property);
    }
    return new NeptuneBlockProperty(property);
}
项目:EnderIO    文件:PaintUtil.java   
public static IBlockState rotate(@Nonnull IBlockState paintSource) {
  // TODO: Need to handle cases like stairs that have 'upper' and 'lower' so they are included in the rotation
  // cycle
  for (IProperty<?> prop : paintSource.getPropertyKeys()) {
    if (prop instanceof PropertyDirection) {
      return paintSource.cycleProperty(prop);
    } else if (prop == BlockSlab.HALF) {
      return paintSource.cycleProperty(prop);
    }
  }
  if (paintSource.getBlock() instanceof BlockLog) {
    return paintSource.cycleProperty(BlockLog.LOG_AXIS);
  }
  return paintSource;
}
项目:customstuff4    文件:BlockOrientableVertical.java   
@Override
protected PropertyDirection getFacingProperty()
{
    return FACING;
}
项目:customstuff4    文件:BlockOrientableHorizontalWithSubtypes.java   
@Override
protected PropertyDirection getFacingProperty()
{
    return FACING;
}
项目:customstuff4    文件:BlockOrientableDirectionalWithSubtypes.java   
@Override
protected PropertyDirection getFacingProperty()
{
    return FACING;
}
项目:customstuff4    文件:BlockOrientableDirectional.java   
@Override
protected PropertyDirection getFacingProperty()
{
    return FACING;
}
项目:customstuff4    文件:BlockOrientableHorizontal.java   
@Override
protected PropertyDirection getFacingProperty()
{
    return FACING;
}
项目:customstuff4    文件:BlockOrientableVerticalWithSubtypes.java   
@Override
protected PropertyDirection getFacingProperty()
{
    return FACING;
}
项目:ToroQuest    文件:BlockMap.java   
private void parsePaleteBlockParameter(String blockname, String propertyString, PaletteEntry entry) {
    String[] aProp = propertyString.split(":");

    if (aProp.length != 2) {
        return;
    }

    IProperty prop = null;
    EnumFacing value = null;

    if ("facing".equals(aProp[0])) {
        // 

        // prop = PropertyDirection.create("facing", new Predicate() {
        // };<EnumFacing><EnumFacing>();


        if(blockname.equals("minecraft:torch")){
            prop = PropertyDirection.create("facing", new Predicate<EnumFacing>() {
                public boolean apply(EnumFacing p_apply_1_) {
                    return p_apply_1_ != EnumFacing.DOWN;
                }
            });
            //FIXME
            //return;
        }else{
            prop = BlockHorizontal.FACING;
        }


    } // PropertyDirection

    if ("north".equals(aProp[1])) {
        value = EnumFacing.NORTH;
    } else if ("south".equals(aProp[1])) {
        value = EnumFacing.SOUTH;
    }



    if (value == null || prop == null) {
        return;
    }

    System.out.println("adding property [" + aProp[0] + "] [" + aProp[1] + "]");

    entry.block = entry.block.withProperty(prop, value);
}
项目:Toms-Mod    文件:TomsModUtils.java   
public static IBlockState getBlockStateFromMeta(int meta, PropertyInteger propState, PropertyDirection propDir, IBlockState defState, int max) {
    EnumFacing facing = EnumFacing.NORTH;
    int state = 0;
    switch (meta) {
    case 0:
        break;
    case 1:
        facing = EnumFacing.SOUTH;
        break;
    case 2:
        facing = EnumFacing.EAST;
        break;
    case 3:
        facing = EnumFacing.WEST;
        break;
    case 4:
        state = 1;
        break;
    case 5:
        state = 1;
        facing = EnumFacing.SOUTH;
        break;
    case 6:
        state = 1;
        facing = EnumFacing.EAST;
        break;
    case 7:
        state = 1;
        facing = EnumFacing.WEST;
        break;
    case 8:
        state = 2;
        break;
    case 9:
        state = 2;
        facing = EnumFacing.SOUTH;
        break;
    case 10:
        state = 2;
        facing = EnumFacing.EAST;
        break;
    case 11:
        state = 2;
        facing = EnumFacing.WEST;
        break;
    case 12:
        state = 3;
        break;
    case 13:
        state = 3;
        facing = EnumFacing.SOUTH;
        break;
    case 14:
        state = 3;
        facing = EnumFacing.EAST;
        break;
    case 15:
        state = 3;
        facing = EnumFacing.WEST;
        break;
    default:
        break;
    }
    return defState.withProperty(propState, Math.min(state, max)).withProperty(propDir, facing);
}
项目:HazardousResearch    文件:BlockMachineBase.java   
protected BlockStateContainer createBlockState()
{
    FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
    ACTIVE = PropertyBool.create("active");
    return new BlockStateContainer(this, FACING, ACTIVE);
}
项目:ClockworkPhase2    文件:CustomProperties.java   
public static void init()
{
    ArrayList<EnumFacing> directions = new ArrayList<EnumFacing>();
    Collections.addAll(directions, EnumFacing.HORIZONTALS);
    FACING_HORIZONTAL = PropertyDirection.create("horizontal_facing", directions);
}
项目:NeptuneCommon    文件:NeptuneBlockDirectionProperty.java   
public NeptuneBlockDirectionProperty(PropertyDirection handle) {
    super(handle);
}
项目:NeptuneCommon    文件:NeptuneBlockDirectionProperty.java   
@Override
public PropertyDirection getHandle() {
    return (PropertyDirection) super.getHandle();
}
项目:AllPI    文件:BlockPropertyUtils.java   
public static EnumFacing getBlockProperty(World par1World, BlockPos pos, PropertyDirection property) {
    return (EnumFacing) par1World.getBlockState(pos).getValue(property);
}
项目:AllPI    文件:BlockPropertyUtils.java   
public static EnumFacing getBlockProperty(World par1World, int par2, int par3, int par4, PropertyDirection property) {
    return (EnumFacing) par1World.getBlockState(new BlockPos(par2, par3, par4)).getValue(property);
}
项目:NeptuneMod    文件:NeptuneBlockDirectionProperty.java   
protected NeptuneBlockDirectionProperty(PropertyDirection handle) {
    super(handle);
}
项目:NeptuneMod    文件:NeptuneBlockDirectionProperty.java   
@Override
public PropertyDirection getHandle() {
    return (PropertyDirection) super.getHandle();
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, BlockPos pos, PropertyDirection property) {
    return par1World.getBlockState(pos).getValue(property);
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, int par2, int par3, int par4, PropertyDirection property) {
    return par1World.getBlockState(new BlockPos(par2, par3, par4)).getValue(property);
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, BlockPos pos, PropertyDirection property) {
    return par1World.getBlockState(pos).getValue(property);
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, int par2, int par3, int par4, PropertyDirection property) {
    return par1World.getBlockState(new BlockPos(par2, par3, par4)).getValue(property);
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, BlockPos pos, PropertyDirection property) {
    return (EnumFacing) par1World.getBlockState(pos).getValue(property);
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, int par2, int par3, int par4, PropertyDirection property) {
    return (EnumFacing) par1World.getBlockState(new BlockPos(par2, par3, par4)).getValue(property);
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, BlockPos pos, PropertyDirection property) {
    return par1World.getBlockState(pos).getValue(property);
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, int par2, int par3, int par4, PropertyDirection property) {
    return par1World.getBlockState(new BlockPos(par2, par3, par4)).getValue(property);
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, BlockPos pos, PropertyDirection property) {
    return par1World.getBlockState(pos).getValue(property);
}
项目:SecurityCraft    文件:BlockUtils.java   
public static EnumFacing getBlockProperty(World par1World, int par2, int par3, int par4, PropertyDirection property) {
    return par1World.getBlockState(new BlockPos(par2, par3, par4)).getValue(property);
}
项目:customstuff4    文件:BlockOrientable.java   
protected abstract PropertyDirection getFacingProperty();