Draylar / get-off-my-lawn

Keep people off your lawn with claims! Built for Fabric.
https://www.curseforge.com/minecraft/mc-mods/get-off-my-lawn
MIT License
4 stars 18 forks source link

Claim checks have duplicated code that could be simplified #5

Closed Draylar closed 3 years ago

Draylar commented 4 years ago

Most claim checks, including all 4 in EventHandlers, have duplicated logic that could be abstracted to a separate method.

The method should take a World, BlockPos, and PlayerEntity, and return an ActionResult that shows whether the action was successful. If individual permissions appear, the two options are reverting this change or having some sort of ActionType enum (BLOCK_BREAK, BLOCK_INTERACT, ENTITY_ATTACK, ENTITY_INTERACT, etc) to check whether the player has permissions in that specific category.