本文整理匯總了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;
}