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


Java ForgeDirection.values方法代码示例

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


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

示例1: checkForCargoEntity

import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
public void checkForCargoEntity()
{
    boolean foundFuelable = false;

    for (final ForgeDirection dir : ForgeDirection.values())
    {
        if (dir != ForgeDirection.UNKNOWN)
        {
            final TileEntity pad = new BlockVec3(this).getTileEntityOnSide(this.worldObj, dir);

            if (pad != null && pad instanceof TileEntityMulti)
            {
               	final TileEntity mainTile = ((TileEntityMulti)pad).getMainBlockTile();

                if (mainTile instanceof ICargoEntity)
                {
                    this.attachedFuelable = (ICargoEntity) mainTile;
                    foundFuelable = true;
                    break;
                }
            }
            else if (pad != null && pad instanceof ICargoEntity)
            {
                this.attachedFuelable = (ICargoEntity) pad;
                foundFuelable = true;
                break;
            }
        }
    }

    if (!foundFuelable)
    {
        this.attachedFuelable = null;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:36,代码来源:TileEntityCargoUnloader.java

示例2: getForgeDirectionId

import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
public static int getForgeDirectionId(ForgeDirection forgeDirection){
    int id = 0;
    for(ForgeDirection direction : ForgeDirection.values()){
        if(direction.equals(forgeDirection))
            return id;
        id++;
    }
    return 7;
}
 
开发者ID:Avaja,项目名称:OpenTechnology,代码行数:10,代码来源:Utils.java

示例3: randDir

import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
private ForgeDirection randDir(Random rand)
{
    return ForgeDirection.values()[rand.nextInt(ForgeDirection.VALID_DIRECTIONS.length)];
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:MapGenDungeon.java

示例4: onBlockActivated

import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
    final TileEntityOxygenPipe tileEntity = (TileEntityOxygenPipe) par1World.getTileEntity(x, y, z);

    if (!par1World.isRemote)
    {
        final ItemStack stack = par5EntityPlayer.inventory.getCurrentItem();

        if (stack != null)
        {
            if (stack.getItem() instanceof ItemDye)
            {
                final int dyeColor = par5EntityPlayer.inventory.getCurrentItem().getItemDamageForDisplay();

                final byte colorBefore = tileEntity.getColor();

                tileEntity.setColor((byte) dyeColor);

                if (colorBefore != (byte) dyeColor && !par5EntityPlayer.capabilities.isCreativeMode && --par5EntityPlayer.inventory.getCurrentItem().stackSize == 0)
                {
                    par5EntityPlayer.inventory.mainInventory[par5EntityPlayer.inventory.currentItem] = null;
                }

                if (colorBefore != (byte) dyeColor && colorBefore != 15)
                {
                    final float f = 0.7F;
                    final double d0 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5D;
                    final double d1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.2D + 0.6D;
                    final double d2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5D;
                    final EntityItem entityitem = new EntityItem(par1World, x + d0, y + d1, z + d2, new ItemStack(Items.dye, 1, colorBefore));
                    entityitem.delayBeforeCanPickup = 10;
                    par1World.spawnEntityInWorld(entityitem);
                }

                //					GCCorePacketManager.sendPacketToClients(GCCorePacketManager.getPacket(GalacticraftCore.CHANNELENTITIES, tileEntity, tileEntity.getColor(), (byte) -1)); TODO Fix pipe color

                BlockVec3 tileVec = new BlockVec3(tileEntity);
                for (final ForgeDirection dir : ForgeDirection.values())
                {
                    final TileEntity tileAt = tileVec.getTileEntityOnSide(tileEntity.getWorldObj(), dir);

                    if (tileAt != null && tileAt instanceof IColorable)
                    {
                        ((IColorable) tileAt).onAdjacentColorChanged(dir);
                    }
                }

                return true;
            }

        }

    }

    return false;

}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:59,代码来源:BlockOxygenPipe.java

示例5: readFromNBT

import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound nbttagcompound) {
	x = nbttagcompound.getDouble("i");
	y = nbttagcompound.getDouble("j");
	z = nbttagcompound.getDouble("k");
	orientation = ForgeDirection.values() [nbttagcompound.getByte("orientation")];
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:7,代码来源:Position.java

示例6: randDir

import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
private ForgeDirection randDir(Random rand) {
	return ForgeDirection.values()[rand.nextInt(ForgeDirection.VALID_DIRECTIONS.length)];
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:4,代码来源:DungeonMapGen.java


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