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