当前位置: 首页>>代码示例>>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;未经允许,请勿转载。