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


Java FluidRegistry.getFluidStack方法代码示例

本文整理汇总了Java中net.minecraftforge.fluids.FluidRegistry.getFluidStack方法的典型用法代码示例。如果您正苦于以下问题:Java FluidRegistry.getFluidStack方法的具体用法?Java FluidRegistry.getFluidStack怎么用?Java FluidRegistry.getFluidStack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.fluids.FluidRegistry的用法示例。


在下文中一共展示了FluidRegistry.getFluidStack方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFluid

import net.minecraftforge.fluids.FluidRegistry; //导入方法依赖的package包/类
@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,代码行数:26,代码来源:FluidBucketWrapper.java

示例2: getSubBlocks

import net.minecraftforge.fluids.FluidRegistry; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
    par3List.add(new ItemStack(par1, 1, 0));
    par3List.add(new ItemStack(par1, 1, 1));
    if (par2CreativeTabs != null) {
        return;
    }
    FluidRegistry.getRegisteredFluidIDs().keySet().iterator();
    for (final Fluid fluid1 : FluidRegistry.getRegisteredFluids().values()) {
        final ItemStack drum = new ItemStack(par1, 1, 0);
        final ItemStack drum2 = new ItemStack(par1, 1, 1);
        final FluidStack fluid2 = FluidRegistry.getFluidStack(fluid1.getName(), TileEntityDrum.getCapacityFromMetadata(1));
        if (fluid2 != null) {
            ((ItemBlockDrum)par1).fill(drum, fluid2, true);
            par3List.add(drum);
            ((ItemBlockDrum)par1).fill(drum2, fluid2, true);
            par3List.add(drum2);
        }
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:21,代码来源:BlockDrum.java

示例3: getFluid

import net.minecraftforge.fluids.FluidRegistry; //导入方法依赖的package包/类
@Nullable
public FluidStack getFluid()
{
	Item item = container.getItem();
	if (MilkRegistry.isMilkRegistered() && item == Overlord.milk_bottle)
		return FluidRegistry.getFluidStack("milk", Fluid.BUCKET_VOLUME);
	return null;
}
 
开发者ID:The-Fireplace-Minecraft-Mods,项目名称:Overlord,代码行数:9,代码来源:MilkBottleWrapper.java

示例4: Deserialize

import net.minecraftforge.fluids.FluidRegistry; //导入方法依赖的package包/类
@Override
public Object Deserialize(Object input) {
    try {
        String[] parts = input.toString().split(":");

        return parts.length <= 1
                ? FluidRegistry.getFluidStack(parts[0], 1)
                : FluidRegistry.getFluidStack(parts[0], Integer.parseInt(parts[1]));
    } catch (Exception e) {
        return null;
    }
}
 
开发者ID:legendblade,项目名称:CraftingHarmonics,代码行数:13,代码来源:FluidStackDeserializer.java

示例5: toFluid

import net.minecraftforge.fluids.FluidRegistry; //导入方法依赖的package包/类
public static FluidStack toFluid(ILiquidStack iStack) {
    if(iStack == null) {
        return null;
    } else
        return FluidRegistry.getFluidStack(iStack.getName(), iStack.getAmount());
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:7,代码来源:Helper.java

示例6: getFluidStack

import net.minecraftforge.fluids.FluidRegistry; //导入方法依赖的package包/类
@Nullable
@Override
public FluidStack getFluidStack()
{
    return FluidRegistry.getFluidStack(fluid, amount);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:7,代码来源:WrappedFluidStackImpl.java

示例7: toFluid

import net.minecraftforge.fluids.FluidRegistry; //导入方法依赖的package包/类
public static FluidStack toFluid(ILiquidStack iStack) {
    if (iStack == null) {
        return null;
    } else return FluidRegistry.getFluidStack(iStack.getName(), iStack.getAmount());
}
 
开发者ID:Belgabor,项目名称:ExtraTweaker,代码行数:6,代码来源:InputHelper.java

示例8: parseAlloyRatiosConfig

import net.minecraftforge.fluids.FluidRegistry; //导入方法依赖的package包/类
private static Map<FluidStack, List<FluidStack>> parseAlloyRatiosConfig (final String[] configEntries)
{
    Map<FluidStack, List<FluidStack>> map = new HashMap<FluidStack, List<FluidStack>>();

    for (final String entry : configEntries)
    {
        String[] entryData = entry.split(DELIMITER_REGEX);

        if (ArrayUtils.isNotEmpty(entryData))
        {
            // Alloys need at least one output and two inputs,
            // so 3 sets of 2 values, or a even length of at least 6.
            if (entryData.length > 5 && entryData.length % 2 == 0)
            {
                if (FluidRegistry.isFluidRegistered(entryData[0]))
                {
                    FluidStack output = FluidRegistry.getFluidStack(entryData[0], Integer.valueOf(entryData[1]));
                    List<FluidStack> inputs = new ArrayList<FluidStack>();

                    // Skip past the first two, which represent the output,
                    // to get to the list of inputs.
                    for (int i = 2; i + 1 < entryData.length; i += 2)
                    {
                        if (FluidRegistry.isFluidRegistered(entryData[i]))
                        {
                            inputs.add(FluidRegistry.getFluidStack(entryData[i],
                                                                   Integer.valueOf(entryData[i + 1])));
                        }
                    }

                    // Only register the alloy if the output fluid
                    // as well as the list of input fluids are valid.
                    if (output != null && inputs.size() > 1)
                    {
                        map.put(output, inputs);
                    }
                }
            }
            else
            {
                LogHelper.warn(String.format("Invalid config option: %s", entryData[0]));
            }
        }
    }

    return map;
}
 
开发者ID:UndeadZeratul,项目名称:TWBB-Tweaks,代码行数:48,代码来源:TConstructTweaks.java


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