Skip to content
AlexIIL edited this page Apr 10, 2019 · 2 revisions

LibBlockAttributes adds 2 new base fluid containing classes, FluidVolume and FluidKey. These are for storing amounts of fluids, and a fluid key identity.

Useful methods:

  • FluidKey.getRawFluid(): Returns the minecraft Fluid, or null if that fluid key doesn't store a fluid.
  • NormalFluidKey.getRawFluid(): Returns the minecraft Fluid.
  • PotionFluidKey.getPotion(): Returns the minecraft Potion.
  • FluidKey.withAmount(int amount): Returns a new FluidVolume for that FluidKey instance.
  • FluidVolume.create(Fluid fluid, int amount): Returns a new FluidVolume with the given amount, from a minecraft fluid.
  • FluidVolume.create(Potion potion, int amount): Returns a new FluidVolume with the given amount, from a minecraft potion.
  • FluidVolume.create(FluidKey key, int amount): Returns a new FluidVolume with the given amount. (This just delegates to FluidKey.withAmount() internally).
  • FluidWorldUtil.drain(world, pos, simulation): Drains some fluid from the world.

Clone this wiki locally