Record Class AnvilUpdateEventTests.Context
java.lang.Object
java.lang.Record
net.neoforged.neoforge.debug.crafting.AnvilUpdateEventTests.Context
- Enclosing class:
AnvilUpdateEventTests
private static record AnvilUpdateEventTests.Context(ExtendedGameTestHelper helper, net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.AnvilMenu menu)
extends Record
Holds the pieces every test needs after setup.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ExtendedGameTestHelper
The field for thehelper
record component.private final net.minecraft.world.inventory.AnvilMenu
The field for themenu
record component.private final net.minecraft.world.entity.player.Player
The field for theplayer
record component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Context
(ExtendedGameTestHelper helper, net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.AnvilMenu menu) Creates an instance of aContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.helper()
Returns the value of thehelper
record component.net.minecraft.world.inventory.AnvilMenu
menu()
Returns the value of themenu
record component.net.minecraft.world.entity.player.Player
player()
Returns the value of theplayer
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
helper
The field for thehelper
record component. -
player
private final net.minecraft.world.entity.player.Player playerThe field for theplayer
record component.
-
-
Constructor Details
-
Context
private Context(ExtendedGameTestHelper helper, net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.AnvilMenu menu) Creates an instance of aContext
record class.- Parameters:
helper
- the value for thehelper
record componentplayer
- the value for theplayer
record componentmenu
- the value for themenu
record component
-
-
Method Details
-
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)
. -
helper
Returns the value of thehelper
record component.- Returns:
- the value of the
helper
record component
-
player
public net.minecraft.world.entity.player.Player player()Returns the value of theplayer
record component.- Returns:
- the value of the
player
record component
-