net.minecraft.util.EnumFacing#getFront ( )源码实例Demo

下面列出了net.minecraft.util.EnumFacing#getFront ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: TofuCraftReload   文件: BlockTofuStation.java
public IBlockState getStateFromMeta(int meta) {
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y) {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码2 项目: TofuCraftReload   文件: BlockAdvancedAggregator.java
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码3 项目: TofuCraftReload   文件: BlockAggregator.java
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码4 项目: TofuCraftReload   文件: BlockTFCrasher.java
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码5 项目: TofuCraftReload   文件: BlockTFCompressor.java
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码6 项目: Sakura_mod   文件: BlockBarrelDistillation.java
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);
	
    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }
	
    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码7 项目: Sakura_mod   文件: BlockBarrel.java
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);
	
    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }
	
    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码8 项目: EmergingTechnology   文件: Ladder.java
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码9 项目: Cyberware   文件: BlockBlueprintArchive.java
@Override
public IBlockState getStateFromMeta(int meta)
{
	EnumFacing enumfacing = EnumFacing.getFront(meta);

	if (enumfacing.getAxis() == EnumFacing.Axis.Y)
	{
		enumfacing = EnumFacing.NORTH;
	}

	return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码10 项目: Cyberware   文件: BlockBeaconLarge.java
@Override
public IBlockState getStateFromMeta(int meta)
{
	EnumFacing enumfacing = EnumFacing.getFront(meta);

	if (enumfacing.getAxis() == EnumFacing.Axis.Y)
	{
		enumfacing = EnumFacing.NORTH;
	}

	return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码11 项目: Cyberware   文件: BlockComponentBox.java
@Override
public IBlockState getStateFromMeta(int meta)
{
	EnumFacing enumfacing = EnumFacing.getFront(meta);

	if (enumfacing.getAxis() == EnumFacing.Axis.Y)
	{
		enumfacing = EnumFacing.NORTH;
	}

	return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码12 项目: Cyberware   文件: BlockBeacon.java
@Override
public IBlockState getStateFromMeta(int meta)
{
	EnumFacing enumfacing = EnumFacing.getFront(meta);

	if (enumfacing.getAxis() == EnumFacing.Axis.Y)
	{
		enumfacing = EnumFacing.NORTH;
	}

	return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
源代码13 项目: Logistics-Pipes-2   文件: TileGenericPipe.java
protected void network() {
	for(int i=0; i<6; i++) {
		EnumFacing direction = EnumFacing.getFront(i);
		
		if(getConnection(direction) == ConnectionTypes.PIPE) {
			TileGenericPipe target = ConnectionHelper.getAdjacentPipe(world, pos, direction);
			//First network contact
			if(target.hasNetwork() && !hasNetwork) {
				//LogisticsPipes2.logger.log(Level.INFO, String.format("Attempting to connect Generic Pipe %1$s %2$s to %3$s %4$s", nodeID.toString(), (hasNetwork ? " with network" : " without network"), target.getBlockType().toString(), (target.hasNetwork ? " with network." : " without network.")));
				nodeID = target.network.subscribeNode(this);//Subscribe to network
				LogisticsPipes2.logger.log(Level.INFO, "Added TileGenericPipe " + nodeID.toString() + " to Network: " + network.getName());
				hasNetwork=true;
				
				network.getNodeByID(target.nodeID).addNeighbor(network.getNodeByID(nodeID), direction.getOpposite().getIndex());//Tell target node he has a new neighbor
				network.getNodeByID(nodeID).addNeighbor(network.getNodeByID(target.nodeID), direction.getIndex());//Add the Target as my neighbor
				network.recalculateNetwork();
				continue;
			}
			//Notify other Neighbors of our presence
			if(target.hasNetwork && hasNetwork) {
				LogisticsPipes2.logger.log(Level.INFO, "Notified GenericPipe " + target.nodeID.toString() + " of presence of: " + nodeID.toString());
				network.getNodeByID(target.nodeID).addNeighbor(network.getNodeByID(nodeID), direction.getOpposite().getIndex());//Tell target node he has a new neighbor
				network.getNodeByID(nodeID).addNeighbor(network.getNodeByID(target.nodeID), direction.getIndex());//Add the Target as my neighbor
				network.recalculateNetwork();
				continue;
			}
		}
	}
}
 
源代码14 项目: Production-Line   文件: MessageBlockDisplayState.java
@Override
@SideOnly(Side.CLIENT)
protected IMessage handlerMessage(MessageBase message, MessageContext ctx) {
    WorldClient world = Minecraft.getMinecraft().world;
    BlockPos pos = BlockPos.fromLong(message.nbt.getLong("pos"));
    TileFacing tilePL = (TileFacing) world.getTileEntity(pos);
    if (tilePL != null) {
        tilePL.active = message.nbt.getBoolean("active");
        tilePL.facing = EnumFacing.getFront(message.nbt.getShort("facing"));
        world.scheduleUpdate(pos, world.getBlockState(pos).getBlock(), 0);
    }
    return null;
}
 
源代码15 项目: Production-Line   文件: BlockPL.java
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta) {
    if (this instanceof IOrientableBlock) {
        EnumFacing enumfacing = EnumFacing.getFront(meta);
        if (enumfacing.getAxis() == EnumFacing.Axis.Y) {
            enumfacing = EnumFacing.NORTH;
        }
        return this.getDefaultState().withProperty(PROPERTY_FACING, enumfacing);
    }
    else {
        return super.getStateFromMeta(meta);
    }
}
 
源代码16 项目: Production-Line   文件: TileFacing.java
@Override
public void readFromNBT(NBTTagCompound nbt) {
    super.readFromNBT(nbt);
    this.facing = EnumFacing.getFront(nbt.getShort("facing"));
    this.active = nbt.getBoolean("active");

}
 
源代码17 项目: AdvancedRocketry   文件: WorldGenAlienTree.java
private void generatePod(World world, Random random, int intitalDist, int x, int y, int z, int dirX, int dirZ) {
	int branchLength = random.nextInt(5) + intitalDist;

	EnumFacing direction = EnumFacing.getFront((dirX != 0 && dirZ != 0) ? Math.abs(dirX)*4 : Math.abs(dirX)*4 + Math.abs(dirZ)*8);

	boolean flag = true;

	for(int l = 0; l < branchLength && flag; l++) {
		int newX = x + (dirX*l);
		int newY = l >= branchLength/2 ? y + 2 : y;
		int newZ = z + (dirZ*l);

		flag = flag && this.replaceBlockWithWood(world, newX, newY, newZ, direction);
		flag = flag && this.replaceBlockWithWood(world, newX, newY - 1, newZ, direction);
		flag = flag && this.replaceBlockWithWood(world, newX + dirZ, newY, newZ + dirX, direction);
		flag = flag && this.replaceBlockWithWood(world, newX + dirZ, newY - 1, newZ + dirX, direction);
	}

	int radius = 4;

	for(int offX = -radius; offX < radius; offX++) {
		for(int offY = -radius; offY < radius; offY++) {
			for(int offZ = -radius; offZ < radius; offZ++) {
				if(offX*offX + offY*offY + offZ*offZ < radius*radius + 1)
					replaceAirWithLeaves(world, x + offX + (dirX*branchLength), y + offY + 1, z + offZ + (dirZ*branchLength));
			}
		}
	}

}
 
源代码18 项目: ClientBase   文件: WrapperEnumFacing.java
public static WrapperEnumFacing getFront(int var0) {
    return new WrapperEnumFacing(EnumFacing.getFront(var0));
}
 
源代码19 项目: ExtraCells1   文件: BlockMEDropper.java
public static EnumFacing getFacing(int metadata)
{
	return EnumFacing.getFront(metadata);
}
 
源代码20 项目: Artifacts   文件: BlockTrap.java
public static EnumFacing getFacing(int par0)
{
    return EnumFacing.getFront(par0 & 7);
}