当前位置: 首页>>代码示例>>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;未经允许,请勿转载。