Skip to content

Fix Crafter bypass#45

Open
SanderGott wants to merge 1 commit into
keehl254:mainfrom
SanderGott:fix/crafter-bypass
Open

Fix Crafter bypass#45
SanderGott wants to merge 1 commit into
keehl254:mainfrom
SanderGott:fix/crafter-bypass

Conversation

@SanderGott

Copy link
Copy Markdown

Noticed that players could bypass craftPermission by using the Crafter block. Found

[12:02:54 ERROR]: Could not pass event CrafterCraftEvent to Elevators v5.0.0-beta.16 java.lang.NoSuchMethodError: 'boolean org.bukkit.inventory.ItemStack.isEmpty()

Can see that the build targets paper version 1.14.4, which from what I can see don't include the function. This causes the event handler to crash before reaching setCancelled(true), allowing players to bypass. Fixed by removing isEmpty() and replacing with result == null || result.getType() == org.bukkit.Material.AIR, which should work across all API versions.

Now this could be an issue with my environment/setup, so if the issue isn't reproduceable please notify me and I'll close the PR. If it actually is a bug I thought I might as well push the fix I did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant