本文整理匯總了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;
}