本文整理汇总了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;
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
}
示例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());
}
示例6: getFluidStack
import net.minecraftforge.fluids.FluidRegistry; //导入方法依赖的package包/类
@Nullable
@Override
public FluidStack getFluidStack()
{
return FluidRegistry.getFluidStack(fluid, amount);
}
示例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());
}
示例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;
}