當前位置: 首頁>>代碼示例>>Java>>正文


Java FluidRegistry.LAVA屬性代碼示例

本文整理匯總了Java中net.minecraftforge.fluids.FluidRegistry.LAVA屬性的典型用法代碼示例。如果您正苦於以下問題:Java FluidRegistry.LAVA屬性的具體用法?Java FluidRegistry.LAVA怎麽用?Java FluidRegistry.LAVA使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraftforge.fluids.FluidRegistry的用法示例。


在下文中一共展示了FluidRegistry.LAVA屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: test_extractFluidsFromTanks

@Test
public void test_extractFluidsFromTanks()
{
    FluidTank tank1 = new FluidTank(FluidRegistry.WATER, 1000, 10000);
    FluidTank tank2 = new FluidTank(FluidRegistry.LAVA, 1000, 10000);

    ItemHelper.extractFluidsFromTanks(Lists.newArrayList(tank1, tank2),
                                      Lists.newArrayList(FluidRegistry.getFluidStack("water", 400),
                                                         FluidRegistry.getFluidStack("lava", 300)));

    assertEquals(600, tank1.getFluidAmount());
    assertEquals(700, tank2.getFluidAmount());

    ItemHelper.extractFluidsFromTanks(Lists.newArrayList(tank1, tank2),
                                      Lists.newArrayList(FluidRegistry.getFluidStack("lava", 400),
                                                         FluidRegistry.getFluidStack("water", 300)));

    assertEquals(300, tank1.getFluidAmount());
    assertEquals(300, tank2.getFluidAmount());
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:20,代碼來源:ItemHelperTests.java

示例2: getFluid

@Nullable
public FluidStack getFluid()
{
    Item item = container.getItem();
    if (item == Items.WATER_BUCKET)
    {
        return new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME);
    }
    else if (item == Items.LAVA_BUCKET)
    {
        return new FluidStack(FluidRegistry.LAVA, Fluid.BUCKET_VOLUME);
    }
    else if (item == Items.MILK_BUCKET)
    {
        return FluidRegistry.getFluidStack("milk", Fluid.BUCKET_VOLUME);
    }
    else if (item == ForgeModContainer.getInstance().universalBucket)
    {
        return ForgeModContainer.getInstance().universalBucket.getFluid(container);
    }
    else
    {
        return null;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:25,代碼來源:FluidBucketWrapper.java

示例3: setFluid

protected void setFluid(Fluid fluid) {
    if (fluid == null)
    {
        container.deserializeNBT(new ItemStack(Items.BUCKET).serializeNBT());
    }
    else if (fluid == FluidRegistry.WATER)
    {
        container.deserializeNBT(new ItemStack(Items.WATER_BUCKET).serializeNBT());
    }
    else if (fluid == FluidRegistry.LAVA)
    {
        container.deserializeNBT(new ItemStack(Items.LAVA_BUCKET).serializeNBT());
    }
    else if (fluid.getName().equals("milk"))
    {
        container.deserializeNBT(new ItemStack(Items.MILK_BUCKET).serializeNBT());
    }
    else if (FluidRegistry.isUniversalBucketEnabled() && FluidRegistry.getBucketFluids().contains(fluid))
    {
        ItemStack filledBucket = UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, fluid);
        container.deserializeNBT(filledBucket.serializeNBT());
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:23,代碼來源:FluidBucketWrapper.java

示例4: getStack

@Nullable
private FluidStack getStack(IBlockState blockState)
{
    Material material = blockState.getMaterial();
    if (material == Material.WATER && blockState.getValue(BlockLiquid.LEVEL) == 0)
    {
        return new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME);
    }
    else if (material == Material.LAVA && blockState.getValue(BlockLiquid.LEVEL) == 0)
    {
        return new FluidStack(FluidRegistry.LAVA, Fluid.BUCKET_VOLUME);
    }
    else
    {
        return null;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:17,代碼來源:BlockLiquidWrapper.java

示例5: getFluid

public Fluid getFluid() {
    Fluid fluid = FluidRegistry.lookupFluidForBlock(getBlockState().getBlock());
    if (fluid != null) return fluid;
    else if (getBlockState().getBlock() == Blocks.FLOWING_LAVA) return FluidRegistry.LAVA;
    else if (getBlockState().getBlock() == Blocks.FLOWING_WATER) return FluidRegistry.WATER;
    return null;
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:7,代碼來源:HeatBehaviourLiquid.java

示例6: canFillFluidType

public boolean canFillFluidType(FluidStack fluid)
{
    if (fluid.getFluid() == FluidRegistry.WATER || fluid.getFluid() == FluidRegistry.LAVA || fluid.getFluid().getName().equals("milk"))
    {
        return true;
    }
    return FluidRegistry.isUniversalBucketEnabled() && FluidRegistry.getBucketFluids().contains(fluid.getFluid());
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:8,代碼來源:FluidBucketWrapper.java

示例7: getFuelEnergyValue

@Override
public int getFuelEnergyValue(FluidStack stack){
	if(stack.getFluid() == FluidRegistry.LAVA){
		return 50;
	}
	return 0;
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:7,代碼來源:TileEntityEngineLava.java

示例8: getFluid

public Fluid getFluid() {
    Block b = getBlock();
    if (b instanceof IFluidBlock) {
        return ((IFluidBlock) b).getFluid();
    }
    if (b == Blocks.water || b == Blocks.flowing_water) {
        return FluidRegistry.WATER;
    }
    if (b == Blocks.lava || b == Blocks.flowing_lava) {
        return FluidRegistry.LAVA;
    }
    return null;
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:13,代碼來源:Coord.java

示例9: hasFluidBucket

public static boolean hasFluidBucket(FluidStack stack) {
    return stack.getFluid() == FluidRegistry.WATER || stack.getFluid() == FluidRegistry.LAVA || FluidRegistry.getBucketFluids().contains(stack.getFluid());
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:3,代碼來源:FluidUtil.java

示例10: update

@SuppressWarnings("deprecation")
@Override
public void update(TileBarrel barrel) {
	// Fluids on top.
	if (barrel.getTank().getFluid() != null) {
		FluidTank tank = barrel.getTank();
		if (tank.getFluid().amount != tank.getCapacity())
			return;

		Fluid fluidInBarrel = tank.getFluid().getFluid();

		BlockPos barrelPos = barrel.getPos();
		BlockPos pos = new BlockPos(barrelPos.getX(), barrelPos.getY() + 1, barrelPos.getZ());
		Block onTop = barrel.getWorld().getBlockState(pos).getBlock();

		Fluid fluidOnTop = null;
		if (onTop instanceof BlockLiquid) {
			fluidOnTop = onTop.getMaterial(barrel.getWorld().getBlockState(pos)) == Material.WATER
					? FluidRegistry.WATER : FluidRegistry.LAVA;
		}

		if (onTop != null && onTop instanceof IFluidBlock) {
			fluidOnTop = ((BlockFluidBase) onTop).getFluid();
		}

		if (FluidOnTopRegistry.isValidRecipe(fluidInBarrel, fluidOnTop)) {
			ItemInfo info = FluidOnTopRegistry.getTransformedBlock(fluidInBarrel, fluidOnTop);
			tank.drain(tank.getCapacity(), true);
			barrel.setMode("block");
			PacketHandler.sendToAllAround(new MessageBarrelModeUpdate("block", barrel.getPos()), barrel);

			barrel.getMode().addItem(info.getItemStack(), barrel);

			return;
		}

		// Fluid transforming time!
		if (FluidTransformRegistry.containsKey(barrel.getTank().getFluid().getFluid().getName())) {
			List<FluidTransformer> transformers = FluidTransformRegistry
					.getFluidTransformers(barrel.getTank().getFluid().getFluid().getName());

			boolean found = false;
			for (int radius = 0; radius <= 2; radius++) {
				for (FluidTransformer transformer : transformers) {
					if (!BarrelLiquidBlacklistRegistry.isBlacklisted(barrel.getTier(), transformer.getOutputFluid())
							&& (Util.isSurroundingBlocksAtLeastOneOf(transformer.getTransformingBlocks(),
									barrel.getPos().add(0, -1, 0), barrel.getWorld(), radius)
									|| Util.isSurroundingBlocksAtLeastOneOf(transformer.getTransformingBlocks(),
											barrel.getPos(), barrel.getWorld(), radius))) {
						// Time to start the process.
						FluidStack fstack = tank.getFluid();
						tank.setFluid(null);

						barrel.setMode("fluidTransform");
						BarrelModeFluidTransform mode = (BarrelModeFluidTransform) barrel.getMode();

						mode.setTransformer(transformer);
						mode.setInputStack(fstack);
						mode.setOutputStack(FluidRegistry.getFluidStack(transformer.getOutputFluid(), 1000));

						PacketHandler.sendNBTUpdate(barrel);
						found = true;
					}
				}
				if (found) break;
			}
		}
	}
}
 
開發者ID:MikeLydeamore,項目名稱:ExNihiloAdscensio,代碼行數:69,代碼來源:BarrelModeFluid.java

示例11: getSpawnFluid

public Fluid getSpawnFluid(ItemStack stack) {
	return stack.getItemDamage() == 0 ? FluidRegistry.LAVA : (Fluid) ENBlocks.fluidWitchwater;
}
 
開發者ID:MikeLydeamore,項目名稱:ExNihiloAdscensio,代碼行數:3,代碼來源:ItemDoll.java


注:本文中的net.minecraftforge.fluids.FluidRegistry.LAVA屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。