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


Java ForgeDirection.equals方法代码示例

本文整理汇总了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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:26,代码来源:TileEntityElectrolyzer.java

示例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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:TileEntityGasLiquefier.java

示例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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:TileEntityOxygen.java

示例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;
    }
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:TileEntityRefinery.java

示例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;
	}
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:31,代码来源:TOInfusedOreWandTrigger.java

示例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)); 
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:15,代码来源:TileEntityMethaneSynthesizer.java

示例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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:12,代码来源:TileEntityGasLiquefier.java

示例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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:TileEntityRefinery.java

示例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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:TileEntityRefinery.java

示例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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:TileEntityRefinery.java

示例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);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:13,代码来源:TileEntityEnergyStorageModule.java

示例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();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:TileEntityCoalGenerator.java

示例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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:16,代码来源:TileEntityFuelLoader.java

示例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();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:TileBaseElectricBlock.java

示例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;
}
 
开发者ID:Avaja,项目名称:OpenTechnology,代码行数:10,代码来源:Utils.java


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