当前位置: 首页>>代码示例>>Java>>正文


Java BlockHopper.getDirectionFromMetadata方法代码示例

本文整理汇总了Java中net.minecraft.block.BlockHopper.getDirectionFromMetadata方法的典型用法代码示例。如果您正苦于以下问题:Java BlockHopper.getDirectionFromMetadata方法的具体用法?Java BlockHopper.getDirectionFromMetadata怎么用?Java BlockHopper.getDirectionFromMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.BlockHopper的用法示例。


在下文中一共展示了BlockHopper.getDirectionFromMetadata方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_145883_k

import net.minecraft.block.BlockHopper; //导入方法依赖的package包/类
private boolean func_145883_k()
{
    TileEntityBlockChristmasPresents_Red iinventory = (TileEntityBlockChristmasPresents_Red) this.func_145895_l();

    if (iinventory == null)
    {
        return false;
    }
    else
    {
        int i = Facing.oppositeSide[BlockHopper.getDirectionFromMetadata(this.getBlockMetadata())];

        if (this.func_152102_a((IInventory) iinventory, i))
        {
            return false;
        }
        else
        {
            for (int j = 0; j < this.getSizeInventory(); ++j)
            {
                if (this.getStackInSlot(j) != null)
                {
                    ItemStack itemstack = this.getStackInSlot(j).copy();
                    ItemStack itemstack1 = func_145889_a(iinventory, this.decrStackSize(j, 1), i);

                    if (itemstack1 == null || itemstack1.stackSize == 0)
                    {
                        iinventory.markDirty();
                        return true;
                    }

                    this.setInventorySlotContents(j, itemstack);
                }
            }

            return false;
        }
    }
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:40,代码来源:TileEntityBlockChristmasPresents_Red.java

示例2: func_145883_k

import net.minecraft.block.BlockHopper; //导入方法依赖的package包/类
private boolean func_145883_k()
{
    IInventory iinventory = this.func_145895_l();

    if (iinventory == null)
    {
        return false;
    }
    else
    {
        int i = Facing.oppositeSide[BlockHopper.getDirectionFromMetadata(this.getBlockMetadata())];

        if (this.func_152102_a(iinventory, i))
        {
            return false;
        }
        else
        {
            for (int j = 0; j < this.getSizeInventory(); ++j)
            {
                if (this.getStackInSlot(j) != null)
                {
                    ItemStack itemstack = this.getStackInSlot(j).copy();
                    ItemStack itemstack1 = func_145889_a(iinventory, this.decrStackSize(j, 1), i);

                    if (itemstack1 == null || itemstack1.stackSize == 0)
                    {
                        iinventory.markDirty();
                        return true;
                    }

                    this.setInventorySlotContents(j, itemstack);
                }
            }

            return false;
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:40,代码来源:TileEntityHopper.java

示例3: func_145895_l

import net.minecraft.block.BlockHopper; //导入方法依赖的package包/类
private IInventory func_145895_l()
{
    int i = BlockHopper.getDirectionFromMetadata(this.getBlockMetadata());
    return func_145893_b(this.getWorldObj(), (double)(this.xCoord + Facing.offsetsXForSide[i]), (double)(this.yCoord + Facing.offsetsYForSide[i]), (double)(this.zCoord + Facing.offsetsZForSide[i]));
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:6,代码来源:TileEntityBlockChristmasPresents_Red.java

示例4: renderTileEntityAt

import net.minecraft.block.BlockHopper; //导入方法依赖的package包/类
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
    this.model.backConnected = this.model.frontConnected = this.model.leftConnected = this.model.rightConnected = false;

    if (tileEntity.hasWorldObj()) {
        boolean connect;
        int x1 = tileEntity.xCoord;
        int y1 = tileEntity.yCoord;
        int z1 = tileEntity.zCoord;

        for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
            connect = false;
            if (direction == ForgeDirection.UP || direction == ForgeDirection.DOWN) {
                continue;
            }

            Block block = tileEntity.getWorldObj().getBlock(x1 + direction.offsetX, y1 + direction.offsetY, z1 + direction.offsetZ);
            TileEntity te = tileEntity.getWorldObj().getTileEntity(x1 + direction.offsetX, y1 + direction.offsetY, z1 + direction.offsetZ);

            if (block == null) {
                continue;
            }

            if (block.isSideSolid(tileEntity.getWorldObj(), x1 + direction.offsetX, y1 + direction.offsetY, z1 + direction.offsetZ, ForgeDirection.getOrientation(ForgeDirection.OPPOSITES[direction.ordinal()]))) {
                connect = true;
            }

            if (block instanceof BlockHopper && BlockHopper.getDirectionFromMetadata(tileEntity.getWorldObj().getBlockMetadata(x1 + direction.offsetX, y1 + direction.offsetY, z1 + direction.offsetZ)) == Facing.oppositeSide[direction.ordinal()]) {
                connect = true;
            }

            if (te instanceof IItemDuct || BlockHelper.isBlockPipe(te, direction)) {
                connect = true;
            }

            if (connect) {
                switch (direction) {
                case NORTH:
                    model.frontConnected = true;
                    break;
                case SOUTH:
                    model.backConnected = true;
                    break;
                case EAST:
                    model.rightConnected = true;
                    break;
                case WEST:
                    model.leftConnected = true;
                    break;
                }
            }
        }
    }

    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    GL11.glRotatef(180, 0F, 0F, 1F);

    this.bindTexture(texture);

    GL11.glPushMatrix();
    this.model.renderModel(0.0625F);
    this.model.renderSkull(0.0625F);
    GL11.glPopMatrix();
    GL11.glPopMatrix();
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:67,代码来源:PlayerInterfaceRenderer.java

示例5: getOutputInventory

import net.minecraft.block.BlockHopper; //导入方法依赖的package包/类
/**
 * Gets the inventory the hopper is pointing at.
 */
private IInventory getOutputInventory()
{
    int i = BlockHopper.getDirectionFromMetadata(this.getBlockMetadata());
    return getInventoryAtLocation(this.getWorldObj(), (double)(this.xCoord + Facing.offsetsXForSide[i]), (double)(this.yCoord + Facing.offsetsYForSide[i]), (double)(this.zCoord + Facing.offsetsZForSide[i]));
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:TileEntityHopper.java


注:本文中的net.minecraft.block.BlockHopper.getDirectionFromMetadata方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。