本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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()]);
}
示例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]);
}
示例8: getExtractDirection
public ForgeDirection getExtractDirection()
{
if (this.extractSide != null)
{
return this.extractSide;
}
else
{
return ForgeDirection.UNKNOWN;
}
}
示例9: getInputDirection
public ForgeDirection getInputDirection()
{
if (this.insertSide != null)
{
return this.insertSide;
}
else
{
return ForgeDirection.UNKNOWN;
}
}
示例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;
}
示例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;
}
示例12: Position
public Position(NBTTagCompound nbttagcompound) {
x = nbttagcompound.getDouble("i");
y = nbttagcompound.getDouble("j");
z = nbttagcompound.getDouble("k");
orientation = ForgeDirection.UNKNOWN;
}
示例13: getTextureIndex
@Override
public int getTextureIndex(ForgeDirection direction) {
if (direction == ForgeDirection.UNKNOWN)
return 0;
return direction.ordinal() + 1;
}