Package net.neoforged.neoforge.items
Record Class ContainerOrHandler
java.lang.Object
java.lang.Record
net.neoforged.neoforge.items.ContainerOrHandler
public record ContainerOrHandler(@Nullable net.minecraft.world.Container container, @Nullable IItemHandler itemHandler)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable net.minecraft.world.Container
The field for thecontainer
record component.static final ContainerOrHandler
private final @Nullable IItemHandler
The field for theitemHandler
record component. -
Constructor Summary
ConstructorsConstructorDescriptionContainerOrHandler
(@Nullable net.minecraft.world.Container container, @Nullable IItemHandler itemHandler) Creates an instance of aContainerOrHandler
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.world.Container
Returns the value of thecontainer
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isEmpty()
@Nullable IItemHandler
Returns the value of theitemHandler
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
container
@Nullable private final @Nullable net.minecraft.world.Container containerThe field for thecontainer
record component. -
itemHandler
The field for theitemHandler
record component. -
EMPTY
-
-
Constructor Details
-
ContainerOrHandler
public ContainerOrHandler(@Nullable @Nullable net.minecraft.world.Container container, @Nullable @Nullable IItemHandler itemHandler) Creates an instance of aContainerOrHandler
record class.- Parameters:
container
- the value for thecontainer
record componentitemHandler
- the value for theitemHandler
record component
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
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)
. -
container
@Nullable public @Nullable net.minecraft.world.Container container()Returns the value of thecontainer
record component.- Returns:
- the value of the
container
record component
-
itemHandler
Returns the value of theitemHandler
record component.- Returns:
- the value of the
itemHandler
record component
-