Package de.Keyle.MyPet.api.gui
Record Class StorageSection
java.lang.Object
java.lang.Record
de.Keyle.MyPet.api.gui.StorageSection
- Record Components:
id- this section's id within its menutype- the registered type handle this section was decoded ascol- left-hand column of the regionrow- top row of the regionwidth- region width in slotsheight- region height in slotsstorageId- names the backing store the handler reads and writes
- All Implemented Interfaces:
Section
public record StorageSection(String id, SectionType<StorageSection> type, int col, int row, int width, int height, String storageId)
extends Record
implements Section
Free-input slots backed by an ItemStack[] supplied by the menu handler at open time
and persisted via the handler at close time. Drag/drop inside the region works
like a vanilla chest; outside is cancelled.
-
Constructor Summary
ConstructorsConstructorDescriptionStorageSection(String id, SectionType<StorageSection> type, int col, int row, int width, int height, String storageId) Rejects a non-positive region or a blank storage id. -
Method Summary
Modifier and TypeMethodDescriptionintcol()Returns the value of thecolrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.id()Returns the value of theidrecord component.introw()Returns the value of therowrecord component.intReturns how many item slots this section holds.Returns the value of thestorageIdrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
StorageSection
public StorageSection(String id, SectionType<StorageSection> type, int col, int row, int width, int height, String storageId) Rejects a non-positive region or a blank storage id.
-
-
Method Details
-
slotCapacity
public int slotCapacity()Returns how many item slots this section holds.- Returns:
width * height
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component. -
type
Returns the value of thetyperecord component. -
col
public int col()Returns the value of thecolrecord component.- Returns:
- the value of the
colrecord component
-
row
public int row()Returns the value of therowrecord component.- Returns:
- the value of the
rowrecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
storageId
Returns the value of thestorageIdrecord component.- Returns:
- the value of the
storageIdrecord component
-