Skip to content

[Suggestion] Change how InventorySlot's isSameSlot compares #5928

@Fusezion

Description

@Fusezion

Suggestion

Change the way isSameSlot works for InventorySlot class

Why?

Currently this class extends SlotWithIndex and use the way the class checks slots (i.e. index slot 1 = index slot 2). This has the major flaw of causing false positives when you have 2 inventories opened and use if hotbar slot of player is clicked slot this will compare the index of hotbar slot with the index of clicked slot causing a false positive if you click say slot number 3 in the top inventory

Other

This is something I wouldn't label a bug but rather a under sight of how the slot comparison would work
I believe the best way to go about this is override the method and add a condition check if Slot is InventorySlot and check if inventory of slot 1 is inventory of slot 2 if not return false otherwise return super.isSameSlot(slot)

EDIT: this issue would technically be present with both files that extend SlotWithIndex (EquipmentSlot and InventorySlot)

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    completedThe issue has been fully resolved and the change will be in the next Skript update.enhancementFeature request, an issue about something that could be improved, or a PR improving something.priority: lowest"Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions