Record Class SlotHoverResult
java.lang.Object
java.lang.Record
com.trevlar.menukit.api.host.SlotHoverResult
- Record Components:
handled- whether the hook took the pointslot- the winning slot, ornullforPASSandBLOCK
public record SlotHoverResult(boolean handled, @Nullable net.minecraft.world.inventory.Slot slot)
extends Record
What
SlotScreenHook.resolveHover(AbstractContainerScreen, double, double) answers for a screen point. It carries only
vanilla's Slot.
PASS: no shown slot takes the point; vanilla's slot resolution runs untouched.of(Slot): a shown slot is under the point and replaces vanilla's answer. It must be the slot in the screen's ownmenu.slots(on the creative screen, the wrapper around it, since creative's click path casts the hovered slot to its wrapper).BLOCK: the point is inside a shown slot panel but between slots; the covered vanilla slot is inert, so a click in the gap cannot fall through.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SlotHoverResultInside a shown slot panel but on a gap: blocked, the covered slot is inert.static final SlotHoverResultNo slot takes the point, so vanilla's resolution runs. -
Constructor Summary
ConstructorsConstructorDescriptionSlotHoverResult(boolean handled, @Nullable net.minecraft.world.inventory.Slot slot) Creates an instance of aSlotHoverResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanhandled()Returns the value of thehandledrecord component.final inthashCode()Returns a hash code value for this object.static SlotHoverResultof(net.minecraft.world.inventory.Slot slot) A shown slot wins the point.@Nullable net.minecraft.world.inventory.Slotslot()Returns the value of theslotrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
PASS
No slot takes the point, so vanilla's resolution runs. -
BLOCK
Inside a shown slot panel but on a gap: blocked, the covered slot is inert.
-
-
Constructor Details
-
SlotHoverResult
-
-
Method Details
-
of
A shown slot wins the point. Pass the slot that is inmenu.slots. -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
handled
-
slot
-