Removed the cancellation of F casting when sneaking to allow compatibility with other plugin using Shift+F to trigger some events

This commit is contained in:
Ka0rX 2022-10-28 21:57:30 +02:00
parent 20c55f2d6b
commit c7aaa6599c

View File

@ -73,6 +73,9 @@ public class SkillBar implements Listener {
*/
if (event.getPreviousSlot() == event.getNewSlot()) return;
//If the player is sneaking, we don't trigger the casting mode (used to avoid conflicts with other plugins using shift+F to open GUI.
if(player.isSneaking()) return;
event.setCancelled(true);
int slot = event.getNewSlot() + (event.getNewSlot() >= player.getInventory().getHeldItemSlot() ? -1 : 0);