本文整理汇总了Java中net.minecraftforge.common.util.ForgeDirection.equals方法的典型用法代码示例。如果您正苦于以下问题:Java ForgeDirection.equals方法的具体用法?Java ForgeDirection.equals怎么用?Java ForgeDirection.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.util.ForgeDirection
的用法示例。
在下文中一共展示了ForgeDirection.equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canConnect
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canConnect(ForgeDirection direction, NetworkType type)
{
if (direction == null || direction.equals(ForgeDirection.UNKNOWN))
{
return false;
}
if (type == NetworkType.OXYGEN)
{
return this.getOxygenOutputDirection() == direction.ordinal();
}
if (type == NetworkType.HYDROGEN)
{
return this.getHydrogenOutputDirection() == direction.ordinal();
}
if (type == NetworkType.POWER)
{
return direction == this.getElectricInputDirection();
}
return false;
}
示例2: canConnect
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canConnect(ForgeDirection direction, NetworkType type)
{
if (direction == null || direction.equals(ForgeDirection.UNKNOWN))
{
return false;
}
if (type == NetworkType.OXYGEN)
{
return direction.ordinal() == this.getBlockMetadata() + 2;
}
if (type == NetworkType.POWER)
{
return direction == ForgeDirection.DOWN;
}
return false;
}
示例3: canConnect
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canConnect(ForgeDirection direction, NetworkType type)
{
if (direction == null || direction.equals(ForgeDirection.UNKNOWN))
{
return false;
}
if (type == NetworkType.OXYGEN)
{
return this.getOxygenInputDirections().contains(direction) || this.getOxygenOutputDirections().contains(direction);
}
if (type == NetworkType.POWER)
// return this.nodeAvailable(new EnergySourceAdjacent(direction));
{
return super.canConnect(direction, type);
}
return false;
}
示例4: fill
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
{
int used = 0;
if (from.equals(ForgeDirection.getOrientation(this.getBlockMetadata() + 2)))
{
final String liquidName = FluidRegistry.getFluidName(resource);
if (liquidName != null && liquidName.startsWith("oil"))
{
if (liquidName.equals(GalacticraftCore.fluidOil.getName()))
used = this.oilTank.fill(resource, doFill);
else
used = this.oilTank.fill(new FluidStack(GalacticraftCore.fluidOil, resource.amount), doFill);
}
// else if (liquidName != null && liquidName.equalsIgnoreCase("oilgc"))
// {
// used = this.oilTank.fill(new FluidStack(GalacticraftCore.fluidOil, resource.amount), doFill);
// }
}
return used;
}
示例5: executeAction
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean executeAction(World world, ItemStack wand, EntityPlayer player, int x, int y, int z, int side,
int event) {
int md = world.getBlockMetadata(x, y, z);
BlockInfusedBlockOre block = (BlockInfusedBlockOre) world.getBlock(x, y, z);
if (world.isRemote) {
for (int i = 0; i < 10; i++)
if (md < 6)
UtilsFX.infusedStoneSparkle(world, x, y, z, md + 1);
return false;
} else {
ForgeDirection dir = ForgeDirection.getOrientation(side);
int iX = dir.equals(ForgeDirection.EAST) ? x + 1 : dir.equals(ForgeDirection.WEST) ? x - 1 : x;
int iY = dir.equals(ForgeDirection.UP) ? y + 1 : dir.equals(ForgeDirection.DOWN) ? y - 1 : y;
int iZ = dir.equals(ForgeDirection.SOUTH) ? z + 1 : dir.equals(ForgeDirection.NORTH) ? z - 1 : z;
for (ItemStack item : block.getDropsWand(world, x, y, z, md, player.isSneaking())) {
float f = 0.7F;
double d0 = (double) (world.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double d1 = (double) (world.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double d2 = (double) (world.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(world, (double) iX + d0, (double) iY + d1, (double) iZ + d2,
item);
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
}
world.setBlock(x, y, z, block.getBaseBlock(), block.getBaseMeta(), 2);
return true;
}
}
示例6: canConnect
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canConnect(ForgeDirection direction, NetworkType type)
{
if (direction == null || direction.equals(ForgeDirection.UNKNOWN) || type == NetworkType.OXYGEN)
{
return false;
}
if (type == NetworkType.POWER)
return direction == this.getElectricInputDirection();
//Hydrogen pipe
return direction.equals(ForgeDirection.getOrientation(this.getBlockMetadata() + 2));
}
示例7: canFill
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canFill(ForgeDirection from, Fluid fluid)
{
if (from.equals(ForgeDirection.getOrientation(this.getBlockMetadata() + 2)))
{
//Can fill with gases
return fluid != null && this.getIdFromName(fluid.getName()) > -1;
}
return false;
}
示例8: canDrain
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canDrain(ForgeDirection from, Fluid fluid)
{
if (from.equals(ForgeDirection.getOrientation((this.getBlockMetadata() + 2) ^ 1)))
{
return this.fuelTank.getFluid() != null && this.fuelTank.getFluidAmount() > 0;
}
return false;
}
示例9: drain
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
{
if (from.equals(ForgeDirection.getOrientation((this.getBlockMetadata() + 2) ^ 1)))
{
return this.fuelTank.drain(resource.amount, doDrain);
}
return null;
}
示例10: canFill
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canFill(ForgeDirection from, Fluid fluid)
{
if (from.equals(ForgeDirection.getOrientation(this.getBlockMetadata() + 2)))
{
return this.oilTank.getFluid() == null || this.oilTank.getFluidAmount() < this.oilTank.getCapacity();
}
return false;
}
示例11: canConnect
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canConnect(ForgeDirection direction, NetworkType type)
{
if (direction == null || direction.equals(ForgeDirection.UNKNOWN) || type != NetworkType.POWER)
{
return false;
}
int metadata = this.getBlockMetadata() & 3;
return direction == ForgeDirection.getOrientation(metadata + 2) || direction == ForgeDirection.getOrientation((metadata + 2) ^ 1);
}
示例12: canConnect
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canConnect(ForgeDirection direction, NetworkType type)
{
if (direction == null || direction.equals(ForgeDirection.UNKNOWN) || type != NetworkType.POWER)
{
return false;
}
return direction == this.getElectricalOutputDirectionMain();
}
示例13: fill
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
{
int used = 0;
if (from.equals(ForgeDirection.getOrientation(this.getBlockMetadata() + 2).getOpposite()))
{
if (FluidUtil.testFuel(FluidRegistry.getFluidName(resource)))
{
used = this.fuelTank.fill(resource, doFill);
}
}
return used;
}
示例14: canConnect
import net.minecraftforge.common.util.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean canConnect(ForgeDirection direction, NetworkType type)
{
if (direction == null || direction.equals(ForgeDirection.UNKNOWN) || type != NetworkType.POWER)
{
return false;
}
return direction == this.getElectricInputDirection();
}
示例15: 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;
}