本文整理汇总了Java中net.minecraft.tileentity.TileEntityChest.checkForAdjacentChests方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntityChest.checkForAdjacentChests方法的具体用法?Java TileEntityChest.checkForAdjacentChests怎么用?Java TileEntityChest.checkForAdjacentChests使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.tileentity.TileEntityChest
的用法示例。
在下文中一共展示了TileEntityChest.checkForAdjacentChests方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIcon
import net.minecraft.tileentity.TileEntityChest; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess w, int x, int y, int z, int side) {
// TODO: Might want to get rid of the seam on the top & bottom of joined chests
if (side == 0 || side == 1) return top;
int face = w.getBlockMetadata(x, y, z);
if (side == face || side == (face ^ 1)) {
ForgeDirection dir = ForgeDirection.getOrientation(side);
boolean back = false;
if (side != face) {
dir = dir.getOpposite();
back = true;
}
TileEntity te = w.getTileEntity(x, y, z);
if (!(te instanceof TileEntityChest)) return back ? this.side : front;
TileEntityChest chest = (TileEntityChest) te;
chest.checkForAdjacentChests();
if (dir == ForgeDirection.WEST) {
if (chest.adjacentChestZNeg != null) return back ? back_left : front_right;
if (chest.adjacentChestZPos != null) return back ? back_right : front_left;
}
if (dir == ForgeDirection.EAST) {
if (chest.adjacentChestZNeg != null) return back ? back_right : front_left;
if (chest.adjacentChestZPos != null) return back ? back_left : front_right;
}
if (dir == ForgeDirection.NORTH) {
if (chest.adjacentChestXNeg != null) return back ? back_right : front_left;
if (chest.adjacentChestXPos != null) return back ? back_left : front_right;
}
if (dir == ForgeDirection.SOUTH) {
if (chest.adjacentChestXNeg != null) return back ? back_left : front_right;
if (chest.adjacentChestXPos != null) return back ? back_right : front_left;
}
return back ? this.side : front;
}
return this.side;
}