diff --git a/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java b/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java index 66b58eb..39ca70b 100644 --- a/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java +++ b/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java @@ -580,11 +580,16 @@ public class CommandClaim { PermHelper.noClaimMessage(player); return 0; } + if (PlayerClaimData.get(player).getEditMode() == EnumEditMode.SUBCLAIM) { + Claim sub = claim.getSubClaim(player.blockPosition()); + if (sub != null) + claim = sub; + } if (remove) { if (claim.removePermGroup(player, group)) player.displayClientMessage(PermHelper.simpleColoredText(String.format(ConfigHandler.langManager.get("groupRemove"), group), ChatFormatting.GOLD), false); else { - PermHelper.genericNoPermMessage(player); + player.displayClientMessage(PermHelper.simpleColoredText(ConfigHandler.langManager.get("noPermission"), ChatFormatting.DARK_RED), false); return 0; } } else { @@ -594,7 +599,7 @@ public class CommandClaim { } else if (claim.editPerms(player, group, PermissionRegistry.EDITPERMS, -1)) player.displayClientMessage(PermHelper.simpleColoredText(String.format(ConfigHandler.langManager.get("groupAdd"), group), ChatFormatting.GOLD), false); else { - PermHelper.genericNoPermMessage(player); + player.displayClientMessage(PermHelper.simpleColoredText(ConfigHandler.langManager.get("noPermission"), ChatFormatting.DARK_RED), false); return 0; } } @@ -623,8 +628,13 @@ public class CommandClaim { PermHelper.noClaimMessage(player); return 0; } + if (PlayerClaimData.get(player).getEditMode() == EnumEditMode.SUBCLAIM) { + Claim sub = claim.getSubClaim(player.blockPosition()); + if (sub != null) + claim = sub; + } if (!claim.canInteract(player, PermissionRegistry.EDITPERMS, player.blockPosition())) { - PermHelper.genericNoPermMessage(player); + player.displayClientMessage(PermHelper.simpleColoredText(ConfigHandler.langManager.get("noPermission"), ChatFormatting.DARK_RED), false); return 0; } List modified = new ArrayList<>(); @@ -670,6 +680,11 @@ public class CommandClaim { PermHelper.noClaimMessage(player); return 0; } + if (PlayerClaimData.get(player).getEditMode() == EnumEditMode.SUBCLAIM) { + Claim sub = claim.getSubClaim(player.blockPosition()); + if (sub != null) + claim = sub; + } if (!claim.canInteract(player, PermissionRegistry.EDITPERMS, player.blockPosition())) { player.displayClientMessage(PermHelper.simpleColoredText(ConfigHandler.langManager.get("noPermission"), ChatFormatting.DARK_RED), false); return 0;