當前位置: 首頁>>代碼示例>>Java>>正文


Java TileEntityChest.checkForAdjacentChests方法代碼示例

本文整理匯總了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;
}
 
開發者ID:purpleposeidon,項目名稱:CyclopeanChests,代碼行數:40,代碼來源:ChestReplacement.java


注:本文中的net.minecraft.tileentity.TileEntityChest.checkForAdjacentChests方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。