-
Notifications
You must be signed in to change notification settings - Fork 12
Fluids
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 minecraftFluid, or null if that fluid key doesn't store a fluid. -
NormalFluidKey.getRawFluid(): Returns the minecraftFluid. -
PotionFluidKey.getPotion(): Returns the minecraftPotion. -
FluidKey.withAmount(int amount): Returns a newFluidVolumefor that FluidKey instance. -
FluidVolume.create(Fluid fluid, int amount): Returns a newFluidVolumewith the given amount, from a minecraft fluid. -
FluidVolume.create(Potion potion, int amount): Returns a newFluidVolumewith the given amount, from a minecraft potion. -
FluidVolume.create(FluidKey key, int amount): Returns a newFluidVolumewith the given amount. (This just delegates toFluidKey.withAmount()internally). -
FluidWorldUtil.drain(world, pos, simulation): Drains some fluid from the world.