本文整理汇总了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;
}
}
示例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;
}
示例3: randDir
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
private ForgeDirection randDir(Random rand)
{
return ForgeDirection.values()[rand.nextInt(ForgeDirection.VALID_DIRECTIONS.length)];
}
示例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;
}
示例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")];
}
示例6: randDir
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
private ForgeDirection randDir(Random rand) {
return ForgeDirection.values()[rand.nextInt(ForgeDirection.VALID_DIRECTIONS.length)];
}