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.
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
, andPlayerEntity
, and return anActionResult
that shows whether the action was successful. If individual permissions appear, the two options are reverting this change or having some sort ofActionType
enum (BLOCK_BREAK
,BLOCK_INTERACT
,ENTITY_ATTACK
,ENTITY_INTERACT
, etc) to check whether the player has permissions in that specific category.