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:
net.minecraft.world.item.crafting.display.SlotDisplay
public record FluidSlotDisplay(net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> fluid)
extends Record
implements net.minecraft.world.item.crafting.display.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
net.minecraft.world.item.crafting.display.SlotDisplay.AnyFuel, net.minecraft.world.item.crafting.display.SlotDisplay.Composite, net.minecraft.world.item.crafting.display.SlotDisplay.Empty, net.minecraft.world.item.crafting.display.SlotDisplay.ItemSlotDisplay, net.minecraft.world.item.crafting.display.SlotDisplay.ItemStackContentsFactory, net.minecraft.world.item.crafting.display.SlotDisplay.ItemStackSlotDisplay, net.minecraft.world.item.crafting.display.SlotDisplay.SmithingTrimDemoSlotDisplay, net.minecraft.world.item.crafting.display.SlotDisplay.TagSlotDisplay, net.minecraft.world.item.crafting.display.SlotDisplay.Type<T extends net.minecraft.world.item.crafting.display.SlotDisplay>, net.minecraft.world.item.crafting.display.SlotDisplay.WithRemainder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final net.minecraft.core.Holder
<net.minecraft.world.level.material.Fluid> The field for thefluid
record component.static final com.mojang.serialization.MapCodec
<FluidSlotDisplay> static final net.minecraft.network.codec.StreamCodec
<net.minecraft.network.RegistryFriendlyByteBuf, FluidSlotDisplay> Fields inherited from interface net.minecraft.world.item.crafting.display.SlotDisplay
CODEC
-
Constructor Summary
ConstructorsConstructorDescriptionFluidSlotDisplay
(net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> fluid) Creates an instance of aFluidSlotDisplay
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.net.minecraft.core.Holder
<net.minecraft.world.level.material.Fluid> fluid()
Returns the value of thefluid
record component.final int
hashCode()
Returns a hash code value for this object.<T> Stream
<T> resolve
(net.minecraft.util.context.ContextMap context, net.minecraft.world.item.crafting.display.DisplayContentsFactory<T> factory) final String
toString()
Returns a string representation of this record class.net.minecraft.world.item.crafting.display.SlotDisplay.Type
<FluidSlotDisplay> type()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.item.crafting.display.SlotDisplay
isEnabled, resolveForFirstStack, resolveForStacks
-
Field Details
-
fluid
private final net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> fluidThe field for thefluid
record component. -
MAP_CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,FluidSlotDisplay> STREAM_CODEC
-
-
Constructor Details
-
FluidSlotDisplay
public FluidSlotDisplay(net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> fluid) Creates an instance of aFluidSlotDisplay
record class.- Parameters:
fluid
- the value for thefluid
record component
-
-
Method Details
-
type
- Specified by:
type
in interfacenet.minecraft.world.item.crafting.display.SlotDisplay
-
resolve
public <T> Stream<T> resolve(net.minecraft.util.context.ContextMap context, net.minecraft.world.item.crafting.display.DisplayContentsFactory<T> factory) - Specified by:
resolve
in interfacenet.minecraft.world.item.crafting.display.SlotDisplay
-
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
public net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> fluid()Returns the value of thefluid
record component.- Returns:
- the value of the
fluid
record component
-