-
-
Notifications
You must be signed in to change notification settings - Fork 446
[Suggestion] Change how InventorySlot's isSameSlot compares #5928
Copy link
Copy link
Closed
Labels
completedThe issue has been fully resolved and the change will be in the next Skript update.The 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.Feature 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)."Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Metadata
Metadata
Assignees
Labels
completedThe issue has been fully resolved and the change will be in the next Skript update.The 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.Feature 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)."Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Type
Fields
Give feedbackNo fields configured for issues without a type.
Suggestion
Change the way
isSameSlotworks forInventorySlotclassWhy?
Currently this class extends
SlotWithIndexand 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 useif hotbar slot of player is clicked slotthis 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 inventoryOther
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
InventorySlotand check if inventory of slot 1 is inventory of slot 2 if not return false otherwisereturn super.isSameSlot(slot)EDIT: this issue would technically be present with both files that extend
SlotWithIndex(EquipmentSlotandInventorySlot)Agreement