Change method signature of allowBreak method in main class #1406
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm working on a plugin, intending it to support GriefPrevention's land protection. There is this public method in the main class that caught my attention a
llowBreak(Player player, Block block, Location location, BlockBreakEvent breakEvent)
. This class takes in a Block type parameter but never utilises its properties - only callingblock.getType()
at some point to test if that block can be broken in a claimed area.It is a suggestion to change the method signature to/add a method with signature
allowBreak(Player player, Material material, Location location, BlockBreakEvent breakEvent)
instead. This will allow plugin authors who want to know if a player can break STONE at a given location without having an actual stone there. Right now the best way to do this is to copy and paste the entire method down.