本文整理匯總了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());
}
示例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;
}
}
示例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());
}
}
示例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;
}
}
示例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;
}
示例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());
}
示例7: getFuelEnergyValue
@Override
public int getFuelEnergyValue(FluidStack stack){
if(stack.getFluid() == FluidRegistry.LAVA){
return 50;
}
return 0;
}
示例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;
}
示例9: hasFluidBucket
public static boolean hasFluidBucket(FluidStack stack) {
return stack.getFluid() == FluidRegistry.WATER || stack.getFluid() == FluidRegistry.LAVA || FluidRegistry.getBucketFluids().contains(stack.getFluid());
}
示例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;
}
}
}
}
示例11: getSpawnFluid
public Fluid getSpawnFluid(ItemStack stack) {
return stack.getItemDamage() == 0 ? FluidRegistry.LAVA : (Fluid) ENBlocks.fluidWitchwater;
}