Record Class FluidSlotDisplay
java.lang.Object
java.lang.Record
net.neoforged.neoforge.fluids.crafting.display.FluidSlotDisplay
- Record Components:
fluid- The fluid to be displayed.
- All Implemented Interfaces:
SlotDisplay
Slot display for a single fluid holder.
Note that information on amount and data of the displayed fluid stack depends on the provided factory!
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.item.crafting.display.SlotDisplay
SlotDisplay.AnyFuel, SlotDisplay.Composite, SlotDisplay.Empty, SlotDisplay.ItemSlotDisplay, SlotDisplay.ItemStackContentsFactory, SlotDisplay.ItemStackSlotDisplay, SlotDisplay.SmithingTrimDemoSlotDisplay, SlotDisplay.TagSlotDisplay, SlotDisplay.Type<T extends SlotDisplay>, SlotDisplay.WithRemainder -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thefluidrecord component.static final com.mojang.serialization.MapCodec<FluidSlotDisplay> static final StreamCodec<RegistryFriendlyByteBuf, FluidSlotDisplay> Fields inherited from interface net.minecraft.world.item.crafting.display.SlotDisplay
CODEC -
Constructor Summary
ConstructorsConstructorDescriptionFluidSlotDisplay(Holder<Fluid> fluid) Creates an instance of aFluidSlotDisplayrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fluid()Returns the value of thefluidrecord component.final inthashCode()Returns a hash code value for this object.<T> Stream<T> resolve(ContextMap context, DisplayContentsFactory<T> factory) final StringtoString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.item.crafting.display.SlotDisplay
isEnabled, resolveForFirstStack, resolveForStacks
-
Field Details
-
fluid
The field for thefluidrecord component. -
MAP_CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
FluidSlotDisplay
Creates an instance of aFluidSlotDisplayrecord class.- Parameters:
fluid- the value for thefluidrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceSlotDisplay
-
resolve
- Specified by:
resolvein interfaceSlotDisplay
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
fluid
Returns the value of thefluidrecord component.- Returns:
- the value of the
fluidrecord component
-