当前位置: 首页>>代码示例>>Java>>正文


Java ForgeDirection.UNKNOWN属性代码示例

本文整理汇总了Java中net.minecraftforge.common.ForgeDirection.UNKNOWN属性的典型用法代码示例。如果您正苦于以下问题:Java ForgeDirection.UNKNOWN属性的具体用法?Java ForgeDirection.UNKNOWN怎么用?Java ForgeDirection.UNKNOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraftforge.common.ForgeDirection的用法示例。


在下文中一共展示了ForgeDirection.UNKNOWN属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFront

/**
 *  Gets the direction the face is at(Opposite to the placer)
 */
public ForgeDirection getFront()
{
	if(direction == 0)//SOUTH PLACE
	{
		return ForgeDirection.NORTH;
	}
	if(direction == 1)//WEST PLACE
	{
		return ForgeDirection.EAST;
	}
	if(direction == 2)//NORTH PLACE
	{
		return ForgeDirection.SOUTH;
	}
	if(direction == 3)//EAST PLACE
	{
		return ForgeDirection.WEST;
	}
	return ForgeDirection.UNKNOWN;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:23,代码来源:TileEntityFurnaceMF.java

示例2: getBack

/**
 *  Gets the direction the back is facing (Same dir as placer)
 */
public ForgeDirection getBack()
{
	if(direction == 0)//SOUTH PLACE
	{
		return ForgeDirection.SOUTH;
	}
	if(direction == 1)//WEST PLACE
	{
		return ForgeDirection.WEST;
	}
	if(direction == 2)//NORTH PLACE
	{
		return ForgeDirection.NORTH;
	}
	if(direction == 3)//EAST PLACE
	{
		return ForgeDirection.EAST;
	}
	return ForgeDirection.UNKNOWN;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:23,代码来源:TileEntityFurnaceMF.java

示例3: getLeft

/**
 *  Gets the direction the left is facing
 */
public ForgeDirection getLeft()
{
	if(direction == 0)//SOUTH PLACE
	{
		return ForgeDirection.WEST;
	}
	if(direction == 1)//WEST PLACE
	{
		return ForgeDirection.NORTH;
	}
	if(direction == 2)//NORTH PLACE
	{
		return ForgeDirection.EAST;
	}
	if(direction == 3)//EAST PLACE
	{
		return ForgeDirection.SOUTH;
	}
	return ForgeDirection.UNKNOWN;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:23,代码来源:TileEntityFurnaceMF.java

示例4: getRight

/**
 *  Gets the direction the right is facing
 */
public ForgeDirection getRight()
{
	if(direction == 0)//SOUTH PLACE
	{
		return ForgeDirection.EAST;
	}
	if(direction == 1)//WEST PLACE
	{
		return ForgeDirection.SOUTH;
	}
	if(direction == 2)//NORTH PLACE
	{
		return ForgeDirection.WEST;
	}
	if(direction == 3)//EAST PLACE
	{
		return ForgeDirection.NORTH;
	}
	return ForgeDirection.UNKNOWN;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:23,代码来源:TileEntityFurnaceMF.java

示例5: rotateBlock

@Override
public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) {
	if (axis == ForgeDirection.UNKNOWN) return false;
	
	int meta = worldObj.getBlockMetadata(x, y, z);
	if (data[meta] == null) return false;
	
	switch (data[meta].facingMode) {
		case None: {
			return false;
		}
		case Horizontal: {
			if (axis.offsetY != 0) return false;
			break;
		}
		// shut up Eclipse
		case All: {}
	}
	
	TileEntity te = worldObj.getBlockTileEntity(x, y, z);
	if (!(te instanceof Tile)) return false;
	
	((Tile) te).setFacing(axis.ordinal());
	
	return true;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:26,代码来源:BlockMultiTile.java

示例6: getAdjacentInventories

/**
 * Searches for inventories adjacent to block, excludes IPowerReceptor
 * 
 * @return
 */
public static IInventory[] getAdjacentInventories(World world, Vect blockPos, ForgeDirection from) {
	ArrayList<IInventory> inventories = new ArrayList<IInventory>();

	for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
		if(from != ForgeDirection.UNKNOWN && from != dir.getOpposite())
			continue;

		TileEntity entity = world.getBlockTileEntity(blockPos.x + dir.offsetX, blockPos.y + dir.offsetY, blockPos.z + dir.offsetZ);
		if (entity != null)
			if (entity instanceof IInventory)
				if (!(entity instanceof IPowerReceptor)) {
					inventories.add((IInventory) entity);
				}
	}

	return inventories.toArray(new IInventory[inventories.size()]);
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:22,代码来源:BlockUtil.java

示例7: getPipeDirections

/**
 * Returns a list of adjacent pipes.
 * 
 * @param world
 * @param blockPos
 * @return
 */
public static ForgeDirection[] getPipeDirections(World world, Vect blockPos, ForgeDirection from) {
	LinkedList<ForgeDirection> possiblePipes = new LinkedList<ForgeDirection>();

	for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
		if(from != ForgeDirection.UNKNOWN && from != dir.getOpposite())
			continue;
		
		Position posPipe = new Position(blockPos.x, blockPos.y, blockPos.z, dir);
		posPipe.moveForwards(1.0);

		TileEntity pipeEntry = world.getBlockTileEntity((int) posPipe.x, (int) posPipe.y, (int) posPipe.z);

		if (pipeEntry instanceof IPipeEntry && ((IPipeEntry) pipeEntry).acceptItems()) {
			if(from != ForgeDirection.UNKNOWN && pipeEntry instanceof IPipeConnection) {
				if(((IPipeConnection)pipeEntry).isPipeConnected(from))
					possiblePipes.add(dir);
			} else
				possiblePipes.add(dir);
		}
	}

	return possiblePipes.toArray(new ForgeDirection[0]);

}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:31,代码来源:BlockUtil.java

示例8: getExtractDirection

public ForgeDirection getExtractDirection()
{
    if (this.extractSide != null)
    {
        return this.extractSide;
    }
    else
    {
        return ForgeDirection.UNKNOWN;
    }
}
 
开发者ID:Maxwolf,项目名称:MC-MineAPI.Java,代码行数:11,代码来源:ContainerTemplate.java

示例9: getInputDirection

public ForgeDirection getInputDirection()
{
    if (this.insertSide != null)
    {
        return this.insertSide;
    }
    else
    {
        return ForgeDirection.UNKNOWN;
    }
}
 
开发者ID:Maxwolf,项目名称:MC-MineAPI.Java,代码行数:11,代码来源:ContainerTemplate.java

示例10: getLeftSide

private ForgeDirection getLeftSide()
{
	switch(direction)
	{
	case 0:
		return ForgeDirection.EAST;
	case 1:
		return ForgeDirection.SOUTH;
	case 2:
		return ForgeDirection.WEST;
	case 3:
		return ForgeDirection.NORTH;
	}
	return ForgeDirection.UNKNOWN;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:15,代码来源:TileEntityRoast.java

示例11: getRightSide

private ForgeDirection getRightSide()
{
	switch(direction)
	{
	case 0:
		return ForgeDirection.WEST;
	case 1:
		return ForgeDirection.NORTH;
	case 2:
		return ForgeDirection.EAST;
	case 3:
		return ForgeDirection.SOUTH;
	}
	return ForgeDirection.UNKNOWN;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:15,代码来源:TileEntityRoast.java

示例12: Position

public Position(NBTTagCompound nbttagcompound) {
	x = nbttagcompound.getDouble("i");
	y = nbttagcompound.getDouble("j");
	z = nbttagcompound.getDouble("k");

	orientation = ForgeDirection.UNKNOWN;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:7,代码来源:Position.java

示例13: getTextureIndex

@Override
public int getTextureIndex(ForgeDirection direction) {
	if (direction == ForgeDirection.UNKNOWN)
		return 0;

	return direction.ordinal() + 1;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:7,代码来源:PipeItemsPropolis.java


注:本文中的net.minecraftforge.common.ForgeDirection.UNKNOWN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。