Class FluidEntry

java.lang.Object
alexiil.mc.lib.attributes.fluid.volume.FluidEntry
Direct Known Subclasses:
FluidEntry.FluidFloatingEntry, FluidRegistryEntry

public abstract class FluidEntry
extends java.lang.Object
Identifier equivalent for FluidKey. The only two permitted sub-types are:
  1. FluidRegistryEntry: for fluids that are based on a minecraft object that's registered in a Registry.
  2. FluidEntry.FluidFloatingEntry: for fluids that aren't based an a minecraft object, and so are identified by a string/identifier.
All FluidEntry to FluidKey mappings are stored in FluidKeys.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  FluidEntry.FluidFloatingEntry  
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected int hash  
  • Method Summary

    Modifier and Type Method Description
    protected abstract boolean equals​(FluidEntry other)  
    boolean equals​(java.lang.Object obj)  
    static FluidEntry fromMcBuffer​(net.minecraft.network.PacketByteBuf buffer)  
    static FluidEntry fromTag​(net.minecraft.nbt.CompoundTag tag)
    Reads a FluidEntry from the given tag.
    abstract net.minecraft.util.Identifier getId()  
    abstract java.lang.String getRegistryInternalName()  
    int hashCode()  
    abstract boolean isEmpty()  
    abstract void toMcBuffer​(net.minecraft.network.PacketByteBuf buffer)  
    abstract void toTag​(net.minecraft.nbt.CompoundTag tag)  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • hash

      protected final int hash
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • equals

      protected abstract boolean equals​(FluidEntry other)
    • toTag

      public abstract void toTag​(net.minecraft.nbt.CompoundTag tag)
    • fromTag

      public static FluidEntry fromTag​(net.minecraft.nbt.CompoundTag tag)
      Reads a FluidEntry from the given tag. Note that the returned entry might not map to a FluidKey.
    • toMcBuffer

      public abstract void toMcBuffer​(net.minecraft.network.PacketByteBuf buffer)
    • fromMcBuffer

      public static FluidEntry fromMcBuffer​(net.minecraft.network.PacketByteBuf buffer)
    • isEmpty

      public abstract boolean isEmpty()
      Returns:
      True if this corresponds to the default value in the backing registry. (No floating entries are empty).
    • getRegistryInternalName

      public abstract java.lang.String getRegistryInternalName()
      Returns:
      The LBA-internal name used to serialise this entry. Floating entries return "i", Fluid-based registry entries return "f", Potion-based registry entries return "p", and any other registry entry returns the ID of that registry.
    • getId

      public abstract net.minecraft.util.Identifier getId()
      Returns:
      The Identifier that the backing object uses.