Class SimpleFluidContent

java.lang.Object
net.neoforged.neoforge.fluids.SimpleFluidContent
All Implemented Interfaces:
net.minecraft.core.component.DataComponentGetter, net.minecraft.core.component.DataComponentHolder, IDataComponentHolderExtension

public class SimpleFluidContent extends Object implements net.minecraft.core.component.DataComponentHolder
Stock data component class to hold a FluidStack.

A corresponding DataComponentType must be registered to use this class.

  • Field Details

    • EMPTY

      public static final SimpleFluidContent EMPTY
    • CODEC

      public static final com.mojang.serialization.Codec<SimpleFluidContent> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleFluidContent> STREAM_CODEC
    • fluidStack

      private final FluidStack fluidStack
  • Constructor Details

    • SimpleFluidContent

      private SimpleFluidContent(FluidStack fluidStack)
  • Method Details

    • copyOf

      public static SimpleFluidContent copyOf(FluidStack fluidStack)
    • copy

      public FluidStack copy()
    • isEmpty

      public boolean isEmpty()
    • getFluid

      public net.minecraft.world.level.material.Fluid getFluid()
    • getFluidHolder

      public net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> getFluidHolder()
    • is

      public boolean is(net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> tag)
    • is

      public boolean is(net.minecraft.world.level.material.Fluid fluid)
    • is

      public boolean is(Predicate<net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid>> predicate)
    • is

      public boolean is(net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> holder)
    • is

      public boolean is(net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> holders)
    • getAmount

      public int getAmount()
    • getFluidType

      public FluidType getFluidType()
    • is

      public boolean is(FluidType fluidType)
    • matches

      public boolean matches(FluidStack other)
    • isSameFluid

      public boolean isSameFluid(FluidStack other)
    • isSameFluidSameComponents

      public boolean isSameFluidSameComponents(FluidStack other)
    • isSameFluidSameComponents

      public boolean isSameFluidSameComponents(SimpleFluidContent content)
    • getComponents

      public net.minecraft.core.component.DataComponentMap getComponents()
      Specified by:
      getComponents in interface net.minecraft.core.component.DataComponentHolder
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object