Record Class GUIView
java.lang.Object
java.lang.Record
de.placeblock.betterinventories.gui.GUIView
- Record Components:
player- The Player of this Viewinventory- The Bukkit Inventory of this View
public record GUIView(org.bukkit.entity.Player player, org.bukkit.inventory.Inventory inventory)
extends Record
A GUIView is created for each player who opens an inventory.
-
Constructor Summary
ConstructorsConstructorDescriptionGUIView(org.bukkit.entity.Player player, org.bukkit.inventory.Inventory inventory) Creates a new GUIView -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.bukkit.inventory.InventoryReturns the value of theinventoryrecord component.org.bukkit.entity.Playerplayer()Returns the value of theplayerrecord component.final StringtoString()Returns a string representation of this record class.voidGets called when the new rendered content should be showed to the player.
-
Constructor Details
-
GUIView
public GUIView(org.bukkit.entity.Player player, org.bukkit.inventory.Inventory inventory) Creates a new GUIView- Parameters:
player- The Player of this Viewinventory- The Bukkit Inventory of this View
-
-
Method Details
-
update
Gets called when the new rendered content should be showed to the player. Updates only changing items in the player's inventory.- Parameters:
content- The new rendered content. The size of the list should be equals the slots in the inventory.
-
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). -
player
public org.bukkit.entity.Player player()Returns the value of theplayerrecord component.- Returns:
- the value of the
playerrecord component
-
inventory
public org.bukkit.inventory.Inventory inventory()Returns the value of theinventoryrecord component.- Returns:
- the value of the
inventoryrecord component
-