當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。