From 39af6e243067a6e73df9495e52b1fe4fa22f5291 Mon Sep 17 00:00:00 2001 From: bloodshot Date: Tue, 30 Jul 2019 16:53:58 -0400 Subject: [PATCH] Move all used text to language file to support translations. * Add WorldGuard migrator. Note: This does not support custom flags atm. * Add message cache for all messages that do not use parameters. * Refactor option permission lookups. * Update kyori text dependencies. * Minor cleanup. --- .../java/com/griefdefender/GDDebugData.java | 36 +- .../java/com/griefdefender/GDPlayerData.java | 37 +- .../griefdefender/GriefDefenderPlugin.java | 10 +- .../com/griefdefender/cache/MessageCache.java | 534 +++++++++++++ .../java/com/griefdefender/claim/GDClaim.java | 117 +-- .../griefdefender/claim/GDClaimManager.java | 2 +- .../griefdefender/command/ClaimFlagBase.java | 105 +-- .../CommandAdjustBonusClaimBlocks.java | 3 +- .../command/CommandClaimAbandon.java | 15 +- .../command/CommandClaimAbandonAll.java | 3 +- .../command/CommandClaimAdmin.java | 4 +- .../command/CommandClaimBank.java | 6 +- .../command/CommandClaimBasic.java | 3 +- .../command/CommandClaimBuy.java | 6 +- .../command/CommandClaimBuyBlocks.java | 17 +- .../command/CommandClaimClear.java | 27 +- .../command/CommandClaimCuboid.java | 6 +- .../command/CommandClaimDelete.java | 7 +- .../command/CommandClaimDeleteAll.java | 2 +- .../command/CommandClaimDeleteAllAdmin.java | 6 +- .../command/CommandClaimFarewell.java | 5 +- .../command/CommandClaimFlagDebug.java | 11 +- .../command/CommandClaimFlagPlayer.java | 4 +- .../command/CommandClaimFlagReset.java | 5 +- .../command/CommandClaimGreeting.java | 3 +- .../command/CommandClaimIgnore.java | 5 +- .../command/CommandClaimInfo.java | 279 +++---- .../command/CommandClaimInherit.java | 11 +- .../command/CommandClaimList.java | 45 +- .../command/CommandClaimOption.java | 8 +- .../command/CommandClaimPermissionGroup.java | 4 +- .../command/CommandClaimPermissionPlayer.java | 3 +- .../command/CommandClaimSchematic.java | 28 +- .../command/CommandClaimSell.java | 12 +- .../command/CommandClaimSellBlocks.java | 11 +- .../command/CommandClaimSpawn.java | 3 +- .../command/CommandClaimSubdivision.java | 4 +- .../command/CommandClaimTown.java | 4 +- .../command/CommandClaimTransfer.java | 9 +- .../command/CommandClaimWorldEdit.java | 4 +- .../command/CommandGDReload.java | 4 +- .../griefdefender/command/CommandHelper.java | 302 ++++---- .../command/CommandPlayerInfo.java | 161 ++-- .../command/CommandRestoreClaim.java | 5 +- .../command/CommandRestoreNature.java | 13 +- .../command/CommandSetAccruedClaimBlocks.java | 28 +- .../command/CommandTownChat.java | 8 +- .../griefdefender/command/CommandTownTag.java | 5 +- .../command/CommandTrustGroup.java | 23 +- .../command/CommandTrustGroupAll.java | 17 +- .../command/CommandTrustList.java | 55 +- .../command/CommandTrustPlayer.java | 30 +- .../command/CommandTrustPlayerAll.java | 19 +- .../command/CommandUntrustGroup.java | 19 +- .../command/CommandUntrustGroupAll.java | 15 +- .../command/CommandUntrustPlayer.java | 20 +- .../command/CommandUntrustPlayerAll.java | 15 +- .../configuration/MessageDataConfig.java | 1 - .../configuration/MessageStorage.java | 220 +++--- .../category/MigratorCategory.java | 6 + .../listener/BlockEventHandler.java | 10 +- .../listener/PlayerEventHandler.java | 41 +- .../migrator/WorldGuardMigrator.java | 722 ++++++++++++++++++ .../com/griefdefender/permission/GDFlag.java | 353 +-------- .../com/griefdefender/permission/GDFlags.java | 2 +- .../griefdefender/permission/GDOption.java | 2 +- .../permission/GDPermissionManager.java | 124 ++- .../permission/GDPermissions.java | 2 +- .../griefdefender/storage/BaseStorage.java | 7 +- .../griefdefender/storage/FileStorage.java | 20 + .../griefdefender/task/ClaimBlockTask.java | 2 +- .../util/CauseContextHelper.java | 6 +- .../com/griefdefender/util/EconomyUtil.java | 5 +- bukkit/src/main/resources/1.12.2.json | 46 +- bukkit/src/main/resources/1.13.2.json | 46 +- bukkit/src/main/resources/1.14.2.json | 46 +- bukkit/src/main/resources/1.14.3.json | 46 +- bukkit/src/main/resources/1.14.4.json | 46 +- bukkit/src/main/resources/1.8.8.json | 46 +- .../src/main/resources/assets/lang/de_DE.conf | 466 +++++++++++ .../src/main/resources/assets/lang/en_US.conf | 223 +++++- .../src/main/resources/assets/lang/ru_RU.conf | 466 +++++++++++ .../src/main/resources/assets/lang/zh_CN.conf | 466 +++++++++++ 83 files changed, 4048 insertions(+), 1515 deletions(-) create mode 100644 bukkit/src/main/java/com/griefdefender/cache/MessageCache.java create mode 100644 bukkit/src/main/java/com/griefdefender/migrator/WorldGuardMigrator.java create mode 100644 bukkit/src/main/resources/assets/lang/de_DE.conf create mode 100644 bukkit/src/main/resources/assets/lang/ru_RU.conf create mode 100644 bukkit/src/main/resources/assets/lang/zh_CN.conf diff --git a/bukkit/src/main/java/com/griefdefender/GDDebugData.java b/bukkit/src/main/java/com/griefdefender/GDDebugData.java index 222dca9..5bd72cb 100644 --- a/bukkit/src/main/java/com/griefdefender/GDDebugData.java +++ b/bukkit/src/main/java/com/griefdefender/GDDebugData.java @@ -24,15 +24,19 @@ */ package com.griefdefender; +import com.google.common.collect.ImmutableMap; import com.google.gson.Gson; import com.google.gson.JsonObject; import com.griefdefender.api.Tristate; +import com.griefdefender.cache.MessageCache; +import com.griefdefender.configuration.MessageStorage; import com.griefdefender.util.HttpClient; import net.kyori.text.Component; import net.kyori.text.TextComponent; import net.kyori.text.adapter.bukkit.TextAdapter; import net.kyori.text.event.ClickEvent; import net.kyori.text.format.TextColor; +import net.kyori.text.serializer.plain.PlainComponentSerializer; import okhttp3.MediaType; import okhttp3.Request; import okhttp3.RequestBody; @@ -94,8 +98,8 @@ public GDDebugData(CommandSender source, OfflinePlayer target, boolean verbose) this.header.add("| LuckPerms Version | " + version); } } - this.header.add("| User | " + (this.target == null ? "ALL" : this.target.getName()) + "|"); - this.header.add("| Record start | " + DATE_FORMAT.format(new Date(this.startTime)) + "|"); + this.header.add("| " + MessageCache.getInstance().LABEL_USER + " | " + (this.target == null ? "ALL" : this.target.getName()) + "|"); + this.header.add("| " + MessageCache.getInstance().DEBUG_RECORD_START + " | " + DATE_FORMAT.format(new Date(this.startTime)) + "|"); } public void addRecord(String flag, String trust, String source, String target, String location, String user, String permission, Tristate result) { @@ -133,18 +137,29 @@ public void setVerbose(boolean verbose) { public void pasteRecords() { if (this.records.isEmpty()) { - TextAdapter.sendComponent(this.source, TextComponent.of("No debug records to paste!", TextColor.RED)); + TextAdapter.sendComponent(this.source, MessageCache.getInstance().DEBUG_NO_RECORDS); return; } final long endTime = System.currentTimeMillis(); List debugOutput = new ArrayList<>(this.header); - debugOutput.add("| Record end | " + DATE_FORMAT.format(new Date(endTime)) + "|"); + final String RECORD_END = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().DEBUG_RECORD_END); + final String TIME_ELAPSED = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().DEBUG_TIME_ELAPSED); + final String OUTPUT = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().LABEL_OUTPUT); + final String FLAG = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().LABEL_FLAG); + final String TRUST = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().LABEL_TRUST); + final String LOCATION = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().LABEL_LOCATION); + final String SOURCE = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().LABEL_SOURCE); + final String TARGET = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().LABEL_TARGET); + final String USER = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().LABEL_USER); + final String PERMISSION = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().LABEL_PERMISSION); + final String RESULT = PlainComponentSerializer.INSTANCE.serialize(MessageCache.getInstance().LABEL_RESULT); + debugOutput.add("| " + RECORD_END + " | " + DATE_FORMAT.format(new Date(endTime)) + "|"); long elapsed = (endTime - startTime) / 1000L; - debugOutput.add("| Time elapsed | " + elapsed + " seconds" + "|"); + debugOutput.add("| " + TIME_ELAPSED + " | " + elapsed + " seconds" + "|"); debugOutput.add(""); - debugOutput.add("### Output") ; - debugOutput.add("| Flag | Trust | Source | Target | Location | User | Permission | Result |"); + debugOutput.add("### " + OUTPUT) ; + debugOutput.add("| " + FLAG + " | " + TRUST + " | " + SOURCE + " | " + TARGET + " | " + LOCATION + " | " + USER + " | " + PERMISSION + " | " + RESULT + " |"); debugOutput.add("|------|-------|--------|--------|----------|------|------------|--------|"); debugOutput.addAll(this.records); @@ -155,7 +170,8 @@ public void pasteRecords() { try { pasteId = postContent(content); } catch (Exception e) { - TextAdapter.sendComponent(this.source, TextComponent.builder("").append("Error uploading content : ", TextColor.RED).append(e.getMessage(), TextColor.WHITE).build()); + TextAdapter.sendComponent(this.source, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DEBUG_ERROR_UPLOAD, + ImmutableMap.of("content", TextComponent.of(e.getMessage(), TextColor.WHITE)))); return; } @@ -168,7 +184,9 @@ public void pasteRecords() { throw new RuntimeException(e); } - TextAdapter.sendComponent(this.source, TextComponent.builder("").append("Paste success! : " + url, TextColor.GREEN) + TextAdapter.sendComponent(this.source, TextComponent.builder() + .append(MessageCache.getInstance().DEBUG_PASTE_SUCCESS) + .append(" : " + url, TextColor.GREEN) .clickEvent(ClickEvent.openUrl(jUrl.toString())).build()); } diff --git a/bukkit/src/main/java/com/griefdefender/GDPlayerData.java b/bukkit/src/main/java/com/griefdefender/GDPlayerData.java index 4a801a7..59f7bb2 100644 --- a/bukkit/src/main/java/com/griefdefender/GDPlayerData.java +++ b/bukkit/src/main/java/com/griefdefender/GDPlayerData.java @@ -32,6 +32,7 @@ import com.griefdefender.api.claim.ShovelTypes; import com.griefdefender.api.data.PlayerData; import com.griefdefender.api.permission.option.Options; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.GriefDefenderConfig; @@ -207,12 +208,12 @@ public void revertActiveVisual(Player player) { @Override public int getBlocksAccruedPerHour() { - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.BLOCKS_ACCRUED_PER_HOUR, this).intValue(); + return GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.BLOCKS_ACCRUED_PER_HOUR, this).intValue(); } @Override public int getChestClaimExpiration() { - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.CHEST_EXPIRATION, this).intValue(); + return GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.CHEST_EXPIRATION, this).intValue(); } @Override @@ -222,12 +223,12 @@ public int getCreateClaimLimit(ClaimType type) { @Override public int getInitialClaimBlocks() { - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.INITIAL_BLOCKS, this).intValue(); + return GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.INITIAL_BLOCKS, this).intValue(); } @Override public int getRemainingClaimBlocks() { - final int initialClaimBlocks = GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.INITIAL_BLOCKS, this).intValue(); + final int initialClaimBlocks = GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.INITIAL_BLOCKS, this).intValue(); int remainingBlocks = initialClaimBlocks + this.getAccruedClaimBlocks() + this.getBonusClaimBlocks(); if (GriefDefenderPlugin.getGlobalConfig().getConfig().economy.economyMode) { if (!this.vaultProvider.getApi().hasAccount(this.getSubject().getOfflinePlayer())) { @@ -235,7 +236,7 @@ public int getRemainingClaimBlocks() { } final double currentFunds = this.vaultProvider.getApi().getBalance(this.getSubject().getOfflinePlayer()); - final Double economyBlockCost = GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.ECONOMY_BLOCK_COST, this); + final Double economyBlockCost = GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.ECONOMY_BLOCK_COST, this); remainingBlocks = (int) Math.round((currentFunds / economyBlockCost)); } else { for (Claim claim : this.claimList) { @@ -308,7 +309,7 @@ public void setBonusClaimBlocks(int bonusClaimBlocks) { public int getClaimCreateMode() { if (this.optionClaimCreateMode == null) { - int mode = GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.CREATE_MODE, this).intValue(); + int mode = GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.CREATE_MODE, this).intValue(); // default to 0 if invalid if (mode != 0 && mode != 1) { mode = 0; @@ -336,27 +337,27 @@ public boolean canCreateClaim(Player player, boolean sendMessage) { if (this.shovelMode == ShovelTypes.BASIC) { if (createMode == 0 && !player.hasPermission(GDPermissions.CLAIM_CREATE_BASIC)) { if (sendMessage) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CLAIM_CREATE)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_CLAIM_CREATE); } return false; } if (createMode == 1 && !player.hasPermission(GDPermissions.CLAIM_CUBOID_BASIC)) { if (sendMessage) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CUBOID)); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_CUBOID_DISABLED)); + GriefDefenderPlugin.sendMessage(player,MessageCache.getInstance().PERMISSION_CUBOID); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_CUBOID_DISABLED); } return false; } } else if (this.shovelMode == ShovelTypes.SUBDIVISION) { if (createMode == 0 && !player.hasPermission(GDPermissions.CLAIM_CREATE_SUBDIVISION)) { if (sendMessage) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CLAIM_CREATE)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_CLAIM_CREATE); } return false; } else if (!player.hasPermission(GDPermissions.CLAIM_CUBOID_SUBDIVISION)) { if (sendMessage) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CUBOID)); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_CUBOID_DISABLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_CUBOID); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_CUBOID_DISABLED); } return false; } @@ -485,12 +486,12 @@ public boolean canManageOption(Player player, GDClaim claim, boolean isGroup) { @Override public int getMaxAccruedClaimBlocks() { - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.MAX_ACCRUED_BLOCKS, this).intValue(); + return GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.MAX_ACCRUED_BLOCKS, this).intValue(); } @Override public double getAbandonedReturnRatio(ClaimType type) { - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.ABANDON_RETURN_RATIO, this); + return GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.ABANDON_RETURN_RATIO, this); } @Override @@ -525,7 +526,7 @@ public int getMinClaimZ(ClaimType type) { @Override public int getMaxClaimLevel() { - int maxClaimLevel = GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.MAX_LEVEL, this).intValue(); + int maxClaimLevel = GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.MAX_LEVEL, this).intValue(); if (!this.checkedDimensionHeight) { final World world = Bukkit.getServer().getWorld(this.worldUniqueId); if (world != null) { @@ -541,17 +542,17 @@ public int getMaxClaimLevel() { @Override public int getMinClaimLevel() { - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.MIN_LEVEL, this).intValue(); + return GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.MIN_LEVEL, this).intValue(); } @Override public double getEconomyClaimBlockCost() { - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.ECONOMY_BLOCK_COST, this); + return GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.ECONOMY_BLOCK_COST, this); } @Override public double getEconomyClaimBlockReturn() { - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(this.getSubject(), Options.ECONOMY_BLOCK_SELL_RETURN, this); + return GDPermissionManager.getInstance().getInternalOptionValue(this.getSubject(), Options.ECONOMY_BLOCK_SELL_RETURN, this); } @Override diff --git a/bukkit/src/main/java/com/griefdefender/GriefDefenderPlugin.java b/bukkit/src/main/java/com/griefdefender/GriefDefenderPlugin.java index a9d3486..32a786d 100644 --- a/bukkit/src/main/java/com/griefdefender/GriefDefenderPlugin.java +++ b/bukkit/src/main/java/com/griefdefender/GriefDefenderPlugin.java @@ -41,6 +41,7 @@ import com.griefdefender.api.claim.TrustType; import com.griefdefender.api.permission.flag.Flag; import com.griefdefender.api.permission.option.Option; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.claim.GDClaimManager; @@ -178,7 +179,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -670,6 +670,13 @@ public void registerBaseCommands() { } return ImmutableList.copyOf(tabList); }); + manager.getCommandCompletions().registerCompletion("gdentityids", c -> { + List tabList = new ArrayList<>(); + for (GDEntityType type : EntityTypeRegistryModule.getInstance().getAll()) { + tabList.add(type.getName()); + } + return ImmutableList.copyOf(tabList); + }); manager.getCommandCompletions().registerCompletion("gdmcids", c -> { List tabList = new ArrayList<>(); for (GDItemType type : ItemTypeRegistryModule.getInstance().getAll()) { @@ -776,6 +783,7 @@ public void loadConfig() { // refresh default permissions this.dataStore.setDefaultGlobalPermissions(); } + MessageCache.getInstance().loadCache(); } catch (Exception e) { e.printStackTrace(); } diff --git a/bukkit/src/main/java/com/griefdefender/cache/MessageCache.java b/bukkit/src/main/java/com/griefdefender/cache/MessageCache.java new file mode 100644 index 0000000..aee596c --- /dev/null +++ b/bukkit/src/main/java/com/griefdefender/cache/MessageCache.java @@ -0,0 +1,534 @@ +/* + * This file is part of GriefDefender, licensed under the MIT License (MIT). + * + * Copyright (c) bloodmc + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.griefdefender.cache; + +import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.configuration.MessageDataConfig; + +import net.kyori.text.Component; + +public class MessageCache { + + private static MessageCache instance; + + static { + instance = new MessageCache(); + } + + public static MessageCache getInstance() { + return instance; + } + + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + + public Component ABANDON_CLAIM_MISSING; + public Component ABANDON_TOP_LEVEL; + public Component ABANDON_TOWN_CHILDREN; + public Component ABANDON_WARNING; + public Component BANK_CLICK_VIEW_TRANSACTIONS; + public Component BANK_DEPOSIT_NO_FUNDS; + public Component BANK_TITLE_TRANSACTIONS; + public Component BANK_TAX_SYSTEM_DISABLED; + public Component CLAIM_AUTOMATIC_NOTIFICATION; + public Component CLAIM_CHEST_CONFIRMATION; + public Component CLAIM_CHILDREN_WARNING; + public Component CLAIM_DISABLED_WORLD; + public Component CLAIM_FAREWELL_CLEAR; + public Component CLAIM_GREETING_CLEAR; + public Component CLAIM_IGNORE; + public Component CLAIM_NO_CLAIMS; + public Component CLAIM_NOT_FOUND; + public Component CLAIM_NOT_YOURS; + public Component CLAIM_OWNER_ALREADY; + public Component CLAIM_OWNER_ONLY; + public Component CLAIM_RESPECTING; + public Component CLAIM_RESTORE_SUCCESS; + public Component CLAIM_TOO_FAR; + public Component CLAIMINFO_UI_ADMIN_SETTINGS; + public Component CLAIMINFO_UI_BANK_INFO; + public Component CLAIMINFO_UI_CLAIM_EXPIRATION; + public Component CLAIMINFO_UI_CLICK_ADMIN; + public Component CLAIMINFO_UI_CLICK_BANK; + public Component CLAIMINFO_UI_CLICK_TOGGLE; + public Component CLAIMINFO_UI_DENY_MESSAGES; + public Component CLAIMINFO_UI_FLAG_OVERRIDES; + public Component CLAIMINFO_UI_FOR_SALE; + public Component CLAIMINFO_UI_INHERIT_PARENT; + public Component CLAIMINFO_UI_LAST_ACTIVE; + public Component CLAIMINFO_UI_NORTH_CORNERS; + public Component CLAIMINFO_UI_PVP_OVERRIDES; + public Component CLAIMINFO_UI_REQUIRES_CLAIM_BLOCKS; + public Component CLAIMINFO_UI_RETURN_BANKINFO; + public Component CLAIMINFO_UI_RETURN_CLAIMINFO; + public Component CLAIMINFO_UI_RETURN_SETTINGS; + public Component CLAIMINFO_UI_SIZE_RESTRICTIONS; + public Component CLAIMINFO_UI_SOUTH_CORNERS; + public Component CLAIMINFO_UI_TELEPORT_FEATURE; + public Component CLAIMINFO_UI_TELEPORT_SPAWN; + public Component CLAIMINFO_UI_TITLE_CLAIMINFO; + public Component CLAIMINFO_UI_TOWN_SETTINGS; + public Component CLAIMLIST_UI_CLICK_INFO; + public Component CLAIMLIST_UI_CLICK_PURCHASE; + public Component CLAIMLIST_UI_CLICK_VIEW_CHILDREN; + public Component CLAIMLIST_UI_CLICK_VIEW_CLAIMS; + public Component CLAIMLIST_UI_NO_CLAIMS_FOUND; + public Component CLAIMLIST_UI_RETURN_CLAIMSLIST; + public Component CLAIMLIST_UI_TITLE; + public Component CLAIMLIST_UI_TITLE_CHILD_CLAIMS; + public Component COMMAND_CLAIMBUY_TITLE; + public Component COMMAND_CLAIMCLEAR_UUID_DENY; + public Component COMMAND_CLAIMFLAGDEBUG_DISABLED; + public Component COMMAND_CLAIMFLAGDEBUG_ENABLED; + public Component COMMAND_CLAIMINFO_NOT_FOUND; + public Component COMMAND_CLAIMINFO_UUID_REQUIRED; + public Component COMMAND_CLAIMINHERIT_DISABLED; + public Component COMMAND_CLAIMINHERIT_ENABLED; + public Component COMMAND_CUBOID_DISABLED; + public Component COMMAND_CUBOID_ENABLED; + public Component COMMAND_INHERIT_ONLY_CHILD; + public Component COMMAND_INVALID; + public Component COMMAND_INVALID_PLAYER_GROUP; + public Component COMMAND_NOT_AVAILABLE_ECONOMY; + public Component COMMAND_WORLDEDIT_MISSING; + public Component CREATE_CANCEL; + public Component CREATE_CUBOID_DISABLED; + public Component CREATE_OVERLAP; + public Component CREATE_OVERLAP_SHORT; + public Component CREATE_SUBDIVISION_FAIL; + public Component CREATE_SUBDIVISION_ONLY; + public Component DEBUG_NO_RECORDS; + public Component DEBUG_PASTE_SUCCESS; + public Component DEBUG_RECORD_END; + public Component DEBUG_RECORD_START; + public Component DEBUG_TIME_ELAPSED; + public Component DELETE_CLAIM; + public Component ECONOMY_BLOCK_BUY_INVALID; + public Component ECONOMY_BLOCK_BUY_SELL_DISABLED; + public Component ECONOMY_BLOCK_NOT_AVAILABLE; + public Component ECONOMY_BLOCK_ONLY_BUY; + public Component ECONOMY_BLOCK_ONLY_SELL; + public Component ECONOMY_CLAIM_NOT_FOR_SALE; + public Component ECONOMY_CLAIM_SALE_CANCELLED; + public Component ECONOMY_NOT_INSTALLED; + public Component ECONOMY_VIRTUAL_NOT_SUPPORTED; + public Component FEATURE_NOT_AVAILABLE; + public Component FLAG_DESCRIPTION_BLOCK_BREAK; + public Component FLAG_DESCRIPTION_BLOCK_GROW; + public Component FLAG_DESCRIPTION_BLOCK_MODIFY; + public Component FLAG_DESCRIPTION_BLOCK_PLACE; + public Component FLAG_DESCRIPTION_COLLIDE_BLOCK; + public Component FLAG_DESCRIPTION_COLLIDE_ENTITY; + public Component FLAG_DESCRIPTION_COMMAND_EXECUTE; + public Component FLAG_DESCRIPTION_COMMAND_EXECUTE_PVP; + public Component FLAG_DESCRIPTION_ENTER_CLAIM; + public Component FLAG_DESCRIPTION_ENTITY_CHUNK_SPAWN; + public Component FLAG_DESCRIPTION_ENTITY_DAMAGE; + public Component FLAG_DESCRIPTION_ENTITY_RIDING; + public Component FLAG_DESCRIPTION_ENTITY_SPAWN; + public Component FLAG_DESCRIPTION_ENTITY_TELEPORT_FROM; + public Component FLAG_DESCRIPTION_ENTITY_TELEPORT_TO; + public Component FLAG_DESCRIPTION_EXIT_CLAIM; + public Component FLAG_DESCRIPTION_EXPLOSION_BLOCK; + public Component FLAG_DESCRIPTION_EXPLOSION_ENTITY; + public Component FLAG_DESCRIPTION_FIRE_SPREAD; + public Component FLAG_DESCRIPTION_INTERACT_BLOCK_PRIMARY; + public Component FLAG_DESCRIPTION_INTERACT_BLOCK_SECONDARY; + public Component FLAG_DESCRIPTION_INTERACT_ENTITY_PRIMARY; + public Component FLAG_DESCRIPTION_INTERACT_ENTITY_SECONDARY; + public Component FLAG_DESCRIPTION_INTERACT_INVENTORY; + public Component FLAG_DESCRIPTION_INTERACT_ITEM_PRIMARY; + public Component FLAG_DESCRIPTION_INTERACT_ITEM_SECONDARY; + public Component FLAG_DESCRIPTION_INTERACT_INVENTORY_CLICK; + public Component FLAG_DESCRIPTION_ITEM_DROP; + public Component FLAG_DESCRIPTION_ITEM_PICKUP; + public Component FLAG_DESCRIPTION_ITEM_SPAWN; + public Component FLAG_DESCRIPTION_ITEM_USE; + public Component FLAG_DESCRIPTION_LEAF_DECAY; + public Component FLAG_DESCRIPTION_LIQUID_FLOW; + public Component FLAG_DESCRIPTION_PORTAL_USE; + public Component FLAG_DESCRIPTION_PROJECTILE_IMPACT_BLOCK; + public Component FLAG_DESCRIPTION_PROJECTILE_IMPACT_ENTITY; + public Component FLAG_RESET_SUCCESS; + public Component FLAG_UI_CLICK_ALLOW; + public Component FLAG_UI_CLICK_DENY; + public Component FLAG_UI_CLICK_REMOVE; + public Component FLAG_UI_INFO_CLAIM; + public Component FLAG_UI_INFO_DEFAULT; + public Component FLAG_UI_INFO_INHERIT; + public Component FLAG_UI_INFO_OVERRIDE; + public Component FLAG_UI_OVERRIDE_NO_PERMISSION; + public Component FLAG_UI_RETURN_FLAGS; + public Component LABEL_ACCESSORS; + public Component LABEL_AREA; + public Component LABEL_BLOCKS; + public Component LABEL_BUILDERS; + public Component LABEL_BUY; + public Component LABEL_CHILDREN; + public Component LABEL_CONFIRM; + public Component LABEL_CONTAINERS; + public Component LABEL_CONTEXT; + public Component LABEL_CREATED; + public Component LABEL_DISPLAYING; + public Component LABEL_EXPIRED; + public Component LABEL_FAREWELL; + public Component LABEL_FLAG; + public Component LABEL_GREETING; + public Component LABEL_GROUP; + public Component LABEL_LOCATION; + public Component LABEL_MANAGERS; + public Component LABEL_NAME; + public Component LABEL_NO; + public Component LABEL_OUTPUT; + public Component LABEL_OWNER; + public Component LABEL_PERMISSION; + public Component LABEL_PLAYER; + public Component LABEL_PRICE; + public Component LABEL_RESIZABLE; + public Component LABEL_RESULT; + public Component LABEL_SCHEMATIC; + public Component LABEL_SOURCE; + public Component LABEL_SPAWN; + public Component LABEL_TARGET; + public Component LABEL_TRUST; + public Component LABEL_TYPE; + public Component LABEL_WORLD; + public Component LABEL_UNKNOWN; + public Component LABEL_USER; + public Component LABEL_YES; + public Component MODE_ADMIN; + public Component MODE_BASIC; + public Component MODE_NATURE; + public Component MODE_SUBDIVISION; + public Component MODE_TOWN; + public Component OWNER_ADMIN; + public Component PERMISSION_ASSIGN_WITHOUT_HAVING; + public Component PERMISSION_CLAIM_CREATE; + public Component PERMISSION_CLAIM_ENTER; + public Component PERMISSION_CLAIM_EXIT; + public Component PERMISSION_CLAIM_LIST; + public Component PERMISSION_CLAIM_RESET_FLAGS_SELF; + public Component PERMISSION_CLAIM_RESIZE; + public Component PERMISSION_CLAIM_SALE; + public Component PERMISSION_CLAIM_TRANSFER_ADMIN; + public Component PERMISSION_CLEAR; + public Component PERMISSION_CLEAR_ALL; + public Component PERMISSION_COMMAND_TRUST; + public Component PERMISSION_CUBOID; + public Component PERMISSION_EDIT_CLAIM; + public Component PERMISSION_FIRE_SPREAD; + public Component PERMISSION_FLAG_DEFAULTS; + public Component PERMISSION_FLAG_OVERRIDES; + public Component PERMISSION_FLAG_USE; + public Component PERMISSION_FLOW_LIQUID; + public Component PERMISSION_GLOBAL_OPTION; + public Component PERMISSION_GRANT; + public Component PERMISSION_GROUP_OPTION; + public Component PERMISSION_OVERRIDE_DENY; + public Component PERMISSION_PLAYER_ADMIN_FLAGS; + public Component PERMISSION_PLAYER_OPTION; + public Component PERMISSION_PLAYER_VIEW_OTHERS; + public Component PERMISSION_VISUAL_CLAIMS_NEARBY; + public Component PLAYERINFO_UI_TITLE; + public Component PLUGIN_EVENT_CANCEL; + public Component PLUGIN_RELOAD; + public Component RESIZE_OVERLAP; + public Component RESIZE_OVERLAP_SUBDIVISION; + public Component RESIZE_SAME_LOCATION; + public Component RESIZE_START; + public Component SCHEMATIC_CREATE; + public Component SCHEMATIC_CREATE_COMPLETE; + public Component SCHEMATIC_CREATE_FAIL; + public Component SCHEMATIC_NONE; + public Component SPAWN_NOT_SET; + public Component TITLE_ACCESSOR; + public Component TITLE_ALL; + public Component TITLE_BUILDER; + public Component TITLE_CLAIM; + public Component TITLE_CONTAINER; + public Component TITLE_DEFAULT; + public Component TITLE_INHERIT; + public Component TITLE_MANAGER; + public Component TITLE_OWN; + public Component TITLE_OVERRIDE; + public Component TOWN_CHAT_DISABLED; + public Component TOWN_CHAT_ENABLED; + public Component TOWN_NOT_FOUND; + public Component TOWN_NOT_IN; + public Component TOWN_OWNER; + public Component TOWN_TAG_CLEAR; + public Component TOWN_TAX_NO_CLAIMS; + public Component TRUST_CLICK_SHOW_LIST; + public Component TRUST_INVALID; + public Component TRUST_LIST_HEADER; + public Component TRUST_NO_CLAIMS; + public Component TRUST_SELF; + public Component UNTRUST_NO_CLAIMS; + public Component UNTRUST_SELF; + + public void loadCache() { + ABANDON_CLAIM_MISSING = MESSAGE_DATA.getMessage("abandon-claim-missing"); + ABANDON_TOP_LEVEL = MESSAGE_DATA.getMessage("abandon-top-level"); + ABANDON_TOWN_CHILDREN = MESSAGE_DATA.getMessage("abandon-town-children"); + ABANDON_WARNING = MESSAGE_DATA.getMessage("abandon-warning"); + BANK_CLICK_VIEW_TRANSACTIONS = MESSAGE_DATA.getMessage("bank-click-view-transactions"); + BANK_DEPOSIT_NO_FUNDS = MESSAGE_DATA.getMessage("bank-deposit-no-funds"); + BANK_TAX_SYSTEM_DISABLED = MESSAGE_DATA.getMessage("bank-tax-system-disabled"); + BANK_TITLE_TRANSACTIONS = MESSAGE_DATA.getMessage("bank-title-transactions"); + CLAIM_AUTOMATIC_NOTIFICATION = MESSAGE_DATA.getMessage("claim-automatic-notification"); + CLAIM_CHEST_CONFIRMATION = MESSAGE_DATA.getMessage("claim-chest-confirmation"); + CLAIM_CHILDREN_WARNING = MESSAGE_DATA.getMessage("claim-children-warning"); + CLAIM_DISABLED_WORLD = MESSAGE_DATA.getMessage("claim-disabled-world"); + CLAIM_FAREWELL_CLEAR = MESSAGE_DATA.getMessage("claim-farewell-clear"); + CLAIM_GREETING_CLEAR = MESSAGE_DATA.getMessage("claim-greeting-clear"); + CLAIM_IGNORE = MESSAGE_DATA.getMessage("claim-ignore"); + CLAIM_NO_CLAIMS = MESSAGE_DATA.getMessage("claim-no-claims"); + CLAIM_NOT_FOUND = MESSAGE_DATA.getMessage("claim-not-found"); + CLAIM_NOT_YOURS = MESSAGE_DATA.getMessage("claim-not-yours"); + CLAIM_OWNER_ALREADY = MESSAGE_DATA.getMessage("claim-owner-already"); + CLAIM_OWNER_ONLY = MESSAGE_DATA.getMessage("claim-owner-only"); + CLAIM_RESPECTING = MESSAGE_DATA.getMessage("claim-respecting"); + CLAIM_RESTORE_SUCCESS = MESSAGE_DATA.getMessage("claim-restore-success"); + CLAIM_TOO_FAR = MESSAGE_DATA.getMessage("claim-too-far"); + CLAIMINFO_UI_ADMIN_SETTINGS = MESSAGE_DATA.getMessage("claiminfo-ui-admin-settings"); + CLAIMINFO_UI_BANK_INFO = MESSAGE_DATA.getMessage("claiminfo-ui-bank-info"); + CLAIMINFO_UI_CLAIM_EXPIRATION = MESSAGE_DATA.getMessage("claiminfo-ui-claim-expiration"); + CLAIMINFO_UI_CLICK_ADMIN = MESSAGE_DATA.getMessage("claiminfo-ui-click-admin"); + CLAIMINFO_UI_CLICK_BANK = MESSAGE_DATA.getMessage("claiminfo-ui-click-bank"); + CLAIMINFO_UI_CLICK_TOGGLE = MESSAGE_DATA.getMessage("claiminfo-ui-click-toggle"); + CLAIMINFO_UI_DENY_MESSAGES = MESSAGE_DATA.getMessage("claiminfo-ui-deny-messages"); + CLAIMINFO_UI_FLAG_OVERRIDES = MESSAGE_DATA.getMessage("claiminfo-ui-flag-overrides"); + CLAIMINFO_UI_FOR_SALE = MESSAGE_DATA.getMessage("claiminfo-ui-for-sale"); + CLAIMINFO_UI_INHERIT_PARENT = MESSAGE_DATA.getMessage("claiminfo-ui-inherit-parent"); + CLAIMINFO_UI_LAST_ACTIVE = MESSAGE_DATA.getMessage("claiminfo-ui-last-active"); + CLAIMINFO_UI_NORTH_CORNERS = MESSAGE_DATA.getMessage("claiminfo-ui-north-corners"); + CLAIMINFO_UI_PVP_OVERRIDES = MESSAGE_DATA.getMessage("claiminfo-ui-pvp-overrides"); + CLAIMINFO_UI_REQUIRES_CLAIM_BLOCKS = MESSAGE_DATA.getMessage("claiminfo-ui-requires-claim-blocks"); + CLAIMINFO_UI_RETURN_BANKINFO = MESSAGE_DATA.getMessage("claiminfo-ui-return-bankinfo"); + CLAIMINFO_UI_RETURN_CLAIMINFO = MESSAGE_DATA.getMessage("claiminfo-ui-return-claiminfo"); + CLAIMINFO_UI_RETURN_SETTINGS = MESSAGE_DATA.getMessage("claiminfo-ui-return-settings"); + CLAIMINFO_UI_SIZE_RESTRICTIONS = MESSAGE_DATA.getMessage("claiminfo-ui-size-restrictions"); + CLAIMINFO_UI_SOUTH_CORNERS = MESSAGE_DATA.getMessage("claiminfo-ui-south-corners"); + CLAIMINFO_UI_TELEPORT_FEATURE = MESSAGE_DATA.getMessage("claiminfo-ui-teleport-feature"); + CLAIMINFO_UI_TELEPORT_SPAWN = MESSAGE_DATA.getMessage("claiminfo-ui-teleport-spawn"); + CLAIMINFO_UI_TITLE_CLAIMINFO = MESSAGE_DATA.getMessage("claiminfo-ui-title-claiminfo"); + CLAIMINFO_UI_TOWN_SETTINGS = MESSAGE_DATA.getMessage("claiminfo-ui-town-settings"); + CLAIMLIST_UI_CLICK_INFO = MESSAGE_DATA.getMessage("claimlist-ui-click-info"); + CLAIMLIST_UI_CLICK_PURCHASE = MESSAGE_DATA.getMessage("claimlist-ui-click-purchase"); + CLAIMLIST_UI_CLICK_VIEW_CHILDREN = MESSAGE_DATA.getMessage("claimlist-ui-click-view-children"); + CLAIMLIST_UI_CLICK_VIEW_CLAIMS = MESSAGE_DATA.getMessage("claimlist-ui-click-view-claims"); + CLAIMLIST_UI_NO_CLAIMS_FOUND = MESSAGE_DATA.getMessage("claimlist-ui-no-claims-found"); + CLAIMLIST_UI_RETURN_CLAIMSLIST = MESSAGE_DATA.getMessage("claimlist-ui-return-claimlist"); + CLAIMLIST_UI_TITLE = MESSAGE_DATA.getMessage("claimlist-ui-title"); + CLAIMLIST_UI_TITLE_CHILD_CLAIMS = MESSAGE_DATA.getMessage("claimlist-ui-title-child-claims"); + COMMAND_CLAIMBUY_TITLE = MESSAGE_DATA.getMessage("command-claimbuy-title"); + COMMAND_CLAIMCLEAR_UUID_DENY = MESSAGE_DATA.getMessage("command-claimclear-uuid-deny"); + COMMAND_CLAIMFLAGDEBUG_DISABLED = MESSAGE_DATA.getMessage("command-claimflagdebug-disabled"); + COMMAND_CLAIMFLAGDEBUG_ENABLED = MESSAGE_DATA.getMessage("command-claimflagdebug-enabled"); + COMMAND_CLAIMINFO_NOT_FOUND = MESSAGE_DATA.getMessage("command-claiminfo-not-found"); + COMMAND_CLAIMINFO_UUID_REQUIRED = MESSAGE_DATA.getMessage("command-claiminfo-uuid-required"); + COMMAND_CLAIMINHERIT_DISABLED = MESSAGE_DATA.getMessage("command-claiminherit-disabled"); + COMMAND_CLAIMINHERIT_ENABLED = MESSAGE_DATA.getMessage("command-claiminherit-enabled"); + COMMAND_CUBOID_DISABLED = MESSAGE_DATA.getMessage("command-cuboid-disabled"); + COMMAND_CUBOID_ENABLED = MESSAGE_DATA.getMessage("command-cuboid-enabled"); + COMMAND_INHERIT_ONLY_CHILD = MESSAGE_DATA.getMessage("command-inherit-only-child"); + COMMAND_INVALID = MESSAGE_DATA.getMessage("command-invalid"); + COMMAND_INVALID_PLAYER_GROUP = MESSAGE_DATA.getMessage("command-invalid-player-group"); + COMMAND_NOT_AVAILABLE_ECONOMY = MESSAGE_DATA.getMessage("command-not-available-economy"); + COMMAND_WORLDEDIT_MISSING = MESSAGE_DATA.getMessage("command-worldedit-missing"); + CREATE_CANCEL = MESSAGE_DATA.getMessage("create-cancel"); + CREATE_CUBOID_DISABLED = MESSAGE_DATA.getMessage("create-cuboid-disabled"); + CREATE_OVERLAP = MESSAGE_DATA.getMessage("create-overlap"); + CREATE_OVERLAP_SHORT = MESSAGE_DATA.getMessage("create-overlap-short"); + CREATE_SUBDIVISION_FAIL = MESSAGE_DATA.getMessage("create-subdivision-fail"); + CREATE_SUBDIVISION_ONLY = MESSAGE_DATA.getMessage("create-subdivision-only"); + DEBUG_NO_RECORDS = MESSAGE_DATA.getMessage("debug-no-records"); + DEBUG_PASTE_SUCCESS = MESSAGE_DATA.getMessage("debug-paste-success"); + DEBUG_RECORD_END = MESSAGE_DATA.getMessage("debug-record-end"); + DEBUG_RECORD_START = MESSAGE_DATA.getMessage("debug-record-start"); + DEBUG_TIME_ELAPSED = MESSAGE_DATA.getMessage("debug-time-elapsed"); + DELETE_CLAIM = MESSAGE_DATA.getMessage("delete-claim"); + ECONOMY_BLOCK_BUY_INVALID = MESSAGE_DATA.getMessage("economy-block-buy-invalid"); + ECONOMY_BLOCK_BUY_SELL_DISABLED = MESSAGE_DATA.getMessage("economy-block-buy-sell-disabled"); + ECONOMY_BLOCK_NOT_AVAILABLE = MESSAGE_DATA.getMessage("economy-block-not-available"); + ECONOMY_BLOCK_ONLY_BUY = MESSAGE_DATA.getMessage("economy-block-only-buy"); + ECONOMY_BLOCK_ONLY_SELL = MESSAGE_DATA.getMessage("economy-block-only-sell"); + ECONOMY_CLAIM_NOT_FOR_SALE = MESSAGE_DATA.getMessage("economy-claim-not-for-sale"); + ECONOMY_CLAIM_SALE_CANCELLED = MESSAGE_DATA.getMessage("economy-claim-sale-cancelled"); + ECONOMY_NOT_INSTALLED = MESSAGE_DATA.getMessage("economy-not-installed"); + ECONOMY_VIRTUAL_NOT_SUPPORTED = MESSAGE_DATA.getMessage("economy-virtual-not-supported"); + FEATURE_NOT_AVAILABLE = MESSAGE_DATA.getMessage("feature-not-available"); + FLAG_DESCRIPTION_BLOCK_BREAK = MESSAGE_DATA.getMessage("flag-description-block-break"); + FLAG_DESCRIPTION_BLOCK_GROW = MESSAGE_DATA.getMessage("flag-description-block-grow"); + FLAG_DESCRIPTION_BLOCK_MODIFY = MESSAGE_DATA.getMessage("flag-description-block-modify"); + FLAG_DESCRIPTION_BLOCK_PLACE = MESSAGE_DATA.getMessage("flag-description-block-place"); + FLAG_DESCRIPTION_COLLIDE_BLOCK = MESSAGE_DATA.getMessage("flag-description-collide-block"); + FLAG_DESCRIPTION_COLLIDE_ENTITY = MESSAGE_DATA.getMessage("flag-description-collide-entity"); + FLAG_DESCRIPTION_COMMAND_EXECUTE = MESSAGE_DATA.getMessage("flag-description-command-execute"); + FLAG_DESCRIPTION_COMMAND_EXECUTE_PVP = MESSAGE_DATA.getMessage("flag-description-command-execute-pvp"); + FLAG_DESCRIPTION_ENTER_CLAIM = MESSAGE_DATA.getMessage("flag-description-enter-claim"); + FLAG_DESCRIPTION_ENTITY_CHUNK_SPAWN = MESSAGE_DATA.getMessage("flag-description-entity-chunk-spawn"); + FLAG_DESCRIPTION_ENTITY_DAMAGE = MESSAGE_DATA.getMessage("flag-description-entity-damage"); + FLAG_DESCRIPTION_ENTITY_RIDING = MESSAGE_DATA.getMessage("flag-description-entity-riding"); + FLAG_DESCRIPTION_ENTITY_SPAWN = MESSAGE_DATA.getMessage("flag-description-entity-spawn"); + FLAG_DESCRIPTION_ENTITY_TELEPORT_FROM = MESSAGE_DATA.getMessage("flag-description-entity-teleport-from"); + FLAG_DESCRIPTION_ENTITY_TELEPORT_TO = MESSAGE_DATA.getMessage("flag-description-entity-teleport-to"); + FLAG_DESCRIPTION_EXIT_CLAIM = MESSAGE_DATA.getMessage("flag-description-exit-claim"); + FLAG_DESCRIPTION_EXPLOSION_BLOCK = MESSAGE_DATA.getMessage("flag-description-explosion-block"); + FLAG_DESCRIPTION_EXPLOSION_ENTITY = MESSAGE_DATA.getMessage("flag-description-explosion-entity"); + FLAG_DESCRIPTION_FIRE_SPREAD = MESSAGE_DATA.getMessage("flag-description-fire-spread"); + FLAG_DESCRIPTION_INTERACT_BLOCK_PRIMARY = MESSAGE_DATA.getMessage("flag-description-block-primary"); + FLAG_DESCRIPTION_INTERACT_BLOCK_SECONDARY = MESSAGE_DATA.getMessage("flag-description-block-secondary"); + FLAG_DESCRIPTION_INTERACT_ENTITY_PRIMARY = MESSAGE_DATA.getMessage("flag-description-entity-primary"); + FLAG_DESCRIPTION_INTERACT_ENTITY_SECONDARY = MESSAGE_DATA.getMessage("flag-description-entity-secondary"); + FLAG_DESCRIPTION_INTERACT_ITEM_PRIMARY = MESSAGE_DATA.getMessage("flag-description-interact-item-primary"); + FLAG_DESCRIPTION_INTERACT_ITEM_SECONDARY = MESSAGE_DATA.getMessage("flag-description-interact-item-secondary"); + FLAG_DESCRIPTION_INTERACT_INVENTORY = MESSAGE_DATA.getMessage("flag-description-interact-inventory"); + FLAG_DESCRIPTION_INTERACT_INVENTORY_CLICK = MESSAGE_DATA.getMessage("flag-description-interact-inventory-click"); + FLAG_DESCRIPTION_ITEM_DROP = MESSAGE_DATA.getMessage("flag-description-item-drop"); + FLAG_DESCRIPTION_ITEM_PICKUP = MESSAGE_DATA.getMessage("flag-description-item-pickup"); + FLAG_DESCRIPTION_ITEM_SPAWN = MESSAGE_DATA.getMessage("flag-description-item-spawn"); + FLAG_DESCRIPTION_ITEM_USE = MESSAGE_DATA.getMessage("flag-description-item-use"); + FLAG_DESCRIPTION_LEAF_DECAY = MESSAGE_DATA.getMessage("flag-description-leaf-decay"); + FLAG_DESCRIPTION_LIQUID_FLOW = MESSAGE_DATA.getMessage("flag-description-liquid-flow"); + FLAG_DESCRIPTION_PORTAL_USE = MESSAGE_DATA.getMessage("flag-description-portal-use"); + FLAG_DESCRIPTION_PROJECTILE_IMPACT_BLOCK = MESSAGE_DATA.getMessage("flag-description-projectile-impact-block"); + FLAG_DESCRIPTION_PROJECTILE_IMPACT_ENTITY = MESSAGE_DATA.getMessage("flag-description-projectile-impact-entity"); + FLAG_RESET_SUCCESS = MESSAGE_DATA.getMessage("flag-reset-success"); + FLAG_UI_CLICK_ALLOW = MESSAGE_DATA.getMessage("flag-ui-click-allow"); + FLAG_UI_CLICK_DENY = MESSAGE_DATA.getMessage("flag-ui-click-deny"); + FLAG_UI_CLICK_REMOVE = MESSAGE_DATA.getMessage("flag-ui-click-remove"); + FLAG_UI_INFO_CLAIM = MESSAGE_DATA.getMessage("flag-ui-info-claim"); + FLAG_UI_INFO_DEFAULT = MESSAGE_DATA.getMessage("flag-ui-info-default"); + FLAG_UI_INFO_INHERIT = MESSAGE_DATA.getMessage("flag-ui-info-inherit"); + FLAG_UI_INFO_OVERRIDE = MESSAGE_DATA.getMessage("flag-ui-info-override"); + FLAG_UI_OVERRIDE_NO_PERMISSION = MESSAGE_DATA.getMessage("flag-ui-override-no-permission"); + FLAG_UI_RETURN_FLAGS = MESSAGE_DATA.getMessage("flag-ui-return-flags"); + LABEL_ACCESSORS = MESSAGE_DATA.getMessage("label-accessors"); + LABEL_AREA = MESSAGE_DATA.getMessage("label-area"); + LABEL_BLOCKS = MESSAGE_DATA.getMessage("label-blocks"); + LABEL_BUILDERS = MESSAGE_DATA.getMessage("label-builders"); + LABEL_BUY = MESSAGE_DATA.getMessage("label-buy"); + LABEL_CHILDREN = MESSAGE_DATA.getMessage("label-children"); + LABEL_CONFIRM = MESSAGE_DATA.getMessage("label-confirm"); + LABEL_CONTAINERS = MESSAGE_DATA.getMessage("label-containers"); + LABEL_CONTEXT = MESSAGE_DATA.getMessage("label-context"); + LABEL_CREATED = MESSAGE_DATA.getMessage("label-created"); + LABEL_DISPLAYING = MESSAGE_DATA.getMessage("label-displaying"); + LABEL_EXPIRED = MESSAGE_DATA.getMessage("label-expired"); + LABEL_FAREWELL = MESSAGE_DATA.getMessage("label-farewell"); + LABEL_FLAG = MESSAGE_DATA.getMessage("label-flag"); + LABEL_GREETING = MESSAGE_DATA.getMessage("label-greeting"); + LABEL_GROUP = MESSAGE_DATA.getMessage("label-group"); + LABEL_LOCATION = MESSAGE_DATA.getMessage("label-location"); + LABEL_MANAGERS = MESSAGE_DATA.getMessage("label-managers"); + LABEL_NAME = MESSAGE_DATA.getMessage("label-name"); + LABEL_NO = MESSAGE_DATA.getMessage("label-no"); + LABEL_OUTPUT = MESSAGE_DATA.getMessage("label-output"); + LABEL_OWNER = MESSAGE_DATA.getMessage("label-owner"); + LABEL_PERMISSION = MESSAGE_DATA.getMessage("label-permission"); + LABEL_PLAYER = MESSAGE_DATA.getMessage("label-player"); + LABEL_PRICE = MESSAGE_DATA.getMessage("label-price"); + LABEL_RESIZABLE = MESSAGE_DATA.getMessage("label-resizable"); + LABEL_RESULT = MESSAGE_DATA.getMessage("label-result"); + LABEL_SCHEMATIC = MESSAGE_DATA.getMessage("label-schematic"); + LABEL_SOURCE = MESSAGE_DATA.getMessage("label-source"); + LABEL_SPAWN = MESSAGE_DATA.getMessage("label-spawn"); + LABEL_TARGET = MESSAGE_DATA.getMessage("label-target"); + LABEL_TRUST = MESSAGE_DATA.getMessage("label-trust"); + LABEL_TYPE = MESSAGE_DATA.getMessage("label-type"); + LABEL_UNKNOWN = MESSAGE_DATA.getMessage("label-unknown"); + LABEL_USER = MESSAGE_DATA.getMessage("label-user"); + LABEL_WORLD = MESSAGE_DATA.getMessage("label-world"); + LABEL_YES = MESSAGE_DATA.getMessage("label-yes"); + MODE_ADMIN = MESSAGE_DATA.getMessage("mode-admin"); + MODE_BASIC = MESSAGE_DATA.getMessage("mode-basic"); + MODE_NATURE = MESSAGE_DATA.getMessage("mode-nature"); + MODE_SUBDIVISION = MESSAGE_DATA.getMessage("mode-subdivision"); + MODE_TOWN = MESSAGE_DATA.getMessage("mode-town"); + OWNER_ADMIN = MESSAGE_DATA.getMessage("owner-admin"); + PERMISSION_ASSIGN_WITHOUT_HAVING = MESSAGE_DATA.getMessage("permission-assign-without-having"); + PERMISSION_CLAIM_CREATE = MESSAGE_DATA.getMessage("permission-claim-create"); + PERMISSION_CLAIM_ENTER = MESSAGE_DATA.getMessage("permission-claim-enter"); + PERMISSION_CLAIM_EXIT = MESSAGE_DATA.getMessage("permission-claim-exit"); + PERMISSION_CLAIM_LIST = MESSAGE_DATA.getMessage("permission-claim-list"); + PERMISSION_CLAIM_RESET_FLAGS_SELF = MESSAGE_DATA.getMessage("permission-claim-reset-flags-self"); + PERMISSION_CLAIM_RESIZE = MESSAGE_DATA.getMessage("permission-claim-resize"); + PERMISSION_CLAIM_SALE = MESSAGE_DATA.getMessage("permission-claim-sale"); + PERMISSION_CLAIM_TRANSFER_ADMIN = MESSAGE_DATA.getMessage("permission-claim-transfer-admin"); + PERMISSION_CLEAR = MESSAGE_DATA.getMessage("permission-clear"); + PERMISSION_CLEAR_ALL = MESSAGE_DATA.getMessage("permission-clear-all"); + PERMISSION_COMMAND_TRUST = MESSAGE_DATA.getMessage("permission-command-trust"); + PERMISSION_CUBOID = MESSAGE_DATA.getMessage("permission-cuboid"); + PERMISSION_EDIT_CLAIM = MESSAGE_DATA.getMessage("permission-edit-claim"); + PERMISSION_FIRE_SPREAD = MESSAGE_DATA.getMessage("permission-fire-spread"); + PERMISSION_FLAG_DEFAULTS = MESSAGE_DATA.getMessage("permission-flag-defaults"); + PERMISSION_FLAG_OVERRIDES = MESSAGE_DATA.getMessage("permission-flag-overrides"); + PERMISSION_FLAG_USE = MESSAGE_DATA.getMessage("permission-flag-use"); + PERMISSION_FLOW_LIQUID = MESSAGE_DATA.getMessage("permission-flow-liquid"); + PERMISSION_GLOBAL_OPTION = MESSAGE_DATA.getMessage("permission-global-option"); + PERMISSION_GRANT = MESSAGE_DATA.getMessage("permission-grant"); + PERMISSION_GROUP_OPTION = MESSAGE_DATA.getMessage("permission-group-option"); + PERMISSION_OVERRIDE_DENY = MESSAGE_DATA.getMessage("permission-override-deny"); + PERMISSION_PLAYER_ADMIN_FLAGS = MESSAGE_DATA.getMessage("permission-player-admin-flags"); + PERMISSION_PLAYER_OPTION = MESSAGE_DATA.getMessage("permission-player-option"); + PERMISSION_PLAYER_VIEW_OTHERS = MESSAGE_DATA.getMessage("permission-player-view-others"); + PERMISSION_VISUAL_CLAIMS_NEARBY = MESSAGE_DATA.getMessage("permission-visual-claims-nearby"); + PLAYERINFO_UI_TITLE = MESSAGE_DATA.getMessage("playerinfo-ui-title"); + PLUGIN_EVENT_CANCEL = MESSAGE_DATA.getMessage("plugin-event-cancel"); + PLUGIN_RELOAD = MESSAGE_DATA.getMessage("plugin-reload"); + RESIZE_OVERLAP_SUBDIVISION = MESSAGE_DATA.getMessage("resize-overlap-subdivision"); + RESIZE_SAME_LOCATION = MESSAGE_DATA.getMessage("resize-same-location"); + RESIZE_START = MESSAGE_DATA.getMessage("resize-start"); + SCHEMATIC_CREATE = MESSAGE_DATA.getMessage("schematic-create"); + SCHEMATIC_CREATE_COMPLETE = MESSAGE_DATA.getMessage("schematic-create-complete"); + SCHEMATIC_CREATE_FAIL = MESSAGE_DATA.getMessage("schematic-create-fail"); + SCHEMATIC_NONE = MESSAGE_DATA.getMessage("schematic-none"); + SPAWN_NOT_SET = MESSAGE_DATA.getMessage("spawn-not-set"); + TITLE_ACCESSOR = MESSAGE_DATA.getMessage("title-accessor"); + TITLE_ALL = MESSAGE_DATA.getMessage("title-all"); + TITLE_BUILDER = MESSAGE_DATA.getMessage("title-builder"); + TITLE_CLAIM = MESSAGE_DATA.getMessage("title-claim"); + TITLE_CONTAINER = MESSAGE_DATA.getMessage("title-container"); + TITLE_DEFAULT = MESSAGE_DATA.getMessage("title-default"); + TITLE_INHERIT = MESSAGE_DATA.getMessage("title-inherit"); + TITLE_MANAGER = MESSAGE_DATA.getMessage("title-manager"); + TITLE_OWN = MESSAGE_DATA.getMessage("title-own"); + TITLE_OVERRIDE = MESSAGE_DATA.getMessage("title-override"); + TOWN_CHAT_DISABLED = MESSAGE_DATA.getMessage("town-chat-disabled"); + TOWN_CHAT_ENABLED = MESSAGE_DATA.getMessage("town-chat-enabled"); + TOWN_NOT_FOUND = MESSAGE_DATA.getMessage("town-not-found"); + TOWN_NOT_IN = MESSAGE_DATA.getMessage("town-not-in"); + TOWN_OWNER = MESSAGE_DATA.getMessage("town-owner"); + TOWN_TAG_CLEAR = MESSAGE_DATA.getMessage("town-tag-clear"); + TOWN_TAX_NO_CLAIMS = MESSAGE_DATA.getMessage("town-tax-no-claims"); + TRUST_CLICK_SHOW_LIST = MESSAGE_DATA.getMessage("trust-click-show-list"); + TRUST_INVALID = MESSAGE_DATA.getMessage("trust-invalid"); + TRUST_LIST_HEADER = MESSAGE_DATA.getMessage("trust-list-header"); + TRUST_NO_CLAIMS = MESSAGE_DATA.getMessage("trust-no-claims"); + TRUST_SELF = MESSAGE_DATA.getMessage("trust-self"); + UNTRUST_NO_CLAIMS = MESSAGE_DATA.getMessage("untrust-no-claims"); + UNTRUST_SELF = MESSAGE_DATA.getMessage("untrust-self"); + } +} diff --git a/bukkit/src/main/java/com/griefdefender/claim/GDClaim.java b/bukkit/src/main/java/com/griefdefender/claim/GDClaim.java index 823fb01..a9b3b5c 100644 --- a/bukkit/src/main/java/com/griefdefender/claim/GDClaim.java +++ b/bukkit/src/main/java/com/griefdefender/claim/GDClaim.java @@ -51,6 +51,7 @@ import com.griefdefender.api.event.EventCause; import com.griefdefender.api.permission.Context; import com.griefdefender.api.permission.option.Options; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.configuration.ClaimDataConfig; import com.griefdefender.configuration.ClaimStorageData; @@ -142,7 +143,7 @@ public class GDClaim implements Claim { public ClaimVisual claimVisual; public List playersWatching = new ArrayList<>(); public Map schematics = new HashMap<>(); - public MessageDataConfig messageData = GriefDefenderPlugin.getInstance().messageData; + public MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; private GDPlayerData ownerPlayerData; private static final int MAX_AREA = GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.VOLUME ? 2560000 : 10000; @@ -232,7 +233,9 @@ public void initializeClaimData(GDClaim parent) { } this.claimData = this.claimStorage.getConfig(); this.parent = parent; - + if (parent != null) { + this.claimStorage.getConfig().setParent(parent.getUniqueId()); + } this.updateClaimStorageData(); } @@ -242,7 +245,9 @@ public ClaimType getType() { public void setType(ClaimType type) { this.type = type; - this.claimData.setType(type); + if (this.claimData != null) { + this.claimData.setType(type); + } } public ClaimVisual getVisualizer() { @@ -447,7 +452,7 @@ public Component allowEdit(GDPermissionUser holder, boolean forced) { return this.parent.allowEdit(holder); } - final Component message = messageData.getMessage(MessageStorage.CLAIM_OWNER_ONLY, ImmutableMap.of( + final Component message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_OWNER_ONLY, ImmutableMap.of( "player", this.getOwnerName())); return message; } @@ -468,7 +473,7 @@ public Component allowGrantPermission(Player player) { return this.parent.allowGrantPermission(player); } - final Component reason = messageData.getMessage(MessageStorage.PERMISSION_TRUST, ImmutableMap.of( + final Component reason = MESSAGE_DATA.getMessage(MessageStorage.PERMISSION_TRUST, ImmutableMap.of( "player", this.getOwnerName())); return reason; } @@ -486,7 +491,7 @@ public Vector3i getGreaterBoundaryCorner() { @Override public Component getOwnerName() { if (this.isAdminClaim() || this.isWilderness()) { - return messageData.getMessage(MessageStorage.OWNER_ADMIN); + return MessageCache.getInstance().OWNER_ADMIN; } if (this.getOwnerPlayerData() == null) { @@ -707,7 +712,7 @@ public double getOwnerEconomyBlockCost() { public double getOwnerEconomyBlockCost(GDPlayerData playerData) { final GDPermissionHolder subject = playerData == null ? GriefDefenderPlugin.DEFAULT_HOLDER : playerData.getSubject(); - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(subject, Options.ECONOMY_BLOCK_COST, this, playerData).intValue(); + return GDPermissionManager.getInstance().getInternalOptionValue(subject, Options.ECONOMY_BLOCK_COST, playerData).intValue(); } public int getOwnerMinClaimLevel() { @@ -716,7 +721,7 @@ public int getOwnerMinClaimLevel() { public int getOwnerMinClaimLevel(GDPlayerData playerData) { final GDPermissionHolder subject = playerData == null ? GriefDefenderPlugin.DEFAULT_HOLDER : playerData.getSubject(); - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(subject, Options.MIN_LEVEL, this, playerData).intValue(); + return GDPermissionManager.getInstance().getInternalOptionValue(subject, Options.MIN_LEVEL, playerData).intValue(); } public int getOwnerMaxClaimLevel() { @@ -725,7 +730,7 @@ public int getOwnerMaxClaimLevel() { public int getOwnerMaxClaimLevel(GDPlayerData playerData) { final GDPermissionHolder subject = playerData == null ? GriefDefenderPlugin.DEFAULT_HOLDER : playerData.getSubject(); - return GDPermissionManager.getInstance().getGlobalInternalOptionValue(subject, Options.MAX_LEVEL, this, playerData).intValue(); + return GDPermissionManager.getInstance().getInternalOptionValue(subject, Options.MAX_LEVEL, playerData).intValue(); } @Override @@ -852,9 +857,9 @@ public ClaimResult transferOwner(UUID newOwnerID) { final Double createClaimLimit = GDPermissionManager.getInstance().getInternalOptionValue(newOwnerData.getSubject(), Options.CREATE_LIMIT, this, newOwnerData); if (createClaimLimit != null && createClaimLimit > 0 && (newOwnerData.getInternalClaims().size() + 1) > createClaimLimit.intValue()) { if (currentOwner != null) { - GriefDefenderPlugin.sendMessage(currentOwner, messageData.getMessage(MessageStorage.CLAIM_TRANSFER_EXCEEDS_LIMIT)); + GriefDefenderPlugin.sendMessage(currentOwner, MESSAGE_DATA.getMessage(MessageStorage.CLAIM_TRANSFER_EXCEEDS_LIMIT)); } - return new GDClaimResult(this, ClaimResultType.EXCEEDS_MAX_CLAIM_LIMIT, messageData.getMessage(MessageStorage.CLAIM_TRANSFER_EXCEEDS_LIMIT)); + return new GDClaimResult(this, ClaimResultType.EXCEEDS_MAX_CLAIM_LIMIT, MESSAGE_DATA.getMessage(MessageStorage.CLAIM_TRANSFER_EXCEEDS_LIMIT)); } // transfer @@ -887,6 +892,19 @@ public ClaimResult transferOwner(UUID newOwnerID) { return new GDClaimResult(this, ClaimResultType.SUCCESS); } + public ClaimResult findParent(GDClaim claimToSearch) { + if (!this.isInside(claimToSearch)) { + return new GDClaimResult(ClaimResultType.CLAIM_NOT_FOUND); + } + Claim current = claimToSearch; + for (Claim child : current.getChildren(true)) { + if (this.isInside(child)) { + current = child; + } + } + return new GDClaimResult(current, ClaimResultType.SUCCESS); + } + public ClaimResult doesClaimOverlap() { if (this.parent != null) { final GDClaim parentClaim = (GDClaim) this.parent; @@ -1179,7 +1197,7 @@ public ClaimResult resize(int x1, int x2, int y1, int y2, int z1, int z2) { if (!result.transactionSuccess()) { Component message = null; if (player != null) { - message = messageData.getMessage(MessageStorage.ECONOMY_NOT_ENOUGH_FUNDS, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.ECONOMY_NOT_ENOUGH_FUNDS, ImmutableMap.of( "balance", this.vaultProvider.getApi().getBalance(player), "amount", requiredFunds)); GriefDefenderPlugin.sendMessage(player, message); @@ -1198,7 +1216,7 @@ public ClaimResult resize(int x1, int x2, int y1, int y2, int z1, int z2) { if (player != null) { if (GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.VOLUME) { final double claimableChunks = Math.abs(remainingClaimBlocks / 65536.0); - GriefDefenderPlugin.sendMessage(player, messageData.getMessage(MessageStorage.CLAIM_SIZE_NEED_BLOCKS_3D, ImmutableMap.of( + GriefDefenderPlugin.sendMessage(player, MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_NEED_BLOCKS_3D, ImmutableMap.of( "chunk-amount", Math.round(claimableChunks * 100.0)/100.0, "block-amount", Math.abs(remainingClaimBlocks)))); } else { @@ -1308,14 +1326,14 @@ public ClaimResult resizeCuboid(Player player, int smallX, int smallY, int small final int minClaimLevel = this.getOwnerMinClaimLevel(); if (playerData != null && playerData.shovelMode != ShovelTypes.ADMIN && smallY < minClaimLevel) { - final Component message = messageData.getMessage(MessageStorage.CLAIM_BELOW_LEVEL, ImmutableMap.of( + final Component message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_BELOW_LEVEL, ImmutableMap.of( "limit", minClaimLevel)); GriefDefenderPlugin.sendMessage(player, message); return new GDClaimResult(ClaimResultType.BELOW_MIN_LEVEL); } final int maxClaimLevel = this.getOwnerMaxClaimLevel(); if (playerData != null && playerData.shovelMode != ShovelTypes.ADMIN && bigY > maxClaimLevel) { - final Component message = messageData.getMessage(MessageStorage.CLAIM_ABOVE_LEVEL, ImmutableMap.of( + final Component message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_ABOVE_LEVEL, ImmutableMap.of( "limit", maxClaimLevel)); GriefDefenderPlugin.sendMessage(player, message); return new GDClaimResult(ClaimResultType.ABOVE_MAX_LEVEL); @@ -1412,7 +1430,7 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect // Handle single block selection if ((this.isCuboid() && greaterCorner.equals(lesserCorner)) || (!this.isCuboid() && greaterCorner.getX() == lesserCorner.getX() && greaterCorner.getZ() == lesserCorner.getZ())) { if (playerData.claimResizing != null) { - final Component message = messageData.getMessage(MessageStorage.RESIZE_SAME_LOCATION); + final Component message = MessageCache.getInstance().RESIZE_SAME_LOCATION; GriefDefenderPlugin.sendMessage(player, message); playerData.lastShovelLocation = null; playerData.claimResizing = null; @@ -1420,7 +1438,7 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect return new GDClaimResult(ClaimResultType.BELOW_MIN_SIZE_X, message); } if (playerData.claimSubdividing == null) { - final Component message = messageData.getMessage(MessageStorage.CREATE_SUBDIVISION_ONLY); + final Component message = MessageCache.getInstance().CREATE_SUBDIVISION_ONLY; GriefDefenderPlugin.sendMessage(player, message); playerData.lastShovelLocation = null; // TODO: Add new result type for this @@ -1442,14 +1460,14 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect if (size > maxClaimX) { if (player != null) { if (this.isCuboid()) { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( "axis", "x", "size", size, "max-size", maxClaimX == 0 ? "∞" : maxClaimX, "min-area", minClaimX + "x" + minClaimY + "x" + minClaimZ, "max-area", maxCuboidArea)); } else { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( "axis", "x", "size", size, "max-size", maxClaimX == 0 ? "∞" : maxClaimX, @@ -1466,14 +1484,14 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect if (size > maxClaimY) { if (player != null) { if (this.isCuboid()) { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( "axis", "y", "size", size, "max-size", maxClaimY == 0 ? "∞" : maxClaimY, "min-area", minClaimX + "x" + minClaimY + "x" + minClaimZ, "max-area", maxCuboidArea)); } else { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( "axis", "y", "size", size, "max-size", maxClaimY == 0 ? "∞" : maxClaimY, @@ -1490,14 +1508,14 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect if (size > maxClaimZ) { if (player != null) { if (this.isCuboid()) { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( "axis", "z", "size", size, "max-size", maxClaimZ == 0 ? "∞" : maxClaimZ, "min-area", minClaimX + "x" + minClaimY + "x" + minClaimZ, "max-area", maxCuboidArea)); } else { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MAX, ImmutableMap.of( "axis", "z", "size", size, "max-size", maxClaimZ == 0 ? "∞" : maxClaimZ, @@ -1514,14 +1532,14 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect if (size < minClaimX) { if (player != null) { if (this.isCuboid()) { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( "axis", "x", "size", size, "min-size", minClaimX == 0 ? "∞" : minClaimX, "min-area", minClaimX + "x" + minClaimY + "x" + minClaimZ, "max-area", maxCuboidArea)); } else { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( "axis", "x", "size", size, "min-size", minClaimX, @@ -1538,14 +1556,14 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect if (size < minClaimY) { if (player != null) { if (this.isCuboid()) { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( "axis", "y", "size", size, "min-size", minClaimY == 0 ? "∞" : minClaimY, "min-area", minClaimX + "x" + minClaimY + "x" + minClaimZ, "max-area", maxCuboidArea)); } else { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( "axis", "y", "size", size, "min-size", minClaimY == 0 ? "∞" : minClaimY, @@ -1562,14 +1580,14 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect if (size < minClaimZ) { if (player != null) { if (this.isCuboid()) { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( "axis", "z", "size", size, "min-size", minClaimZ == 0 ? "∞" : minClaimZ, "min-area", minClaimX + "x" + minClaimY + "x" + minClaimZ, "max-area", maxCuboidArea)); } else { - message = messageData.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( + message = MESSAGE_DATA.getMessage(MessageStorage.CLAIM_SIZE_MIN, ImmutableMap.of( "axis", "z", "size", size, "min-size", minClaimZ == 0 ? "∞" : minClaimZ, @@ -1871,46 +1889,57 @@ public ClaimResult validateClaimType(ClaimType type, UUID newOwnerUUID, GDPlayer if (type == ClaimTypes.ADMIN) { if (!isAdmin) { - final Component message = TextComponent.of("You do not have administrative permissions to change type to ADMIN.", TextColor.RED); - return new GDClaimResult(ClaimResultType.WRONG_CLAIM_TYPE, message); - } - if (this.parent != null && this.parent.isAdminClaim()) { - final Component message = TextComponent.of("Admin claims cannot have direct admin children claims.", TextColor.RED); + final Component message = MESSAGE_DATA.getMessage(MessageStorage.RESULT_TYPE_CHANGE_NOT_ADMIN, + ImmutableMap.of("type", TextComponent.of("ADMIN").color(TextColor.RED))); return new GDClaimResult(ClaimResultType.WRONG_CLAIM_TYPE, message); } } else if (type == ClaimTypes.BASIC) { if (this.isAdminClaim() && newOwnerUUID == null) { - return new GDClaimResult(ClaimResultType.REQUIRES_OWNER, TextComponent.of("Could not convert admin claim to basic. Owner is required.", TextColor.RED)); + return new GDClaimResult(ClaimResultType.REQUIRES_OWNER, MESSAGE_DATA.getMessage(MessageStorage.RESULT_TYPE_REQUIRES_OWNER, + ImmutableMap.of( + "type", TextComponent.of("ADMIN", TextColor.RED), + "target_type", TextComponent.of("BASIC", TextColor.GREEN)))); } if (this.parent != null && this.parent.isBasicClaim()) { - final Component message = TextComponent.of("Basic claims cannot have direct basic children claims.", TextColor.RED); + final Component message = MESSAGE_DATA.getMessage(MessageStorage.RESULT_TYPE_CHILD_SAME, + ImmutableMap.of("type", TextComponent.of("BASIC").color(TextColor.GREEN))); return new GDClaimResult(ClaimResultType.WRONG_CLAIM_TYPE, message); } for (Claim child : this.children) { if (!child.isSubdivision()) { - final Component message = TextComponent.of("Basic claims can only contain subdivisions.", TextColor.RED); + final Component message = MESSAGE_DATA.getMessage(MessageStorage.RESULT_TYPE_ONLY_SUBDIVISION, + ImmutableMap.of("type", TextComponent.of("BASIC").color(TextColor.GREEN))); return new GDClaimResult(ClaimResultType.WRONG_CLAIM_TYPE, message); } } } else if (type == ClaimTypes.SUBDIVISION) { if (!this.children.isEmpty()) { - final Component message = TextComponent.of("Subdivisions cannot contain children claims.", TextColor.RED); + final Component message = MESSAGE_DATA.getMessage(MessageStorage.RESULT_TYPE_NO_CHILDREN, + ImmutableMap.of("type", TextComponent.of("SUBDIVISION").color(TextColor.AQUA))); return new GDClaimResult(ClaimResultType.WRONG_CLAIM_TYPE, message); } if (this.parent == null) { - final Component message = TextComponent.of("Subdivisions cannot be created in the wilderness.", TextColor.RED); + final Component message = MESSAGE_DATA.getMessage(MessageStorage.RESULT_TYPE_CREATE_DENY, + ImmutableMap.of( + "type", TextComponent.of("SUBDIVISION", TextColor.AQUA), + "target_type", TextComponent.of("WILDERNESS", TextColor.GREEN))); return new GDClaimResult(ClaimResultType.WRONG_CLAIM_TYPE, message); } if (this.isAdminClaim() && newOwnerUUID == null) { - return new GDClaimResult(ClaimResultType.REQUIRES_OWNER, TextComponent.of("Could not convert admin claim to subdivision. Owner is required.", TextColor.RED)); + return new GDClaimResult(ClaimResultType.REQUIRES_OWNER, MESSAGE_DATA.getMessage(MessageStorage.RESULT_TYPE_REQUIRES_OWNER, + ImmutableMap.of( + "type", TextComponent.of("ADMIN", TextColor.RED), + "target_type", TextComponent.of("SUBDIVISION", TextColor.AQUA)))); } } else if (type == ClaimTypes.TOWN) { if (this.parent != null && this.parent.isTown()) { - final Component message = TextComponent.of("Towns cannot contain children towns.", TextColor.RED); + final Component message = MESSAGE_DATA.getMessage(MessageStorage.RESULT_TYPE_NO_CHILDREN, + ImmutableMap.of("type", TextComponent.of("TOWN").color(TextColor.GREEN))); return new GDClaimResult(ClaimResultType.WRONG_CLAIM_TYPE, message); } } else if (type == ClaimTypes.WILDERNESS) { - final Component message = TextComponent.of("You cannot change a claim to WILDERNESS.", TextColor.RED); + final Component message = MESSAGE_DATA.getMessage(MessageStorage.RESULT_TYPE_CHANGE_DENY, + ImmutableMap.of("type", TextComponent.of("WILDERNESS").color(TextColor.GREEN))); return new GDClaimResult(ClaimResultType.WRONG_CLAIM_TYPE, message); } @@ -2748,7 +2777,7 @@ public ClaimResult build() { if ((claim.isBasicClaim() || claim.isTown()) && this.requiresClaimBlocks) { final int claimCost = BlockUtil.getInstance().getClaimBlockCost(world, claim.lesserBoundaryCorner, claim.greaterBoundaryCorner, claim.cuboid); if (GriefDefenderPlugin.getInstance().isEconomyModeEnabled()) { - final OfflinePlayer vaultPlayer = playerData.getSubject().getOnlinePlayer() != null ? playerData.getSubject().getOnlinePlayer() : playerData.getSubject().getOfflinePlayer(); + final OfflinePlayer vaultPlayer = playerData.getSubject().getOfflinePlayer(); final Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi(); if (!economy.hasAccount(vaultPlayer)) { return new GDClaimResult(claim, ClaimResultType.ECONOMY_ACCOUNT_NOT_FOUND); @@ -2904,7 +2933,7 @@ public boolean migrateClaims(List claims) { return true; } - private void moveChildToParent(GDClaim parentClaim, GDClaim childClaim) { + public void moveChildToParent(GDClaim parentClaim, GDClaim childClaim) { // Remove child from current parent if available if (childClaim.parent != null && childClaim.parent != parentClaim) { childClaim.parent.children.remove(childClaim); diff --git a/bukkit/src/main/java/com/griefdefender/claim/GDClaimManager.java b/bukkit/src/main/java/com/griefdefender/claim/GDClaimManager.java index 1720dc0..1f909f3 100644 --- a/bukkit/src/main/java/com/griefdefender/claim/GDClaimManager.java +++ b/bukkit/src/main/java/com/griefdefender/claim/GDClaimManager.java @@ -630,7 +630,7 @@ public void resetPlayerData() { if (newAccruedBlocks < 0) { newAccruedBlocks = 0; } - final int maxAccruedBlocks = GDPermissionManager.getInstance().getGlobalInternalOptionValue(playerData.getSubject(), Options.MAX_ACCRUED_BLOCKS, playerData).intValue(); + final int maxAccruedBlocks = GDPermissionManager.getInstance().getInternalOptionValue(playerData.getSubject(), Options.MAX_ACCRUED_BLOCKS, playerData).intValue(); if (newAccruedBlocks > maxAccruedBlocks) { newAccruedBlocks = maxAccruedBlocks; } diff --git a/bukkit/src/main/java/com/griefdefender/command/ClaimFlagBase.java b/bukkit/src/main/java/com/griefdefender/command/ClaimFlagBase.java index 444465b..903b94d 100644 --- a/bukkit/src/main/java/com/griefdefender/command/ClaimFlagBase.java +++ b/bukkit/src/main/java/com/griefdefender/command/ClaimFlagBase.java @@ -28,6 +28,7 @@ import co.aikar.commands.InvalidCommandArgument; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; @@ -40,7 +41,9 @@ import com.griefdefender.api.permission.Context; import com.griefdefender.api.permission.PermissionResult; import com.griefdefender.api.permission.flag.Flag; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; import com.griefdefender.event.GDFlagClaimEvent; @@ -80,6 +83,8 @@ public abstract class ClaimFlagBase extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + public enum FlagType { DEFAULT, CLAIM, @@ -121,12 +126,13 @@ public void execute(Player player, String[] args) throws InvalidCommandArgument } final Flag flag = FlagRegistryModule.getInstance().getById(commandFlag).orElse(null); if (commandFlag != null && flag == null) { - TextAdapter.sendComponent(player, TextComponent.of("Flag not found.", TextColor.RED)); + TextAdapter.sendComponent(player, MESSAGE_DATA.getMessage(MessageStorage.FLAG_NOT_FOUND, ImmutableMap.of( + "flag", commandFlag))); return; } if (flag != null && !player.hasPermission(GDPermissions.USER_CLAIM_FLAGS + flag.getPermission().replace(GDPermissions.FLAG_BASE, ""))) { - TextAdapter.sendComponent(player, TextComponent.of("You do not have permission to change this flag.", TextColor.RED)); + TextAdapter.sendComponent(player, MessageCache.getInstance().PERMISSION_FLAG_USE); return; } @@ -166,10 +172,8 @@ public void execute(Player player, String[] args) throws InvalidCommandArgument GDCauseStackManager.getInstance().popCause(); return; } - - GriefDefenderPlugin.sendMessage(player, TextComponent.of("Usage: /cf [ [subject|context]]")); } else { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_FOUND)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_FOUND); } } @@ -187,22 +191,14 @@ protected void showFlagPermissions(CommandSender src, GDClaim claim, FlagType fl } final Component whiteOpenBracket = TextComponent.of("[", TextColor.AQUA); final Component whiteCloseBracket = TextComponent.of("]", TextColor.AQUA); - final Component showOverrideText = TextComponent.builder("") - .append("Click here to filter by ") - .append("OVERRIDE ", TextColor.RED) - .append("permissions.").build(); - final Component showDefaultText = TextComponent.builder("") - .append("Click here to filter by ") - .append("DEFAULT ", TextColor.LIGHT_PURPLE) - .append("permissions.").build(); - final Component showClaimText = TextComponent.builder("") - .append("Click here to filter by ") - .append("CLAIM ", TextColor.GOLD) - .append("permissions.").build(); - final Component showInheritText = TextComponent.builder("") - .append("Click here to filter by ") - .append("INHERIT ", TextColor.AQUA) - .append("permissions.").build(); + final Component showOverrideText = MESSAGE_DATA.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", TextComponent.of("OVERRIDE", TextColor.RED))); + final Component showDefaultText = MESSAGE_DATA.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", TextComponent.of("DEFAULT", TextColor.LIGHT_PURPLE))); + final Component showClaimText = MESSAGE_DATA.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", TextComponent.of("CLAIM", TextColor.GOLD))); + final Component showInheritText = MESSAGE_DATA.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", TextComponent.of("INHERIT", TextColor.AQUA))); Component defaultFlagText = TextComponent.empty(); if (isAdmin) { defaultFlagText = TextComponent.builder("") @@ -371,11 +367,8 @@ protected void showFlagPermissions(CommandSender src, GDClaim claim, FlagType fl if (hasPermission) { undefinedText = TextComponent.builder("") .append("undefined", TextColor.GRAY) - .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append(baseFlagPerm) - .append(" is currently being ") - .append("overridden", TextColor.RED) - .append(" by an administrator.\nClick here to remove this flag.").build())) + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.FLAG_UI_OVERRIDE_PERMISSION, + ImmutableMap.of("flag", baseFlagPerm)))) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createFlagConsumer(src, claim, overrideContextSet, flagPermission, Tristate.UNDEFINED, flagType, FlagType.CLAIM, false)))).build(); } else { undefinedText = TextComponent.builder("") @@ -388,10 +381,7 @@ protected void showFlagPermissions(CommandSender src, GDClaim claim, FlagType fl .append("[", TextColor.AQUA) .append(String.valueOf(overridePermissionEntry.getValue()), TextColor.RED) .append("]", TextColor.AQUA) - .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append("This flag has been overridden by an administrator and can ") - .append(TextComponent.of("NOT").color(TextColor.RED).decoration(TextDecoration.UNDERLINED, true)) - .append(" be changed.").build())) + .hoverEvent(HoverEvent.showText(MessageCache.getInstance().FLAG_UI_OVERRIDE_NO_PERMISSION)) .build(); break; } @@ -424,11 +414,10 @@ protected void showFlagPermissions(CommandSender src, GDClaim claim, FlagType fl .append("undefined", TextColor.GRAY) .append(TextComponent.empty()) .build()) - .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append(baseFlagPerm) - .append(" is currently not set.\nThe default claim value of ") - .append(String.valueOf(flagValue), TextColor.LIGHT_PURPLE) - .append(" will be active until set.").build())) + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.FLAG_NOT_SET, + ImmutableMap.of( + "flag", baseFlagPerm, + "value", TextComponent.of(flagValue, TextColor.LIGHT_PURPLE))))) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createFlagConsumer(src, claim, claimContexts, flagPermission, Tristate.UNDEFINED, flagType, FlagType.CLAIM, false)))).build(); } else { undefinedText = TextComponent.builder("").append( @@ -501,11 +490,8 @@ protected void showFlagPermissions(CommandSender src, GDClaim claim, FlagType fl if (hasPermission) { undefinedText = TextComponent.builder("") .append("undefined", TextColor.GRAY) - .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append(baseFlag, TextColor.GREEN) - .append(" is currently being ") - .append("overridden", TextColor.RED) - .append(" by an administrator.\nClick here to remove this flag.").build())) + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.FLAG_UI_OVERRIDE_PERMISSION, + ImmutableMap.of("flag", TextComponent.of(baseFlag, TextColor.GREEN))))) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createFlagConsumer(src, claim, overrideContextSet, flagPermission, Tristate.UNDEFINED, flagType, FlagType.CLAIM, false)))).build(); } else { undefinedText = TextComponent.builder("") @@ -518,10 +504,7 @@ protected void showFlagPermissions(CommandSender src, GDClaim claim, FlagType fl .append("[", TextColor.AQUA) .append(String.valueOf(overridePermissionEntry.getValue()), TextColor.RED) .append("]", TextColor.AQUA) - .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append("This flag has been overridden by an administrator and can ") - .append(TextComponent.of("NOT").color(TextColor.RED).decoration(TextDecoration.UNDERLINED, true)) - .append(" be changed.").build())) + .hoverEvent(HoverEvent.showText(MessageCache.getInstance().FLAG_UI_OVERRIDE_NO_PERMISSION)) .build(); break; } @@ -641,11 +624,8 @@ protected void showFlagPermissions(CommandSender src, GDClaim claim, FlagType fl hasOverride = true; final Component undefinedText = TextComponent.builder("") .append("undefined", TextColor.GRAY) - .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append(baseFlagPerm, TextColor.GREEN) - .append(" is currently being ") - .append("overridden", TextColor.RED) - .append(" by an administrator.\nClick here to remove this flag.").build())) + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.FLAG_UI_OVERRIDE_PERMISSION, + ImmutableMap.of("flag", TextComponent.of(baseFlag.toString().toLowerCase(), TextColor.GREEN))))) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createFlagConsumer(src, claim, overrideContextSet, flagPermission, Tristate.UNDEFINED, flagType, FlagType.CLAIM, false)))).build(); flagText = TextComponent.builder("") .append(undefinedText) @@ -653,10 +633,7 @@ protected void showFlagPermissions(CommandSender src, GDClaim claim, FlagType fl .append("[", TextColor.AQUA) .append(String.valueOf(overridePermissionEntry.getValue())) .append("]", TextColor.AQUA) - .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append("This flag has been overridden by an administrator and can ") - .append(TextComponent.of("NOT").color(TextColor.RED).decoration(TextDecoration.UNDERLINED, true)) - .append(" be changed.").build())) + .hoverEvent(HoverEvent.showText(MessageCache.getInstance().FLAG_UI_OVERRIDE_NO_PERMISSION)) .build(); break; } @@ -895,14 +872,15 @@ private Component getClickableText(CommandSender src, GDClaim claim, Set contexts, String flagPermission, Tristate currentValue, Tristate flagValue, FlagType displayType, FlagType flagType, boolean toggleType) { - Component hoverEventText = TextComponent.of("Click here to toggle " + flagType.name().toLowerCase() + " value."); + Component hoverEventText = MESSAGE_DATA.getMessage(MessageStorage.FLAG_UI_CLICK_TOGGLE, + ImmutableMap.of( "flag", flagType.name().toLowerCase())); if (!toggleType) { if (flagValue == Tristate.TRUE) { - hoverEventText = TextComponent.of("Click here to allow this flag."); + hoverEventText = MessageCache.getInstance().FLAG_UI_CLICK_ALLOW; } else if (flagValue == Tristate.FALSE) { - hoverEventText = TextComponent.of("Click here to deny this flag."); + hoverEventText = MessageCache.getInstance().FLAG_UI_CLICK_DENY; } else { - hoverEventText = TextComponent.of("Click here to remove this flag."); + hoverEventText = MessageCache.getInstance().FLAG_UI_CLICK_REMOVE; } } TextColor flagColor = TextColor.GOLD; @@ -910,22 +888,19 @@ private Component getClickableText(CommandSender src, GDClaim claim, Set 0 && !this.abandonTopClaim) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_TOP_LEVEL)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ABANDON_TOP_LEVEL); return; } else { if (this.abandonTopClaim && (claim.isTown() || claim.isAdminClaim()) && claim.children.size() > 0) { @@ -100,7 +99,7 @@ public void execute(Player player) { } if (!invalidClaims.isEmpty()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_TOWN_CHILDREN)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ABANDON_TOWN_CHILDREN); CommandHelper.showClaims(player, invalidClaims, 0, true); return; } @@ -111,7 +110,7 @@ public void execute(Player player) { GriefDefender.getEventManager().post(event); GDCauseStackManager.getInstance().popCause(); if (event.cancelled()) { - TextAdapter.sendComponent(player, event.getMessage().orElse(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PLUGIN_EVENT_CANCEL))); + TextAdapter.sendComponent(player, event.getMessage().orElse(MessageCache.getInstance().PLUGIN_EVENT_CANCEL)); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimAbandonAll.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimAbandonAll.java index 1bd4236..5dcf4fb 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimAbandonAll.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimAbandonAll.java @@ -36,6 +36,7 @@ import com.griefdefender.api.GriefDefender; import com.griefdefender.api.claim.Claim; import com.griefdefender.api.permission.option.Options; +import com.griefdefender.cache.MessageCache; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; import com.griefdefender.event.GDDeleteClaimEvent; @@ -63,7 +64,7 @@ public void execute(Player player) { if (originalClaimCount == 0) { try { - throw new CommandException(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NO_CLAIMS)); + throw new CommandException(MessageCache.getInstance().CLAIM_NO_CLAIMS); } catch (CommandException e) { TextAdapter.sendComponent(player, e.getText()); return; diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimAdmin.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimAdmin.java index 009f14b..c745ca2 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimAdmin.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimAdmin.java @@ -32,7 +32,7 @@ import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.ShovelTypes; -import com.griefdefender.configuration.MessageStorage; +import com.griefdefender.cache.MessageCache; import com.griefdefender.permission.GDPermissions; import org.bukkit.entity.Player; @@ -47,6 +47,6 @@ public void execute(Player player) { final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); playerData.shovelMode = ShovelTypes.ADMIN; - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.MODE_ADMIN)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().MODE_ADMIN); } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimBank.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimBank.java index fa26dd8..03e8d9a 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimBank.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimBank.java @@ -32,8 +32,8 @@ import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; -import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; import org.bukkit.entity.Player; @@ -49,13 +49,13 @@ public class CommandClaimBank extends BaseCommand { @Subcommand("claim bank") public void execute(Player player, @Optional String[] args) throws CommandException { if (!GriefDefenderPlugin.getActiveConfig(player.getWorld().getUID()).getConfig().claim.bankTaxSystem) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.BANK_TAX_SYSTEM_DISABLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().BANK_TAX_SYSTEM_DISABLED); return; } GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation()); if (this.townOnly) { if (!claim.isInTown()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOWN_NOT_IN)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TOWN_NOT_IN); return; } claim = claim.getTownClaim(); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimBasic.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimBasic.java index ae3f6b2..9393de6 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimBasic.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimBasic.java @@ -32,6 +32,7 @@ import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.ShovelTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; import org.bukkit.entity.Player; @@ -47,6 +48,6 @@ public void execute(Player player) { final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); playerData.shovelMode = ShovelTypes.BASIC; playerData.claimSubdividing = null; - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.MODE_BASIC)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().MODE_BASIC); } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimBuy.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimBuy.java index 5dd0691..2f2bd20 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimBuy.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimBuy.java @@ -32,13 +32,13 @@ import com.google.common.collect.ImmutableMap; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.Claim; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaimManager; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.pagination.PaginationList; import com.griefdefender.permission.GDPermissions; import net.kyori.text.Component; import net.kyori.text.TextComponent; -import net.kyori.text.format.TextColor; import net.kyori.text.format.TextDecoration; import net.milkbowl.vault.economy.Economy; import org.bukkit.entity.Player; @@ -57,7 +57,7 @@ public class CommandClaimBuy extends BaseCommand { @Subcommand("buy claim") public void execute(Player player) { if (GriefDefenderPlugin.getInstance().getVaultProvider() == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_NOT_INSTALLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_NOT_INSTALLED); return; } @@ -90,7 +90,7 @@ public void execute(Player player) { List claimsTextList = CommandHelper.generateClaimTextList(new ArrayList(), claimsForSale, player.getWorld().getName(), null, player, CommandHelper.createCommandConsumer(player, "claimbuy", ""), true, false); PaginationList.Builder paginationBuilder = PaginationList.builder() - .title(TextComponent.of("Claims for sale", TextColor.AQUA)).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(claimsTextList); + .title(MessageCache.getInstance().COMMAND_CLAIMBUY_TITLE).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(claimsTextList); paginationBuilder.sendTo(player); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimBuyBlocks.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimBuyBlocks.java index 0c6b970..c7f5c8a 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimBuyBlocks.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimBuyBlocks.java @@ -36,14 +36,13 @@ import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.permission.option.Options; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissionManager; import com.griefdefender.permission.GDPermissions; import net.kyori.text.Component; -import net.kyori.text.TextComponent; import net.kyori.text.adapter.bukkit.TextAdapter; -import net.kyori.text.format.TextColor; import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.EconomyResponse; import org.bukkit.entity.Player; @@ -58,12 +57,12 @@ public class CommandClaimBuyBlocks extends BaseCommand { @Subcommand("buy blocks") public void execute(Player player, @Optional Integer blockCount) { if (GriefDefenderPlugin.getInstance().isEconomyModeEnabled()) { - TextAdapter.sendComponent(player, TextComponent.of("This command is not available while server is in economy mode.", TextColor.RED)); + TextAdapter.sendComponent(player, MessageCache.getInstance().COMMAND_NOT_AVAILABLE_ECONOMY); return; } if (GriefDefenderPlugin.getInstance().getVaultProvider() == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_NOT_INSTALLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_NOT_INSTALLED); return; } @@ -77,15 +76,15 @@ public void execute(Player player, @Optional Integer blockCount) { final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation()); - final double economyBlockCost = GDPermissionManager.getInstance().getGlobalInternalOptionValue(player, Options.ECONOMY_BLOCK_COST, playerData); - final double economyBlockSell = GDPermissionManager.getInstance().getGlobalInternalOptionValue(player, Options.ECONOMY_BLOCK_SELL_RETURN, playerData); + final double economyBlockCost = GDPermissionManager.getInstance().getInternalOptionValue(player, Options.ECONOMY_BLOCK_COST, playerData); + final double economyBlockSell = GDPermissionManager.getInstance().getInternalOptionValue(player, Options.ECONOMY_BLOCK_SELL_RETURN, playerData); if (economyBlockCost == 0 && economyBlockSell == 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_BUY_SELL_DISABLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_BLOCK_BUY_SELL_DISABLED); return; } if (economyBlockCost == 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_BLOCK_ONLY_SELL)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_BLOCK_ONLY_SELL); return; } @@ -98,7 +97,7 @@ public void execute(Player player, @Optional Integer blockCount) { return; } else { if (blockCount <= 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_BLOCK_BUY_INVALID)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_BLOCK_BUY_INVALID); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimClear.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimClear.java index c122fac..6480a16 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimClear.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimClear.java @@ -26,13 +26,16 @@ import co.aikar.commands.BaseCommand; import co.aikar.commands.annotation.CommandAlias; +import co.aikar.commands.annotation.CommandCompletion; import co.aikar.commands.annotation.CommandPermission; import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Optional; import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; +import com.google.common.collect.ImmutableMap; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.util.NMSUtil; @@ -55,6 +58,7 @@ @CommandPermission(GDPermissions.COMMAND_CLAIM_CLEAR) public class CommandClaimClear extends BaseCommand { + @CommandCompletion("@gdentityids @gddummy") @CommandAlias("claimclear") @Description("Allows clearing of entities within one or more claims.") @Syntax(" [claim_uuid]") @@ -62,7 +66,7 @@ public class CommandClaimClear extends BaseCommand { public void execute(Player player, String target, @Optional String claimId) { World world = player.getWorld(); if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(world.getUID())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_DISABLED_WORLD)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_DISABLED_WORLD); return; } @@ -78,7 +82,7 @@ public void execute(Player player, String target, @Optional String claimId) { claimUniqueId = targetClaim.getUniqueId(); } else { if (!player.hasPermission(GDPermissions.COMMAND_DELETE_CLAIMS)) { - GriefDefenderPlugin.sendMessage(player, TextComponent.of("Only administrators may clear claims by UUID.", TextColor.RED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_CLAIMCLEAR_UUID_DENY); return; } try { @@ -89,7 +93,8 @@ public void execute(Player player, String target, @Optional String claimId) { } if (targetClaim.isWilderness()) { - GriefDefenderPlugin.sendMessage(player, TextComponent.of("This action is not available in the wilderness.", TextColor.RED)); + GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_ACTION_NOT_AVAILABLE, + ImmutableMap.of("type", TextComponent.of("the wilderness")))); return; } @@ -124,17 +129,13 @@ public void execute(Player player, String target, @Optional String claimId) { } if (count == 0) { - GriefDefenderPlugin.sendMessage(player, TextComponent.builder("") - .append("Could not locate any entities of type ") - .append(target, TextColor.GREEN) - .append(".").build()); + GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_CLAIMCLEAR_NO_ENTITIES, + ImmutableMap.of("type", TextComponent.of(target, TextColor.GREEN)))); } else { - GriefDefenderPlugin.sendMessage(player, TextComponent.builder("") - .append("Killed ", TextColor.RED) - .append(String.valueOf(count), TextColor.AQUA) - .append(" entities of type ") - .append(target, TextColor.GREEN) - .append(".").build()); + GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_CLAIMCLEAR_NO_ENTITIES, + ImmutableMap.of( + "amount", count, + "type", TextComponent.of(target, TextColor.GREEN)))); } } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimCuboid.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimCuboid.java index 8df4335..031e997 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimCuboid.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimCuboid.java @@ -31,7 +31,7 @@ import co.aikar.commands.annotation.Subcommand; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; -import com.griefdefender.configuration.MessageStorage; +import com.griefdefender.cache.MessageCache; import com.griefdefender.permission.GDPermissions; import org.bukkit.entity.Player; @@ -46,10 +46,10 @@ public void execute(Player player) { final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); if (playerData.getClaimCreateMode() == 0) { playerData.setClaimCreateMode(1); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_CUBOID_ENABLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_CUBOID_ENABLED); } else { playerData.setClaimCreateMode(0); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_CUBOID_DISABLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_CUBOID_DISABLED); } } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimDelete.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimDelete.java index da3e780..ae29532 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimDelete.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimDelete.java @@ -33,6 +33,7 @@ import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.ClaimResult; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; @@ -57,7 +58,7 @@ public void execute(Player player) { final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation()); final boolean isTown = claim.isTown(); if (claim.isWilderness()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_FOUND)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_FOUND); return; } @@ -75,7 +76,7 @@ public void execute(Player player) { } if (!this.deleteTopLevelClaim && !claim.isTown() && claim.children.size() > 0 /*&& !playerData.warnedAboutMajorDeletion*/) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_CHILDREN_WARNING)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_CHILDREN_WARNING); return; } @@ -88,7 +89,7 @@ public void execute(Player player) { } PermissionUtil.getInstance().clearPermissions(GriefDefenderPlugin.DEFAULT_HOLDER, claim.getContext()); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_CLAIM)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().DELETE_CLAIM); playerData.revertActiveVisual(player); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimDeleteAll.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimDeleteAll.java index 3def21e..c12e286 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimDeleteAll.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimDeleteAll.java @@ -73,7 +73,7 @@ public void execute(Player player, OfflinePlayer otherPlayer) { } GriefDefenderPlugin.getInstance().dataStore.deleteClaimsForPlayer(otherPlayer.getUniqueId()); - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_SUCCESS, ImmutableMap.of( + final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_PLAYER_SUCCESS, ImmutableMap.of( "player", otherPlayer.getName())); GriefDefenderPlugin.sendMessage(player, message); if (player != null) { diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimDeleteAllAdmin.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimDeleteAllAdmin.java index 8e0142c..8a1a57a 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimDeleteAllAdmin.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimDeleteAllAdmin.java @@ -37,6 +37,9 @@ import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; import net.kyori.text.Component; +import net.kyori.text.TextComponent; +import net.kyori.text.format.TextColor; + import org.bukkit.entity.Player; @CommandAlias("%griefdefender") @@ -56,7 +59,8 @@ public void execute(Player player) { return; } - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_ADMIN_SUCCESS)); + GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_TYPE_SUCCESS, + ImmutableMap.of("type", TextComponent.of("ADMIN").color(TextColor.RED)))); GriefDefenderPlugin.getInstance().getLogger().info(player.getName() + " deleted all administrative claims."); GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); playerData.revertActiveVisual(player); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimFarewell.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimFarewell.java index f14e010..1179f8d 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimFarewell.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimFarewell.java @@ -34,6 +34,7 @@ import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; @@ -55,7 +56,7 @@ public void execute(Player player, String message) { final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(playerData, player.getLocation()); if (claim.allowEdit(player) != null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_EDIT_CLAIM)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_EDIT_CLAIM); return; } @@ -68,7 +69,7 @@ public void execute(Player player, String message) { claim.getInternalClaimData().setRequiresSave(true); Component resultMessage = null; if (!claim.getInternalClaimData().getFarewell().isPresent()) { - resultMessage = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_FAREWELL_CLEAR); + resultMessage = MessageCache.getInstance().CLAIM_FAREWELL_CLEAR; } else { resultMessage = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_FAREWELL, ImmutableMap.of( diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagDebug.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagDebug.java index b29db0e..ed7261d 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagDebug.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagDebug.java @@ -31,13 +31,12 @@ import co.aikar.commands.annotation.Subcommand; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.permission.GDPermissionUser; import com.griefdefender.permission.GDPermissions; import net.kyori.text.Component; -import net.kyori.text.TextComponent; -import net.kyori.text.format.TextColor; import org.bukkit.entity.Player; @CommandAlias("%griefdefender") @@ -60,13 +59,9 @@ public void execute(Player player) { playerData.debugClaimPermissions = !playerData.debugClaimPermissions; if (!playerData.debugClaimPermissions) { - GriefDefenderPlugin.sendMessage(player, TextComponent.builder("") - .append("Claim flags debug ") - .append("OFF", TextColor.RED).build()); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_CLAIMFLAGDEBUG_DISABLED); } else { - GriefDefenderPlugin.sendMessage(player, TextComponent.builder("") - .append("Claim flags debug ") - .append("ON", TextColor.GREEN).build()); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_CLAIMFLAGDEBUG_ENABLED); } } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagPlayer.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagPlayer.java index 4f4c417..ee3f822 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagPlayer.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagPlayer.java @@ -34,8 +34,8 @@ import co.aikar.commands.annotation.Syntax; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.Tristate; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; -import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; import com.griefdefender.util.PermissionUtil; import org.bukkit.OfflinePlayer; @@ -59,7 +59,7 @@ public void execute(Player src, OfflinePlayer player, @Optional String[] args) t this.friendlySubjectName = player.getName(); if (PermissionUtil.getInstance().getPermissionValue(this.subject, GDPermissions.COMMAND_ADMIN_CLAIMS) == Tristate.TRUE && !src.hasPermission(GDPermissions.SET_ADMIN_FLAGS)) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_PLAYER_ADMIN_FLAGS)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().PERMISSION_PLAYER_ADMIN_FLAGS); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagReset.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagReset.java index 111a592..fb56129 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagReset.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimFlagReset.java @@ -33,6 +33,7 @@ import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.permission.Context; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; @@ -66,7 +67,7 @@ public void execute(Player player) { return; } } else if (!player.hasPermission(GDPermissions.COMMAND_ADMIN_CLAIMS) && (claim.isBasicClaim() || claim.isSubdivision()) && !player.getUniqueId().equals(claim.getOwnerUniqueId())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CLAIM_RESET_FLAGS_SELF)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_CLAIM_RESET_FLAGS_SELF); return; } @@ -77,6 +78,6 @@ public void execute(Player player) { } } - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.FLAG_RESET_SUCCESS)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().FLAG_RESET_SUCCESS); } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimGreeting.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimGreeting.java index e72e26d..9d0406d 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimGreeting.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimGreeting.java @@ -34,6 +34,7 @@ import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; @@ -69,7 +70,7 @@ public void execute(Player player, String message) { claim.getInternalClaimData().setRequiresSave(true); Component resultMessage = null; if (!claim.getInternalClaimData().getGreeting().isPresent()) { - resultMessage = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_GREETING_CLEAR); + resultMessage = MessageCache.getInstance().CLAIM_GREETING_CLEAR; } else { resultMessage = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_GREETING, ImmutableMap.of( diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimIgnore.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimIgnore.java index 63829c4..2f2e883 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimIgnore.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimIgnore.java @@ -32,6 +32,7 @@ import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; @@ -58,9 +59,9 @@ public void execute(Player player) { playerData.ignoreClaims = !playerData.ignoreClaims; if (!playerData.ignoreClaims) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_RESPECTING)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_RESPECTING); } else { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_IGNORE)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_IGNORE); } } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimInfo.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimInfo.java index fea3541..9564007 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimInfo.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimInfo.java @@ -31,6 +31,7 @@ import co.aikar.commands.annotation.Syntax; import com.flowpowered.math.vector.Vector3i; +import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.Tristate; @@ -39,8 +40,10 @@ import com.griefdefender.api.claim.ClaimType; import com.griefdefender.api.claim.ClaimTypes; import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.claim.GDClaimManager; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.pagination.PaginationList; import com.griefdefender.internal.util.VecHelper; @@ -74,17 +77,18 @@ @CommandPermission(GDPermissions.COMMAND_CLAIM_INFO_BASE) public class CommandClaimInfo extends BaseCommand { - private static final Component NONE = TextComponent.of("none", TextColor.GRAY); - private static final String ADMIN_SETTINGS = "Admin Settings"; - private static final String CLAIM_EXPIRATION = "ClaimExpiration"; - private static final String DENY_MESSAGES = "DenyMessages"; - private static final String FLAG_OVERRIDES = "FlagOverrides"; - private static final String INHERIT_PARENT = "InheritParent"; - private static final String PVP_OVERRIDE = "PvPOverride"; - private static final String RESIZABLE = "Resizable"; - private static final String REQUIRES_CLAIM_BLOCKS = "RequiresClaimBlocks"; - private static final String SIZE_RESTRICTIONS = "SizeRestrictions"; - private static final String FOR_SALE = "ForSale"; + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + private final Component NONE = TextComponent.of("none", TextColor.GRAY); + private final int ADMIN_SETTINGS = 0; + private final int CLAIM_EXPIRATION = 1; + private final int DENY_MESSAGES = 2; + private final int FLAG_OVERRIDES = 3; + private final int INHERIT_PARENT = 4; + private final int PVP_OVERRIDE = 5; + private final int RESIZABLE = 6; + private final int REQUIRES_CLAIM_BLOCKS = 7; + private final int SIZE_RESTRICTIONS = 8; + private final int FOR_SALE = 9; private boolean useTownInfo = false; public CommandClaimInfo() { @@ -108,13 +112,13 @@ public void execute(CommandSender src, String[] args) { if (src instanceof Player) { player = (Player) src; if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(player.getWorld().getUID())) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_DISABLED_WORLD)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().CLAIM_DISABLED_WORLD); return; } } if (player == null && claimIdentifier == null) { - TextAdapter.sendComponent(src, TextComponent.of("No valid player or claim UUID found.", TextColor.RED)); + TextAdapter.sendComponent(src, MessageCache.getInstance().COMMAND_CLAIMINFO_NOT_FOUND); return; } @@ -125,7 +129,7 @@ public void execute(CommandSender src, String[] args) { if (player != null) { claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation()); } else { - TextAdapter.sendComponent(src, TextComponent.of("Claim UUID is required if executing from non-player source.", TextColor.RED)); + TextAdapter.sendComponent(src, MessageCache.getInstance().COMMAND_CLAIMINFO_UUID_REQUIRED); return; } } else { @@ -155,13 +159,13 @@ public void execute(CommandSender src, String[] args) { } if (claim == null) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_FOUND)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().CLAIM_NOT_FOUND); return; } if (this.useTownInfo) { if (!claim.isInTown()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOWN_NOT_IN)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TOWN_NOT_IN); return; } claim = claim.getTown().get(); @@ -179,7 +183,7 @@ public void execute(CommandSender src, String[] args) { && !gpClaim.getInternalClaimData().getBuilders().contains(player.getUniqueId()) && !gpClaim.getInternalClaimData().getManagers().contains(player.getUniqueId()) && !player.hasPermission(GDPermissions.COMMAND_CLAIM_INFO_OTHERS)) { - TextAdapter.sendComponent(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_YOURS)); + TextAdapter.sendComponent(player, MessageCache.getInstance().CLAIM_NOT_YOURS); return; } } @@ -231,25 +235,28 @@ public void execute(CommandSender src, String[] args) { Component claimSize = TextComponent.empty(); if (claim.isCuboid()) { claimSize = TextComponent.builder(" ") - .append("Area: ", TextColor.YELLOW) + .append(MessageCache.getInstance().LABEL_AREA.color(TextColor.YELLOW)) + .append(": ", TextColor.YELLOW) .append(sizeX + "x" + sizeY + "x" + sizeZ, TextColor.GRAY).build(); } else { claimSize = TextComponent.builder(" ") - .append("Area: ", TextColor.YELLOW) + .append(MessageCache.getInstance().LABEL_AREA.color(TextColor.YELLOW)) + .append(": ", TextColor.YELLOW) .append(sizeX + "x" + sizeZ, TextColor.GRAY).build(); } final Component claimCost = TextComponent.builder(" ") - .append("Blocks: ", TextColor.YELLOW) + .append(MessageCache.getInstance().LABEL_BLOCKS.color(TextColor.YELLOW)) + .append(": ", TextColor.YELLOW) .append(String.valueOf(claim.getClaimBlocks()), TextColor.GRAY).build(); if (claim.isWilderness() && name == null) { name = TextComponent.of("Wilderness", TextColor.GREEN); } - Component claimName = TextComponent.builder("") - .append("Name", TextColor.YELLOW) - .append(" : ") + Component claimName = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_NAME.color(TextColor.YELLOW)) + .append(" : ", TextColor.YELLOW) .append(name == null ? NONE : name).build(); if (!claim.isWilderness() && !claim.isAdminClaim()) { - claimName = TextComponent.builder("") + claimName = TextComponent.builder() .append(claimName) .append(claimSize) .append(claimCost).build(); @@ -318,10 +325,10 @@ public void execute(CommandSender src, String[] args) { }*/ if (isAdmin) { - Component adminSettings = TextComponent.builder("") - .append(TextComponent.of(ADMIN_SETTINGS, TextColor.RED).decoration(TextDecoration.ITALIC, true)) + Component adminSettings = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_ADMIN_SETTINGS).decoration(TextDecoration.ITALIC, true).color(TextColor.RED) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createSettingsConsumer(src, claim, generateAdminSettings(src, gpClaim), ClaimTypes.ADMIN)))) - .hoverEvent(HoverEvent.showText(TextComponent.of("Click here to view admin settings"))) + .hoverEvent(HoverEvent.showText(MessageCache.getInstance().CLAIMINFO_UI_CLICK_ADMIN)) .build(); textList.add(adminSettings); } @@ -330,36 +337,36 @@ public void execute(CommandSender src, String[] args) { Component forSaleText = null; if (GriefDefenderPlugin.getInstance().getVaultProvider() != null) { if (GriefDefenderPlugin.getActiveConfig(gpClaim.getWorld().getUID()).getConfig().claim.bankTaxSystem) { - bankInfo = TextComponent.builder("") - .append("Bank Info", TextColor.GOLD, TextDecoration.ITALIC) - .hoverEvent(HoverEvent.showText(TextComponent.of("Click to check bank information"))) + bankInfo = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_BANK_INFO.color(TextColor.GOLD).decoration(TextDecoration.ITALIC, true)) + .hoverEvent(HoverEvent.showText(MessageCache.getInstance().CLAIMINFO_UI_BANK_INFO)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(Consumer -> { CommandHelper.displayClaimBankInfo(src, gpClaim, gpClaim.isTown() ? true : false, true); }))) .build(); } - forSaleText = TextComponent.builder("") - .append("ForSale", TextColor.YELLOW) + forSaleText = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_FOR_SALE.color(TextColor.YELLOW)) .append(" : ") - .append(getClickableInfoText(src, claim, FOR_SALE, claim.getEconomyData().isForSale() ? TextComponent.of("YES", TextColor.GREEN) : TextComponent.of("NO", TextColor.GRAY))).build(); + .append(getClickableInfoText(src, claim, FOR_SALE, claim.getEconomyData().isForSale() ? MessageCache.getInstance().LABEL_YES.color(TextColor.GREEN) : MessageCache.getInstance().LABEL_NO.color(TextColor.GRAY))).build(); if (claim.getEconomyData().isForSale()) { - forSaleText = TextComponent.builder("") + forSaleText = TextComponent.builder() .append(forSaleText) .append(" ") - .append("Price", TextColor.YELLOW) + .append(MessageCache.getInstance().LABEL_PRICE.color(TextColor.YELLOW)) .append(" : ") .append(String.valueOf(claim.getEconomyData().getSalePrice()), TextColor.GOLD) .build(); } } - Component claimId = TextComponent.builder("") + Component claimId = TextComponent.builder() .append("UUID", TextColor.YELLOW) .append(" : ") - .append(TextComponent.builder("") + .append(TextComponent.builder() .append(claim.getUniqueId().toString(), TextColor.GRAY) .insertion(claim.getUniqueId().toString()).build()).build(); final String ownerName = PlayerUtil.getInstance().getUserName(ownerUniqueId); - Component ownerLine = TextComponent.builder("") - .append("Owner", TextColor.YELLOW) + Component ownerLine = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_OWNER.color(TextColor.YELLOW)) .append(" : ") .append(ownerName != null && !claim.isAdminClaim() && !claim.isWilderness() ? ownerName : "administrator", TextColor.GOLD).build(); Component adminShowText = TextComponent.empty(); @@ -369,7 +376,7 @@ public void execute(CommandSender src, String[] args) { Component claimType = TextComponent.empty(); final Component whiteOpenBracket = TextComponent.of("["); final Component whiteCloseBracket = TextComponent.of("]"); - Component defaultTypeText = TextComponent.builder("") + Component defaultTypeText = TextComponent.builder() .append(whiteOpenBracket) .append(gpClaim.getFriendlyNameType(true)) .append(whiteCloseBracket).build(); @@ -378,23 +385,23 @@ public void execute(CommandSender src, String[] args) { basicShowText = allowEdit; subdivisionShowText = allowEdit; townShowText = allowEdit; - Component adminTypeText = TextComponent.builder("") + Component adminTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.ADMIN ? defaultTypeText : TextComponent.of("ADMIN", TextColor.GRAY)) .hoverEvent(HoverEvent.showText(adminShowText)).build(); - Component basicTypeText = TextComponent.builder("") + Component basicTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.BASIC ? defaultTypeText : TextComponent.of("BASIC", TextColor.GRAY)) .hoverEvent(HoverEvent.showText(basicShowText)).build(); - Component subTypeText = TextComponent.builder("") + Component subTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.SUBDIVISION ? defaultTypeText : TextComponent.of("SUBDIVISION", TextColor.GRAY)) .hoverEvent(HoverEvent.showText(subdivisionShowText)).build(); - Component townTypeText = TextComponent.builder("") + Component townTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.TOWN ? defaultTypeText : TextComponent.of("TOWN", TextColor.GRAY)) .hoverEvent(HoverEvent.showText(townShowText)).build(); - claimType = TextComponent.builder("") + claimType = TextComponent.builder() .append(claim.isCuboid() ? "3D " : "2D ", TextColor.GREEN) .append(adminTypeText) .append(" ") @@ -411,19 +418,17 @@ public void execute(CommandSender src, String[] args) { Component townTypeText = defaultTypeText; if (!claim.isAdminClaim()) { final Component message = ((GDClaim) claim).validateClaimType(ClaimTypes.ADMIN, ownerUniqueId, playerData).getMessage().orElse(null); - adminShowText = message != null ? message : TextComponent.builder("") - .append("Click here to change claim to ") - .append("ADMIN ", TextColor.RED) - .append("type.").build(); + adminShowText = message != null ? message : MESSAGE_DATA.getMessage(MessageStorage.CLAIMINFO_UI_CLICK_CHANGE_CLAIM, + ImmutableMap.of("type", TextComponent.of("ADMIN ", TextColor.RED))); if (message == null) { - adminTypeText = TextComponent.builder("") + adminTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.ADMIN ? defaultTypeText : TextComponent.of("ADMIN", TextColor.GRAY)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimTypeConsumer(src, claim, ClaimTypes.ADMIN, isAdmin)))) .hoverEvent(HoverEvent.showText(adminShowText)).build(); } else { - adminTypeText = TextComponent.builder("") + adminTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.ADMIN ? defaultTypeText : TextComponent.of("ADMIN", TextColor.GRAY)) .hoverEvent(HoverEvent.showText(adminShowText)).build(); @@ -431,60 +436,54 @@ public void execute(CommandSender src, String[] args) { } if (!claim.isBasicClaim()) { final Component message = ((GDClaim) claim).validateClaimType(ClaimTypes.BASIC, ownerUniqueId, playerData).getMessage().orElse(null); - basicShowText = message != null ? message : TextComponent.builder("") - .append("Click here to change claim to ") - .append("BASIC ", TextColor.YELLOW) - .append("type.").build(); + basicShowText = message != null ? message : MESSAGE_DATA.getMessage(MessageStorage.CLAIMINFO_UI_CLICK_CHANGE_CLAIM, + ImmutableMap.of("type", TextComponent.of("BASIC ", TextColor.YELLOW))); if (message == null) { - basicTypeText = TextComponent.builder("") + basicTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.BASIC ? defaultTypeText : TextComponent.of("BASIC", TextColor.GRAY)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimTypeConsumer(src, claim, ClaimTypes.BASIC, isAdmin)))) .hoverEvent(HoverEvent.showText(basicShowText)).build(); } else { - basicTypeText = TextComponent.builder("") + basicTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.BASIC ? defaultTypeText : TextComponent.of("BASIC", TextColor.GRAY)) .hoverEvent(HoverEvent.showText(basicShowText)).build(); } } if (!claim.isSubdivision()) { final Component message = ((GDClaim) claim).validateClaimType(ClaimTypes.SUBDIVISION, ownerUniqueId, playerData).getMessage().orElse(null); - subdivisionShowText = message != null ? message : TextComponent.builder("") - .append("Click here to change claim to ") - .append("SUBDIVISION ", TextColor.AQUA) - .append("type.").build(); + subdivisionShowText = message != null ? message : MESSAGE_DATA.getMessage(MessageStorage.CLAIMINFO_UI_CLICK_CHANGE_CLAIM, + ImmutableMap.of("type", TextComponent.of("SUBDIVISION ", TextColor.AQUA))); if (message == null) { - subTypeText = TextComponent.builder("") + subTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.SUBDIVISION ? defaultTypeText : TextComponent.of("SUBDIVISION", TextColor.GRAY)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimTypeConsumer(src, claim, ClaimTypes.SUBDIVISION, isAdmin)))) .hoverEvent(HoverEvent.showText(subdivisionShowText)).build(); } else { - subTypeText = TextComponent.builder("") + subTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.SUBDIVISION ? defaultTypeText : TextComponent.of("SUBDIVISION", TextColor.GRAY)) .hoverEvent(HoverEvent.showText(subdivisionShowText)).build(); } } if (!claim.isTown()) { final Component message = ((GDClaim) claim).validateClaimType(ClaimTypes.TOWN, ownerUniqueId, playerData).getMessage().orElse(null); - townShowText = message != null ? message : TextComponent.builder("") - .append("Click here to change claim to ") - .append("TOWN ", TextColor.GREEN) - .append("type.").build(); + townShowText = message != null ? message : MESSAGE_DATA.getMessage(MessageStorage.CLAIMINFO_UI_CLICK_CHANGE_CLAIM, + ImmutableMap.of("type", TextComponent.of("TOWN ", TextColor.GREEN))); if (message == null) { - townTypeText = TextComponent.builder("") + townTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.TOWN ? defaultTypeText : TextComponent.of("TOWN", TextColor.GRAY)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimTypeConsumer(src, claim, ClaimTypes.TOWN, isAdmin)))) .hoverEvent(HoverEvent.showText(townShowText)).build(); } else { - townTypeText = TextComponent.builder("") + townTypeText = TextComponent.builder() .append(claim.getType() == ClaimTypes.TOWN ? defaultTypeText : TextComponent.of("TOWN", TextColor.GRAY)) .hoverEvent(HoverEvent.showText(townShowText)).build(); } } - claimType = TextComponent.builder("") + claimType = TextComponent.builder() .append(claim.isCuboid() ? "3D " : "2D ", TextColor.GREEN) .append(adminTypeText) .append(" ") @@ -496,114 +495,118 @@ public void execute(CommandSender src, String[] args) { .build(); } - Component claimTypeInfo = TextComponent.builder("") - .append("Type", TextColor.YELLOW) + Component claimTypeInfo = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_TYPE.color(TextColor.YELLOW)) .append(" : ") .append(claimType).build(); - Component claimInherit = TextComponent.builder("") - .append(INHERIT_PARENT, TextColor.YELLOW) + Component claimInherit = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_INHERIT_PARENT.color(TextColor.YELLOW)) .append(" : ") .append(getClickableInfoText(src, claim, INHERIT_PARENT, claim.getData().doesInheritParent() ? TextComponent.of("ON", TextColor.GREEN) : TextComponent.of("OFF", TextColor.RED))).build(); - Component claimExpired = TextComponent.builder("") - .append("Expired", TextColor.YELLOW) + Component claimExpired = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_EXPIRED.color(TextColor.YELLOW)) .append(" : ") .append(claim.getData().isExpired() ? TextComponent.of("YES", TextColor.RED) : TextComponent.of("NO", TextColor.GRAY)).build(); - Component claimFarewell = TextComponent.builder("") - .append("Farewell", TextColor.YELLOW) + Component claimFarewell = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_FAREWELL.color(TextColor.YELLOW)) .append(" : ") .append(farewell == null ? NONE : farewell).build(); - Component claimGreeting = TextComponent.builder("") - .append("Greeting", TextColor.YELLOW) + Component claimGreeting = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_GREETING.color(TextColor.YELLOW)) .append(" : ") .append(greeting == null ? NONE : greeting).build(); Component claimSpawn = null; if (claim.getData().getSpawnPos().isPresent()) { Vector3i spawnPos = claim.getData().getSpawnPos().get(); Location spawnLoc = new Location(gpClaim.getWorld(), spawnPos.getX(), spawnPos.getY(), spawnPos.getZ()); - claimSpawn = TextComponent.builder("") - .append("Spawn", TextColor.GREEN) + claimSpawn = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_SPAWN.color(TextColor.GREEN)) .append(" : ") .append(spawnPos.toString(), TextColor.GRAY) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createTeleportConsumer(player, spawnLoc, claim)))) - .hoverEvent(HoverEvent.showText(TextComponent.of("Click here to teleport to claim spawn."))) + .hoverEvent(HoverEvent.showText(MessageCache.getInstance().CLAIMINFO_UI_TELEPORT_SPAWN)) .build(); } - Component southWestCorner = TextComponent.builder("") + Component southWestCorner = TextComponent.builder() .append("SW", TextColor.LIGHT_PURPLE) .append(" : ") .append(VecHelper.toVector3i(southWest).toString(), TextColor.GRAY) .append(" ") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createTeleportConsumer(player, southWest, claim)))) - .hoverEvent(HoverEvent.showText(TextComponent.of("Click here to teleport to SW corner of claim."))) + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.CLAIMINFO_UI_TELEPORT_DIRECTION, + ImmutableMap.of("direction", TextComponent.of("SW").color(TextColor.AQUA))))) .build(); - Component southEastCorner = TextComponent.builder("") + Component southEastCorner = TextComponent.builder() .append("SE", TextColor.LIGHT_PURPLE) .append(" : ") .append(VecHelper.toVector3i(southEast).toString(), TextColor.GRAY) .append(" ") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createTeleportConsumer(player, southEast, claim)))) - .hoverEvent(HoverEvent.showText(TextComponent.of("Click here to teleport to SE corner of claim."))) + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.CLAIMINFO_UI_TELEPORT_DIRECTION, + ImmutableMap.of("direction", TextComponent.of("SE").color(TextColor.AQUA))))) .build(); - Component southCorners = TextComponent.builder("") + Component southCorners = TextComponent.builder() .append("SouthCorners", TextColor.YELLOW) .append(" : ") .append(southWestCorner) .append(southEastCorner).build(); - Component northWestCorner = TextComponent.builder("") + Component northWestCorner = TextComponent.builder() .append("NW", TextColor.LIGHT_PURPLE) .append(" : ") .append(VecHelper.toVector3i(northWest).toString(), TextColor.GRAY) .append(" ") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createTeleportConsumer(player, northWest, claim)))) - .hoverEvent(HoverEvent.showText(TextComponent.of("Click here to teleport to NW corner of claim."))) + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.CLAIMINFO_UI_TELEPORT_DIRECTION, + ImmutableMap.of("direction", TextComponent.of("NW").color(TextColor.AQUA))))) .build(); - Component northEastCorner = TextComponent.builder("") + Component northEastCorner = TextComponent.builder() .append("NE", TextColor.LIGHT_PURPLE) .append(" : ") .append(VecHelper.toVector3i(northEast).toString(), TextColor.GRAY) .append(" ") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createTeleportConsumer(player, northEast, claim)))) - .hoverEvent(HoverEvent.showText(TextComponent.of("Click here to teleport to NE corner of claim."))) + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.CLAIMINFO_UI_TELEPORT_DIRECTION, + ImmutableMap.of("direction", TextComponent.of("NE").color(TextColor.AQUA))))) .build(); - Component northCorners = TextComponent.builder("") - .append("NorthCorners", TextColor.YELLOW) + Component northCorners = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_NORTH_CORNERS.color(TextColor.YELLOW)) .append(" : ") .append(northWestCorner) .append(northEastCorner).build(); - Component claimAccessors = TextComponent.builder("") - .append("Accessors", TextColor.YELLOW) + Component claimAccessors = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_ACCESSORS.color(TextColor.YELLOW)) .append(" : ") .append(accessors.equals("") ? NONE : TextComponent.of(accessors, TextColor.BLUE)) .append(" ") .append(accessorGroups, TextColor.LIGHT_PURPLE).build(); - Component claimBuilders = TextComponent.builder("") - .append("Builders", TextColor.YELLOW) + Component claimBuilders = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_BUILDERS.color(TextColor.YELLOW)) .append(" : ") .append(builders.equals("") ? NONE : TextComponent.of(builders, TextColor.BLUE)) .append(" ") .append(builderGroups, TextColor.LIGHT_PURPLE).build(); - Component claimContainers = TextComponent.builder("") - .append("Containers", TextColor.YELLOW) + Component claimContainers = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_CONTAINERS.color(TextColor.YELLOW)) .append(" : ") .append(containers.equals("") ? NONE : TextComponent.of(containers, TextColor.BLUE)) .append(" ") .append(containerGroups, TextColor.LIGHT_PURPLE).build(); - Component claimCoowners = TextComponent.builder("") - .append("Managers", TextColor.YELLOW) + Component claimCoowners = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_MANAGERS.color(TextColor.YELLOW)) .append(" : ") .append(managers.equals("") ? NONE : TextComponent.of(managers, TextColor.BLUE)) .append(" ") .append(managerGroups, TextColor.LIGHT_PURPLE).build(); - Component dateCreated = TextComponent.builder("") - .append("Created", TextColor.YELLOW) + Component dateCreated = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_CREATED.color(TextColor.YELLOW)) .append(" : ") .append(created != null ? created.toString() : "Unknown", TextColor.GRAY).build(); - Component dateLastActive = TextComponent.builder("") - .append("LastActive", TextColor.YELLOW) + Component dateLastActive = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_LAST_ACTIVE.color(TextColor.YELLOW)) .append(" : ") - .append(lastActive != null ? lastActive.toString() : "Unknown", TextColor.GRAY).build(); - Component worldName = TextComponent.builder("") - .append("World", TextColor.YELLOW) + .append(lastActive != null ? TextComponent.of(lastActive.toString(), TextColor.GRAY) : MessageCache.getInstance().LABEL_UNKNOWN.color(TextColor.GRAY)).build(); + Component worldName = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_WORLD.color(TextColor.YELLOW)) .append(" : ") .append(gpClaim.getWorld().getName(), TextColor.GRAY).build(); @@ -617,7 +620,7 @@ public void execute(CommandSender src, String[] args) { textList.add(ownerLine); textList.add(claimTypeInfo); if (!claim.isAdminClaim() && !claim.isWilderness()) { - textList.add(TextComponent.builder("") + textList.add(TextComponent.builder() .append(claimInherit) .append(" ") .append(claimExpired).build()); @@ -654,51 +657,51 @@ public void execute(CommandSender src, String[] args) { } PaginationList.Builder paginationBuilder = PaginationList.builder() - .title(TextComponent.of("Claim Info", TextColor.AQUA)).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(textList); + .title(MessageCache.getInstance().CLAIMINFO_UI_TITLE_CLAIMINFO.color(TextColor.AQUA)).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(textList); paginationBuilder.sendTo(src); } public static Consumer createSettingsConsumer(CommandSender src, Claim claim, List textList, ClaimType type) { return settings -> { - String name = type == ClaimTypes.TOWN ? "Town Settings" : "Admin Settings"; + Component name = type == ClaimTypes.TOWN ? MessageCache.getInstance().CLAIMINFO_UI_TOWN_SETTINGS : MessageCache.getInstance().CLAIMINFO_UI_ADMIN_SETTINGS; PaginationList.Builder paginationBuilder = PaginationList.builder() - .title(TextComponent.of(name, TextColor.AQUA)).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(textList); + .title(name.color(TextColor.AQUA)).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(textList); paginationBuilder.sendTo(src); }; } - private static List generateAdminSettings(CommandSender src, GDClaim claim) { + private List generateAdminSettings(CommandSender src, GDClaim claim) { List textList = new ArrayList<>(); - Component returnToClaimInfo = TextComponent.builder("") + Component returnToClaimInfo = TextComponent.builder() .append("\n[") - .append("Return to standard settings", TextColor.AQUA) + .append(MessageCache.getInstance().CLAIMINFO_UI_RETURN_SETTINGS.color(TextColor.AQUA)) .append("]\n") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(src, "claiminfo", claim.getUniqueId().toString())))).build(); - Component claimDenyMessages = TextComponent.builder("") - .append(DENY_MESSAGES, TextColor.YELLOW) + Component claimDenyMessages = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_DENY_MESSAGES.color(TextColor.YELLOW)) .append(" : ") .append(getClickableInfoText(src, claim, DENY_MESSAGES, claim.getInternalClaimData().allowDenyMessages() ? TextComponent.of("ON", TextColor.GREEN) : TextComponent.of("OFF", TextColor.RED))).build(); - Component claimResizable = TextComponent.builder("") - .append(RESIZABLE, TextColor.YELLOW) + Component claimResizable = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_RESIZABLE.color(TextColor.YELLOW)) .append(" : ") .append(getClickableInfoText(src, claim, RESIZABLE, claim.getInternalClaimData().isResizable() ? TextComponent.of("ON", TextColor.GREEN) : TextComponent.of("OFF", TextColor.RED))).build(); - Component claimRequiresClaimBlocks = TextComponent.builder("") - .append(REQUIRES_CLAIM_BLOCKS, TextColor.YELLOW) + Component claimRequiresClaimBlocks = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_REQUIRES_CLAIM_BLOCKS.color(TextColor.YELLOW)) .append(" : ") .append(getClickableInfoText(src, claim, REQUIRES_CLAIM_BLOCKS, claim.getInternalClaimData().requiresClaimBlocks() ? TextComponent.of("ON", TextColor.GREEN) : TextComponent.of("OFF", TextColor.RED))).build(); - Component claimSizeRestrictions = TextComponent.builder("") - .append(SIZE_RESTRICTIONS, TextColor.YELLOW) + Component claimSizeRestrictions = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_SIZE_RESTRICTIONS.color(TextColor.YELLOW)) .append(" : ") .append(getClickableInfoText(src, claim, SIZE_RESTRICTIONS, claim.getInternalClaimData().hasSizeRestrictions() ? TextComponent.of("ON", TextColor.GREEN) : TextComponent.of("OFF", TextColor.RED))).build(); - Component claimExpiration = TextComponent.builder("") - .append(CLAIM_EXPIRATION, TextColor.YELLOW) + Component claimExpiration = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_CLAIM_EXPIRATION.color(TextColor.YELLOW)) .append(" : ") .append(getClickableInfoText(src, claim, CLAIM_EXPIRATION, claim.getInternalClaimData().allowExpiration() ? TextComponent.of("ON", TextColor.GREEN) : TextComponent.of("OFF", TextColor.RED))).build(); - Component claimFlagOverrides = TextComponent.builder("") - .append(FLAG_OVERRIDES, TextColor.YELLOW) + Component claimFlagOverrides = TextComponent.builder() + .append(MessageCache.getInstance().CLAIMINFO_UI_FLAG_OVERRIDES.color(TextColor.YELLOW)) .append(" : ") .append(getClickableInfoText(src, claim, FLAG_OVERRIDES, claim.getInternalClaimData().allowFlagOverrides() ? TextComponent.of("ON", TextColor.GREEN) : TextComponent.of("OFF", TextColor.RED))).build(); - Component pvp = TextComponent.builder("") + Component pvp = TextComponent.builder() .append("PvP", TextColor.YELLOW) .append(" : ") .append(getClickableInfoText(src, claim, PVP_OVERRIDE, claim.getInternalClaimData().getPvpOverride() == Tristate.TRUE ? TextComponent.of("ON", TextColor.GREEN) : TextComponent.of(claim.getInternalClaimData().getPvpOverride().name(), TextColor.RED))).build(); @@ -719,14 +722,14 @@ private static List generateAdminSettings(CommandSender src, GDClaim return textList; } - private static void executeAdminSettings(CommandSender src, GDClaim claim) { + private void executeAdminSettings(CommandSender src, GDClaim claim) { PaginationList.Builder paginationBuilder = PaginationList.builder() - .title(TextComponent.of("Admin Settings", TextColor.AQUA)).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(generateAdminSettings(src, claim)); + .title(MessageCache.getInstance().CLAIMINFO_UI_ADMIN_SETTINGS).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(generateAdminSettings(src, claim)); paginationBuilder.sendTo(src); } - public static Component getClickableInfoText(CommandSender src, Claim claim, String title, Component infoText) { - Component onClickText = TextComponent.of("Click here to toggle value."); + public Component getClickableInfoText(CommandSender src, Claim claim, int titleId, Component infoText) { + Component onClickText = MessageCache.getInstance().CLAIMINFO_UI_CLICK_TOGGLE; boolean hasPermission = true; if (src instanceof Player) { Component denyReason = ((GDClaim) claim).allowEdit((Player) src); @@ -736,19 +739,19 @@ public static Component getClickableInfoText(CommandSender src, Claim claim, Str } } - TextComponent.Builder textBuilder = TextComponent.builder("") + TextComponent.Builder textBuilder = TextComponent.builder() .append(infoText) .hoverEvent(HoverEvent.showText(onClickText)); if (hasPermission) { - textBuilder.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimInfoConsumer(src, claim, title)))); + textBuilder.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimInfoConsumer(src, claim, titleId)))); } return textBuilder.build(); } - private static Consumer createClaimInfoConsumer(CommandSender src, Claim claim, String title) { + private Consumer createClaimInfoConsumer(CommandSender src, Claim claim, int titleId) { GDClaim gpClaim = (GDClaim) claim; return info -> { - switch (title) { + switch (titleId) { case INHERIT_PARENT : if (!src.hasPermission(GDPermissions.COMMAND_CLAIM_INHERIT)) { return; @@ -827,7 +830,7 @@ private static Consumer createClaimTypeConsumer(CommandSender src final Player player = (Player) src; if (!isAdmin && ((GDClaim) gpClaim).allowEdit(player) != null) { - TextAdapter.sendComponent(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_YOURS)); + TextAdapter.sendComponent(src, MessageCache.getInstance().CLAIM_NOT_YOURS); return; } final ClaimResult result = claim.changeType(clicked, Optional.of(player.getUniqueId()), src); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimInherit.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimInherit.java index cb0a925..0ab0da0 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimInherit.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimInherit.java @@ -31,6 +31,7 @@ import co.aikar.commands.annotation.Subcommand; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; @@ -56,20 +57,16 @@ public void execute(Player player) { } if (claim.parent == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INHERIT)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_INHERIT_ONLY_CHILD); return; } claim.getData().setInheritParent(!claim.getData().doesInheritParent()); claim.getInternalClaimData().setRequiresSave(true); if (!claim.getData().doesInheritParent()) { - GriefDefenderPlugin.sendMessage(player, TextComponent.builder("") - .append("Parent claim inheritance ") - .append("OFF", TextColor.RED).build()); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_CLAIMINHERIT_DISABLED); } else { - GriefDefenderPlugin.sendMessage(player, TextComponent.builder("") - .append("Parent claim inheritance ") - .append("ON", TextColor.GREEN).build()); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_CLAIMINHERIT_ENABLED); } } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimList.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimList.java index 46ed54c..425e05e 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimList.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimList.java @@ -33,13 +33,17 @@ import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; +import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.Claim; import com.griefdefender.api.claim.ClaimType; import com.griefdefender.api.claim.ClaimTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaimManager; +import com.griefdefender.configuration.MessageDataConfig; +import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.pagination.PaginationList; import com.griefdefender.internal.util.BlockUtil; import com.griefdefender.permission.GDPermissionUser; @@ -71,6 +75,7 @@ @CommandPermission(GDPermissions.COMMAND_CLAIM_LIST) public class CommandClaimList extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; private final ClaimType forcedType; private boolean canListOthers; private boolean canListAdmin; @@ -95,13 +100,15 @@ public void execute(Player src, @Optional String[] args) { if (args.length > 0) { user = Bukkit.getServer().getOfflinePlayer(args[0]); if (user == null) { - TextAdapter.sendComponent(src, TextComponent.of("User ' " + args[0] + "' could not be found.", TextColor.RED)); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_PLAYER_NOT_FOUND, + ImmutableMap.of("player", args[0]))); return; } if (args.length > 1) { world = Bukkit.getServer().getWorld(args[1]); if (world == null) { - TextAdapter.sendComponent(src, TextComponent.of("World ' " + args[1] + "' could not be found.", TextColor.RED)); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_WORLD_NOT_FOUND, + ImmutableMap.of("world", args[1]))); return; } } @@ -170,29 +177,21 @@ private void showClaimList(Player src, GDPermissionUser user, ClaimType type, UU final Component whiteOpenBracket = TextComponent.of("["); final Component whiteCloseBracket = TextComponent.of("]"); - Component ownedShowText = TextComponent.of("Click here to view the claims you own."); - Component adminShowText = TextComponent.builder("") - .append("Click here to filter by ") - .append("ADMIN ", TextColor.RED) - .append("type.").build(); - Component basicShowText = TextComponent.builder("") - .append("Click here to filter by ") - .append("BASIC ", TextColor.YELLOW) - .append("type.").build(); - Component subdivisionShowText = TextComponent.builder("") - .append("Click here to filter by ") - .append("SUBDIVISION ", TextColor.AQUA) - .append("type.").build(); - Component townShowText = TextComponent.builder("") - .append("Click here to filter by ") - .append("TOWN ", TextColor.GREEN) - .append("type.").build(); + Component ownedShowText = MessageCache.getInstance().CLAIMLIST_UI_CLICK_VIEW_CLAIMS; + Component adminShowText = MESSAGE_DATA.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", TextComponent.of("ADMIN", TextColor.RED))); + Component basicShowText = MESSAGE_DATA.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", TextComponent.of("BASIC", TextColor.YELLOW))); + Component subdivisionShowText = MESSAGE_DATA.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", TextComponent.of("SUBDIVISION", TextColor.AQUA))); + Component townShowText = MESSAGE_DATA.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", TextComponent.of("TOWN", TextColor.GREEN))); Component ownedTypeText = TextComponent.builder("") .append(this.displayOwned && type == null ? TextComponent.builder("") .append(whiteOpenBracket) - .append("OWN", TextColor.GOLD) - .append(whiteCloseBracket).build() : TextComponent.of("OWN", TextColor.GRAY)) + .append(MessageCache.getInstance().TITLE_OWN.color(TextColor.GOLD)) + .append(whiteCloseBracket).build() : MessageCache.getInstance().TITLE_OWN.color(TextColor.GRAY)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimListConsumer(src, user, "OWN", worldUniqueId)))) .hoverEvent(HoverEvent.showText(ownedShowText)).build(); Component adminTypeText = TextComponent.builder("") @@ -224,7 +223,9 @@ private void showClaimList(Player src, GDPermissionUser user, ClaimType type, UU .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimListConsumer(src, user, ClaimTypes.TOWN, worldUniqueId)))) .hoverEvent(HoverEvent.showText(townShowText)).build(); Component claimListHead = TextComponent.builder("") - .append(" Displaying : ", TextColor.AQUA) + .append(" ") + .append(MessageCache.getInstance().LABEL_DISPLAYING.color(TextColor.AQUA)) + .append(" : ", TextColor.AQUA) .append(ownedTypeText) .append(" ") .append(adminTypeText) diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimOption.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimOption.java index 4990a87..effb3a1 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimOption.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimOption.java @@ -41,6 +41,7 @@ import com.griefdefender.api.claim.ClaimContexts; import com.griefdefender.api.permission.Context; import com.griefdefender.api.permission.option.Option; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; @@ -91,7 +92,7 @@ public void execute(Player player, @Optional String[] args) throws CommandExcept option = OptionRegistryModule.getInstance().getById(commandOption).orElse(null); // Check if global option if (option != null && option.isGlobal() && !player.hasPermission(GDPermissions.MANAGE_GLOBAL_OPTIONS)) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_GLOBAL_OPTION)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_GLOBAL_OPTION); return; } try { @@ -156,12 +157,13 @@ public void execute(Player player, @Optional String[] args) throws CommandExcept if (option != null && !option.isGlobal()) { if (claim.isSubdivision()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_CLAIM)); + GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_CLAIM, + ImmutableMap.of("type", claim.getFriendlyNameType()))); return; } if (!playerData.canManageOption(player, claim, true)) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_GROUP_OPTION)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_GROUP_OPTION); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimPermissionGroup.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimPermissionGroup.java index 3d7ee30..7008279 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimPermissionGroup.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimPermissionGroup.java @@ -36,11 +36,11 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; -import com.google.inject.spi.Message; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.Tristate; import com.griefdefender.api.permission.Context; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; @@ -78,7 +78,7 @@ public void execute(Player player, String group, @Optional String[] args) throws } permission = args[0]; if (permission != null && !player.hasPermission(permission)) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_ASSIGN_WITHOUT_HAVING)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_ASSIGN_WITHOUT_HAVING); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimPermissionPlayer.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimPermissionPlayer.java index 8a77c4b..7eb8e76 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimPermissionPlayer.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimPermissionPlayer.java @@ -40,6 +40,7 @@ import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.Tristate; import com.griefdefender.api.permission.Context; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; @@ -78,7 +79,7 @@ public void execute(Player player, OfflinePlayer otherPlayer, @Optional String[] } permission = args[0]; if (permission != null && !player.hasPermission(permission)) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_ASSIGN_WITHOUT_HAVING)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_ASSIGN_WITHOUT_HAVING); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSchematic.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSchematic.java index 68d3c75..b67d912 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSchematic.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSchematic.java @@ -38,6 +38,7 @@ import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.Claim; import com.griefdefender.api.claim.ClaimSchematic; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.pagination.PaginationList; @@ -69,7 +70,7 @@ public class CommandClaimSchematic extends BaseCommand { @Subcommand("schematic") public void execute(Player player, @Optional String[] args) throws CommandException, InvalidCommandArgument { if (GriefDefenderPlugin.getInstance().getWorldEditProvider() == null) { - TextAdapter.sendComponent(player, TextComponent.of("This command requires WorldEdit to be running on server.", TextColor.RED)); + TextAdapter.sendComponent(player, MessageCache.getInstance().COMMAND_WORLDEDIT_MISSING); return; } @@ -93,7 +94,7 @@ public void execute(Player player, @Optional String[] args) throws CommandExcept if (action == null) { if (claim.schematics.isEmpty()) { - TextAdapter.sendComponent(player, TextComponent.of("There are no schematic backups for this claim.", TextColor.RED)); + TextAdapter.sendComponent(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.SCHEMATIC_NONE)); return; } @@ -105,16 +106,10 @@ public void execute(Player player, @Optional String[] args) throws CommandExcept TextComponent.builder("") .append(schematicName, TextColor.GREEN) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(displayConfirmationConsumer(player, claim, schematic)))) - .hoverEvent(HoverEvent.showText( - TextComponent.builder("") - .append("Click here to restore claim schematic.\n") - .append("Name", TextColor.YELLOW) - .append(": ") - .append(schematicName, TextColor.GREEN) - .append("\n") - .append("Created", TextColor.YELLOW) - .append(": ") - .append(Date.from(schematicDate).toString(), TextColor.AQUA).build())) + .hoverEvent(HoverEvent.showText(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.SCHEMATIC_RESTORE_CLICK, + ImmutableMap.of( + "name", TextComponent.of(schematicName, TextColor.GREEN), + "date", TextComponent.of(Date.from(schematicDate).toString(), TextColor.AQUA))))) .build()); } @@ -131,7 +126,8 @@ public void execute(Player player, @Optional String[] args) throws CommandExcept } } else if (action.equalsIgnoreCase("delete")) { claim.deleteSchematic(name); - TextAdapter.sendComponent(player, TextComponent.of("Schematic '" + name + "' has been deleted.", TextColor.GREEN)); + TextAdapter.sendComponent(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.SCHEMATIC_DELETED, + ImmutableMap.of("name", name))); } } @@ -142,7 +138,7 @@ private static Consumer displayConfirmationConsumer(CommandSender .append("Confirm", TextColor.GREEN) .append("]\n") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createConfirmationConsumer(src, claim, schematic)))) - .hoverEvent(HoverEvent.showText(TextComponent.of("Clicking confirm will restore ALL claim data with schematic. Use cautiously!"))).build(); + .hoverEvent(HoverEvent.showText(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.SCHEMATIC_RESTORE_CONFIRMATION))).build(); TextAdapter.sendComponent(src, schematicConfirmationText); }; } @@ -150,8 +146,8 @@ private static Consumer displayConfirmationConsumer(CommandSender private static Consumer createConfirmationConsumer(CommandSender src, Claim claim, ClaimSchematic schematic) { return confirm -> { schematic.apply(); - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.SCHEMATIC_RESTORE_CONFIRMED, ImmutableMap.of( - "name", schematic.getName())); + final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.SCHEMATIC_RESTORE_CONFIRMED, + ImmutableMap.of("name", schematic.getName())); GriefDefenderPlugin.sendMessage(src, message); }; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSell.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSell.java index 556ea12..bc04e8e 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSell.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSell.java @@ -36,6 +36,7 @@ import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.Claim; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; @@ -47,7 +48,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import java.util.Map; import java.util.function.Consumer; @CommandAlias("%griefdefender") @@ -61,7 +61,7 @@ public class CommandClaimSell extends BaseCommand { public void execute(Player player, String arg) throws InvalidCommandArgument { // if economy is disabled, don't do anything if (GriefDefenderPlugin.getInstance().getVaultProvider() == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_NOT_INSTALLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_NOT_INSTALLED); return; } @@ -69,24 +69,24 @@ public void execute(Player player, String arg) throws InvalidCommandArgument { final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation()); if (claim.isAdminClaim() || claim.isWilderness()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_NOT_FOR_SALE)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_CLAIM_NOT_FOR_SALE); return; } if (!playerData.canIgnoreClaim(claim) && !player.getUniqueId().equals(claim.getOwnerUniqueId())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CLAIM_SALE)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_CLAIM_SALE); return; } Double salePrice = null; if (!claim.getEconomyData().isForSale()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_NOT_FOR_SALE)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_CLAIM_NOT_FOR_SALE); return; } if (arg.equalsIgnoreCase("cancel")) { claim.getEconomyData().setForSale(false); claim.getEconomyData().setSalePrice(-1); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_SALE_CANCELLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_CLAIM_SALE_CANCELLED); return; } else { try { diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSellBlocks.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSellBlocks.java index ced00e3..1035915 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSellBlocks.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSellBlocks.java @@ -35,6 +35,7 @@ import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; import net.kyori.text.Component; @@ -59,19 +60,19 @@ public void execute(Player player, @Optional Integer blockCount) { // if economy is disabled, don't do anything if (GriefDefenderPlugin.getInstance().getVaultProvider() == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_NOT_INSTALLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_NOT_INSTALLED); return; } final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); if (playerData.getEconomyClaimBlockCost() == 0 && playerData.getEconomyClaimBlockReturn() == 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_BUY_SELL_DISABLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_BLOCK_BUY_SELL_DISABLED); return; } // if selling disabled, send error message if (playerData.getEconomyClaimBlockReturn() == 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_BLOCK_ONLY_BUY)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_BLOCK_ONLY_BUY); return; } @@ -86,10 +87,10 @@ public void execute(Player player, @Optional Integer blockCount) { } else { // try to parse number of blocks if (blockCount <= 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_BLOCK_BUY_INVALID)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_BLOCK_BUY_INVALID); return; } else if (blockCount > availableBlocks) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_BLOCK_NOT_AVAILABLE)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_BLOCK_NOT_AVAILABLE); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSpawn.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSpawn.java index 38ff99c..d55f964 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSpawn.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSpawn.java @@ -33,6 +33,7 @@ import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; @@ -56,7 +57,7 @@ public void execute(Player player) { final Vector3i spawnPos = claim.getData().getSpawnPos().orElse(null); if (spawnPos == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.SPAWN_NOT_SET)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().SPAWN_NOT_SET); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSubdivision.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSubdivision.java index 0a1a1ef..88a7c29 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimSubdivision.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimSubdivision.java @@ -32,7 +32,7 @@ import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.ShovelTypes; -import com.griefdefender.configuration.MessageStorage; +import com.griefdefender.cache.MessageCache; import com.griefdefender.permission.GDPermissions; import org.bukkit.entity.Player; @@ -48,6 +48,6 @@ public void execute(Player player) { final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); playerData.shovelMode = ShovelTypes.SUBDIVISION; playerData.claimSubdividing = null; - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.MODE_SUBDIVISION)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().MODE_SUBDIVISION); } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimTown.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimTown.java index 4ea1d2e..503dd12 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimTown.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimTown.java @@ -32,7 +32,7 @@ import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.ShovelTypes; -import com.griefdefender.configuration.MessageStorage; +import com.griefdefender.cache.MessageCache; import com.griefdefender.permission.GDPermissions; import org.bukkit.entity.Player; @@ -48,6 +48,6 @@ public void execute(Player player) { final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); playerData.shovelMode = ShovelTypes.TOWN; playerData.claimSubdividing = null; - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.MODE_TOWN)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().MODE_TOWN); } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimTransfer.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimTransfer.java index cdb4a90..5fb176b 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimTransfer.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimTransfer.java @@ -12,6 +12,7 @@ import com.griefdefender.api.claim.ClaimResultType; import com.griefdefender.api.claim.TrustTypes; import com.griefdefender.api.data.PlayerData; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; @@ -36,7 +37,7 @@ public void execute(Player player, OfflinePlayer otherPlayer) { final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(playerData, player.getLocation()); if (claim == null || claim.isWilderness()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_FOUND)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_FOUND); return; } @@ -44,17 +45,17 @@ public void execute(Player player, OfflinePlayer otherPlayer) { final boolean isAdmin = playerData.canIgnoreClaim(claim); // check permission if (!isAdmin && claim.isAdminClaim() && !player.hasPermission(GDPermissions.COMMAND_ADMIN_CLAIMS)) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CLAIM_TRANSFER_ADMIN)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_CLAIM_TRANSFER_ADMIN); return; } else if (!isAdmin && !player.getUniqueId().equals(ownerId) && claim.isUserTrusted(player, TrustTypes.MANAGER)) { if (claim.parent == null) { // Managers can only transfer child claims - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_YOURS)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_YOURS); return; } } else if (!isAdmin && !claim.isAdminClaim() && !player.getUniqueId().equals(ownerId)) { // verify ownership - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_YOURS)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_YOURS); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandClaimWorldEdit.java b/bukkit/src/main/java/com/griefdefender/command/CommandClaimWorldEdit.java index e778686..4859464 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandClaimWorldEdit.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandClaimWorldEdit.java @@ -30,7 +30,7 @@ import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Subcommand; import com.griefdefender.GriefDefenderPlugin; -import com.griefdefender.configuration.MessageStorage; +import com.griefdefender.cache.MessageCache; import com.griefdefender.permission.GDPermissions; import org.bukkit.entity.Player; @@ -43,7 +43,7 @@ public class CommandClaimWorldEdit extends BaseCommand { @Subcommand("claim worldedit|claim we") public void execute(Player player) { if (GriefDefenderPlugin.getInstance().getWorldEditProvider() == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_WORLDEDIT_MISSING)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_WORLDEDIT_MISSING); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandGDReload.java b/bukkit/src/main/java/com/griefdefender/command/CommandGDReload.java index dd2c2a0..7fdcb1d 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandGDReload.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandGDReload.java @@ -30,7 +30,7 @@ import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Subcommand; import com.griefdefender.GriefDefenderPlugin; -import com.griefdefender.configuration.MessageStorage; +import com.griefdefender.cache.MessageCache; import com.griefdefender.permission.GDPermissions; import org.bukkit.command.CommandSender; @@ -43,6 +43,6 @@ public class CommandGDReload extends BaseCommand { @Subcommand("reload") public void execute(CommandSender src) { GriefDefenderPlugin.getInstance().loadConfig(); - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PLUGIN_RELOAD)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().PLUGIN_RELOAD); } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandHelper.java b/bukkit/src/main/java/com/griefdefender/command/CommandHelper.java index 65bb0ac..f469813 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandHelper.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandHelper.java @@ -33,6 +33,7 @@ import com.griefdefender.api.Tristate; import com.griefdefender.api.claim.Claim; import com.griefdefender.api.claim.ClaimContexts; +import com.griefdefender.api.claim.ClaimResult; import com.griefdefender.api.claim.TrustType; import com.griefdefender.api.claim.TrustTypes; import com.griefdefender.api.economy.BankTransactionType; @@ -42,10 +43,12 @@ import com.griefdefender.api.permission.flag.Flag; import com.griefdefender.api.permission.flag.Flags; import com.griefdefender.api.permission.option.Options; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.command.ClaimFlagBase.FlagType; import com.griefdefender.configuration.GriefDefenderConfig; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.economy.GDBankTransaction; import com.griefdefender.internal.pagination.PaginationList; @@ -96,6 +99,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.function.Consumer; @@ -104,6 +108,8 @@ public class CommandHelper { + private final static MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + public static Comparator PLAIN_COMPARATOR = (text1, text2) -> PlainComponentSerializer.INSTANCE.serialize(text1).compareTo(PlainComponentSerializer.INSTANCE.serialize(text2)); public static Player checkPlayer(CommandSender source) { @@ -277,7 +283,7 @@ public static PermissionResult applyFlagPermission(CommandSender src, GDPermissi } if (result != Tristate.TRUE) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_FLAG_USE)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().PERMISSION_FLAG_USE); return new GDPermissionResult(ResultTypes.NO_PERMISSION); } } @@ -349,38 +355,36 @@ public static PermissionResult applyFlagPermission(CommandSender src, GDPermissi if (holder == GriefDefenderPlugin.DEFAULT_HOLDER) { PermissionUtil.getInstance().setPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, flagPermission, value, contexts); - if (!clicked) { + if (!clicked && src instanceof Player) { TextAdapter.sendComponent(src, TextComponent.builder("") - .append(TextComponent.builder("\n[").append("Return to flags", TextColor.AQUA).append("]\n") + .append(TextComponent.builder("\n[").append(MessageCache.getInstance().FLAG_UI_RETURN_FLAGS.color(TextColor.AQUA)).append("]\n") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createCommandConsumer(src, "claimflag", "")))).build()) - .append("Set ") - .append(flagTypeText) - .append(" permission ", TextColor.GREEN) - .append(flagPermission.replace(GDPermissions.FLAG_BASE + ".", "") + "\n", TextColor.AQUA) - .append("with contexts") - .append(getFriendlyContextString(claim, contexts), TextColor.GRAY) - .append("\n to ", TextColor.GREEN) - .append(getClickableText(src, (GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, subjectName, contexts, flagPermission, value, flagType).color(TextColor.LIGHT_PURPLE)) - .append(" on ", TextColor.GREEN) - .append("ALL", TextColor.GOLD).build()); + .append(MESSAGE_DATA.getMessage(MessageStorage.FLAG_SET_PERMISSION_TARGET, + ImmutableMap.of( + "type", flagTypeText, + "permission", flagPermission.replace(GDPermissions.FLAG_BASE + ".", ""), + "contexts", getFriendlyContextString(claim, contexts), + "value", getClickableText(src, (GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, subjectName, contexts, flagPermission, value, flagType).color(TextColor.LIGHT_PURPLE), + "target", "ALL"))) + .build()); } } else { PermissionUtil.getInstance().setPermissionValue((GDClaim) claim, holder, flagPermission, value, contexts); - if (!clicked) { + if (!clicked && src instanceof Player) { TextAdapter.sendComponent(src, TextComponent.builder("") .append(TextComponent.builder("") .append("\n[") - .append("Return to flags", TextColor.AQUA) + .append(MessageCache.getInstance().FLAG_UI_RETURN_FLAGS.color(TextColor.AQUA)) .append("]\n", TextColor.WHITE) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createCommandConsumer(src, holder instanceof GDPermissionUser ? "claimflagplayer" : "claimflaggroup", subjectName)))).build()) - .append("Set ", TextColor.GREEN) - .append(flagTypeText) - .append(" permission ") - .append(flagPermission.replace(GDPermissions.FLAG_BASE + ".", ""), TextColor.AQUA) - .append("\n to ", TextColor.GREEN) - .append(getClickableText(src, (GDClaim) claim, holder, subjectName, contexts, flagPermission, value, flagType).color(TextColor.LIGHT_PURPLE)) - .append(" on ", TextColor.GREEN) - .append(subjectName, TextColor.GOLD).build()); + .append(MESSAGE_DATA.getMessage(MessageStorage.FLAG_SET_PERMISSION_TARGET, + ImmutableMap.of( + "type", flagTypeText, + "permission", flagPermission.replace(GDPermissions.FLAG_BASE + ".", ""), + "contexts", getFriendlyContextString(claim, contexts), + "value", getClickableText(src, (GDClaim) claim, holder, subjectName, contexts, flagPermission, value, flagType).color(TextColor.LIGHT_PURPLE), + "target", subjectName))) + .build()); } } @@ -451,7 +455,10 @@ public static Consumer createCommandConsumer(CommandSender src, S public static Consumer createCommandConsumer(CommandSender src, String command, String arguments, Consumer postConsumerTask) { return consumer -> { if (!NMSUtil.getInstance().getBukkitCommandMap().dispatch(src, command + " " + arguments)) { - TextAdapter.sendComponent(src, TextComponent.of("Failed to execute command " + command + " " + arguments, TextColor.RED)); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_EXECUTE_FAILED, + ImmutableMap.of( + "command", command, + "args", arguments))); } if (postConsumerTask != null) { postConsumerTask.accept(src); @@ -461,7 +468,10 @@ public static Consumer createCommandConsumer(CommandSender src, S public static void executeCommand(CommandSender src, String command, String arguments) { if (!NMSUtil.getInstance().getBukkitCommandMap().dispatch(src, command + " " + arguments)) { - TextAdapter.sendComponent(src, TextComponent.of("Failed to execute command " + command + " " + arguments, TextColor.RED)); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_EXECUTE_FAILED, + ImmutableMap.of( + "command", command, + "args", arguments))); } } @@ -508,7 +518,7 @@ public static void showClaims(CommandSender src, Set claims, int height, //PaginationList.Builder paginationBuilder = paginationService.builder() // .title(Text.of(TextColors.RED,"Claim list")).padding(Text.of(TextStyles.STRIKETHROUGH, "-")).contents(claimsTextList); //paginationBuilder.sendTo(src); - PaginationList.Builder builder = PaginationList.builder().title(TextComponent.of("Claim list", TextColor.RED)).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(claimsTextList); + PaginationList.Builder builder = PaginationList.builder().title(MessageCache.getInstance().CLAIMLIST_UI_TITLE.color(TextColor.RED)).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(claimsTextList); builder.sendTo(src); } @@ -554,7 +564,8 @@ public static List generateClaimTextList(List claimsTextLi //Location southWest = claim.lesserBoundaryCorner.setPosition(new Vector3d(claim.lesserBoundaryCorner.getPosition().getX(), teleportHeight, claim.greaterBoundaryCorner.getPosition().getZ())); Component claimName = claim.getData().getName().orElse(TextComponent.empty()); Component teleportName = claim.getData().getName().orElse(claim.getFriendlyNameType()); - Component ownerLine = TextComponent.builder("Owner").color(TextColor.YELLOW) + Component ownerLine = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_OWNER.color(TextColor.YELLOW)) .append(" : ", TextColor.WHITE) .append(claim.getOwnerName().color(TextColor.GOLD)) .append("\n").build(); @@ -563,10 +574,12 @@ public static List generateClaimTextList(List claimsTextLi .append(claim.getFriendlyNameType()) .append(" ") .append(claim.isCuboid() ? "3D " : "2D ", TextColor.GRAY) - .append(" (Area: ", TextColor.WHITE) + .append(" (") + .append(MessageCache.getInstance().LABEL_AREA) + .append(": ", TextColor.WHITE) .append(String.valueOf(claim.getClaimBlocks()), TextColor.GRAY) .append(" blocks)\n", TextColor.WHITE).build(); - Component clickInfo = TextComponent.of("Click to check more info."); + Component clickInfo = MessageCache.getInstance().CLAIMLIST_UI_CLICK_INFO; Component basicInfo = TextComponent.builder("") .append(ownerLine) .append(claimTypeInfo) @@ -582,14 +595,12 @@ public static List generateClaimTextList(List claimsTextLi .append("TP", TextColor.LIGHT_PURPLE) .append("]") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createTeleportConsumer(src, VecHelper.toLocation(claim.getWorld(), southWest), claim)))) - .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append("Click here to teleport to ") - .append(teleportName) - .append(" ") - .append(southWest.toString()) - .append(" in ") - .append(claim.getWorld().getName(), TextColor.LIGHT_PURPLE) - .append(".").build())).build(); + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.CLAIMLIST_UI_CLICK_TELEPORT_TARGET, + ImmutableMap.of( + "name", teleportName, + "target", southWest.toString(), + "world", claim.getWorld().getName())))) + .build(); Component claimSpawn = null; if (claim.getData().getSpawnPos().isPresent()) { @@ -600,14 +611,11 @@ public static List generateClaimTextList(List claimsTextLi .append("TP", TextColor.LIGHT_PURPLE) .append("]") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createTeleportConsumer(src, spawnLoc, claim)))) - .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append("Click here to teleport to ") - .append(teleportName) - .append("'s spawn @ ") - .append(spawnPos.toString()) - .append(" in ") - .append(claim.getWorld().getName(), TextColor.LIGHT_PURPLE) - .append(".").build())) + .hoverEvent(HoverEvent.showText(MESSAGE_DATA.getMessage(MessageStorage.CLAIMLIST_UI_CLICK_TELEPORT_TARGET, + ImmutableMap.of( + "name", teleportName, + "target", "'s spawn @ " + spawnPos.toString(), + "world", claim.getWorld().getName())))) .build(); } else { claimSpawn = claimCoordsTPClick; @@ -620,21 +628,23 @@ public static List generateClaimTextList(List claimsTextLi final Player player = src instanceof Player ? (Player) src : null; Component buyClaim = TextComponent.empty(); if (player != null && claim.getEconomyData().isForSale() && claim.getEconomyData().getSalePrice() > -1) { - Component buyInfo = TextComponent.builder("Price ").color(TextColor.AQUA) - .append(": ", TextColor.WHITE) + Component buyInfo = TextComponent.builder() + .append(MessageCache.getInstance().LABEL_PRICE.color(TextColor.AQUA)) + .append(" : ", TextColor.WHITE) .append(String.valueOf(claim.getEconomyData().getSalePrice()), TextColor.GOLD) - .append("\nClick here to purchase claim.").build(); + .append("\n") + .append(MessageCache.getInstance().CLAIMLIST_UI_CLICK_PURCHASE).build(); buyClaim = TextComponent.builder() - .append(claim.getEconomyData().isForSale() ? TextComponent.builder(" [").append("Buy", TextColor.GREEN).append("]", TextColor.WHITE).build() : TextComponent.empty()) + .append(claim.getEconomyData().isForSale() ? TextComponent.builder(" [").append(MessageCache.getInstance().LABEL_BUY.color(TextColor.GREEN)).append("]", TextColor.WHITE).build() : TextComponent.empty()) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(buyClaimConsumerConfirmation(src, claim)))) - .hoverEvent(HoverEvent.showText(player.getUniqueId().equals(claim.getOwnerUniqueId()) ? TextComponent.of("You already own this claim.") : buyInfo)).build(); + .hoverEvent(HoverEvent.showText(player.getUniqueId().equals(claim.getOwnerUniqueId()) ? MessageCache.getInstance().CLAIM_OWNER_ALREADY : buyInfo)).build(); } if (!childrenTextList.isEmpty()) { Component children = TextComponent.builder("[") - .append("children", TextColor.AQUA) + .append(MessageCache.getInstance().LABEL_CHILDREN.color(TextColor.AQUA)) .append("]", TextColor.WHITE) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(showChildrenList(childrenTextList, src, returnCommand, claim)))) - .hoverEvent(HoverEvent.showText(TextComponent.of("Click here to view child claim list."))).build(); + .hoverEvent(HoverEvent.showText(MessageCache.getInstance().CLAIMLIST_UI_CLICK_VIEW_CHILDREN)).build(); claimsTextList.add(TextComponent.builder("") .append(claimSpawn) .append(" ") @@ -642,10 +652,10 @@ public static List generateClaimTextList(List claimsTextLi .append(" : ", TextColor.WHITE) .append(claim.getOwnerName().color(TextColor.GOLD)) .append(" ") - .append(children) - .append(" ") .append(claimName == TextComponent.empty() ? TextComponent.of("") : claimName) .append(" ") + .append(children) + .append(" ") .append(buyClaim) .build()); } else { @@ -662,7 +672,7 @@ public static List generateClaimTextList(List claimsTextLi } } if (claimsTextList.size() == 0) { - claimsTextList.add(TextComponent.of("No claims found in world.", TextColor.RED)); + claimsTextList.add(MessageCache.getInstance().CLAIMLIST_UI_NO_CLAIMS_FOUND.color(TextColor.RED)); } } return claimsTextList; @@ -674,77 +684,79 @@ public static Consumer buyClaimConsumerConfirmation(CommandSender if (player.getUniqueId().equals(claim.getOwnerUniqueId())) { return; } - /*Account playerAccount = GriefDefenderPlugin.getInstance().economyService.get().getOrCreateAccount(player.getUniqueId()).orElse(null); - if (playerAccount == null) { - Map params = ImmutableMap.of( - "user", player.getName()); - GriefDefenderPlugin.sendMessage(player, MessageStorage.ECONOMY_USER_NOT_FOUND, GriefDefenderPlugin.getInstance().messageData.economyUserNotFound, params); + + final Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi(); + if (!economy.hasAccount(player)) { + final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_PLAYER_NOT_FOUND, ImmutableMap.of( + "player", player.getName())); + GriefDefenderPlugin.sendMessage(player, message); return; } - final double balance = playerAccount.getBalance(GriefDefenderPlugin.getInstance().economyService.get().getDefaultCurrency()).doubleValue(); + final double balance = economy.getBalance(player); if (balance < claim.getEconomyData().getSalePrice()) { - Map params = ImmutableMap.of( - "sale_price", claim.getEconomyData().getSalePrice(), + Map params = ImmutableMap.of( + "amount", claim.getEconomyData().getSalePrice(), "balance", balance, - "amount_needed", claim.getEconomyData().getSalePrice() - balance); - GriefDefenderPlugin.sendMessage(player, "economy-claim-buy-not-enough-funds", GriefDefenderPlugin.getInstance().messageData.economyClaimBuyNotEnoughFunds, params); + "amount_required", claim.getEconomyData().getSalePrice() - balance); + GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_NOT_ENOUGH_FUNDS, params)); return; } - final Component message = GriefDefenderPlugin.getInstance().messageData.economyClaimBuyConfirmation - .apply(ImmutableMap.of( - "sale_price", claim.getEconomyData().getSalePrice())).build(); + final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_CONFIRMATION, + ImmutableMap.of("amount", claim.getEconomyData().getSalePrice())); GriefDefenderPlugin.sendMessage(src, message); final Component buyConfirmationText = TextComponent.builder("") .append("\n[") - .append("Confirm", TextColor.GREEN) + .append(MessageCache.getInstance().LABEL_CONFIRM.color(TextColor.GREEN)) .append("]\n") - .clickEvent(ClickEvent.runCommand(GPCallbackHolder.getInstance().createCallbackRunCommand(createBuyConsumerConfirmed(src, claim)))).build(); - GriefDefenderPlugin.sendMessage(player, buyConfirmationText);*/ + .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createBuyConsumerConfirmed(src, claim)))).build(); + GriefDefenderPlugin.sendMessage(player, buyConfirmationText); }; } private static Consumer createBuyConsumerConfirmed(CommandSender src, Claim claim) { return confirm -> { final Player player = (Player) src; - final Player ownerPlayer = Bukkit.getPlayer(claim.getOwnerUniqueId()); - /*final Account ownerAccount = GriefDefenderPlugin.getInstance().economyService.get().getOrCreateAccount(claim.getOwnerUniqueId()).orElse(null); - if (ownerAccount == null) { - TextAdapter.sendComponent(src, TextComponent.of("Buy cancelled! Could not locate an economy account for owner.", TextColor.RED)); + final GDPermissionUser owner = PermissionHolderCache.getInstance().getOrCreateUser(claim.getOwnerUniqueId()); + + final Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi(); + if (!economy.hasAccount(owner.getOfflinePlayer())) { + final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_PLAYER_NOT_FOUND, ImmutableMap.of( + "player", owner.getName())); + GriefDefenderPlugin.sendMessage(player, message); return; } final ClaimResult result = claim.transferOwner(player.getUniqueId()); if (!result.successful()) { - final Component defaultMessage = TextComponent.builder("") - .append("Buy cancelled! Could not transfer owner. Result was ", TextColor.RED) - .append(result.getResultType().name(), TextColor.GREEN).build(); + final Component defaultMessage = MESSAGE_DATA.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_TRANSFER_CANCELLED, + ImmutableMap.of( + "owner", owner.getName(), + "player", player.getName())); TextAdapter.sendComponent(src, result.getMessage().orElse(defaultMessage)); return; } - final Currency defaultCurrency = GriefDefenderPlugin.getInstance().economyService.get().getDefaultCurrency(); final double salePrice = claim.getEconomyData().getSalePrice(); - Sponge.getCauseStackManager().pushCause(src); - final TransactionResult ownerResult = ownerAccount.deposit(defaultCurrency, BigDecimal.valueOf(salePrice), Sponge.getCauseStackManager().getCurrentCause()); - Account playerAccount = GriefDefenderPlugin.getInstance().economyService.get().getOrCreateAccount(player.getUniqueId()).orElse(null); - final TransactionResult - transactionResult = - playerAccount.withdraw(defaultCurrency, BigDecimal.valueOf(salePrice), Sponge.getCauseStackManager().getCurrentCause()); - final Component message = GriefDefenderPlugin.getInstance().messageData.economyClaimBuyConfirmed - .apply(ImmutableMap.of( - "sale_price", salePrice)).build(); - final Component saleMessage = GriefDefenderPlugin.getInstance().messageData.economyClaimSold - .apply(ImmutableMap.of( - "amount", salePrice, - "balance", ownerAccount.getBalance(defaultCurrency))).build(); - if (ownerPlayer != null) { - TextAdapter.sendComponent(ownerPlayer, saleMessage); + final EconomyResponse response = economy.depositPlayer(owner.getOfflinePlayer(), salePrice); + if (response.transactionSuccess()) { + final EconomyResponse withdrawResponse = economy.withdrawPlayer(player, salePrice); + economy.withdrawPlayer(owner.getOfflinePlayer(), salePrice); + final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_CONFIRMED, + ImmutableMap.of( + "amount", salePrice)); + final Component saleMessage = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_SOLD, + ImmutableMap.of( + "amount", salePrice, + "balance", economy.getBalance(owner.getOfflinePlayer()))); + if (owner.getOnlinePlayer() != null) { + TextAdapter.sendComponent(owner.getOnlinePlayer(), saleMessage); + } + claim.getEconomyData().setForSale(false); + claim.getEconomyData().setSalePrice(0); + claim.getData().save(); + GriefDefenderPlugin.sendMessage(src, message); } - claim.getEconomyData().setForSale(false); - claim.getEconomyData().setSalePrice(0); - claim.getData().save(); - GriefDefenderPlugin.sendMessage(src, message);*/ }; } @@ -752,7 +764,7 @@ public static Consumer showChildrenList(List childrenT return consumer -> { Component claimListReturnCommand = TextComponent.builder("") .append("\n[") - .append("Return to claimslist", TextColor.AQUA) + .append(MessageCache.getInstance().CLAIMLIST_UI_RETURN_CLAIMSLIST.color(TextColor.AQUA)) .append("]\n", TextColor.WHITE) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(returnCommand))).build(); @@ -761,7 +773,7 @@ public static Consumer showChildrenList(List childrenT textList.addAll(childrenTextList); PaginationList.Builder builder = PaginationList.builder() .title(parent.getName().orElse(parent.getFriendlyNameType()) - .append(TextComponent.of(" Child Claims"))).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(textList); + .append(TextComponent.of(" ").append(MessageCache.getInstance().CLAIMLIST_UI_TITLE_CHILD_CLAIMS))).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(textList); builder.sendTo(src); }; } @@ -770,7 +782,7 @@ public static Consumer createReturnClaimListConsumer(CommandSende return consumer -> { Component claimListReturnCommand = TextComponent.builder("") .append("\n[") - .append("Return to claimslist", TextColor.AQUA) + .append(MessageCache.getInstance().CLAIMLIST_UI_RETURN_CLAIMSLIST.color(TextColor.AQUA)) .append("]\n", TextColor.WHITE) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(returnCommand))).build(); TextAdapter.sendComponent(src, claimListReturnCommand); @@ -781,7 +793,7 @@ public static Consumer createReturnClaimListConsumer(CommandSende return consumer -> { Component claimListReturnCommand = TextComponent.builder("") .append("\n[") - .append("Return to claimslist", TextColor.AQUA) + .append(MessageCache.getInstance().CLAIMLIST_UI_RETURN_CLAIMSLIST.color(TextColor.AQUA)) .append("]\n", TextColor.WHITE) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(src, "/claimslist", arguments)))).build(); TextAdapter.sendComponent(src, claimListReturnCommand); @@ -806,10 +818,10 @@ public static Consumer createFlagConsumer(CommandSender src, GDPe } public static Component getClickableText(CommandSender src, GDClaim claim, GDPermissionHolder holder, String subjectName, Set contexts, String flagPermission, Tristate flagValue, FlagType type) { - String onClickText = "Click here to toggle " + type.name().toLowerCase() + " value."; TextComponent.Builder textBuilder = TextComponent.builder(flagValue.toString().toLowerCase()) .hoverEvent(HoverEvent.showText(TextComponent.builder("") - .append(onClickText) + .append(MESSAGE_DATA.getMessage(MessageStorage.CLAIMLIST_UI_CLICK_TOGGLE_VALUE, + ImmutableMap.of("type", type.name().toLowerCase()))) .append("\n") .append(getFlagTypeHoverText(type)).build())) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createFlagConsumer(src, claim, holder, subjectName, contexts, flagPermission, flagValue, type)))); @@ -817,15 +829,12 @@ public static Component getClickableText(CommandSender src, GDClaim claim, GDPer } public static Component getClickableText(CommandSender src, GDPermissionHolder subject, String subjectName, Set contexts, GDClaim claim, String flagPermission, Tristate flagValue, String source, FlagType type) { - Component onClickText = TextComponent.of("Click here to toggle flag value."); + Component onClickText = MESSAGE_DATA.getMessage(MessageStorage.CLAIMLIST_UI_CLICK_TOGGLE_VALUE, + ImmutableMap.of("type", "flag")); boolean hasPermission = true; if (type == FlagType.INHERIT) { - onClickText = TextComponent.builder("") - .append("This flag is inherited from parent claim ") - .append(claim.getName().orElse(claim.getFriendlyNameType())) - .append(" and ") - .append(TextComponent.of("cannot").decoration(TextDecoration.UNDERLINED, true)) - .append(TextComponent.of(" be changed.")).build(); + onClickText = MESSAGE_DATA.getMessage(MessageStorage.FLAG_UI_INHERIT_PARENT, + ImmutableMap.of("name", claim.getFriendlyNameType())); hasPermission = false; } else if (src instanceof Player) { Component denyReason = claim.allowEdit((Player) src); @@ -854,8 +863,7 @@ public static String handleCommandFlag(CommandSender src, String target) { if (argsIndex != -1) { if (argsIndex == 0) { // invalid - TextAdapter.sendComponent(src, TextComponent.of( - "No valid command entered.", TextColor.RED)); + TextAdapter.sendComponent(src, MessageCache.getInstance().COMMAND_INVALID); return null; } command = target.substring(0, argsIndex); @@ -882,9 +890,10 @@ public static String handleCommandFlag(CommandSender src, String target) { Matcher m = p.matcher(args); if (!m.find()) { // invalid - TextAdapter.sendComponent(src, TextComponent.builder("Invalid arguments '").color(TextColor.RED) - .append(args, TextColor.AQUA) - .append("' entered. Check syntax matches 'command[arg1:arg2:etc]'", TextColor.RED).build()); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_EXECUTE_FAILED, + ImmutableMap.of( + "command", command, + "args", args))); return null; } args = m.group(1); @@ -911,11 +920,10 @@ public static String handleCommandFlag(CommandSender src, String target) { private static boolean validateCommandMapping(CommandSender src, String command, String pluginId) { Command commandMapping = NMSUtil.getInstance().getBukkitCommandMap().getCommand(command); if (commandMapping == null) { - TextAdapter.sendComponent(src, TextComponent.builder("Could not locate the command '").color(TextColor.RED) - .append(command, TextColor.GREEN) - .append("' for mod id '", TextColor.RED) - .append(pluginId, TextColor.AQUA) - .append("'.", TextColor.RED).build()); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.PLUGIN_COMMAND_NOT_FOUND, + ImmutableMap.of( + "command", command, + "id", pluginId))); return false; } return true; @@ -946,11 +954,11 @@ public static Consumer createTeleportConsumer(CommandSender src, // if not owner of claim, validate perms if (!player.getUniqueId().equals(claim.getOwnerUniqueId())) { if (!player.hasPermission(GDPermissions.COMMAND_CLAIM_INFO_TELEPORT_OTHERS) && !gpClaim.isUserTrusted(player, TrustTypes.ACCESSOR)) { - TextAdapter.sendComponent(player, TextComponent.of("You do not have permission to use the teleport feature in this claim.", TextColor.RED)); + TextAdapter.sendComponent(player, MessageCache.getInstance().CLAIMINFO_UI_TELEPORT_FEATURE.color(TextColor.RED)); return; } } else if (!player.hasPermission(GDPermissions.COMMAND_CLAIM_INFO_TELEPORT_BASE)) { - TextAdapter.sendComponent(player, TextComponent.of("You do not have permission to use the teleport feature in your claim.", TextColor.RED)); + TextAdapter.sendComponent(player, MessageCache.getInstance().CLAIMINFO_UI_TELEPORT_FEATURE.color(TextColor.RED)); return; } } @@ -967,7 +975,7 @@ public static Consumer createForceTeleportConsumer(Player player, public static void handleBankTransaction(CommandSender src, String[] args, GDClaim claim) { if (GriefDefenderPlugin.getInstance().getVaultProvider() == null) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_NOT_INSTALLED)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().ECONOMY_NOT_INSTALLED); return; } @@ -976,7 +984,7 @@ public static void handleBankTransaction(CommandSender src, String[] args, GDCla } if (!claim.getEconomyAccountId().isPresent()) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_VIRTUAL_NOT_SUPPORTED)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().ECONOMY_VIRTUAL_NOT_SUPPORTED); return; } @@ -989,7 +997,7 @@ public static void handleBankTransaction(CommandSender src, String[] args, GDCla if (playerData.canIgnoreClaim(claim) || claim.getOwnerUniqueId().equals(playerSource) || claim.getUserTrusts(TrustTypes.MANAGER).contains(playerData.playerID)) { final UUID bankAccount = claim.getEconomyAccountId().orElse(null); if (bankAccount == null) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_VIRTUAL_NOT_SUPPORTED)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().ECONOMY_VIRTUAL_NOT_SUPPORTED); return; } if (command.equalsIgnoreCase("withdraw")) { @@ -1068,12 +1076,12 @@ public static void displayClaimBankInfo(Player player, GDClaim claim) { public static void displayClaimBankInfo(CommandSender player, GDClaim claim, boolean checkTown, boolean returnToClaimInfo) { if (GriefDefenderPlugin.getInstance().getVaultProvider() == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_NOT_INSTALLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_NOT_INSTALLED); return; } if (checkTown && !claim.isInTown()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOWN_NOT_IN)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TOWN_NOT_IN); return; } @@ -1084,7 +1092,7 @@ public static void displayClaimBankInfo(CommandSender player, GDClaim claim, boo final GDClaim town = claim.getTownClaim(); final UUID bankAccount = checkTown ? town.getEconomyAccountId().orElse(null) : claim.getEconomyAccountId().orElse(null); if (bankAccount == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_VIRTUAL_NOT_SUPPORTED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_VIRTUAL_NOT_SUPPORTED); return; } @@ -1120,15 +1128,15 @@ public static void displayClaimBankInfo(CommandSender player, GDClaim claim, boo "time-remaining", timeLeft, "tax-balance", claim.getData().getEconomyData().getTaxBalance())); Component transactions = TextComponent.builder("") - .append("Bank Transactions", TextColor.AQUA, TextDecoration.ITALIC) + .append(MessageCache.getInstance().BANK_TITLE_TRANSACTIONS.color(TextColor.AQUA).decoration(TextDecoration.ITALIC, true)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createBankTransactionsConsumer(player, claim, checkTown, returnToClaimInfo)))) - .hoverEvent(HoverEvent.showText(TextComponent.of("Click here to view bank transactions"))) + .hoverEvent(HoverEvent.showText(MessageCache.getInstance().BANK_CLICK_VIEW_TRANSACTIONS)) .build(); List textList = new ArrayList<>(); if (returnToClaimInfo) { textList.add(TextComponent.builder("") .append("\n[") - .append("Return to claim info", TextColor.AQUA) + .append(MessageCache.getInstance().CLAIMINFO_UI_RETURN_CLAIMINFO.color(TextColor.AQUA)) .append("]\n") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(player, "claiminfo", "")))).build()); } @@ -1141,13 +1149,12 @@ public static void displayClaimBankInfo(CommandSender player, GDClaim claim, boo public static Consumer createBankTransactionsConsumer(CommandSender src, GDClaim claim, boolean checkTown, boolean returnToClaimInfo) { return settings -> { - final String name = "Bank Transactions"; List bankTransactions = new ArrayList<>(claim.getData().getEconomyData().getBankTransactionLog()); Collections.reverse(bankTransactions); List textList = new ArrayList<>(); textList.add(TextComponent.builder("") .append("\n[") - .append("Return to bank info", TextColor.AQUA) + .append(MessageCache.getInstance().CLAIMINFO_UI_RETURN_BANKINFO.color(TextColor.AQUA)) .append("]\n") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(consumer -> { displayClaimBankInfo(src, claim, checkTown, returnToClaimInfo); }))).build()); Gson gson = new Gson(); @@ -1171,11 +1178,11 @@ public static Consumer createBankTransactionsConsumer(CommandSend } textList.add(TextComponent.builder("") .append("\n[") - .append("Return to bank info", TextColor.AQUA) + .append(MessageCache.getInstance().CLAIMINFO_UI_RETURN_BANKINFO.color(TextColor.AQUA)) .append("]\n") .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(src, "claimbank", "")))).build()); PaginationList.Builder builder = PaginationList.builder() - .title(TextComponent.of(name, TextColor.AQUA)).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(textList); + .title(MessageCache.getInstance().BANK_TITLE_TRANSACTIONS.color(TextColor.AQUA)).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(textList); builder.sendTo(src); }; } @@ -1216,23 +1223,27 @@ public static Component getFlagTypeHoverText(FlagType type) { Component hoverText = TextComponent.empty(); if (type == FlagType.DEFAULT) { hoverText = TextComponent.builder("") - .append("DEFAULT ", TextColor.LIGHT_PURPLE) - .append(" : Default is last to be checked. Both claim and override take priority over this.") + .append(MessageCache.getInstance().TITLE_DEFAULT.color(TextColor.LIGHT_PURPLE)) + .append(" : ") + .append(MessageCache.getInstance().FLAG_UI_INFO_DEFAULT) .build(); } else if (type == FlagType.CLAIM) { hoverText = TextComponent.builder("") - .append("CLAIM", TextColor.GOLD) - .append(" : Claim is checked before default values. Allows claim owners to specify flag settings in claim only.") + .append(MessageCache.getInstance().TITLE_CLAIM.color(TextColor.GOLD)) + .append(" : ") + .append(MessageCache.getInstance().FLAG_UI_INFO_CLAIM) .build(); } else if (type == FlagType.OVERRIDE) { hoverText = TextComponent.builder("") - .append("OVERRIDE", TextColor.RED) - .append(" : Override has highest priority and is checked above both default and claim values. Allows admins to override all basic and admin claims.") + .append(MessageCache.getInstance().TITLE_OVERRIDE.color(TextColor.RED)) + .append(" : ") + .append(MessageCache.getInstance().FLAG_UI_INFO_OVERRIDE) .build(); } else if (type == FlagType.INHERIT) { hoverText = TextComponent.builder("") - .append("INHERIT", TextColor.AQUA) - .append(" : Inherit is an enforced flag set by a parent claim that cannot changed.") + .append(MessageCache.getInstance().TITLE_INHERIT.color(TextColor.AQUA)) + .append(" : ") + .append(MessageCache.getInstance().FLAG_UI_INFO_INHERIT) .build(); } return hoverText; @@ -1247,7 +1258,8 @@ public static Component getBaseFlagOverlayText(String flagPermission) { final Flag flag = FlagRegistryModule.getInstance().getById(baseFlag).orElse(null); if (flag == null) { - return TextComponent.of("Not defined."); + return MESSAGE_DATA.getMessage(MessageStorage.FLAG_NOT_FOUND, ImmutableMap.of( + "flag", baseFlag)); } return flag.getDescription(); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandPlayerInfo.java b/bukkit/src/main/java/com/griefdefender/command/CommandPlayerInfo.java index 706f21e..d0e27be 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandPlayerInfo.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandPlayerInfo.java @@ -34,6 +34,7 @@ import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; @@ -41,11 +42,15 @@ import com.griefdefender.api.claim.ClaimBlockSystem; import com.griefdefender.api.claim.ClaimTypes; import com.griefdefender.api.permission.option.Options; +import com.griefdefender.cache.MessageCache; +import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.pagination.PaginationList; import com.griefdefender.internal.util.NMSUtil; import com.griefdefender.permission.GDPermissionManager; +import com.griefdefender.permission.GDPermissionUser; import com.griefdefender.permission.GDPermissions; import com.griefdefender.storage.BaseStorage; import net.kyori.text.Component; @@ -68,6 +73,8 @@ @CommandPermission(GDPermissions.COMMAND_PLAYER_INFO_BASE) public class CommandPlayerInfo extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdplayers @gddummy") @CommandAlias("playerinfo") @Description("Gets information about a player.") @@ -77,18 +84,21 @@ public void execute(CommandSender src, @Optional String[] args) throws InvalidCo OfflinePlayer user = null; World world = null; if (args.length > 0) { - user = Bukkit.getServer().getOfflinePlayer(args[0]); - if (user == null) { - TextAdapter.sendComponent(src, TextComponent.of("User ' " + args[0] + "' could not be found.", TextColor.RED)); - throw new InvalidCommandArgument(); + GDPermissionUser holder = PermissionHolderCache.getInstance().getOrCreateUser(args[0]); + if (holder == null) { + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_PLAYER_NOT_FOUND, + ImmutableMap.of("player", args[0]))); + return; } if (args.length > 1) { world = Bukkit.getServer().getWorld(args[1]); if (world == null) { - TextAdapter.sendComponent(src, TextComponent.of("World ' " + args[1] + "' could not be found.", TextColor.RED)); - throw new InvalidCommandArgument(); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_WORLD_NOT_FOUND, + ImmutableMap.of("world", args[1]))); + return; } } + user = holder.getOfflinePlayer(); } if (user == null) { @@ -99,7 +109,7 @@ public void execute(CommandSender src, @Optional String[] args) throws InvalidCo user = (OfflinePlayer) src; if (world == null) { - world = ((Player) user).getWorld(); + world = ((Player) src).getWorld(); } } if (world == null) { @@ -108,7 +118,7 @@ public void execute(CommandSender src, @Optional String[] args) throws InvalidCo // otherwise if no permission to delve into another player's claims data or self if ((user != null && user != src && !src.hasPermission(GDPermissions.COMMAND_PLAYER_INFO_OTHERS))) { - TextAdapter.sendComponent(src, TextComponent.of("No permission to view other players.", TextColor.RED)); + TextAdapter.sendComponent(src, MessageCache.getInstance().PERMISSION_PLAYER_VIEW_OTHERS); } @@ -129,82 +139,37 @@ public void execute(CommandSender src, @Optional String[] args) throws InvalidCo claimSizeLimit = TextComponent.of(playerData.getMaxClaimX(ClaimTypes.BASIC) + "," + playerData.getMaxClaimY(ClaimTypes.BASIC) + "," + playerData.getMaxClaimZ(ClaimTypes.BASIC), TextColor.GRAY); } - - final Component WHITE_SEMI_COLON = TextComponent.of(" : "); final double claimableChunks = GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.VOLUME ? (playerData.getRemainingClaimBlocks() / 65536.0) : (playerData.getRemainingClaimBlocks() / 256.0); - final Component uuidText = TextComponent.builder("") - .append("UUID", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(user.getUniqueId().toString(), TextColor.GRAY) - .build(); - final Component worldText = TextComponent.builder("") - .append("World", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(world.getName(), TextColor.GRAY) - .build(); - final Component sizeLimitText = TextComponent.builder("") - .append("Claim Size Limits", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(claimSizeLimit) - .build(); - final Component initialBlockText = TextComponent.builder("") - .append("Initial Blocks", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(playerData.getInitialClaimBlocks()), TextColor.GREEN) - .build(); - final Component accruedBlockText = TextComponent.builder("") - .append("Accrued Blocks", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(playerData.getAccruedClaimBlocks()), TextColor.GREEN) - .append(" (", TextColor.GRAY) - .append(String.valueOf(playerData.getBlocksAccruedPerHour()), TextColor.LIGHT_PURPLE) - .append(" per hour") - .append(")", TextColor.GRAY).build(); - final Component maxAccruedBlockText = TextComponent.builder("") - .append("Max Accrued Blocks", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(playerData.getMaxAccruedClaimBlocks()), TextColor.GREEN) - .build(); - final Component bonusBlockText = TextComponent.builder("") - .append("Bonus Blocks", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(playerData.getBonusClaimBlocks()), TextColor.GREEN) - .build(); - final Component remainingBlockText = TextComponent.builder("") - .append("Remaining Blocks", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(playerData.getRemainingClaimBlocks()), TextColor.GREEN) - .build(); - final Component minMaxLevelText = TextComponent.builder("") - .append("Min/Max Claim Level", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(playerData.getMinClaimLevel() + "-" + playerData.getMaxClaimLevel()), TextColor.GREEN) - .build(); - final Component abandonRatioText = TextComponent.builder("") - .append("Abandoned Return Ratio", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(playerData.getAbandonedReturnRatio(ClaimTypes.BASIC)), TextColor.GREEN) - .build(); - final Component totalTaxText = TextComponent.builder("") - .append("Total Tax", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(playerData.getTotalTax()), TextColor.GREEN) - .build(); - final Component totalBlockText = TextComponent.builder("") - .append("Total Blocks", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(playerData.getInitialClaimBlocks() + playerData.getAccruedClaimBlocks() + playerData.getBonusClaimBlocks()), TextColor.GREEN) - .build(); - final Component totalClaimableChunkText = TextComponent.builder("") - .append("Total Claimable Chunks", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(Math.round(claimableChunks * 100.0)/100.0), TextColor.GREEN) - .build(); - final Component totalClaimText = TextComponent.builder("") - .append("Total Claims", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(String.valueOf(claimList.size()), TextColor.GREEN) - .build(); + final Component uuidText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_UUID, + ImmutableMap.of("id", user.getUniqueId().toString())); + final Component worldText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_WORLD, + ImmutableMap.of("world", world.getName())); + final Component sizeLimitText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_CLAIM_SIZE_LIMIT, + ImmutableMap.of("limit", claimSizeLimit)); + final Component initialBlockText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_BLOCK_INITIAL, + ImmutableMap.of("amount", String.valueOf(playerData.getInitialClaimBlocks()))); + final Component accruedBlockText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_BLOCK_ACCRUED, + ImmutableMap.of( + "amount", String.valueOf(playerData.getAccruedClaimBlocks()), + "block_amount", String.valueOf(playerData.getBlocksAccruedPerHour()))); + final Component maxAccruedBlockText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_BLOCK_MAX_ACCRUED, + ImmutableMap.of("amount", String.valueOf(playerData.getMaxAccruedClaimBlocks()))); + final Component bonusBlockText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_BLOCK_BONUS, + ImmutableMap.of("amount", String.valueOf(playerData.getBonusClaimBlocks()))); + final Component remainingBlockText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_BLOCK_REMAINING, + ImmutableMap.of("amount", String.valueOf(playerData.getRemainingClaimBlocks()))); + final Component minMaxLevelText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_CLAIM_LEVEL, + ImmutableMap.of("level", String.valueOf(playerData.getMinClaimLevel() + "-" + playerData.getMaxClaimLevel()))); + final Component abandonRatioText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_ABANDON_RETURN_RATIO, + ImmutableMap.of("ratio", String.valueOf(playerData.getAbandonedReturnRatio(ClaimTypes.BASIC)))); + final Component totalTaxText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_TAX_TOTAL, + ImmutableMap.of("amount", String.valueOf(playerData.getInitialClaimBlocks()))); + final Component totalBlockText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_BLOCK_TOTAL, + ImmutableMap.of("amount", String.valueOf(playerData.getInitialClaimBlocks()))); + final Component totalClaimableChunkText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_CHUNK_TOTAL, + ImmutableMap.of("amount", String.valueOf(Math.round(claimableChunks * 100.0)/100.0))); + final Component totalClaimText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_CLAIM_TOTAL, + ImmutableMap.of("amount", String.valueOf(claimList.size()))); List claimsTextList = Lists.newArrayList(); claimsTextList.add(uuidText); @@ -260,24 +225,15 @@ public void execute(CommandSender src, @Optional String[] args) throws InvalidCo final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation()); if (claim != null && !claim.isWilderness()) { final double playerTaxRate = GDPermissionManager.getInstance().getInternalOptionValue(user, Options.TAX_RATE, claim, playerData); - currentTaxRateText = TextComponent.builder("") - .append("Current Claim Tax Rate", TextColor.YELLOW) - .append(" : ") - .append(String.valueOf(playerTaxRate), TextColor.GREEN) - .build(); + currentTaxRateText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_TAX_CURRENT_RATE, + ImmutableMap.of("rate", String.valueOf(playerTaxRate))); } } } - final Component globalTownTaxText = TextComponent.builder("") - .append("Global Town Tax Rate", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(townTaxRate) - .build(); - final Component globalClaimTaxText = TextComponent.builder("") - .append("Global Claim Tax Rate", TextColor.YELLOW) - .append(WHITE_SEMI_COLON) - .append(claimTaxRate) - .build(); + final Component globalTownTaxText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_TAX_GLOBAL_TOWN_RATE, + ImmutableMap.of("rate", townTaxRate)); + final Component globalClaimTaxText = MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_TAX_GLOBAL_CLAIM_RATE, + ImmutableMap.of("rate", claimTaxRate)); claimsTextList.add(currentTaxRateText); claimsTextList.add(globalTownTaxText); claimsTextList.add(globalClaimTaxText); @@ -295,16 +251,13 @@ public void execute(CommandSender src, @Optional String[] args) throws InvalidCo // ignore } if (lastActive != null) { - claimsTextList.add(TextComponent.builder("") - .append("Last Active", TextColor.YELLOW) - .append(" : ") - .append(lastActive.toString(), TextColor.GRAY) - .build()); + claimsTextList.add(MESSAGE_DATA.getMessage(MessageStorage.PLAYERINFO_UI_LAST_ACTIVE, + ImmutableMap.of("date", lastActive))); } } PaginationList.Builder paginationBuilder = PaginationList.builder() - .title(TextComponent.of("Player Info", TextColor.AQUA)).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(claimsTextList); + .title(MessageCache.getInstance().PLAYERINFO_UI_TITLE).padding(TextComponent.of(" ").decoration(TextDecoration.STRIKETHROUGH, true)).contents(claimsTextList); paginationBuilder.sendTo(src); } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandRestoreClaim.java b/bukkit/src/main/java/com/griefdefender/command/CommandRestoreClaim.java index 81ab1c5..4c15e85 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandRestoreClaim.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandRestoreClaim.java @@ -31,6 +31,7 @@ import co.aikar.commands.annotation.Subcommand; import com.google.common.collect.ImmutableMap; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.util.BlockUtil; @@ -61,7 +62,7 @@ public void execute(Player player) { final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation()); if (claim.isWilderness()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_FOUND)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_FOUND); return; } @@ -91,7 +92,7 @@ private static void displayConfirmationConsumer(CommandSender src, GDClaim claim private static Consumer createConfirmationConsumer(CommandSender src, GDClaim claim) { return confirm -> { BlockUtil.getInstance().restoreClaim(claim); - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_RESTORE_SUCCESS); + final Component message = MessageCache.getInstance().CLAIM_RESTORE_SUCCESS; GriefDefenderPlugin.sendMessage(src, message); }; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandRestoreNature.java b/bukkit/src/main/java/com/griefdefender/command/CommandRestoreNature.java index 9a8d71f..ece805a 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandRestoreNature.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandRestoreNature.java @@ -29,9 +29,12 @@ import co.aikar.commands.annotation.CommandPermission; import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Subcommand; + +import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.ShovelTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.util.NMSUtil; import com.griefdefender.permission.GDPermissions; @@ -49,20 +52,18 @@ public class CommandRestoreNature extends BaseCommand { @Subcommand("mode nature") public void execute(Player player) { if (true) { - GriefDefenderPlugin.sendMessage(player, TextComponent.of("This mode is currently being worked on and will be available in a future build.", TextColor.RED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().FEATURE_NOT_AVAILABLE); return; } if (!NMSUtil.getInstance().hasItemInOneHand(player, GriefDefenderPlugin.getInstance().modificationTool)) { - TextAdapter.sendComponent(player, TextComponent.builder("") - .append("You do not have ", TextColor.RED) - .append(GriefDefenderPlugin.getInstance().modificationTool.getName().toLowerCase(), TextColor.GREEN) - .append(" equipped.", TextColor.RED).build()); + TextAdapter.sendComponent(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOOL_NOT_EQUIPPED, + ImmutableMap.of("tool", TextComponent.of(GriefDefenderPlugin.getInstance().modificationTool.getName().toLowerCase(), TextColor.GREEN)))); return; } final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); playerData.shovelMode = ShovelTypes.RESTORE; - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_RESTORE_NATURE_ACTIVATE)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().MODE_NATURE); } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandSetAccruedClaimBlocks.java b/bukkit/src/main/java/com/griefdefender/command/CommandSetAccruedClaimBlocks.java index 344ce40..18aff73 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandSetAccruedClaimBlocks.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandSetAccruedClaimBlocks.java @@ -33,15 +33,16 @@ import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; +import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissionUser; import com.griefdefender.permission.GDPermissions; -import net.kyori.text.TextComponent; import net.kyori.text.adapter.bukkit.TextAdapter; -import net.kyori.text.format.TextColor; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.command.CommandSender; @@ -50,6 +51,8 @@ @CommandPermission(GDPermissions.COMMAND_SET_ACCRUED_CLAIM_BLOCKS) public class CommandSetAccruedClaimBlocks extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdplayers @gddummy") @CommandAlias("setaccruedblocks") @Description("Updates a player's accrued claim block total.") @@ -57,7 +60,7 @@ public class CommandSetAccruedClaimBlocks extends BaseCommand { @Subcommand("player setaccruedblocks") public void execute(CommandSender src, String[] args) throws InvalidCommandArgument { if (GriefDefenderPlugin.getGlobalConfig().getConfig().economy.economyMode) { - TextAdapter.sendComponent(src, TextComponent.of("This command is not available while server is in economy mode.", TextColor.RED)); + TextAdapter.sendComponent(src, MessageCache.getInstance().COMMAND_NOT_AVAILABLE_ECONOMY); return; } @@ -69,27 +72,32 @@ public void execute(CommandSender src, String[] args) throws InvalidCommandArgum int newAmount = Integer.parseInt(args[1]); World world = null; if (user == null) { - TextAdapter.sendComponent(src, TextComponent.of("User ' " + args[0] + "' could not be found.", TextColor.RED)); - throw new InvalidCommandArgument(); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_PLAYER_NOT_FOUND, + ImmutableMap.of("player", args[0]))); + return; } if (args.length > 2) { world = Bukkit.getServer().getWorld(args[2]); if (world == null) { - TextAdapter.sendComponent(src, TextComponent.of("World ' " + args[1] + "' could not be found.", TextColor.RED)); - throw new InvalidCommandArgument(); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_WORLD_NOT_FOUND, + ImmutableMap.of("world", args[2]))); + return; } } if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(world.getUID())) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_DISABLED_WORLD)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().CLAIM_DISABLED_WORLD); return; } // set player's blocks GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(world.getUID(), user.getUniqueId()); if (!playerData.setAccruedClaimBlocks(newAmount)) { - TextAdapter.sendComponent(src, TextComponent.of("User " + user.getName() + " has a total of " + playerData.getAccruedClaimBlocks() + " and will exceed the maximum allowed accrued claim blocks if granted an additional " + newAmount + " blocks. " + - "Either lower the amount or have an admin grant the user with an override.", TextColor.RED)); + TextAdapter.sendComponent(src, MESSAGE_DATA.getMessage(MessageStorage.PLAYER_ACCRUED_BLOCKS_EXCEEDED, + ImmutableMap.of( + "player", user.getName(), + "total", playerData.getAccruedClaimBlocks(), + "amount", newAmount))); return; } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandTownChat.java b/bukkit/src/main/java/com/griefdefender/command/CommandTownChat.java index 0a9b16f..e7c4b29 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandTownChat.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandTownChat.java @@ -31,8 +31,8 @@ import co.aikar.commands.annotation.Subcommand; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; -import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; import org.bukkit.entity.Player; @@ -47,7 +47,7 @@ public void execute(Player player) { final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation()); if (!claim.isInTown()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOWN_NOT_IN)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TOWN_NOT_IN); return; } @@ -55,9 +55,9 @@ public void execute(Player player) { // toggle ignore claims mode on or off if (!playerData.townChat) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOWN_CHAT_DISABLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TOWN_CHAT_DISABLED); } else { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOWN_CHAT_ENABLED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TOWN_CHAT_ENABLED); } } } diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandTownTag.java b/bukkit/src/main/java/com/griefdefender/command/CommandTownTag.java index 5d77168..e172806 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandTownTag.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandTownTag.java @@ -32,6 +32,7 @@ import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.permission.GDPermissions; @@ -52,7 +53,7 @@ public void execute(Player player, String tag) { final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(playerData, player.getLocation()); if (claim == null || !claim.isInTown()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOWN_NOT_IN)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TOWN_NOT_IN); return; } @@ -73,7 +74,7 @@ public void execute(Player player, String tag) { town.getInternalClaimData().setRequiresSave(true); Component resultMessage = null; if (!claim.getTownData().getTownTag().isPresent()) { - resultMessage = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOWN_TAG_CLEAR); + resultMessage = MessageCache.getInstance().TOWN_TAG_CLEAR; } else { resultMessage = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TOWN_TAG, ImmutableMap.of( diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandTrustGroup.java b/bukkit/src/main/java/com/griefdefender/command/CommandTrustGroup.java index 4ed0024..1fb9346 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandTrustGroup.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandTrustGroup.java @@ -41,8 +41,10 @@ import com.griefdefender.api.claim.TrustType; import com.griefdefender.api.claim.TrustTypes; import com.griefdefender.api.permission.Context; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; import com.griefdefender.event.GDGroupTrustClaimEvent; @@ -51,9 +53,7 @@ import com.griefdefender.util.PermissionUtil; import me.lucko.luckperms.api.Group; import net.kyori.text.Component; -import net.kyori.text.TextComponent; import net.kyori.text.adapter.bukkit.TextAdapter; -import net.kyori.text.format.TextColor; import java.util.HashSet; import java.util.List; @@ -65,6 +65,8 @@ @CommandPermission(GDPermissions.COMMAND_TRUST_GROUP) public class CommandTrustGroup extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdgroups @gdtrusttypes @gddummy") @CommandAlias("trustgroup") @Description("Grants a group access to your claim." @@ -77,19 +79,19 @@ public class CommandTrustGroup extends BaseCommand { public void execute(Player player, String groupName, String type) { final TrustType trustType = CommandHelper.getTrustType(type); if (trustType == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_INVALID)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TRUST_INVALID); return; } final Group group = PermissionUtil.getInstance().getGroupSubject(groupName); if (group == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_GROUP, ImmutableMap.of( + GriefDefenderPlugin.sendMessage(player, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_GROUP, ImmutableMap.of( "group", groupName))); return; } if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(player.getWorld().getUID())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_DISABLED_WORLD)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_DISABLED_WORLD); return; } @@ -97,13 +99,13 @@ public void execute(Player player, String groupName, String type) { GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(playerData, player.getLocation()); if (!playerData.canIgnoreClaim(claim) && claim.allowEdit(player) != null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_COMMAND_TRUST)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_COMMAND_TRUST); return; } //check permission here if(claim.allowGrantPermission(player) != null) { - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_TRUST, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.PERMISSION_TRUST, ImmutableMap.of( "owner", claim.getOwnerName())); GriefDefenderPlugin.sendMessage(player, message); @@ -116,7 +118,8 @@ public void execute(Player player, String groupName, String type) { GriefDefender.getEventManager().post(event); GDCauseStackManager.getInstance().popCause(); if (event.cancelled()) { - TextAdapter.sendComponent(player, event.getMessage().orElse(TextComponent.of("Could not trust group '" + group + "'. A plugin has denied it.").color(TextColor.RED))); + TextAdapter.sendComponent(player, event.getMessage().orElse(MESSAGE_DATA.getMessage(MessageStorage.TRUST_PLUGIN_CANCEL, + ImmutableMap.of("target", group)))); return; } @@ -127,7 +130,7 @@ public void execute(Player player, String groupName, String type) { if (!groupTrustList.contains(group.getName())) { groupTrustList.add(group.getName()); } else { - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_ALREADY_HAS, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.TRUST_ALREADY_HAS, ImmutableMap.of( "target", group.getName(), "type", trustType.getName())); @@ -139,7 +142,7 @@ public void execute(Player player, String groupName, String type) { claim.getInternalClaimData().setRequiresSave(true); claim.getInternalClaimData().save(); - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_GRANT, ImmutableMap.of( + final Component message = MESSAGE_DATA.getMessage(MessageStorage.TRUST_GRANT, ImmutableMap.of( "target", group.getName(), "type", trustType.getName())); GriefDefenderPlugin.sendMessage(player, message); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandTrustGroupAll.java b/bukkit/src/main/java/com/griefdefender/command/CommandTrustGroupAll.java index 54a3a4c..c8d5d8f 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandTrustGroupAll.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandTrustGroupAll.java @@ -39,17 +39,17 @@ import com.griefdefender.api.GriefDefender; import com.griefdefender.api.claim.Claim; import com.griefdefender.api.claim.TrustType; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; import com.griefdefender.event.GDGroupTrustClaimEvent; import com.griefdefender.permission.GDPermissionGroup; import com.griefdefender.permission.GDPermissions; import net.kyori.text.Component; -import net.kyori.text.TextComponent; import net.kyori.text.adapter.bukkit.TextAdapter; -import net.kyori.text.format.TextColor; import org.bukkit.entity.Player; import java.util.ArrayList; @@ -60,6 +60,8 @@ @CommandPermission(GDPermissions.COMMAND_TRUSTALL_GROUP) public class CommandTrustGroupAll extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdgroups @gdtrusttypes @gddummy") @CommandAlias("trustallgroup") @Description("Grants a group access to all your claims." @@ -72,7 +74,7 @@ public class CommandTrustGroupAll extends BaseCommand { public void execute(Player player, String target, String type) { final TrustType trustType = CommandHelper.getTrustType(type); if (trustType == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_INVALID)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TRUST_INVALID); return; } @@ -80,7 +82,7 @@ public void execute(Player player, String target, String type) { // validate player argument if (group == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_GROUP, ImmutableMap.of( + GriefDefenderPlugin.sendMessage(player, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_GROUP, ImmutableMap.of( "group", target))); return; } @@ -92,7 +94,7 @@ public void execute(Player player, String target, String type) { } if (playerData == null || claimList == null || claimList.size() == 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_NO_CLAIMS)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TRUST_NO_CLAIMS); return; } @@ -102,7 +104,8 @@ public void execute(Player player, String target, String type) { GriefDefender.getEventManager().post(event); GDCauseStackManager.getInstance().popCause(); if (event.cancelled()) { - TextAdapter.sendComponent(player, event.getMessage().orElse(TextComponent.of("Could not add trust for group '" + group + "'. A plugin has denied it.", TextColor.RED))); + TextAdapter.sendComponent(player, event.getMessage().orElse(MESSAGE_DATA.getMessage(MessageStorage.TRUST_PLUGIN_CANCEL, + ImmutableMap.of("target", group)))); return; } @@ -110,7 +113,7 @@ public void execute(Player player, String target, String type) { this.addAllGroupTrust(claim, group, trustType); } - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_INDIVIDUAL_ALL_CLAIMS, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.TRUST_INDIVIDUAL_ALL_CLAIMS, ImmutableMap.of( "player", group.getName())); GriefDefenderPlugin.sendMessage(player, message); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandTrustList.java b/bukkit/src/main/java/com/griefdefender/command/CommandTrustList.java index 4a9e5ce..2096a7d 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandTrustList.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandTrustList.java @@ -29,12 +29,17 @@ import co.aikar.commands.annotation.CommandPermission; import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Subcommand; + +import com.google.common.collect.ImmutableMap; import com.griefdefender.GDPlayerData; import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.TrustType; import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.MessageDataConfig; +import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.pagination.PaginationList; import com.griefdefender.permission.GDPermissionUser; import com.griefdefender.permission.GDPermissions; @@ -69,27 +74,15 @@ public void execute(Player player) { public static void showTrustList(CommandSender src, GDClaim claim, Player player, TrustType type) { final Component whiteOpenBracket = TextComponent.of("[", TextColor.AQUA); final Component whiteCloseBracket = TextComponent.of("]", TextColor.AQUA); - final Component showAllText = TextComponent.of("Click here to show all trusted users for claim."); - final Component showAccessorText = TextComponent.builder("") - .append("Click here to filter by ") - .append("ACCESSOR ", TextColor.YELLOW) - .append("permissions.") - .build(); - final Component showContainerText = TextComponent.builder("") - .append("Click here to filter by ") - .append("CONTAINER ", TextColor.LIGHT_PURPLE) - .append("permissions.") - .build(); - final Component showBuilderText = TextComponent.builder("") - .append("Click here to filter by ") - .append("BUILDER ", TextColor.GREEN) - .append("permissions.") - .build(); - final Component showManagerText = TextComponent.builder("") - .append("Click here to filter by ") - .append("MANAGER ", TextColor.GOLD) - .append("permissions.") - .build(); + final Component showAllText = MessageCache.getInstance().TRUST_CLICK_SHOW_LIST; + final Component showAccessorText = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", MessageCache.getInstance().TITLE_ACCESSOR.color(TextColor.YELLOW))); + final Component showContainerText = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", MessageCache.getInstance().TITLE_CONTAINER.color(TextColor.LIGHT_PURPLE))); + final Component showBuilderText = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", MessageCache.getInstance().TITLE_BUILDER.color(TextColor.GREEN))); + final Component showManagerText = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UI_CLICK_FILTER_TYPE, + ImmutableMap.of("type", MessageCache.getInstance().TITLE_MANAGER.color(TextColor.GOLD))); final Component allTypeText = TextComponent.builder("") .append(type == TrustTypes.NONE ? TextComponent.builder("") .append(whiteOpenBracket) @@ -103,25 +96,25 @@ public static void showTrustList(CommandSender src, GDClaim claim, Player player final Component accessorTrustText = TextComponent.builder("") .append(type == TrustTypes.ACCESSOR ? TextComponent.builder("") .append(whiteOpenBracket) - .append("ACCESSOR", TextColor.YELLOW) + .append(MessageCache.getInstance().TITLE_ACCESSOR.color(TextColor.YELLOW)) .append(whiteCloseBracket) - .build() : TextComponent.of("ACCESSOR", TextColor.GRAY)) + .build() : MessageCache.getInstance().TITLE_ACCESSOR.color(TextColor.GRAY)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createTrustConsumer(src, claim, player, TrustTypes.ACCESSOR)))) .hoverEvent(HoverEvent.showText(showAccessorText)).build(); final Component builderTrustText = TextComponent.builder("") .append(type == TrustTypes.BUILDER ? TextComponent.builder("") .append(whiteOpenBracket) - .append("BUILDER", TextColor.GREEN) + .append(MessageCache.getInstance().TITLE_BUILDER.color(TextColor.GREEN)) .append(whiteCloseBracket) - .build() : TextComponent.of("BUILDER", TextColor.GRAY)) + .build() : MessageCache.getInstance().TITLE_BUILDER.color(TextColor.GRAY)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createTrustConsumer(src, claim, player, TrustTypes.BUILDER)))) .hoverEvent(HoverEvent.showText(showBuilderText)).build(); final Component containerTrustText = TextComponent.builder("") .append(type == TrustTypes.CONTAINER ? TextComponent.builder("") .append(whiteOpenBracket) - .append("CONTAINER", TextColor.LIGHT_PURPLE) + .append(MessageCache.getInstance().TITLE_CONTAINER.color(TextColor.LIGHT_PURPLE)) .append(whiteCloseBracket) - .build() : TextComponent.of("CONTAINER", TextColor.GRAY)) + .build() : MessageCache.getInstance().TITLE_CONTAINER.color(TextColor.GRAY)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createTrustConsumer(src, claim, player, TrustTypes.CONTAINER)))) .hoverEvent(HoverEvent.showText(showContainerText)).build(); final Component managerTrustText = TextComponent.builder("") @@ -129,11 +122,13 @@ public static void showTrustList(CommandSender src, GDClaim claim, Player player .append(whiteOpenBracket) .append("MANAGER", TextColor.GOLD) .append(whiteCloseBracket) - .build() : TextComponent.of("MANAGER", TextColor.GRAY)) + .build() : MessageCache.getInstance().TITLE_MANAGER.color(TextColor.GRAY)) .clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createTrustConsumer(src, claim, player, TrustTypes.MANAGER)))) .hoverEvent(HoverEvent.showText(showManagerText)).build(); - final Component claimTrustHead = TextComponent.builder("") - .append(" Displaying : ", TextColor.AQUA) + final Component claimTrustHead = TextComponent.builder() + .append(" ") + .append(MessageCache.getInstance().LABEL_DISPLAYING.color(TextColor.AQUA)) + .append(" ") .append(allTypeText) .append(" ") .append(accessorTrustText) diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandTrustPlayer.java b/bukkit/src/main/java/com/griefdefender/command/CommandTrustPlayer.java index c3d90e8..8f1f5bb 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandTrustPlayer.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandTrustPlayer.java @@ -32,11 +32,11 @@ import co.aikar.commands.annotation.Optional; import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; + +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import net.kyori.text.Component; -import net.kyori.text.TextComponent; import net.kyori.text.adapter.bukkit.TextAdapter; -import net.kyori.text.format.TextColor; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -45,6 +45,7 @@ import com.griefdefender.api.GriefDefender; import com.griefdefender.api.claim.TrustType; import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.event.GDCauseStackManager; @@ -61,6 +62,8 @@ @CommandPermission(GDPermissions.COMMAND_TRUST_PLAYER) public class CommandTrustPlayer extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdplayers @gdtrusttypes @gddummy") @CommandAlias("trust") @Description("Grants a player access to your claim." @@ -77,7 +80,7 @@ public void execute(Player player, String target, @Optional String type) { } else { trustType = CommandHelper.getTrustType(type); if (trustType == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_INVALID)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TRUST_INVALID); return; } } @@ -90,13 +93,13 @@ public void execute(Player player, String target, @Optional String type) { } if (user == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_PLAYER, + GriefDefenderPlugin.sendMessage(player, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_PLAYER, ImmutableMap.of( "player", target))); return; } if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(player.getWorld().getUID())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_DISABLED_WORLD)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_DISABLED_WORLD); return; } @@ -104,22 +107,22 @@ public void execute(Player player, String target, @Optional String type) { GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(playerData, player.getLocation()); if (!claim.getOwnerUniqueId().equals(player.getUniqueId()) && !playerData.canIgnoreClaim(claim) && claim.allowEdit(player) != null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_COMMAND_TRUST)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_COMMAND_TRUST); return; } if (user.getUniqueId().equals(player.getUniqueId()) && !playerData.canIgnoreClaim(claim)) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_SELF)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TRUST_SELF); return; } if (user != null && claim.getOwnerUniqueId().equals(user.getUniqueId())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_OWNER_ALREADY)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_OWNER_ALREADY); return; } else { //check permission here if(claim.allowGrantPermission(player) != null) { - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_TRUST, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.PERMISSION_TRUST, ImmutableMap.of( "player", claim.getOwnerName())); GriefDefenderPlugin.sendMessage(player, message); @@ -129,7 +132,7 @@ public void execute(Player player, String target, @Optional String type) { if(trustType == TrustTypes.MANAGER) { Component denyReason = claim.allowEdit(player); if(denyReason != null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_GRANT)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_GRANT); return; } } @@ -142,13 +145,14 @@ public void execute(Player player, String target, @Optional String type) { GriefDefender.getEventManager().post(event); GDCauseStackManager.getInstance().popCause(); if (event.cancelled()) { - TextAdapter.sendComponent(player, event.getMessage().orElse(TextComponent.of("Could not trust user '" + user.getName() + "'. A plugin has denied it.").color(TextColor.RED))); + TextAdapter.sendComponent(player, event.getMessage().orElse(event.getMessage().orElse(MESSAGE_DATA.getMessage(MessageStorage.TRUST_PLUGIN_CANCEL, + ImmutableMap.of("target", user.getName()))))); return; } final List trustList = claim.getUserTrustList(trustType); if (trustList.contains(user.getUniqueId())) { - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_ALREADY_HAS, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.TRUST_ALREADY_HAS, ImmutableMap.of( "target", user.getName(), "type", trustType.getName())); @@ -160,7 +164,7 @@ public void execute(Player player, String target, @Optional String type) { claim.getInternalClaimData().setRequiresSave(true); claim.getInternalClaimData().save(); - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_GRANT, ImmutableMap.of( + final Component message = MESSAGE_DATA.getMessage(MessageStorage.TRUST_GRANT, ImmutableMap.of( "target", user.getName(), "type", trustType.getName())); GriefDefenderPlugin.sendMessage(player, message); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandTrustPlayerAll.java b/bukkit/src/main/java/com/griefdefender/command/CommandTrustPlayerAll.java index ec50f4a..d126074 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandTrustPlayerAll.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandTrustPlayerAll.java @@ -41,17 +41,17 @@ import com.griefdefender.api.claim.Claim; import com.griefdefender.api.claim.TrustType; import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; import com.griefdefender.event.GDUserTrustClaimEvent; import com.griefdefender.permission.GDPermissionUser; import com.griefdefender.permission.GDPermissions; import net.kyori.text.Component; -import net.kyori.text.TextComponent; import net.kyori.text.adapter.bukkit.TextAdapter; -import net.kyori.text.format.TextColor; import org.bukkit.entity.Player; import java.util.ArrayList; @@ -63,6 +63,8 @@ @CommandPermission(GDPermissions.COMMAND_TRUSTALL_PLAYER) public class CommandTrustPlayerAll extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdplayers @gdtrusttypes @gddummy") @CommandAlias("trustall") @Description("Grants a player access to all your claims." @@ -79,7 +81,7 @@ public void execute(Player player, String target, @Optional String type) { } else { trustType = CommandHelper.getTrustType(type); if (trustType == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_INVALID)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TRUST_INVALID); return; } } @@ -93,14 +95,14 @@ public void execute(Player player, String target, @Optional String type) { // validate player argument if (user == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_PLAYER, + GriefDefenderPlugin.sendMessage(player, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_PLAYER, ImmutableMap.of( "player", target))); return; } if (user.getUniqueId().equals(player.getUniqueId())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_SELF)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TRUST_SELF); return; } @@ -111,7 +113,7 @@ public void execute(Player player, String target, @Optional String type) { } if (playerData == null || claimList == null || claimList.size() == 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_NO_CLAIMS)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TRUST_NO_CLAIMS); return; } @@ -121,7 +123,8 @@ public void execute(Player player, String target, @Optional String type) { GriefDefender.getEventManager().post(event); GDCauseStackManager.getInstance().popCause(); if (event.cancelled()) { - TextAdapter.sendComponent(player, event.getMessage().orElse(TextComponent.of("Could not add trust for user '" + user.getName() + "'. A plugin has denied it.").color(TextColor.RED))); + TextAdapter.sendComponent(player, event.getMessage().orElse(MESSAGE_DATA.getMessage(MessageStorage.TRUST_PLUGIN_CANCEL, + ImmutableMap.of("target", user.getName())))); return; } @@ -129,7 +132,7 @@ public void execute(Player player, String target, @Optional String type) { this.addAllUserTrust(claim, user, trustType); } - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_INDIVIDUAL_ALL_CLAIMS, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.TRUST_INDIVIDUAL_ALL_CLAIMS, ImmutableMap.of( "player", user.getName())); GriefDefenderPlugin.sendMessage(player, message); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandUntrustGroup.java b/bukkit/src/main/java/com/griefdefender/command/CommandUntrustGroup.java index f61720a..ca0cbcd 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandUntrustGroup.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandUntrustGroup.java @@ -37,7 +37,9 @@ import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.GriefDefender; import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; import com.griefdefender.event.GDGroupTrustClaimEvent; @@ -45,9 +47,7 @@ import com.griefdefender.util.PermissionUtil; import me.lucko.luckperms.api.Group; import net.kyori.text.Component; -import net.kyori.text.TextComponent; import net.kyori.text.adapter.bukkit.TextAdapter; -import net.kyori.text.format.TextColor; import org.bukkit.entity.Player; @@ -55,6 +55,8 @@ @CommandPermission(GDPermissions.COMMAND_UNTRUST_GROUP) public class CommandUntrustGroup extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdgroups @gddummy") @CommandAlias("untrustgroup") @Description("Revokes group access to your claim.") @@ -62,13 +64,13 @@ public class CommandUntrustGroup extends BaseCommand { public void execute(Player player, String target) { final Group group = PermissionUtil.getInstance().getGroupSubject(target); if (group == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_GROUP, ImmutableMap.of( + GriefDefenderPlugin.sendMessage(player, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_GROUP, ImmutableMap.of( "group", target))); return; } if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(player.getWorld().getUID())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_DISABLED_WORLD)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_DISABLED_WORLD); return; } @@ -76,13 +78,13 @@ public void execute(Player player, String target) { GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(playerData, player.getLocation()); if (!playerData.canIgnoreClaim(claim) && claim.allowEdit(player) != null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_COMMAND_TRUST)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_COMMAND_TRUST); return; } //check permission here if(claim.allowGrantPermission(player) != null) { - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_TRUST, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.PERMISSION_TRUST, ImmutableMap.of( "player", claim.getOwnerName())); GriefDefenderPlugin.sendMessage(player, message); @@ -95,7 +97,8 @@ public void execute(Player player, String target) { GriefDefender.getEventManager().post(event); GDCauseStackManager.getInstance().popCause(); if (event.cancelled()) { - TextAdapter.sendComponent(player, event.getMessage().orElse(TextComponent.of("Could not untrust group '" + group + "'. A plugin has denied it.").color(TextColor.RED))); + TextAdapter.sendComponent(player, event.getMessage().orElse(MESSAGE_DATA.getMessage(MessageStorage.TRUST_PLUGIN_CANCEL, + ImmutableMap.of("target", group)))); return; } @@ -103,7 +106,7 @@ public void execute(Player player, String target) { claim.getInternalClaimData().setRequiresSave(true); claim.getInternalClaimData().save(); - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UNTRUST_INDIVIDUAL_SINGLE_CLAIM, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.UNTRUST_INDIVIDUAL_SINGLE_CLAIM, ImmutableMap.of( "target", group)); GriefDefenderPlugin.sendMessage(player, message); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandUntrustGroupAll.java b/bukkit/src/main/java/com/griefdefender/command/CommandUntrustGroupAll.java index a8e856c..13d1db5 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandUntrustGroupAll.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandUntrustGroupAll.java @@ -39,17 +39,17 @@ import com.griefdefender.api.GriefDefender; import com.griefdefender.api.claim.Claim; import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; import com.griefdefender.event.GDGroupTrustClaimEvent; import com.griefdefender.permission.GDPermissionGroup; import com.griefdefender.permission.GDPermissions; import net.kyori.text.Component; -import net.kyori.text.TextComponent; import net.kyori.text.adapter.bukkit.TextAdapter; -import net.kyori.text.format.TextColor; import org.bukkit.entity.Player; import java.util.ArrayList; @@ -59,6 +59,8 @@ @CommandPermission(GDPermissions.COMMAND_UNTRUSTALL_GROUP) public class CommandUntrustGroupAll extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdgroups @gdtrusttypes @gddummy") @CommandAlias("untrustallgroup") @Description("Revokes group access to all your claims") @@ -69,7 +71,7 @@ public void execute(Player player, String target, String type) { // validate player argument if (group == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_GROUP, + GriefDefenderPlugin.sendMessage(player, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_GROUP, ImmutableMap.of( "group", target))); return; @@ -82,7 +84,7 @@ public void execute(Player player, String target, String type) { } if (playerData == null || claimList == null || claimList.size() == 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TRUST_NO_CLAIMS)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TRUST_NO_CLAIMS); return; } @@ -92,7 +94,8 @@ public void execute(Player player, String target, String type) { GriefDefender.getEventManager().post(event); GDCauseStackManager.getInstance().popCause(); if (event.cancelled()) { - TextAdapter.sendComponent(player, event.getMessage().orElse(TextComponent.of("Could not untrust group '" + group + "'. A plugin has denied it.", TextColor.RED))); + TextAdapter.sendComponent(player, event.getMessage().orElse(MESSAGE_DATA.getMessage(MessageStorage.TRUST_PLUGIN_CANCEL, + ImmutableMap.of("target", group)))); return; } @@ -100,7 +103,7 @@ public void execute(Player player, String target, String type) { this.removeAllGroupTrust(claim, group); } - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UNTRUST_INDIVIDUAL_ALL_CLAIMS, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.UNTRUST_INDIVIDUAL_ALL_CLAIMS, ImmutableMap.of( "player", group.getName())); GriefDefenderPlugin.sendMessage(player, message); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandUntrustPlayer.java b/bukkit/src/main/java/com/griefdefender/command/CommandUntrustPlayer.java index da2868d..fdd0002 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandUntrustPlayer.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandUntrustPlayer.java @@ -31,6 +31,8 @@ import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; + +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import net.kyori.text.Component; import net.kyori.text.TextComponent; @@ -43,6 +45,7 @@ import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.GriefDefender; import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.event.GDCauseStackManager; @@ -56,6 +59,8 @@ @CommandPermission(GDPermissions.COMMAND_UNTRUST_PLAYER) public class CommandUntrustPlayer extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdplayers @gddummy") @CommandAlias("untrust") @Description("Revokes player access to your claim.") @@ -71,13 +76,13 @@ public void execute(Player player, String target) { System.out.println("user = " + user); if (user == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_PLAYER, + GriefDefenderPlugin.sendMessage(player, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_PLAYER, ImmutableMap.of( "player", target))); return; } if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(player.getWorld().getUID())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_DISABLED_WORLD)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_DISABLED_WORLD); return; } @@ -85,17 +90,17 @@ public void execute(Player player, String target) { GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(playerData, player.getLocation()); if (!claim.getOwnerUniqueId().equals(player.getUniqueId()) && !playerData.canIgnoreClaim(claim) && claim.allowEdit(player) != null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_COMMAND_TRUST)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_COMMAND_TRUST); return; } if (user.getUniqueId().equals(player.getUniqueId()) && !playerData.canIgnoreClaim(claim)) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UNTRUST_SELF)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().UNTRUST_SELF); return; } if (user != null && claim.getOwnerUniqueId().equals(user.getUniqueId())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_OWNER_ALREADY)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_OWNER_ALREADY); return; } @@ -106,7 +111,8 @@ public void execute(Player player, String target) { GriefDefender.getEventManager().post(event); GDCauseStackManager.getInstance().popCause(); if (event.cancelled()) { - TextAdapter.sendComponent(player, event.getMessage().orElse(TextComponent.of("Could not untrust user '" + user.getName() + "'. A plugin has denied it.").color(TextColor.RED))); + TextAdapter.sendComponent(player, event.getMessage().orElse(MESSAGE_DATA.getMessage(MessageStorage.TRUST_PLUGIN_CANCEL, + ImmutableMap.of("target", user.getName())))); return; } @@ -114,7 +120,7 @@ public void execute(Player player, String target) { claim.getInternalClaimData().setRequiresSave(true); claim.getInternalClaimData().save(); - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UNTRUST_INDIVIDUAL_SINGLE_CLAIM, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.UNTRUST_INDIVIDUAL_SINGLE_CLAIM, ImmutableMap.of( "target", user.getName())); GriefDefenderPlugin.sendMessage(player, message); diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandUntrustPlayerAll.java b/bukkit/src/main/java/com/griefdefender/command/CommandUntrustPlayerAll.java index 4f104d8..89181c3 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandUntrustPlayerAll.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandUntrustPlayerAll.java @@ -39,8 +39,10 @@ import com.griefdefender.api.GriefDefender; import com.griefdefender.api.claim.Claim; import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.MessageDataConfig; import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; import com.griefdefender.event.GDUserTrustClaimEvent; @@ -59,6 +61,8 @@ @CommandPermission(GDPermissions.COMMAND_UNTRUSTALL_PLAYER) public class CommandUntrustPlayerAll extends BaseCommand { + private MessageDataConfig MESSAGE_DATA = GriefDefenderPlugin.getInstance().messageData; + @CommandCompletion("@gdplayers @gddummy") @CommandAlias("untrustall") @Description("Revokes player access to all your claims.") @@ -74,13 +78,13 @@ public void execute(Player player, String target) { // validate player argument if (user == null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.COMMAND_INVALID_PLAYER, ImmutableMap.of( + GriefDefenderPlugin.sendMessage(player, MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_PLAYER, ImmutableMap.of( "player", target))); return; } if (user.getUniqueId().equals(player.getUniqueId())) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UNTRUST_SELF)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().UNTRUST_SELF); return; } @@ -91,7 +95,7 @@ public void execute(Player player, String target) { } if (playerData == null || claimList == null || claimList.size() == 0) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UNTRUST_NO_CLAIMS)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().UNTRUST_NO_CLAIMS); return; } @@ -101,7 +105,8 @@ public void execute(Player player, String target) { GriefDefender.getEventManager().post(event); GDCauseStackManager.getInstance().popCause(); if (event.cancelled()) { - TextAdapter.sendComponent(player, event.getMessage().orElse(TextComponent.of("Could not remove trust for user '" + user.getName() + "'. A plugin has denied it.").color(TextColor.RED))); + TextAdapter.sendComponent(player, event.getMessage().orElse(MESSAGE_DATA.getMessage(MessageStorage.TRUST_PLUGIN_CANCEL, + ImmutableMap.of("target", user.getName())))); return; } @@ -109,7 +114,7 @@ public void execute(Player player, String target) { this.removeAllUserTrust(claim, user); } - final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.UNTRUST_INDIVIDUAL_ALL_CLAIMS, + final Component message = MESSAGE_DATA.getMessage(MessageStorage.UNTRUST_INDIVIDUAL_ALL_CLAIMS, ImmutableMap.of( "player", user.getName())); GriefDefenderPlugin.sendMessage(player, message); diff --git a/bukkit/src/main/java/com/griefdefender/configuration/MessageDataConfig.java b/bukkit/src/main/java/com/griefdefender/configuration/MessageDataConfig.java index ef054e2..1026749 100644 --- a/bukkit/src/main/java/com/griefdefender/configuration/MessageDataConfig.java +++ b/bukkit/src/main/java/com/griefdefender/configuration/MessageDataConfig.java @@ -33,7 +33,6 @@ import net.kyori.text.Component; import net.kyori.text.TextComponent; import net.kyori.text.serializer.legacy.LegacyComponentSerializer; -import net.kyori.text.serializer.plain.PlainComponentSerializer; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; diff --git a/bukkit/src/main/java/com/griefdefender/configuration/MessageStorage.java b/bukkit/src/main/java/com/griefdefender/configuration/MessageStorage.java index 3780327..8e6a62b 100644 --- a/bukkit/src/main/java/com/griefdefender/configuration/MessageStorage.java +++ b/bukkit/src/main/java/com/griefdefender/configuration/MessageStorage.java @@ -25,6 +25,7 @@ package com.griefdefender.configuration; import com.griefdefender.GriefDefenderPlugin; + import ninja.leaping.configurate.ConfigurationOptions; import ninja.leaping.configurate.commented.CommentedConfigurationNode; import ninja.leaping.configurate.commented.SimpleCommentedConfigurationNode; @@ -45,70 +46,73 @@ public class MessageStorage { private ObjectMapper.BoundInstance configMapper; private MessageDataConfig configBase; - public static final String ABANDON_CLAIM_MISSING = "abandon-claim-missing"; + // descriptions + public static String DESCRIPTION_ABANDON_ALL = "abandon-all"; + public static String DESCRIPTION_ABANDON_CLAIM = "abandon-claim"; + public static String DESCRIPTION_ABANDON_TOP = "abandon-top"; + public static String DESCRIPTION_BUY_BLOCKS = "buy-blocks"; + public static String DESCRIPTION_CALLBACK = "callback"; + public static String DESCRIPTION_CLAIM_BANK = "claim-bank"; + public static String DESCRIPTION_CLAIM_CLEAR = "claim-clear"; + public static String DESCRIPTION_CLAIM_DEBUG = "claim-debug"; + public static String DESCRIPTION_CLAIM_FAREWELL = "claim-farewell"; + public static String DESCRIPTION_CLAIM_GREETING = "claim-greeting"; + public static String DESCRIPTION_CLAIM_IGNORE = "claim-ignore"; + public static String DESCRIPTION_CLAIM_INFO = "claim-info"; + public static String DESCRIPTION_CLAIM_INHERIT = "claim-inherit"; + public static String DESCRIPTION_CLAIM_LIST = "claim-list"; + public static String DESCRIPTION_CLAIM_NAME = "claim-name"; + public static String DESCRIPTION_CLAIM_RESTORE = "claim-restore"; + public static String DESCRIPTION_CLAIM_SETSPAWN = "claim-setspawn"; + public static String DESCRIPTION_CLAIM_SPAWN = "claim-spawn"; + public static String DESCRIPTION_CLAIM_TRANSFER = "claim-transfer"; + public static String DESCRIPTION_CLAIM_WORLDEDIT = "claim-worldedit"; + public static String DESCRIPTION_CUBOID = "cuboid"; + public static String DESCRIPTION_DEBUG = "debug"; + public static String DESCRIPTION_DELETE_ALL = "delete-all"; + public static String DESCRIPTION_DELETE_ALL_ADMIN = "delete-all-admin"; + public static String DESCRIPTION_DELETE_CLAIM = "delete-claim"; + public static String DESCRIPTION_DELETE_TOP = "delete-top"; + public static String DESCRIPTION_FLAG_CLAIM = "flag-claim"; + public static String DESCRIPTION_FLAG_GROUP = "flag-group"; + public static String DESCRIPTION_FLAG_PLAYER = "flag-player"; + public static String DESCRIPTION_FLAG_RESET = "flag-reset"; + public static String DESCRIPTION_MODE_ADMIN = "mode-admin"; + public static String DESCRIPTION_MODE_BASIC = "mode-basic"; + public static String DESCRIPTION_MODE_NATURE = "mode-nature"; + public static String DESCRIPTION_MODE_SUBDIVISION = "mode-subdivision"; + public static String DESCRIPTION_MODE_TOWN = "mode-town"; + public static String DESCRIPTION_OPTION_CLAIM = "option-claim"; + public static String DESCRIPTION_PERMISSION_GROUP = "permission-group"; + public static String DESCRIPTION_PERMISSION_PLAYER = "permission-player"; + public static String DESCRIPTION_PLAYER_ADJUST_BONUS_BLOCKS = "player-adjust-bonus-blocks"; + public static String DESCRIPTION_PLAYER_INFO = "player-info"; + + // messages with parameters public static final String ABANDON_OTHER_SUCCESS = "abandon-other-success"; public static final String ABANDON_SUCCESS = "abandon-success"; - public static final String ABANDON_TOP_LEVEL = "abandon-top-level"; - public static final String ABANDON_TOWN_CHILDREN = "abandon-town-children"; - public static final String ABANDON_WARNING = "abandon-warning"; public static final String ADJUST_ACCRUED_BLOCKS_SUCCESS = "adjust-accrued-blocks-success"; public static final String ADJUST_BONUS_BLOCKS_SUCCESS = "adjust-bonus-blocks-success"; public static final String BANK_DEPOSIT = "bank-deposit"; - public static final String BANK_DEPOSIT_NO_FUNDS = "bank-deposit-no-funds"; public static final String BANK_INFO = "bank-info"; public static final String BANK_NO_PERMISSION = "bank-no-permission"; - public static final String BANK_TAX_SYSTEM_DISABLED = "bank-tax-system-disabled"; public static final String BANK_WITHDRAW = "bank-withdraw"; public static final String BANK_WITHDRAW_NO_FUNDS = "bank-withdraw-no-funds"; public static final String BLOCK_CLAIMED = "block-claimed"; public static final String BLOCK_NOT_CLAIMED = "block-not-claimed"; public static final String BLOCK_SALE_VALUE = "block-sale-value"; - public static final String COMMAND_BLOCKED = "command-blocked"; - public static final String COMMAND_CUBOID_DISABLED = "command-cuboid-disabled"; - public static final String COMMAND_CUBOID_ENABLED = "command-cuboid-enabled"; - public static final String COMMAND_INHERIT = "command-inherit"; - public static final String COMMAND_INVALID_CLAIM = "command-invalid-claim"; - public static final String COMMAND_INVALID_PLAYER_GROUP = "command-invalid-player-group"; - public static final String COMMAND_INVALID_GROUP = "command-invalid-group"; - public static final String COMMAND_INVALID_PLAYER = "command-invalid-player"; - public static final String COMMAND_OPTION_EXCEEDS_ADMIN = "command-option-exceeds-admin"; - public static final String CREATE_CUBOID_DISABLED = "create-cuboid-disabled"; - public static final String CREATE_CANCEL = "create-cancel"; - public static final String CREATE_FAILED_CLAIM_LIMIT = "create-failed-claim-limit"; - public static final String CREATE_INSUFFICIENT_BLOCKS_2D = "create-insufficient-blocks-2d"; - public static final String CREATE_INSUFFICIENT_BLOCKS_3D = "create-insufficient-blocks-3d"; - public static final String CREATE_OVERLAP = "create-overlap"; - public static final String CREATE_OVERLAP_PLAYER = "create-overlap-player"; - public static final String CREATE_OVERLAP_SHORT = "create-overlap-short"; - public static final String CREATE_SUBDIVISION_FAIL = "create-subdivision-fail"; - public static final String CREATE_SUBDIVISION_ONLY = "create-subdivision-only"; - public static final String CREATE_SUCCESS = "create-success"; - public static final String CREATE_WORLDEDIT_MISSING = "create-worldedit-missing"; public static final String CLAIM_ABOVE_LEVEL = "claim-above-level"; - public static final String CLAIM_AUTOMATIC_NOTIFICATION = "claim-automatic-notification"; + public static final String CLAIM_ACTION_NOT_AVAILABLE = "claim-action-not-available"; public static final String CLAIM_BELOW_LEVEL = "claim-below-level"; - public static final String CLAIM_CHEST_CONFIRMATION = "claim-chest-confirmation"; public static final String CLAIM_CHEST_OUTSIDE_LEVEL = "claim-chest-outside-level"; - public static final String CLAIM_CHILDREN_WARNING = "claim-children-warning"; public static final String CLAIM_CONTEXT_NOT_FOUND = "claim-context-not-found"; - public static final String CLAIM_DISABLED_WORLD = "claim-disabled-world"; public static final String CLAIM_FAREWELL = "claim-farewell"; - public static final String CLAIM_FAREWELL_CLEAR = "claim-farewell-clear"; public static final String CLAIM_FAREWELL_INVALID = "claim-farewell-invalid"; public static final String CLAIM_GREETING = "claim-greeting"; - public static final String CLAIM_GREETING_CLEAR = "claim-greeting-clear"; - public static final String CLAIM_IGNORE = "claim-ignore"; public static final String CLAIM_LAST_ACTIVE = "claim-last-active"; public static final String CLAIM_NAME = "claim-name"; - public static final String CLAIM_NO_CLAIMS = "claim-no-claims"; - public static final String CLAIM_NOT_FOUND = "claim-not-found"; - public static final String CLAIM_NOT_YOURS = "claim-not-yours"; - public static final String CLAIM_OWNER_ALREADY = "claim-owner-already"; public static final String CLAIM_OWNER_ONLY = "claim-owner-only"; public static final String CLAIM_PROTECTED_ENTITY = "claim-protected-entity"; - public static final String CLAIM_RESPECTING = "claim-respecting"; - public static final String CLAIM_RESTORE_SUCCESS = "claim-restore-success"; - public static final String CLAIM_RESTORE_NATURE_ACTIVATE = "claim-restore-nature-activate"; public static final String CLAIM_SHOW_NEARBY = "claim-show-nearby"; public static final String CLAIM_SIZE_MIN = "claim-size-min"; public static final String CLAIM_SIZE_MAX = "claim-size-max"; @@ -117,80 +121,69 @@ public class MessageStorage { public static final String CLAIM_SIZE_TOO_SMALL = "size-too-small"; public static final String CLAIM_NO_SET_HOME = "claim-no-set-home"; public static final String CLAIM_START = "claim-start"; - public static final String CLAIM_TOO_FAR = "claim-too-far"; public static final String CLAIM_TRANSFER_EXCEEDS_LIMIT = "claim-transfer-exceeds-limit"; public static final String CLAIM_TRANSFER_SUCCESS = "claim-transfer-success"; public static final String CLAIM_TYPE_NOT_FOUND = "claim-type-not-found"; - public static final String DELETE_ALL_ADMIN_SUCCESS = "delete-all-admin-success"; - public static final String DELETE_ALL_ADMIN_WARNING = "delete-all-admin-warning"; - public static final String DELETE_ALL_SUCCESS = "delete-all-success"; - public static final String DELETE_ALL_WARNING = "delete-all-warning"; - public static final String DELETE_CLAIM = "delete-claim"; - public static final String ECONOMY_BLOCK_NOT_AVAILABLE = "economy-block-not-available"; - public static final String ECONOMY_BLOCK_ONLY_BUY = "economy-block-only-buy"; - public static final String ECONOMY_BLOCK_ONLY_SELL = "economy-block-only-sell"; + public static final String CLAIMINFO_UI_CLICK_CHANGE_CLAIM = "claiminfo-ui-click-change-claim"; + public static final String CLAIMINFO_UI_TELEPORT_DIRECTION = "claiminfo-ui-teleport-direction"; + public static final String CLAIMLIST_UI_CLICK_TELEPORT_TARGET = "claimlist-ui-click-teleport-target"; + public static final String CLAIMLIST_UI_CLICK_TOGGLE_VALUE = "claimlist-ui-click-toggle-value"; + public static final String COMMAND_BLOCKED = "command-blocked"; + public static final String COMMAND_CLAIMCLEAR_NO_ENTITIES = "command-claimclear-no-entities"; + public static final String COMMAND_EXECUTE_FAILED = "command-execute-failed"; + public static final String COMMAND_INVALID_CLAIM = "command-invalid-claim"; + public static final String COMMAND_INVALID_GROUP = "command-invalid-group"; + public static final String COMMAND_INVALID_PLAYER = "command-invalid-player"; + public static final String COMMAND_OPTION_EXCEEDS_ADMIN = "command-option-exceeds-admin"; + public static final String COMMAND_PLAYER_NOT_FOUND = "command-player-not-found"; + public static final String COMMAND_WORLD_NOT_FOUND = "command-world-not-found"; + public static final String CREATE_FAILED_CLAIM_LIMIT = "create-failed-claim-limit"; + public static final String CREATE_INSUFFICIENT_BLOCKS_2D = "create-insufficient-blocks-2d"; + public static final String CREATE_INSUFFICIENT_BLOCKS_3D = "create-insufficient-blocks-3d"; + public static final String CREATE_OVERLAP_PLAYER = "create-overlap-player"; + public static final String CREATE_SUCCESS = "create-success"; + public static final String DEBUG_ERROR_UPLOAD = "debug-error-upload"; + public static final String DELETE_ALL_TYPE_DENY = "delete-all-type-deny"; + public static final String DELETE_ALL_TYPE_SUCCESS = "delete-all-type-success"; + public static final String DELETE_ALL_TYPE_WARNING = "delete-all-type-warning"; + public static final String DELETE_ALL_PLAYER_SUCCESS = "delete-all-player-success"; + public static final String DELETE_ALL_PLAYER_WARNING = "delete-all-player-warning"; public static final String ECONOMY_BLOCK_PURCHASE_CONFIRMATION = "economy-block-purchase-confirmation"; public static final String ECONOMY_BLOCK_PURCHASE_COST = "economy-block-purchase-cost"; public static final String ECONOMY_BLOCK_PURCHASE_LIMIT = "economy-block-purchase-limit"; public static final String ECONOMY_BLOCK_SALE_CONFIRMATION = "economy-block-sale-confirmation"; public static final String ECONOMY_BLOCK_SELL_ERROR = "economy-block-sell-error"; - public static final String ECONOMY_BLOCK_BUY_INVALID = "economy-block-buy-invalid"; - public static final String ECONOMY_BUY_SELL_DISABLED = "economy-buy-sell-disabled"; public static final String ECONOMY_CLAIM_ABANDON_SUCCESS = "economy-claim-abandon-success"; + public static final String ECONOMY_CLAIM_BUY_CANCELLED = "economy-claim-buy-cancelled"; public static final String ECONOMY_CLAIM_BUY_CONFIRMATION = "economy-claim-buy-confirmation"; public static final String ECONOMY_CLAIM_BUY_CONFIRMED = "economy-claim-buy-confirmed"; public static final String ECONOMY_CLAIM_BUY_NOT_ENOUGH_FUNDS = "economy-claim-buy-not-enough-funds"; - public static final String ECONOMY_CLAIM_NOT_FOR_SALE = "economy-claim-not-for-sale"; - public static final String ECONOMY_CLAIM_SALE_CANCELLED = "economy-claim-sale-cancelled"; + public static final String ECONOMY_CLAIM_BUY_TRANSFER_CANCELLED = "economy-claim-buy-transfer-cancelled"; public static final String ECONOMY_CLAIM_SALE_CONFIRMATION = "economy-claim-sale-confirmation"; public static final String ECONOMY_CLAIM_SALE_CONFIRMED = "economy-claim-sale-confirmed"; public static final String ECONOMY_CLAIM_SALE_INVALID_PRICE = "economy-claim-sale-invalid-price"; public static final String ECONOMY_CLAIM_SOLD = "economy-claim-sold"; public static final String ECONOMY_NOT_ENOUGH_FUNDS = "economy-not-enough-funds"; - public static final String ECONOMY_NOT_INSTALLED = "economy-not-installed"; public static final String ECONOMY_PLAYER_NOT_FOUND = "economy-player-not-found"; - public static final String ECONOMY_VIRTUAL_NOT_SUPPORTED = "economy-virtual-not-supported"; public static final String ECONOMY_WITHDRAW_ERROR = "economy-withdraw-error"; public static final String FLAG_INVALID_CONTEXT = "flag-invalid-context"; public static final String FLAG_INVALID_META = "flag-invalid-meta"; public static final String FLAG_INVALID_TARGET = "flag-invalid-target"; + public static final String FLAG_NOT_FOUND = "flag-not-found"; + public static final String FLAG_NOT_SET = "flag-not-set"; public static final String FLAG_OVERRIDDEN = "flag-overridden"; public static final String FLAG_OVERRIDE_NOT_SUPPORTED = "flag-override-not-supported"; - public static final String FLAG_RESET_SUCCESS = "flag-reset-success"; - public static final String MODE_ADMIN = "mode-admin"; - public static final String MODE_BASIC = "mode-basic"; - public static final String MODE_SUBDIVISION = "mode-subdivision"; - public static final String MODE_TOWN = "mode-town"; - public static final String OWNER_ADMIN = "owner-admin"; + public static final String FLAG_SET_PERMISSION_TARGET = "flag-set-permission-target"; + public static final String FLAG_UI_CLICK_TOGGLE = "flag-ui-click-toggle"; + public static final String FLAG_UI_INHERIT_PARENT = "flag-ui-inherit-parent"; + public static final String FLAG_UI_OVERRIDE_PERMISSION = "flag-ui-override-permission"; public static final String PERMISSION_ACCESS = "permission-access"; - public static final String PERMISSION_ASSIGN_WITHOUT_HAVING = "permission-assign-without-having"; public static final String PERMISSION_BUILD = "permission-build"; public static final String PERMISSION_BUILD_NEAR_CLAIM = "permission-build-near-claim"; - public static final String PERMISSION_CLAIM_CREATE = "permission-claim-create"; public static final String PERMISSION_CLAIM_DELETE = "permission-claim-delete"; - public static final String PERMISSION_CLAIM_ENTER = "permission-claim-enter"; - public static final String PERMISSION_CLAIM_EXIT = "permission-claim-exit"; public static final String PERMISSION_CLAIM_IGNORE = "permission-claim-ignore"; - public static final String PERMISSION_CLAIM_LIST = "permission-claim-list"; public static final String PERMISSION_CLAIM_MANAGE = "permission-claim-manage"; public static final String PERMISSION_CLAIM_RESET_FLAGS = "permission-claim-reset-flags"; - public static final String PERMISSION_CLAIM_RESET_FLAGS_SELF = "permission-claim-reset-flags-self"; - public static final String PERMISSION_CLAIM_RESIZE = "permission-claim-resize"; - public static final String PERMISSION_CLAIM_SALE = "permission-claim-sale"; - public static final String PERMISSION_CLAIM_TRANSFER_ADMIN = "permission-claim-transfer-admin"; - public static final String PERMISSION_CLEAR = "permission-clear"; - public static final String PERMISSION_CLEAR_ALL = "permission-clear-all"; - public static final String PERMISSION_COMMAND_TRUST = "permission-command-trust"; - public static final String PERMISSION_CUBOID = "permission-cuboid"; - public static final String PERMISSION_EDIT_CLAIM = "permission-edit-claim"; - public static final String PERMISSION_FIRE_SPREAD = "permission-fire-spread"; - public static final String PERMISSION_FLAG_DEFAULTS = "permission-flag-defaults"; - public static final String PERMISSION_FLAG_OVERRIDES = "permission-flag-overrides"; - public static final String PERMISSION_FLAG_USE = "permission-flag-use"; - public static final String PERMISSION_FLOW_LIQUID = "permission-flow-liquid"; - public static final String PERMISSION_GLOBAL_OPTION = "permission-global-option"; - public static final String PERMISSION_GRANT = "permission-grant"; - public static final String PERMISSION_GROUP_OPTION = "permission-group-option"; public static final String PERMISSION_INTERACT_BLOCK = "permission-interact-block"; public static final String PERMISSION_INTERACT_ENTITY = "permission-interact-entity"; public static final String PERMISSION_INTERACT_ITEM = "permission-interact-item"; @@ -199,26 +192,46 @@ public class MessageStorage { public static final String PERMISSION_INVENTORY_OPEN = "permission-inventory-open"; public static final String PERMISSION_ITEM_DROP = "permission-item-drop"; public static final String PERMISSION_ITEM_USE = "permission-item-use"; - public static final String PERMISSION_OVERRIDE_DENY = "permission-override-deny"; - public static final String PERMISSION_PLAYER_ADMIN_FLAGS = "permission-player-admin-flags"; - public static final String PERMISSION_PLAYER_OPTION = "permission-player-option"; public static final String PERMISSION_PORTAL_ENTER = "permission-portal-enter"; public static final String PERMISSION_PORTAL_EXIT = "permission-portal-exit"; public static final String PERMISSION_PROTECTED_PORTAL = "permission-protected-portal"; public static final String PERMISSION_TRUST = "permission-trust"; - public static final String PERMISSION_VISUAL_CLAIMS_NEARBY = "permission-visual-claims-nearby"; + public static final String PLAYER_ACCRUED_BLOCKS_EXCEEDED = "player-accrued-blocks-exceeded"; public static final String PLAYER_REMAINING_BLOCKS_2D = "player-remaining-blocks-2d"; public static final String PLAYER_REMAINING_BLOCKS_3D = "player-remaining-blocks-3d"; - public static final String PLUGIN_RELOAD = "plugin-reload"; - public static final String PLUGIN_EVENT_CANCEL = "plugin-event-cancel"; - public static final String RESIZE_OVERLAP = "resize-overlap"; - public static final String RESIZE_OVERLAP_SUBDIVISION = "resize-overlap-subdivision"; - public static final String RESIZE_SAME_LOCATION = "resize-same-location"; - public static final String RESIZE_START = "resize-start"; + public static final String PLAYERINFO_UI_ABANDON_RETURN_RATIO = "playerinfo-ui-abandon-return-ratio"; + public static final String PLAYERINFO_UI_BLOCK_ACCRUED = "playerinfo-ui-block-accrued"; + public static final String PLAYERINFO_UI_BLOCK_BONUS = "playerinfo-ui-block-bonus"; + public static final String PLAYERINFO_UI_CLAIM_LEVEL = "playerinfo-ui-claim-level"; + public static final String PLAYERINFO_UI_CLAIM_SIZE_LIMIT = "playerinfo-ui-claim-size-limit"; + public static final String PLAYERINFO_UI_BLOCK_INITIAL = "playerinfo-ui-block-initial"; + public static final String PLAYERINFO_UI_BLOCK_MAX_ACCRUED = "playerinfo-ui-block-max-accrued"; + public static final String PLAYERINFO_UI_BLOCK_REMAINING = "playerinfo-ui-block-remaining"; + public static final String PLAYERINFO_UI_BLOCK_TOTAL = "playerinfo-ui-block-total"; + public static final String PLAYERINFO_UI_CHUNK_TOTAL = "playerinfo-ui-chunk-total"; + public static final String PLAYERINFO_UI_CLAIM_TOTAL = "playerinfo-ui-claim-total"; + public static final String PLAYERINFO_UI_LAST_ACTIVE = "playerinfo-ui-last-active"; + public static final String PLAYERINFO_UI_TAX_CURRENT_RATE = "playerinfo-ui-tax-current-rate"; + public static final String PLAYERINFO_UI_TAX_GLOBAL_CLAIM_RATE = "playerinfo-ui-tax-global-claim-rate"; + public static final String PLAYERINFO_UI_TAX_GLOBAL_TOWN_RATE = "playerinfo-ui-tax-global-town-rate"; + public static final String PLAYERINFO_UI_TAX_TOTAL = "playerinfo-ui-tax-total"; + public static final String PLAYERINFO_UI_UUID = "playerinfo-ui-uuid"; + public static final String PLAYERINFO_UI_WORLD = "playerinfo-ui-world"; + public static final String PLUGIN_COMMAND_NOT_FOUND = "plugin-command-not-found"; public static final String RESIZE_SUCCESS_2D = "resize-success-2d"; public static final String RESIZE_SUCCESS_3D = "resize-success-3d"; + public static final String RESULT_TYPE_CHANGE_DENY = "result-type-change-deny"; + public static final String RESULT_TYPE_CHANGE_NOT_ADMIN = "result-type-change-not-admin"; + public static final String RESULT_TYPE_CHILD_SAME = "result-type-child-same"; + public static final String RESULT_TYPE_CREATE_DENY = "result-type-create-deny"; + public static final String RESULT_TYPE_NO_CHILDREN = "result-type-no-children"; + public static final String RESULT_TYPE_ONLY_SUBDIVISION = "result-type-only-subdivision"; + public static final String RESULT_TYPE_REQUIRES_OWNER = "result-type-requires-owner"; + public static final String SCHEMATIC_DELETED = "schematic-deleted"; + public static final String SCHEMATIC_NONE = "schematic-none"; + public static final String SCHEMATIC_RESTORE_CLICK = "schematic-restore-click"; + public static final String SCHEMATIC_RESTORE_CONFIRMATION = "schematic-restore-confirmation"; public static final String SCHEMATIC_RESTORE_CONFIRMED = "schematic-restore-confirmed"; - public static final String SPAWN_NOT_SET = "spawn-not-set"; public static final String SPAWN_SET_SUCCESS = "spawn-set-success"; public static final String SPAWN_TELEPORT = "spawn-teleport"; public static final String TAX_CLAIM_EXPIRED = "tax-claim-expired"; @@ -226,29 +239,20 @@ public class MessageStorage { public static final String TAX_CLAIM_PAID_PARTIAL = "tax-claim-paid-partial"; public static final String TAX_INFO = "tax-info"; public static final String TAX_PAST_DUE = "tax-past-due"; - public static final String TOWN_CHAT_DISABLED = "town-chat-disabled"; - public static final String TOWN_CHAT_ENABLED = "town-chat-enabled"; + public static final String TOOL_NOT_EQUIPPED = "tool-not-equipped"; public static final String TOWN_CREATE_NOT_ENOUGH_FUNDS = "town-create-not-enough-funds"; public static final String TOWN_NAME = "town-name"; - public static final String TOWN_NOT_FOUND = "town-not-found"; - public static final String TOWN_NOT_IN = "town-not-in"; - public static final String TOWN_OWNER = "town-owner"; public static final String TOWN_TAG = "town-tag"; - public static final String TOWN_TAG_CLEAR = "town-tag-clear"; - public static final String TOWN_TAX_NO_CLAIMS = "town-tax-no-claims"; public static final String TRUST_ALREADY_HAS = "trust-already-has"; public static final String TRUST_GRANT = "trust-grant"; public static final String TRUST_INDIVIDUAL_ALL_CLAIMS = "trust-individual-all-claims"; - public static final String TRUST_INVALID = "trust-invalid"; - public static final String TRUST_LIST_HEADER = "trust-list-header"; - public static final String TRUST_NO_CLAIMS = "trust-no-claims"; - public static final String TRUST_SELF = "trust-self"; + public static final String TRUST_PLUGIN_CANCEL = "trust-plugin-cancel"; public static final String TUTORIAL_CLAIM_BASIC = "tutorial-claim-basic"; + public static final String UI_CLICK_FILTER_TYPE = "ui-click-filter-type"; public static final String UNTRUST_INDIVIDUAL_ALL_CLAIMS = "untrust-individual-all-claims"; public static final String UNTRUST_INDIVIDUAL_SINGLE_CLAIM = "untrust-individual-single-claim"; - public static final String UNTRUST_NO_CLAIMS = "untrust-no-claims"; public static final String UNTRUST_OWNER = "untrust-owner"; - public static final String UNTRUST_SELF = "untrust-self"; + @SuppressWarnings({"unchecked", "rawtypes"}) public MessageStorage(Path path) { diff --git a/bukkit/src/main/java/com/griefdefender/configuration/category/MigratorCategory.java b/bukkit/src/main/java/com/griefdefender/configuration/category/MigratorCategory.java index e21779e..bd3dd47 100644 --- a/bukkit/src/main/java/com/griefdefender/configuration/category/MigratorCategory.java +++ b/bukkit/src/main/java/com/griefdefender/configuration/category/MigratorCategory.java @@ -34,4 +34,10 @@ public class MigratorCategory extends ConfigCategory { "\nNote: Migrates GP bukkit classic claim data to current format." + "\nNote: It is recommended to backup data before using.") public boolean classicMigrator = false; + + @Setting(value = "worldguard", comment = + "Set to true to enable WorldGuard data migrator." + + "\nNote: Only cuboid regions are supported." + + "\nNote: It is recommended to backup data before using.") + public boolean worldGuardMigrator = false; } diff --git a/bukkit/src/main/java/com/griefdefender/listener/BlockEventHandler.java b/bukkit/src/main/java/com/griefdefender/listener/BlockEventHandler.java index 3740732..cea25a6 100644 --- a/bukkit/src/main/java/com/griefdefender/listener/BlockEventHandler.java +++ b/bukkit/src/main/java/com/griefdefender/listener/BlockEventHandler.java @@ -37,6 +37,7 @@ import com.griefdefender.api.claim.TrustTypes; import com.griefdefender.api.permission.flag.Flags; import com.griefdefender.api.permission.option.Options; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.claim.GDClaimManager; @@ -56,7 +57,6 @@ import com.griefdefender.util.Direction; import com.griefdefender.visual.ClaimVisualType; import net.kyori.text.Component; -import net.kyori.text.TextComponent; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -592,8 +592,8 @@ public void onBlockPlace(BlockPlaceEvent event) { return; } - final int minClaimLevel = GDPermissionManager.getInstance().getGlobalInternalOptionValue(player, Options.MIN_LEVEL, playerData).intValue(); - final int maxClaimLevel = GDPermissionManager.getInstance().getGlobalInternalOptionValue(player, Options.MAX_LEVEL, playerData).intValue(); + final int minClaimLevel = GDPermissionManager.getInstance().getInternalOptionValue(player, Options.MIN_LEVEL, playerData).intValue(); + final int maxClaimLevel = GDPermissionManager.getInstance().getInternalOptionValue(player, Options.MAX_LEVEL, playerData).intValue(); if (blockPos.getY() < minClaimLevel || blockPos.getY() > maxClaimLevel) { final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_CHEST_OUTSIDE_LEVEL, ImmutableMap.of( @@ -620,7 +620,7 @@ public void onBlockPlace(BlockPlaceEvent event) { final Claim claim = result.getClaim().get(); final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(world.getUID()); claimManager.addClaim(claim, true); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_CHEST_CONFIRMATION)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_CHEST_CONFIRMATION); GDTimings.BLOCK_PLACE_EVENT.stopTiming(); return; } @@ -646,7 +646,7 @@ public void onBlockPlace(BlockPlaceEvent event) { radius--; } else { // notify and explain to player - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_AUTOMATIC_NOTIFICATION)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_AUTOMATIC_NOTIFICATION); // show the player the protected area GDClaim newClaim = this.storage.getClaimAt(block.getLocation()); diff --git a/bukkit/src/main/java/com/griefdefender/listener/PlayerEventHandler.java b/bukkit/src/main/java/com/griefdefender/listener/PlayerEventHandler.java index 6736cec..572e8f8 100644 --- a/bukkit/src/main/java/com/griefdefender/listener/PlayerEventHandler.java +++ b/bukkit/src/main/java/com/griefdefender/listener/PlayerEventHandler.java @@ -44,6 +44,7 @@ import com.griefdefender.api.claim.TrustTypes; import com.griefdefender.api.permission.flag.Flags; import com.griefdefender.api.permission.option.Options; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.claim.GDClaimManager; @@ -219,7 +220,7 @@ public void onPlayerChangeHeldItem(PlayerItemHeldEvent event) { // always reset to basic claims mode if (playerData.shovelMode != ShovelTypes.BASIC) { playerData.shovelMode = ShovelTypes.BASIC; - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.MODE_BASIC)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().MODE_BASIC); } // tell him how many claim blocks he has available @@ -891,11 +892,11 @@ public void onPlayerMove(PlayerMoveEvent event){ final Component cancelMessage = gpEvent.getMessage().orElse(null); if (exitCancelled) { if (cancelMessage != null) { - GriefDefenderPlugin.sendClaimDenyMessage(fromClaim, player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CLAIM_EXIT)); + GriefDefenderPlugin.sendClaimDenyMessage(fromClaim, player, MessageCache.getInstance().PERMISSION_CLAIM_EXIT); } } else if (enterCancelled) { if (cancelMessage != null) { - GriefDefenderPlugin.sendClaimDenyMessage(toClaim, player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CLAIM_ENTER)); + GriefDefenderPlugin.sendClaimDenyMessage(toClaim, player, MessageCache.getInstance().PERMISSION_CLAIM_ENTER); } } @@ -991,7 +992,7 @@ private void onPlayerHandleShovelAction(PlayerInteractEvent event, Block clicked playerData = this.dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); if (playerData.shovelMode == ShovelTypes.RESTORE) { if (true) { - GriefDefenderPlugin.sendMessage(player, TextComponent.of("This mode is currently being worked on and will be available in a future build.", TextColor.RED)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().FEATURE_NOT_AVAILABLE); GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming(); return; } @@ -1046,7 +1047,7 @@ private void onPlayerHandleShovelAction(PlayerInteractEvent event, Block clicked } else if ((playerData.shovelMode == ShovelTypes.SUBDIVISION || ((claim.isTown() || claim.isAdminClaim()) && (playerData.lastShovelLocation == null || playerData.claimSubdividing != null)) && playerData.shovelMode != ShovelTypes.TOWN)) { if (claim.getTownClaim() != null && playerData.shovelMode == ShovelTypes.TOWN) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_OVERLAP_SHORT)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_OVERLAP_SHORT); Set claims = new HashSet<>(); claims.add(claim); CommandHelper.showClaims(player, claims, location.getBlockY(), true); @@ -1056,7 +1057,7 @@ private void onPlayerHandleShovelAction(PlayerInteractEvent event, Block clicked createSubdivisionFinish(event, player, location, playerData, claim); } } else { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_OVERLAP)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_OVERLAP); Set claims = new HashSet<>(); claims.add(claim); CommandHelper.showClaims(player, claims, location.getBlockY(), true); @@ -1064,7 +1065,7 @@ private void onPlayerHandleShovelAction(PlayerInteractEvent event, Block clicked GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming(); return; } else if (playerData.shovelMode == ShovelTypes.SUBDIVISION && playerData.lastShovelLocation != null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_SUBDIVISION_FAIL)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_SUBDIVISION_FAIL); playerData.lastShovelLocation = null; GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming(); return; @@ -1126,7 +1127,7 @@ private void createClaimStart(PlayerInteractEvent event, Player player, Location } if (playerData.shovelMode == ShovelTypes.SUBDIVISION && claim.isWilderness()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_SUBDIVISION_FAIL)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_SUBDIVISION_FAIL); return; } @@ -1156,7 +1157,7 @@ private void createClaimFinish(PlayerInteractEvent event, Player player, Locatio final GDClaim clickedClaim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(location, playerData, true); if (!firstClaim.equals(clickedClaim)) { final GDClaim overlapClaim = firstClaim.isWilderness() ? clickedClaim : firstClaim; - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_OVERLAP_SHORT)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_OVERLAP_SHORT); Set claims = new HashSet<>(); claims.add(overlapClaim); CommandHelper.showClaims(player, claims, location.getBlockY(), true); @@ -1193,12 +1194,12 @@ private void createClaimFinish(PlayerInteractEvent event, Player player, Locatio if (!result.successful()) { if (result.getResultType() == ClaimResultType.OVERLAPPING_CLAIM) { GDClaim overlapClaim = (GDClaim) result.getClaim().get(); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_OVERLAP_SHORT)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_OVERLAP_SHORT); Set claims = new HashSet<>(); claims.add(overlapClaim); CommandHelper.showOverlapClaims(player, claims, location.getBlockY()); } else if (result.getResultType() == ClaimResultType.CLAIM_EVENT_CANCELLED) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_CANCEL)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_CANCEL); } return; } else { @@ -1235,7 +1236,7 @@ private void createSubdivisionStart(PlayerInteractEvent event, Player player, Lo } if (claim.isSubdivision()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.RESIZE_OVERLAP_SUBDIVISION)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().RESIZE_OVERLAP_SUBDIVISION); } else { final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_START, ImmutableMap.of( @@ -1253,7 +1254,7 @@ private void createSubdivisionFinish(PlayerInteractEvent event, Player player, L final GDClaim clickedClaim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(location); if (clickedClaim == null || !playerData.claimSubdividing.getUniqueId().equals(clickedClaim.getUniqueId())) { if (clickedClaim != null) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_OVERLAP_SHORT)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_OVERLAP_SHORT); final GDClaim overlapClaim = playerData.claimSubdividing; Set claims = new HashSet<>(); claims.add(overlapClaim); @@ -1277,7 +1278,7 @@ private void createSubdivisionFinish(PlayerInteractEvent event, Player player, L GDClaim gdClaim = (GDClaim) result.getClaim().orElse(null); if (!result.successful()) { if (result.getResultType() == ClaimResultType.OVERLAPPING_CLAIM) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_OVERLAP_SHORT)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_OVERLAP_SHORT); Set claims = new HashSet<>(); claims.add(gdClaim); CommandHelper.showOverlapClaims(player, claims, location.getBlockY()); @@ -1336,7 +1337,7 @@ private void handleResizeStart(PlayerInteractEvent event, Player player, Locatio } if (!claim.getInternalClaimData().isResizable() || !playerCanResize) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_CLAIM_RESIZE)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_CLAIM_RESIZE); return; } @@ -1349,7 +1350,7 @@ private void handleResizeStart(PlayerInteractEvent event, Player player, Locatio final int z = playerData.lastShovelLocation.getBlockZ() == claim.lesserBoundaryCorner.getZ() ? claim.greaterBoundaryCorner.getZ() : claim.lesserBoundaryCorner.getZ(); this.worldEditProvider.visualizeClaim(claim, new Vector3i(x, y, z), VecHelper.toVector3i(playerData.lastShovelLocation), player, playerData, false); } - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.RESIZE_START)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().RESIZE_START); } private void handleResizeFinish(PlayerInteractEvent event, Player player, Location location, GDPlayerData playerData) { @@ -1443,13 +1444,13 @@ private void handleResizeFinish(PlayerInteractEvent event, Player player, Locati } else { if (claimResult.getResultType() == ClaimResultType.OVERLAPPING_CLAIM) { GDClaim overlapClaim = (GDClaim) claimResult.getClaim().get(); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.RESIZE_OVERLAP)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().RESIZE_OVERLAP); Set claims = new HashSet<>(); claims.add(overlapClaim); CommandHelper.showOverlapClaims(player, claims, location.getBlockY()); } else { if (!claimResult.getMessage().isPresent()) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_NOT_YOURS)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_YOURS); } } @@ -1479,7 +1480,7 @@ private boolean investigateClaim(PlayerInteractEvent event, Player player, Block claim = this.findNearbyClaim(player); if (player.isSneaking()) { if (!playerData.canIgnoreClaim(claim) && !player.hasPermission(GDPermissions.VISUALIZE_CLAIMS_NEARBY)) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_VISUAL_CLAIMS_NEARBY)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_VISUAL_CLAIMS_NEARBY); GDTimings.PLAYER_INVESTIGATE_CLAIM.stopTiming(); return false; } @@ -1570,7 +1571,7 @@ private GDClaim findNearbyClaim(Player player) { } if (count == maxDistance) { - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_TOO_FAR)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_TOO_FAR); } else if (claim != null && claim.isWilderness()){ GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.BLOCK_NOT_CLAIMED)); } diff --git a/bukkit/src/main/java/com/griefdefender/migrator/WorldGuardMigrator.java b/bukkit/src/main/java/com/griefdefender/migrator/WorldGuardMigrator.java new file mode 100644 index 0000000..d86da9a --- /dev/null +++ b/bukkit/src/main/java/com/griefdefender/migrator/WorldGuardMigrator.java @@ -0,0 +1,722 @@ +/* + * This file is part of GriefPrevention, licensed under the MIT License (MIT). + * + * Copyright (c) bloodmc + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.griefdefender.migrator; + +import com.flowpowered.math.vector.Vector3i; +import com.google.common.reflect.TypeToken; +import com.griefdefender.GriefDefenderPlugin; +import com.griefdefender.api.Tristate; +import com.griefdefender.api.claim.Claim; +import com.griefdefender.api.claim.ClaimResult; +import com.griefdefender.api.claim.ClaimType; +import com.griefdefender.api.claim.ClaimTypes; +import com.griefdefender.api.claim.TrustTypes; +import com.griefdefender.api.permission.Context; +import com.griefdefender.api.permission.flag.Flags; +import com.griefdefender.cache.PermissionHolderCache; +import com.griefdefender.claim.GDClaim; +import com.griefdefender.configuration.ClaimDataConfig; +import com.griefdefender.internal.util.BlockUtil; +import com.griefdefender.permission.GDPermissionManager; +import com.griefdefender.permission.GDPermissionUser; + +import net.kyori.text.TextComponent; +import net.kyori.text.serializer.legacy.LegacyComponentSerializer; +import ninja.leaping.configurate.ConfigurationNode; +import ninja.leaping.configurate.loader.ConfigurationLoader; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; +import ninja.leaping.configurate.yaml.YAMLConfigurationLoader; + +import org.bukkit.World; +import org.bukkit.World.Environment; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.Instant; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.UUID; + +public class WorldGuardMigrator { + + static final GDPermissionManager PERMISSION_MANAGER = GDPermissionManager.getInstance(); + + public static void migrate(World world) throws FileNotFoundException, ClassNotFoundException { + if (!GriefDefenderPlugin.getGlobalConfig().getConfig().migrator.worldGuardMigrator) { + return; + } + + final Environment dimType = world.getEnvironment(); + final String worldName = world.getName().toLowerCase(); + final String dimName = dimType.name().toLowerCase(); + final Path path = Paths.get("plugins", "WorldGuard", "worlds", worldName, "regions.yml"); + List tempClaimList = new ArrayList<>(); + int count = 0; + try { + GriefDefenderPlugin.getInstance().getLogger().info("Starting WorldGuard region data migration for world " + worldName + "..."); + ConfigurationLoader regionManager = YAMLConfigurationLoader.builder().setPath(path).build(); + ConfigurationNode region = regionManager.load().getNode("regions"); + GriefDefenderPlugin.getInstance().getLogger().info("Scanning WorldGuard regions in world data file '" + path + "'..."); + for (Object key:region.getChildrenMap().keySet()){ + String rname = key.toString(); + + boolean isWildernessClaim = false; + if (rname.equalsIgnoreCase("__global__")) { + isWildernessClaim = true; + } + if (!region.getNode(rname).hasMapChildren()){ + continue; + } + if (!isWildernessClaim && !region.getNode(rname, "type").getString().equals("cuboid")) { + GriefDefenderPlugin.getInstance().getLogger().info("Unable to migrate region '" + rname + "' as it is not a cuboid. Skipping..."); + continue; + } + + final Map minMap = region.getNode(rname, "min").getChildrenMap(); + final Map maxMap = region.getNode(rname, "max").getChildrenMap(); + final Map flagsMap = region.getNode(rname, "flags").getChildrenMap(); + final List membersList = region.getNode(rname, "members").getNode("unique-ids").getList(TypeToken.of(UUID.class)); + final List ownersList = region.getNode(rname, "owners").getNode("unique-ids").getList(TypeToken.of(UUID.class)); + + List managers = new ArrayList(); + UUID creator = null; + for (UUID uuid : ownersList) { + if (managers.isEmpty()) { + creator = uuid; + } else { + managers.add(uuid); + } + } + + // create GP claim data file + GriefDefenderPlugin.getInstance().getLogger().info("Migrating WorldGuard region data '" + rname + "'..."); + GDPermissionUser owner = null; + if (!isWildernessClaim) { + try { + // check cache first + owner = PermissionHolderCache.getInstance().getOrCreateUser(creator); + } catch (Throwable e) { + // assume admin claim + } + } + + UUID claimUniqueId = isWildernessClaim ? world.getUID() : UUID.randomUUID(); + ClaimType type = isWildernessClaim ? ClaimTypes.WILDERNESS : owner == null ? ClaimTypes.ADMIN : ClaimTypes.BASIC; + + ClaimDataConfig claimDataConfig = null; + GDClaim newClaim = null; + if (isWildernessClaim) { + newClaim = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(world.getUID()).getWildernessClaim(); + } else { + final Vector3i min = new Vector3i(minMap.get("x").getInt(), minMap.get("y").getInt(), minMap.get("z").getInt()); + final Vector3i max = new Vector3i(maxMap.get("x").getInt(), maxMap.get("y").getInt(), maxMap.get("z").getInt()); + final boolean cuboid = min.getY() == 0 && max.getY() == 256 ? true : false; + newClaim = new GDClaim(world, min, max, claimUniqueId, type, owner == null ? null : owner.getUniqueId(), cuboid); + final ClaimResult claimResult = newClaim.checkArea(false); + if (!claimResult.successful()) { + GriefDefenderPlugin.getInstance().getLogger().info("Could not migrate region '" + rname + "' due to reason: " + claimResult.getResultType()); + continue; + } + + boolean validClaim = true; + Claim parentClaim = null; + Claim childClaim = null; + if (type != ClaimTypes.WILDERNESS) { + for (GDClaim claim : tempClaimList) { + // Search for parent + final ClaimResult result = newClaim.findParent(claim); + if (result.successful()) { + final Claim parent = result.getClaim().get(); + if (parent.isSubdivision()) { + // avoid creating child claim under subdivision + // instead create admin claim + break; + } + System.out.println("FOUND PARENT " + parent.getUniqueId() + ", type = " + parent.getType() + ", name = " + parent.getName().orElse(TextComponent.of("unknown"))); + if (parent.isBasicClaim() || parent.isAdminClaim()) { + parentClaim = parent; + if (type == ClaimTypes.BASIC) { + if (parent.isBasicClaim()) { + type = ClaimTypes.SUBDIVISION; + newClaim.setType(type); + } else { + type = ClaimTypes.BASIC; + newClaim.setType(type); + } + } + ((GDClaim) parent).children.add(newClaim); + newClaim.parent = (GDClaim) parent; + GriefDefenderPlugin.getInstance().getLogger().info("Found parent region '" + parent.getName().orElse(TextComponent.of("unknown")) + "'. Set current region '" + rname + "' as it's child."); + } else { + GriefDefenderPlugin.getInstance().getLogger().warning("Could not migrate region '" + rname + "' as it exceeds the maximum level supported by migrator. Skipping..."); + validClaim = false; + } + break; + } + // Search for child + if (claim.isInside(newClaim)) { + if (!claim.getParent().isPresent()) { + childClaim = claim; + claim.getClaimStorage().getConfig().setType(ClaimTypes.SUBDIVISION); + claim.getClaimStorage().getConfig().setParent(newClaim.getUniqueId()); + GriefDefenderPlugin.getInstance().getLogger().info("Found child region '" + claim.getName().orElse(TextComponent.of("unknown")) + "'. Set current region '" + rname + "' as it's parent."); + } + } + } + if (!validClaim) { + continue; + } + tempClaimList.add(newClaim); + } + + newClaim.initializeClaimData((GDClaim) parentClaim); + if (childClaim != null) { + // Migrate child to parent + ((GDClaim) newClaim).moveChildToParent(newClaim, (GDClaim) childClaim); + } + claimDataConfig = newClaim.getClaimStorage().getConfig(); + claimDataConfig.setName(TextComponent.of(rname)); + claimDataConfig.setWorldUniqueId(world.getUID()); + if (owner != null) { + claimDataConfig.setOwnerUniqueId(owner.getUniqueId()); + } + claimDataConfig.setLesserBoundaryCorner(BlockUtil.getInstance().posToString(min)); + claimDataConfig.setGreaterBoundaryCorner(BlockUtil.getInstance().posToString(max)); + claimDataConfig.setCuboid(cuboid); + claimDataConfig.setDateLastActive(Instant.now()); + claimDataConfig.setType(type); + } + claimDataConfig = newClaim.getClaimStorage().getConfig(); + + for (UUID builder : membersList) { + GDPermissionUser builderUser = null; + try { + builderUser = PermissionHolderCache.getInstance().getOrCreateUser(builder); + } catch (Throwable e) { + GriefDefenderPlugin.getInstance().getLogger().warning("Could not locate a valid UUID for user '" + builder + "' in region '" + rname + + "'. Skipping..."); + continue; + } + if (!claimDataConfig.getBuilders().contains(builderUser.getUniqueId()) && owner != null && !builderUser.getUniqueId().equals(owner.getUniqueId())) { + claimDataConfig.getBuilders().add(builderUser.getUniqueId()); + } + } + + for (UUID manager : managers) { + GDPermissionUser managerUser = null; + try { + managerUser = PermissionHolderCache.getInstance().getOrCreateUser(manager); + } catch (Throwable e) { + GriefDefenderPlugin.getInstance().getLogger().warning("Could not locate a valid UUID for user '" + manager + "' in region '" + rname + + "'. Skipping..."); + continue; + } + if (!claimDataConfig.getManagers().contains(managerUser.getUniqueId()) && owner != null && !managerUser.getUniqueId().equals(owner.getUniqueId())) { + claimDataConfig.getManagers().add(managerUser.getUniqueId()); + } + } + final Set contexts = new HashSet<>(); + contexts.add(newClaim.getContext()); + final Context sourcePlayer = new Context("source", "player"); + final Context sourceTnt = new Context("source", "tnt"); + final Context sourceCreeper = new Context("source", "creeper"); + final Context sourceEnderDragon = new Context("source", "enderdragon"); + final Context sourceGhast = new Context("source", "ghast"); + final Context sourceEnderman = new Context("source", "enderman"); + final Context sourceSnowman = new Context("source", "snowman"); + final Context sourceMonster = new Context("source", "monster"); + final Context sourceWither = new Context("source", "wither"); + final Context sourceLava = new Context("source", "flowing_lava"); + final Context sourceWater = new Context("source", "flowing_water"); + final Context sourceLightningBolt = new Context("source", "lightning_bolt"); + final Context sourceFall = new Context("source", "fall"); + final Context sourceFireworks = new Context("source", "fireworks"); + // migrate flags + for (Entry mapEntry : flagsMap.entrySet()) { + if (!(mapEntry.getKey() instanceof String)) { + continue; + } + final String flag = (String) mapEntry.getKey(); + ConfigurationNode valueNode = mapEntry.getValue(); + System.out.println("Found flag " + flag + " with val " + valueNode.getString()); + switch (flag) { + case "build": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_PLACE, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_PRIMARY, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ENTITY_PRIMARY, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ENTITY_SECONDARY, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_PLACE, Tristate.TRUE, contexts); + } + break; + case "interact": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_PRIMARY, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ENTITY_PRIMARY, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ENTITY_SECONDARY, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_PLACE, Tristate.TRUE, contexts); + } + break; + case "block-break": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.TRUE, contexts); + } + break; + case "block-place": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_PLACE, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_PLACE, Tristate.TRUE, contexts); + } + break; + case "use": + if (valueNode.getString().equals("allow")) { + newClaim.addUserTrust(GriefDefenderPlugin.PUBLIC_UUID, TrustTypes.ACCESSOR); + } + break; + case "damage-animals": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "animal", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "animal", Tristate.TRUE, contexts); + } + break; + case "chest-access": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, "chest", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, "chest", Tristate.TRUE, contexts); + } + break; + case "ride": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_RIDING, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_RIDING, Tristate.TRUE, contexts); + } + break; + case "pvp": + contexts.add(sourcePlayer); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "player", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "player", Tristate.TRUE, contexts); + } + contexts.remove(sourcePlayer); + break; + case "sleep": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, "bed", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, "bed", Tristate.TRUE, contexts); + } + break; + case "tnt": + contexts.add(sourceTnt); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_BLOCK, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_ENTITY, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_BLOCK, Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_ENTITY, Tristate.TRUE, contexts); + } + contexts.remove(sourceTnt); + break; + case "vehicle-place": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, "boat", Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, "minecart", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, "boat", Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_BLOCK_SECONDARY, "minecart", Tristate.TRUE, contexts); + } + break; + case "lighter": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ITEM_SECONDARY, "flint_and_steel", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ITEM_SECONDARY, "flint_and_steel", Tristate.TRUE, contexts); + } + break; + case "block-trampling": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.COLLIDE_BLOCK, "farmland", Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.COLLIDE_BLOCK, "turtle_egg", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.COLLIDE_BLOCK, "farmland", Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.COLLIDE_BLOCK, "turtle_egg", Tristate.TRUE, contexts); + } + break; + case "frosted-ice-form": + break; + case "creeper-explosion": + contexts.add(sourceCreeper); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_BLOCK, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_ENTITY, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_BLOCK, Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_ENTITY, Tristate.TRUE, contexts); + } + contexts.remove(sourceCreeper); + break; + case "enderdragon-block-damage": + contexts.add(sourceEnderDragon); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.TRUE, contexts); + } + contexts.remove(sourceEnderDragon); + break; + case "ghast-fireball": + contexts.add(sourceGhast); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.TRUE, contexts); + } + contexts.remove(sourceGhast); + break; + case "other-explosion": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_BLOCK, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_ENTITY, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_BLOCK, Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXPLOSION_ENTITY, Tristate.TRUE, contexts); + } + break; + case "fire-spread": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.FIRE_SPREAD, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.FIRE_SPREAD, Tristate.TRUE, contexts); + } + break; + case "enderman-grief": + contexts.add(sourceEnderman); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.TRUE, contexts); + } + contexts.remove(sourceEnderman); + break; + case "snowman-trail": + contexts.add(sourceSnowman); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.TRUE, contexts); + } + contexts.remove(sourceSnowman); + break; + case "mob-damage": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "monster", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "monster", Tristate.TRUE, contexts); + } + break; + case "mob-spawning": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_SPAWN, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_SPAWN, Tristate.TRUE, contexts); + } + break; + case "deny-spawn": + List entityTypes = valueNode.getList(TypeToken.of(String.class)); + for (String entityType : entityTypes) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_SPAWN, entityType, Tristate.FALSE, contexts); + } + break; + case "entity-painting-destroy": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "painting", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "painting", Tristate.TRUE, contexts); + } + break; + case "entity-item-frame-destroy": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "item_frame", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "item_frame", Tristate.TRUE, contexts); + } + break; + case "wither-damage": + contexts.add(sourceWither); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.FALSE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_BREAK, Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_MODIFY, Tristate.TRUE, contexts); + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.TRUE, contexts); + } + contexts.remove(sourceWither); + break; + case "lava-fire": + contexts.add(sourceLava); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.FIRE_SPREAD, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.FIRE_SPREAD, Tristate.TRUE, contexts); + } + contexts.remove(sourceLava); + break; + case "lightning": + contexts.add(sourceLightningBolt); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.TRUE, contexts); + } + contexts.remove(sourceLightningBolt); + break; + case "water-flow": + contexts.add(sourceWater); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.LIQUID_FLOW, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.LIQUID_FLOW, Tristate.TRUE, contexts); + } + contexts.remove(sourceWater); + break; + case "lava-flow": + contexts.add(sourceLava); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.LIQUID_FLOW, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.LIQUID_FLOW, Tristate.TRUE, contexts); + } + contexts.remove(sourceLava); + break; + case "snow-fall": + case "snow-melt": + case "ice-form": + case "ice-melt": + case "frosted-ice-melt": + break; + case "mushroom-growth": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_GROW, "mushroom", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_GROW, "mushroom", Tristate.TRUE, contexts); + } + break; + case "leaf-decay": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.LEAF_DECAY, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.LEAF_DECAY, Tristate.TRUE, contexts); + } + break; + case "grass-growth": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_GROW, "grass", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_GROW, "grass", Tristate.TRUE, contexts); + } + break; + case "mycelium-spread": + break; + case "vine-growth": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_GROW, "vine", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_GROW, "vine", Tristate.TRUE, contexts); + } + break; + case "crop-growth": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_GROW, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.BLOCK_GROW, Tristate.TRUE, contexts); + } + break; + case "soil-dry": + break; + case "entry": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTER_CLAIM, "player", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTER_CLAIM, "player", Tristate.TRUE, contexts); + } + break; + case "exit": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXIT_CLAIM, "player", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.EXIT_CLAIM, "player", Tristate.TRUE, contexts); + } + break; + // These can be handled via GD API + case "exit-override": + case "entry-deny-message": + case "exit-deny-message": + case "notify-enter": + case "notify-exit": + break; + case "greeting": + final String greeting = valueNode.getString(); + if (greeting != null && !greeting.equals("")) { + claimDataConfig.setGreeting(LegacyComponentSerializer.legacy().deserialize(greeting, '&')); + } + break; + case "farewell": + final String farewell = valueNode.getString(); + if (farewell != null && !farewell.equals("")) { + claimDataConfig.setFarewell(LegacyComponentSerializer.legacy().deserialize(farewell, '&')); + } + case "enderpearl": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ITEM_SECONDARY, "enderpearl", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ITEM_SECONDARY, "enderpearl", Tristate.TRUE, contexts); + } + break; + case "chorus-fruit-teleport": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ITEM_SECONDARY, "chorus_fruit", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.INTERACT_ITEM_SECONDARY, "chorus_fruit", Tristate.TRUE, contexts); + } + break; + case "teleport": + final String location = valueNode.getString(); + break; + case "spawn": + break; + case "item-pickup": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ITEM_PICKUP, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ITEM_PICKUP, Tristate.TRUE, contexts); + } + break; + case "item-drop": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ITEM_DROP, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ITEM_DROP, Tristate.TRUE, contexts); + } + break; + case "exp-drop": + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ITEM_DROP, "xp_orb", Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ITEM_DROP, "xp_orb", Tristate.TRUE, contexts); + } + break; + case "deny-message": + break; + case "invincible": + if (valueNode.getString().equals("allow")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, "player", Tristate.FALSE, contexts); + } + break; + case "fall-damage": + contexts.add(sourceFall); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.TRUE, contexts); + } + contexts.remove(sourceFall); + break; + case "firework-damage": + contexts.add(sourceFireworks); + if (valueNode.getString().equals("deny")) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.FALSE, contexts); + } else { + PERMISSION_MANAGER.setPermission(newClaim, Flags.ENTITY_DAMAGE, Tristate.TRUE, contexts); + } + contexts.remove(sourceFireworks); + break; + case "game-mode": + case "time-lock": + case "weather-lock": + case "heal-delay": + case "heal-amount": + case "heal-min-health": + case "heal-max-health": + case "feed-delay": + case "feed-amount": + case "feed-min-hunger": + case "feed-max-hunger": + break; + case "blocked-cmds": + List blocked = valueNode.getList(TypeToken.of(String.class)); + for (String cmd : blocked) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.COMMAND_EXECUTE, cmd, Tristate.FALSE, contexts); + } + break; + case "allowed-cmds": + List allowed = valueNode.getList(TypeToken.of(String.class)); + for (String cmd : allowed) { + PERMISSION_MANAGER.setPermission(newClaim, Flags.COMMAND_EXECUTE, cmd, Tristate.TRUE, contexts); + } + } + } + + claimDataConfig.setRequiresSave(true); + newClaim.getClaimStorage().save(); + GriefDefenderPlugin.getInstance().getLogger().info("Successfully migrated WorldGuard region data '" + rname + "' to '" + newClaim.getClaimStorage().filePath + "'"); + count++; + } + GriefDefenderPlugin.getInstance().getLogger().info("Finished WorldGuard region data migration for world '" + world.getName() + "'." + + " Migrated a total of " + count + " regions."); + } catch (IOException e) { + e.printStackTrace(); + } catch (ObjectMappingException e) { + e.printStackTrace(); + } + } +} diff --git a/bukkit/src/main/java/com/griefdefender/permission/GDFlag.java b/bukkit/src/main/java/com/griefdefender/permission/GDFlag.java index 6fb0e49..849f566 100644 --- a/bukkit/src/main/java/com/griefdefender/permission/GDFlag.java +++ b/bukkit/src/main/java/com/griefdefender/permission/GDFlag.java @@ -24,10 +24,13 @@ */ package com.griefdefender.permission; +import com.griefdefender.GriefDefenderPlugin; import com.griefdefender.api.claim.ClaimType; import com.griefdefender.api.claim.ClaimTypes; import com.griefdefender.api.permission.flag.Flag; import com.griefdefender.api.permission.flag.Flags; +import com.griefdefender.cache.MessageCache; + import net.kyori.text.Component; import net.kyori.text.TextComponent; import net.kyori.text.format.TextColor; @@ -70,354 +73,10 @@ public String toString() { } private Component createDescription() { - if (this == Flags.BLOCK_BREAK) { - return TextComponent.builder("") - .append("Controls whether a block can be broken.\n") - .append("Example 1", TextColor.LIGHT_PURPLE) - .append(" : To prevent any source from breaking dirt blocks, enter\n") - .append("/cf block-break minecraft:dirt false\n", TextColor.GREEN) - .append("Note", TextColor.AQUA) - .append(" : minecraft represents the modid and dirt represents the block id.\n" + - "Specifying no modid will always default to minecraft.\n") - .append("Example 2", TextColor.LIGHT_PURPLE) - .append(" : To prevent players from breaking dirt blocks, enter\n") - .append("/cf block-break minecraft:player minecraft:dirt false\n", TextColor.GREEN) - .build(); + final Component description = GriefDefenderPlugin.getInstance().messageData.getMessage("flag-description-" + this.name.toLowerCase()); + if (description != null) { + return description; } - if (this == Flags.BLOCK_GROW) { - return TextComponent.builder("") - .append("Controls whether a block can grow.\n") - .append("Example 1", TextColor.LIGHT_PURPLE) - .append(" : To prevent a cactus from growing, enter\n") - .append("/cf block-grow cactus false\n", TextColor.GREEN) - .build(); - } - if (this == Flags.BLOCK_MODIFY) { - return TextComponent.builder("") - .append("Controls whether a block can be modified.\n") - .append("Example 1", TextColor.LIGHT_PURPLE) - .append(" : To prevent any source from igniting a block, enter\n") - .append("/cf block-modify minecraft:fire false\n", TextColor.GREEN) - .append("Note", TextColor.AQUA) - .append(" : minecraft represents the modid and fire represents the block id.\n" + - "Specifying no modid will always default to minecraft.\n") - .build(); - } - if (this == Flags.BLOCK_PLACE) { - return TextComponent.builder("") - .append("Controls whether a block can be placed.\n") - .append("Example 1", TextColor.LIGHT_PURPLE) - .append(" : To prevent any source from placing dirt blocks, enter\n") - .append("/cf block-place minecraft:dirt false\n", TextColor.GREEN) - .append("Note", TextColor.AQUA) - .append(" : minecraft represents the modid and dirt represents the block id.\n" + - "Specifying no modid will always default to minecraft.\n") - .append("Example 2", TextColor.LIGHT_PURPLE) - .append(" : To prevent players from placing dirt blocks, enter\n") - .append("/cf block-place minecraft:player minecraft:dirt false\n", TextColor.GREEN) - .build(); - } - if (this == Flags.COLLIDE_BLOCK) { - return TextComponent.builder("") - .append("Controls whether an entity can collide with a block.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent entity collisions with dirt blocks, enter\n") - .append("/cf collide-block minecraft:dirt false", TextColor.GREEN) - .build(); - } - if (this == Flags.COLLIDE_ENTITY) { - return TextComponent.builder("") - .append("Controls whether an entity can collide with an entity.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent entity collisions with item frames, enter\n") - .append("/cf collide-entity minecraft:itemframe false", TextColor.GREEN) - .build(); - } - if (this == Flags.COMMAND_EXECUTE) { - return TextComponent.builder("") - .append("Controls whether a command can be executed.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent pixelmon's command '/shop select' from being run, enter\n") - .append("/cf command-execute pixelmon:shop[select] false\n", TextColor.GREEN) - .append("Note", TextColor.AQUA) - .append(" : ") - .append(TextComponent.of("pixelmon", TextColor.GOLD).decoration(TextDecoration.ITALIC, true)) - .append(" represents the modid, ") - .append(TextComponent.of("shop", TextColor.GOLD).decoration(TextDecoration.ITALIC, true)) - .append(" represents the base command, and ") - .append(TextComponent.of("select", TextColor.GOLD).decoration(TextDecoration.ITALIC, true)) - .append(" represents the argument.\nSpecifying no modid will always default to minecraft.\n") - .build(); - } - if (this == Flags.COMMAND_EXECUTE_PVP) { - return TextComponent.builder("") - .append("Controls whether a command can be executed while engaged in ") - .append("PvP.\n", TextColor.RED) - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent pixelmon's command '/shop select' from being run, enter\n") - .append("/cf command-execute pixelmon:shop[select] false\n", TextColor.GREEN) - .append("Note", TextColor.AQUA) - .append(" : ") - .append(TextComponent.of("pixelmon", TextColor.GOLD).decoration(TextDecoration.ITALIC, true)) - .append(" represents the modid, ") - .append(TextComponent.of("shop", TextColor.GOLD).decoration(TextDecoration.ITALIC, true)) - .append(" represents the base command, and ") - .append(TextComponent.of("select", TextColor.GOLD).decoration(TextDecoration.ITALIC, true)) - .append(" represents the argument.\nSpecifying no modid will always default to minecraft.\n") - .build(); - } - if (this == Flags.ENTER_CLAIM) { - return TextComponent.builder("") - .append("Controls whether an entity can enter claim.\n") - .append("Note", TextColor.AQUA) - .append(" : If you want to use this for players, it is recommended to use \nthe '/cfg' command with the group the player is in.") - .build(); - } - if (this == Flags.ENTITY_CHUNK_SPAWN) { - return TextComponent.builder("") - .append("Controls whether an entity can be spawned during chunk load.\n") - .append("Note", TextColor.AQUA) - .append(" : This will remove all saved entities within a chunk after it loads.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent horses from spawning in chunks enter\n") - .append("/cf entity-chunk-spawn minecraft:horse false", TextColor.GREEN) - .build(); - } - if (this == Flags.ENTITY_DAMAGE) { - return TextComponent.builder("") - .append("Controls whether an entity can be damaged.\n") - .append("Example 1", TextColor.LIGHT_PURPLE) - .append(" : To prevent horses from being damaged, enter\n") - .append("/cf entity-damage minecraft:horse false\n", TextColor.GREEN) - .append("Example 2", TextColor.LIGHT_PURPLE) - .append(" : To prevent all animals from being damaged, enter\n") - .append("/cf entity-damage minecraft:animals false", TextColor.GREEN) - .build(); - } - if (this == Flags.ENTITY_RIDING) { - return TextComponent.builder("") - .append("Controls whether an entity can be mounted.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent horses from being mounted enter\n") - .append("/cf entity-riding minecraft:horse false", TextColor.GREEN) - .build(); - } - if (this == Flags.ENTITY_SPAWN) { - return TextComponent.builder("") - .append("Controls whether an entity can be spawned into the world.\n") - .append("Note", TextColor.AQUA) - .append(" : This does not include entity items. See item-spawn flag.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent horses from spawning enter\n") - .append("/cf entity-spawn minecraft:horse false", TextColor.GREEN) - .build(); - } - if (this == Flags.ENTITY_TELEPORT_FROM) { - return TextComponent.builder("") - .append("Controls whether an entity can teleport from their current location.\n") - .append("Note", TextColor.AQUA) - .append(" : If you want to use this for players, it is recommended to use \n") - .append("the '/cfg' command with the group the player is in.") - .build(); - } - if (this == Flags.ENTITY_TELEPORT_TO) { - return TextComponent.builder("") - .append("Controls whether an entity can teleport to a location.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent creepers from traveling and/or teleporting within your claim, enter\n") - .append("/cf entity-teleport-to minecraft:creeper false\n", TextColor.GREEN) - .append("Note", TextColor.AQUA) - .append(" : If you want to use this for players, it is recommended to use \n") - .append("the '/cfg' command with the group the player is in.") - .build(); - } - if (this == Flags.EXIT_CLAIM) { - return TextComponent.builder("") - .append("Controls whether an entity can exit claim.\n") - .append("Note", TextColor.AQUA) - .append(" : If you want to use this for players, it is recommended to use \n") - .append("the '/cfg' command with the group the player is in.") - .build(); - } - if (this == Flags.EXPLOSION_BLOCK) { - return TextComponent.builder("") - .append("Controls whether an explosion can damage blocks in the world.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent an explosion from affecting blocks, enter\n") - .append("/cf explosion-block any false", TextColor.GREEN) - .build(); - } - if (this == Flags.EXPLOSION_ENTITY) { - return TextComponent.builder("") - .append("Controls whether an explosion can damage entities in the world.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent an explosion from affecting entities, enter\n") - .append("/cf explosion-entity any false", TextColor.GREEN) - .build(); - } - if (this == Flags.FIRE_SPREAD) { - return TextComponent.builder("") - .append("Controls whether fire can spread in a world.\n") - .append("Note", TextColor.AQUA) - .append(" : This does not prevent the initial fire being placed, only spread.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent fire from spreading, enter\n") - .append("/cf fire-spread any false", TextColor.GREEN) - .build(); - } - if (this == Flags.INTERACT_BLOCK_PRIMARY) { - return TextComponent.builder("") - .append("Controls whether a player can left-click(attack) a block.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent players from left-clicking chests, enter\n") - .append("/cf interact-block-primary minecraft:chest false", TextColor.GREEN) - .build(); - } - if (this == Flags.INTERACT_BLOCK_SECONDARY) { - return TextComponent.builder("") - .append("Controls whether a player can right-click a block.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent players from right-clicking(opening) chests, enter\n") - .append("/cf interact-block-secondary minecraft:chest false", TextColor.GREEN) - .build(); - } - if (this == Flags.INTERACT_ENTITY_PRIMARY) { - return TextComponent.builder("") - .append("Controls whether a player can left-click(attack) an entity.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent players from left-clicking horses, enter\n") - .append("/cf interact-entity-primary minecraft:player minecraft:horse false\n", TextColor.GREEN) - .build(); - } - if (this == Flags.INTERACT_ENTITY_SECONDARY) { - return TextComponent.builder("") - .append("Controls whether a player can right-click on an entity.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent horses from being mounted, enter\n") - .append("/cf interact-entity-secondary minecraft:horse false\n", TextColor.GREEN) - .append("Note", TextColor.AQUA) - .append(" : minecraft represents the modid and horse represents the entity id.\n") - .append("Specifying no modid will always default to minecraft.\n") - .build(); - } - if (this == Flags.INTERACT_INVENTORY) { - return TextComponent.builder("") - .append("Controls whether a player can right-click with a block that contains inventory such as a chest.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent players from right-clicking any block that contains inventory, enter\n") - .append("/cf interact-inventory any false", TextColor.GREEN) - .build(); - } - if (this == Flags.INTERACT_INVENTORY_CLICK) { - return TextComponent.builder("") - .append("Controls whether a player can click on an inventory slot.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent players from clicking an inventory slot that contains diamond, enter\n") - .append("/cf interact-inventory-click minecraft:diamond false", TextColor.GREEN) - .build(); - } - if (this == Flags.INTERACT_ITEM_PRIMARY) { - return TextComponent.builder("") - .append("Controls whether a player can left-click(attack) with an item.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent players from left-clicking while holding a diamond sword, enter\n") - .append("/cf interact-item-primary minecraft:diamond_sword false", TextColor.GREEN) - .build(); - } - if (this == Flags.INTERACT_ITEM_SECONDARY) { - return TextComponent.builder("") - .append("Controls whether a player can right-click with an item.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent players from right-clicking while holding a flint and steel, enter\n") - .append("/cf interact-item-secondary minecraft:flint_and_steel false", TextColor.GREEN) - .build(); - } - if (this == Flags.ITEM_DROP) { - return TextComponent.builder("") - .append("Controls whether an item can be dropped.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent tnt from dropping in the world, enter\n") - .append("/cf item-drop minecraft:tnt false", TextColor.GREEN) - .build(); - } - if (this == Flags.ITEM_PICKUP) { - return TextComponent.builder("") - .append("Controls whether an item can be picked up.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent tnt from dropping in the world, enter\n") - .append("/cf item-drop minecraft:tnt false", TextColor.GREEN) - .build(); - } - if (this == Flags.ITEM_SPAWN) { - return TextComponent.builder("") - .append("Controls whether an item can be spawned into the world up.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent feather's from dropping in the world, enter\n") - .append("/cf item-drop minecraft:feather false", TextColor.GREEN) - .build(); - } - if (this == Flags.ITEM_USE) { - return TextComponent.builder("") - .append("Controls whether an item can be used.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent usage of diamond swords, enter\n") - .append("/cf item-use minecraft:diamond_sword false", TextColor.GREEN) - .build(); - } - if (this == Flags.LEAF_DECAY) { - return TextComponent.builder("") - .append("Controls whether leaves can decay in a world.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent leaves from decaying, enter\n") - .append("/cf leaf-decay any false", TextColor.GREEN) - .build(); - } - if (this == Flags.LIQUID_FLOW) { - return TextComponent.builder("") - .append("Controls whether liquid is allowed to flow.\n") - .append("Example", TextColor.LIGHT_PURPLE) - .append(" : To prevent liquid flow, enter\n") - .append("/cf liquid-flow any false", TextColor.GREEN) - .build(); - } - if (this == Flags.PORTAL_USE) { - return TextComponent.builder("") - .append("Controls whether a portal can be used.\n") - .append("Example 1", TextColor.LIGHT_PURPLE) - .append(" : To prevent any source from using portals, enter\n") - .append("/cf portal-use any false\n", TextColor.GREEN) - .append("Example 2", TextColor.LIGHT_PURPLE) - .append(" : To prevent only players from using portals, enter\n") - .append("/cf portal-use minecraft:player any false", TextColor.GREEN) - .build(); - } - if (this == Flags.PROJECTILE_IMPACT_BLOCK) { - return TextComponent.builder("") - .append("Controls whether a projectile can impact(collide) with a block.\n") - .append("Note", TextColor.AQUA) - .append(" : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc.\n") - .append("Example 1", TextColor.LIGHT_PURPLE) - .append(" : To prevent any projectile from impacting a block, enter\n") - .append("/cf projectile-impact-block any false\n", TextColor.GREEN) - .append("Example 2", TextColor.LIGHT_PURPLE) - .append(" : To allow pixelmon pokeball's to impact blocks, enter\n") - .append("/cf projectile-impact-block pixelmon:occupiedpokeball any true", TextColor.GREEN) - .build(); - } - if (this == Flags.PROJECTILE_IMPACT_ENTITY) { - return TextComponent.builder("") - .append("Controls whether a projectile can impact(collide) with an entity.\n") - .append("Note", TextColor.AQUA) - .append(" : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc.\n") - .append("Example 1", TextColor.LIGHT_PURPLE) - .append(" : To prevent any projectile from impacting an entity, enter\n") - .append("/cf projectile-impact-entity any false\n", TextColor.GREEN) - .append("Example 2", TextColor.LIGHT_PURPLE) - .append(" : To allow arrows to impact entities, enter\n") - .append("/cf projectile-impact-entity minecraft:arrow any true", TextColor.GREEN) - .build(); - } - return TextComponent.of("Not defined."); } diff --git a/bukkit/src/main/java/com/griefdefender/permission/GDFlags.java b/bukkit/src/main/java/com/griefdefender/permission/GDFlags.java index 58b140b..4f5d384 100644 --- a/bukkit/src/main/java/com/griefdefender/permission/GDFlags.java +++ b/bukkit/src/main/java/com/griefdefender/permission/GDFlags.java @@ -52,9 +52,9 @@ public class GDFlags { public static boolean INTERACT_BLOCK_SECONDARY; public static boolean INTERACT_ENTITY_PRIMARY; public static boolean INTERACT_ENTITY_SECONDARY; - public static boolean INTERACT_INVENTORY; public static boolean INTERACT_ITEM_PRIMARY; public static boolean INTERACT_ITEM_SECONDARY; + public static boolean INTERACT_INVENTORY; public static boolean INTERACT_INVENTORY_CLICK; public static boolean ITEM_DROP; public static boolean ITEM_PICKUP; diff --git a/bukkit/src/main/java/com/griefdefender/permission/GDOption.java b/bukkit/src/main/java/com/griefdefender/permission/GDOption.java index 11b5ff6..24f67a9 100644 --- a/bukkit/src/main/java/com/griefdefender/permission/GDOption.java +++ b/bukkit/src/main/java/com/griefdefender/permission/GDOption.java @@ -33,7 +33,7 @@ public class GDOption implements Option { private static final List GLOBAL_OPTIONS = Arrays.asList( - "blocks-accrued-per-hour", "chest-expiration", + "abandon-return-ratio", "blocks-accrued-per-hour", "chest-expiration", "create-mode", "economy-block-cost", "economy-block-sell", "initial-blocks", "max-accrued-blocks", "max-level", "min-level", diff --git a/bukkit/src/main/java/com/griefdefender/permission/GDPermissionManager.java b/bukkit/src/main/java/com/griefdefender/permission/GDPermissionManager.java index fb3cfd0..e16efce 100644 --- a/bukkit/src/main/java/com/griefdefender/permission/GDPermissionManager.java +++ b/bukkit/src/main/java/com/griefdefender/permission/GDPermissionManager.java @@ -40,10 +40,10 @@ import com.griefdefender.api.permission.flag.Flag; import com.griefdefender.api.permission.flag.Flags; import com.griefdefender.api.permission.option.Option; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.command.CommandHelper; -import com.griefdefender.configuration.MessageStorage; import com.griefdefender.event.GDCauseStackManager; import com.griefdefender.event.GDFlagClaimEvent; import com.griefdefender.internal.registry.BlockTypeRegistryModule; @@ -372,7 +372,7 @@ private Tristate getFlagOverride(Claim claim, GDPermissionHolder permissionHolde } } if (value == Tristate.FALSE) { - this.eventMessage = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_OVERRIDE_DENY); + this.eventMessage = MessageCache.getInstance().PERMISSION_OVERRIDE_DENY; } return processResult(claim, flagPermission, value, permissionHolder); } @@ -671,7 +671,7 @@ public CompletableFuture setPermission(Claim claim, GDPermissi } else if (subject == GriefDefenderPlugin.DEFAULT_HOLDER) { subjectName = "ALL"; } - //result.complete(CommandHelper.addFlagPermission(commandSource, subject, subjectName, claim, flag, target, value, contexts)); + result.complete(CommandHelper.addFlagPermission(commandSource, subject, subjectName, claim, flag, target, value, contexts)); return result; } @@ -779,66 +779,27 @@ public Optional getOptionValue(String identifier, Option option, Set 0) { Location lastLocation = playerData.lastAfkCheckLocation; // if he's not in a vehicle and has moved at least three blocks since the last check and he's not being pushed around by fluids diff --git a/bukkit/src/main/java/com/griefdefender/util/CauseContextHelper.java b/bukkit/src/main/java/com/griefdefender/util/CauseContextHelper.java index c1faa67..2812088 100644 --- a/bukkit/src/main/java/com/griefdefender/util/CauseContextHelper.java +++ b/bukkit/src/main/java/com/griefdefender/util/CauseContextHelper.java @@ -28,9 +28,9 @@ import com.griefdefender.api.claim.Claim; import com.griefdefender.api.claim.ClaimContexts; import com.griefdefender.api.permission.Context; +import com.griefdefender.cache.MessageCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.claim.GDClaimManager; -import com.griefdefender.configuration.MessageStorage; import com.griefdefender.internal.registry.GDItemType; import com.griefdefender.internal.registry.ItemTypeRegistryModule; import com.griefdefender.internal.tracking.chunk.GDChunk; @@ -134,7 +134,7 @@ public static Set generateContexts(CommandSender src, Claim claim, Stri contextSet.add(new Context(contextName, arg1)); } else if (contextName.equals("default")) { if (!canManageDefaults) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_FLAG_DEFAULTS)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().PERMISSION_FLAG_DEFAULTS); return new HashSet<>(); } if (arg1.equals("any")) { @@ -157,7 +157,7 @@ public static Set generateContexts(CommandSender src, Claim claim, Stri return null; } if (!canManageOverrides) { - GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_FLAG_OVERRIDES)); + GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().PERMISSION_FLAG_OVERRIDES); return null; } if (arg1.equals("any")) { diff --git a/bukkit/src/main/java/com/griefdefender/util/EconomyUtil.java b/bukkit/src/main/java/com/griefdefender/util/EconomyUtil.java index 0894c37..bc38656 100644 --- a/bukkit/src/main/java/com/griefdefender/util/EconomyUtil.java +++ b/bukkit/src/main/java/com/griefdefender/util/EconomyUtil.java @@ -33,6 +33,7 @@ import com.griefdefender.api.claim.ClaimResultType; import com.griefdefender.api.claim.ClaimType; import com.griefdefender.api.permission.option.Options; +import com.griefdefender.cache.MessageCache; import com.griefdefender.cache.PermissionHolderCache; import com.griefdefender.claim.GDClaim; import com.griefdefender.command.CommandHelper; @@ -71,7 +72,7 @@ public void economyCreateClaimConfirmation(Player player, GDPlayerData playerDat claim.parent = (GDClaim) parent; final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(player); final int claimCost = BlockUtil.getInstance().getClaimBlockCost(player.getWorld(), claim.lesserBoundaryCorner, claim.greaterBoundaryCorner, claim.cuboid); - final Double economyBlockCost = GDPermissionManager.getInstance().getGlobalInternalOptionValue(user, Options.ECONOMY_BLOCK_COST, claim, playerData); + final Double economyBlockCost = GDPermissionManager.getInstance().getInternalOptionValue(user, Options.ECONOMY_BLOCK_COST, claim, playerData); final double requiredFunds = claimCost * economyBlockCost; final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_CONFIRMED, ImmutableMap.of( "amount", requiredFunds)); @@ -101,7 +102,7 @@ private Consumer economyClaimBuyConfirmed(Player player, GDPlayer if (!result.successful()) { if (result.getResultType() == ClaimResultType.OVERLAPPING_CLAIM) { GDClaim overlapClaim = (GDClaim) result.getClaim().get(); - GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_OVERLAP_SHORT)); + GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_OVERLAP_SHORT); Set claims = new HashSet<>(); claims.add(overlapClaim); CommandHelper.showClaims(player, claims, height, true); diff --git a/bukkit/src/main/resources/1.12.2.json b/bukkit/src/main/resources/1.12.2.json index b0edb8b..de64166 100644 --- a/bukkit/src/main/resources/1.12.2.json +++ b/bukkit/src/main/resources/1.12.2.json @@ -45,12 +45,6 @@ "path": "co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar", "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar" }, - { - "name": "co.aikar:acf-jda:0.5.0-SNAPSHOT", - "sha1": "08490f017eec96db1e84ebf74e5dee803462782f", - "path": "co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar", - "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar" - }, { "name": "co.aikar:locales:1.0-SNAPSHOT", "sha1": "09c89ff1a611600186edf8482d1059544875582b", @@ -217,11 +211,11 @@ "url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar" }, { - "name": "net.kyori:text-adapter-bukkit:3.0.2", - "sha1": "756bc77013e70a256652a9a399d18d6bffd21300", - "path": "net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar", + "name": "net.kyori:text-adapter-bukkit:3.0.3", + "sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3", + "path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar" }, { "name": "net.kyori:text-adapter-bungeecord:3.0.2", @@ -238,32 +232,32 @@ "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar" }, { - "name": "net.kyori:text-api:3.0.1", - "sha1": "664de5e3f01adad302adb0bd1d7933203463caba", - "path": "net/kyori/text-api/3.0.1/text-api-3.0.1.jar", + "name": "net.kyori:text-api:3.0.2", + "sha1": "608cdb44a74bbd68745941760df730ed55e4b47c", + "path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.1/text-api-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-gson:3.0.1", - "sha1": "e3c395e7ed613b48f6d4963c5127307b3e3666bb", - "path": "net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar", + "name": "net.kyori:text-serializer-gson:3.0.2", + "sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e", + "path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-legacy:3.0.1", - "sha1": "6fdbf35ca215180bd65a9a8805374a4c35b86cff", - "path": "net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar", + "name": "net.kyori:text-serializer-legacy:3.0.2", + "sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5", + "path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-plain:3.0.1", - "sha1": "3b7624310a8377e0ce38279244a256ebdb52b68e", - "path": "net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar", + "name": "net.kyori:text-serializer-plain:3.0.2", + "sha1": "8d60703f579019f7c26959d2e46501c3d389b48d", + "path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar" } ] } \ No newline at end of file diff --git a/bukkit/src/main/resources/1.13.2.json b/bukkit/src/main/resources/1.13.2.json index f92df14..a1d776f 100644 --- a/bukkit/src/main/resources/1.13.2.json +++ b/bukkit/src/main/resources/1.13.2.json @@ -57,12 +57,6 @@ "path": "co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar", "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar" }, - { - "name": "co.aikar:acf-jda:0.5.0-SNAPSHOT", - "sha1": "08490f017eec96db1e84ebf74e5dee803462782f", - "path": "co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar", - "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar" - }, { "name": "co.aikar:locales:1.0-SNAPSHOT", "sha1": "09c89ff1a611600186edf8482d1059544875582b", @@ -229,11 +223,11 @@ "url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar" }, { - "name": "net.kyori:text-adapter-bukkit:3.0.2", - "sha1": "756bc77013e70a256652a9a399d18d6bffd21300", - "path": "net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar", + "name": "net.kyori:text-adapter-bukkit:3.0.3", + "sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3", + "path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar" }, { "name": "net.kyori:text-adapter-bungeecord:3.0.2", @@ -250,32 +244,32 @@ "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar" }, { - "name": "net.kyori:text-api:3.0.1", - "sha1": "664de5e3f01adad302adb0bd1d7933203463caba", - "path": "net/kyori/text-api/3.0.1/text-api-3.0.1.jar", + "name": "net.kyori:text-api:3.0.2", + "sha1": "608cdb44a74bbd68745941760df730ed55e4b47c", + "path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.1/text-api-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-gson:3.0.1", - "sha1": "e3c395e7ed613b48f6d4963c5127307b3e3666bb", - "path": "net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar", + "name": "net.kyori:text-serializer-gson:3.0.2", + "sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e", + "path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-legacy:3.0.1", - "sha1": "6fdbf35ca215180bd65a9a8805374a4c35b86cff", - "path": "net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar", + "name": "net.kyori:text-serializer-legacy:3.0.2", + "sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5", + "path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-plain:3.0.1", - "sha1": "3b7624310a8377e0ce38279244a256ebdb52b68e", - "path": "net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar", + "name": "net.kyori:text-serializer-plain:3.0.2", + "sha1": "8d60703f579019f7c26959d2e46501c3d389b48d", + "path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar" } ] } \ No newline at end of file diff --git a/bukkit/src/main/resources/1.14.2.json b/bukkit/src/main/resources/1.14.2.json index 576af86..816dde9 100644 --- a/bukkit/src/main/resources/1.14.2.json +++ b/bukkit/src/main/resources/1.14.2.json @@ -57,12 +57,6 @@ "path": "co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar", "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar" }, - { - "name": "co.aikar:acf-jda:0.5.0-SNAPSHOT", - "sha1": "08490f017eec96db1e84ebf74e5dee803462782f", - "path": "co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar", - "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar" - }, { "name": "co.aikar:locales:1.0-SNAPSHOT", "sha1": "09c89ff1a611600186edf8482d1059544875582b", @@ -229,11 +223,11 @@ "url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar" }, { - "name": "net.kyori:text-adapter-bukkit:3.0.2", - "sha1": "756bc77013e70a256652a9a399d18d6bffd21300", - "path": "net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar", + "name": "net.kyori:text-adapter-bukkit:3.0.3", + "sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3", + "path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar" }, { "name": "net.kyori:text-adapter-bungeecord:3.0.2", @@ -250,32 +244,32 @@ "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar" }, { - "name": "net.kyori:text-api:3.0.1", - "sha1": "664de5e3f01adad302adb0bd1d7933203463caba", - "path": "net/kyori/text-api/3.0.1/text-api-3.0.1.jar", + "name": "net.kyori:text-api:3.0.2", + "sha1": "608cdb44a74bbd68745941760df730ed55e4b47c", + "path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.1/text-api-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-gson:3.0.1", - "sha1": "e3c395e7ed613b48f6d4963c5127307b3e3666bb", - "path": "net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar", + "name": "net.kyori:text-serializer-gson:3.0.2", + "sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e", + "path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-legacy:3.0.1", - "sha1": "6fdbf35ca215180bd65a9a8805374a4c35b86cff", - "path": "net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar", + "name": "net.kyori:text-serializer-legacy:3.0.2", + "sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5", + "path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-plain:3.0.1", - "sha1": "3b7624310a8377e0ce38279244a256ebdb52b68e", - "path": "net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar", + "name": "net.kyori:text-serializer-plain:3.0.2", + "sha1": "8d60703f579019f7c26959d2e46501c3d389b48d", + "path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar" } ] } \ No newline at end of file diff --git a/bukkit/src/main/resources/1.14.3.json b/bukkit/src/main/resources/1.14.3.json index 86b9f7f..c7cad0e 100644 --- a/bukkit/src/main/resources/1.14.3.json +++ b/bukkit/src/main/resources/1.14.3.json @@ -57,12 +57,6 @@ "path": "co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar", "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar" }, - { - "name": "co.aikar:acf-jda:0.5.0-SNAPSHOT", - "sha1": "08490f017eec96db1e84ebf74e5dee803462782f", - "path": "co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar", - "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar" - }, { "name": "co.aikar:locales:1.0-SNAPSHOT", "sha1": "09c89ff1a611600186edf8482d1059544875582b", @@ -229,11 +223,11 @@ "url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar" }, { - "name": "net.kyori:text-adapter-bukkit:3.0.2", - "sha1": "756bc77013e70a256652a9a399d18d6bffd21300", - "path": "net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar", + "name": "net.kyori:text-adapter-bukkit:3.0.3", + "sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3", + "path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar" }, { "name": "net.kyori:text-adapter-bungeecord:3.0.2", @@ -250,32 +244,32 @@ "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar" }, { - "name": "net.kyori:text-api:3.0.1", - "sha1": "664de5e3f01adad302adb0bd1d7933203463caba", - "path": "net/kyori/text-api/3.0.1/text-api-3.0.1.jar", + "name": "net.kyori:text-api:3.0.2", + "sha1": "608cdb44a74bbd68745941760df730ed55e4b47c", + "path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.1/text-api-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-gson:3.0.1", - "sha1": "e3c395e7ed613b48f6d4963c5127307b3e3666bb", - "path": "net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar", + "name": "net.kyori:text-serializer-gson:3.0.2", + "sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e", + "path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-legacy:3.0.1", - "sha1": "6fdbf35ca215180bd65a9a8805374a4c35b86cff", - "path": "net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar", + "name": "net.kyori:text-serializer-legacy:3.0.2", + "sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5", + "path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-plain:3.0.1", - "sha1": "3b7624310a8377e0ce38279244a256ebdb52b68e", - "path": "net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar", + "name": "net.kyori:text-serializer-plain:3.0.2", + "sha1": "8d60703f579019f7c26959d2e46501c3d389b48d", + "path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar" } ] } \ No newline at end of file diff --git a/bukkit/src/main/resources/1.14.4.json b/bukkit/src/main/resources/1.14.4.json index 148d93a..6b34d58 100644 --- a/bukkit/src/main/resources/1.14.4.json +++ b/bukkit/src/main/resources/1.14.4.json @@ -57,12 +57,6 @@ "path": "co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar", "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar" }, - { - "name": "co.aikar:acf-jda:0.5.0-SNAPSHOT", - "sha1": "08490f017eec96db1e84ebf74e5dee803462782f", - "path": "co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar", - "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar" - }, { "name": "co.aikar:locales:1.0-SNAPSHOT", "sha1": "09c89ff1a611600186edf8482d1059544875582b", @@ -229,11 +223,11 @@ "url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar" }, { - "name": "net.kyori:text-adapter-bukkit:3.0.2", - "sha1": "756bc77013e70a256652a9a399d18d6bffd21300", - "path": "net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar", + "name": "net.kyori:text-adapter-bukkit:3.0.3", + "sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3", + "path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar" }, { "name": "net.kyori:text-adapter-bungeecord:3.0.2", @@ -250,32 +244,32 @@ "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar" }, { - "name": "net.kyori:text-api:3.0.1", - "sha1": "664de5e3f01adad302adb0bd1d7933203463caba", - "path": "net/kyori/text-api/3.0.1/text-api-3.0.1.jar", + "name": "net.kyori:text-api:3.0.2", + "sha1": "608cdb44a74bbd68745941760df730ed55e4b47c", + "path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.1/text-api-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-gson:3.0.1", - "sha1": "e3c395e7ed613b48f6d4963c5127307b3e3666bb", - "path": "net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar", + "name": "net.kyori:text-serializer-gson:3.0.2", + "sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e", + "path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-legacy:3.0.1", - "sha1": "6fdbf35ca215180bd65a9a8805374a4c35b86cff", - "path": "net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar", + "name": "net.kyori:text-serializer-legacy:3.0.2", + "sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5", + "path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-plain:3.0.1", - "sha1": "3b7624310a8377e0ce38279244a256ebdb52b68e", - "path": "net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar", + "name": "net.kyori:text-serializer-plain:3.0.2", + "sha1": "8d60703f579019f7c26959d2e46501c3d389b48d", + "path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar" } ] } \ No newline at end of file diff --git a/bukkit/src/main/resources/1.8.8.json b/bukkit/src/main/resources/1.8.8.json index f2b3cae..327a0e4 100644 --- a/bukkit/src/main/resources/1.8.8.json +++ b/bukkit/src/main/resources/1.8.8.json @@ -45,12 +45,6 @@ "path": "co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar", "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar" }, - { - "name": "co.aikar:acf-jda:0.5.0-SNAPSHOT", - "sha1": "08490f017eec96db1e84ebf74e5dee803462782f", - "path": "co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar", - "url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-jda/0.5.0-SNAPSHOT/acf-jda-0.5.0-20190617.211140-70.jar" - }, { "name": "co.aikar:locales:1.0-SNAPSHOT", "sha1": "09c89ff1a611600186edf8482d1059544875582b", @@ -217,11 +211,11 @@ "url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar" }, { - "name": "net.kyori:text-adapter-bukkit:3.0.2", - "sha1": "756bc77013e70a256652a9a399d18d6bffd21300", - "path": "net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar", + "name": "net.kyori:text-adapter-bukkit:3.0.3", + "sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3", + "path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.2/text-adapter-bukkit-3.0.2.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar" }, { "name": "net.kyori:text-adapter-bungeecord:3.0.2", @@ -238,32 +232,32 @@ "url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar" }, { - "name": "net.kyori:text-api:3.0.1", - "sha1": "664de5e3f01adad302adb0bd1d7933203463caba", - "path": "net/kyori/text-api/3.0.1/text-api-3.0.1.jar", + "name": "net.kyori:text-api:3.0.2", + "sha1": "608cdb44a74bbd68745941760df730ed55e4b47c", + "path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.1/text-api-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-gson:3.0.1", - "sha1": "e3c395e7ed613b48f6d4963c5127307b3e3666bb", - "path": "net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar", + "name": "net.kyori:text-serializer-gson:3.0.2", + "sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e", + "path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.1/text-serializer-gson-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-legacy:3.0.1", - "sha1": "6fdbf35ca215180bd65a9a8805374a4c35b86cff", - "path": "net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar", + "name": "net.kyori:text-serializer-legacy:3.0.2", + "sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5", + "path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.1/text-serializer-legacy-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar" }, { - "name": "net.kyori:text-serializer-plain:3.0.1", - "sha1": "3b7624310a8377e0ce38279244a256ebdb52b68e", - "path": "net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar", + "name": "net.kyori:text-serializer-plain:3.0.2", + "sha1": "8d60703f579019f7c26959d2e46501c3d389b48d", + "path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar", "relocate": "net.kyori:kyori", - "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.1/text-serializer-plain-3.0.1.jar" + "url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar" } ] } \ No newline at end of file diff --git a/bukkit/src/main/resources/assets/lang/de_DE.conf b/bukkit/src/main/resources/assets/lang/de_DE.conf new file mode 100644 index 0000000..e33093c --- /dev/null +++ b/bukkit/src/main/resources/assets/lang/de_DE.conf @@ -0,0 +1,466 @@ +GriefDefender { + descriptions { + abandon-all="Abandons ALL your claims." + abandon-claim="Abandons a claim." + abandon-top="Abandons top level claim." + buy-blocks="Purchases additional claim blocks with server money.\nNote: Requires economy plugin." + callback="Execute a callback registered as part of a Text object. Primarily for internal use." + claim-bank="Used to withdraw or deposit money for use in claim." + claim-clear="Allows clearing of entities within one or more claims." + claim-debug="Toggles claim flag debug mode." + claim-farewell="Sets the farewell message of your claim." + claim-greeting="Sets the greeting message of your claim." + claim-ignore="Toggles ignore claims mode." + claim-info="Displays all known information for claim you are standing in." + claim-inherit="Toggles whether this claim should inherit permissions from parent(s)." + claim-list="Lists all known claims in area." + claim-name="Sets the claim name." + claim-restore="Restores claim to its natural state. Use with caution." + claim-setspawn="Sets the claim spawn for players." + claim-spawn="Teleports you to claim spawn if available." + claim-transfer="Transfers a basic or admin claim to another player." + claim-worldedit="Uses the worldedit selection to create a claim." + cuboid="Toggles cuboid claims mode." + debug="Captures all GD actions for debugging purposes." + delete-all="Delete all of another player's claims." + delete-all-admin="Deletes all administrative claims." + delete-claim="Deletes the claim you're standing in, even if it's not your claim." + delete-top="Deletes the claim you're standing in, even if it's not your claim." + flag-claim="Gets/Sets claim flags in the claim you are standing in." + flag-group="Gets/Sets flag permission for a group in claim you are standing in." + flag-player="Gets/Sets flag permission for a player in claim you are standing in." + flag-reset="Resets a claim to flag defaults." + mode-admin="Switches the shovel tool to administrative claims mode" + mode-basic="Switches the shovel tool back to basic claims mode." + mode-nature="Switches the shovel tool to restoration mode." + mode-subdivision="Switches the shovel tool to subdivision mode, used to subdivide your claims." + mode-town="Switches the shovel tool to town claims mode." + option-claim="Gets/Sets claim options in the claim you are standing in." + permission-group="Sets a permission on a group with a claim context." + permission-player="Sets a permission on a player with a claim context." + player-adjust-bonus-blocks="Updates a player's bonus claim block total." + player-info="Shows information about a player." + player-set-accrued-blocks="Updates a player's accrued claim block total." + reload="Reloads GriefDefender's configuration settings." + schematic="Manages claim schematics. Use '/claimschematic create ' to create a live backup of claim." + sell-blocks="Sell your claim blocks for server money.\nNote: Requires economy plugin." + sell-claim="Puts your claim up for sale. Use /claimsell amount.\nNote: Requires economy plugin." + town-chat="Toggles town chat." + town-tag="Sets the tag of your town." + trust-group="Grants a group access to your claim.\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + trust-group-all="Grants a group access to ALL your claim(s).\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + trust-player="Grants a player access to your claim.\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + trust-player-all="Grants a player access to ALL your claim(s).\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + untrust-group="Revokes group access to your claim." + untrust-group-all="Revokes group access to all your claims." + untrust-player="Revokes player access to your claim." + untrust-player-all="Revokes player access to all your claims." + version="Displays GriefDefender's version information." + } + messages { + abandon-claim-missing="&cNo claim found. Stand in the claim you want to abandon, or consider &f/abandonall&c." + abandon-other-success="&6{player}&a's claim has been abandoned. &6{player}&a now has &6{amount}&a available claim blocks." + abandon-success="&aClaim abandoned. You now have &6{amount}&a available claim blocks." + abandon-top-level="&cThis claim cannot be abandoned as it contains one or more child claims. In order to abandon a claim with child claims, you must use &f/abandontop&c instead." + abandon-town-children="&cYou do not have permission to abandon a town with child claims you do not own. Use &f/ignoreclaims&c or have the child claim owner abandon their claim first. If you just want to abandon the town without affecting children then use &f/abandon&c instead." + abandon-warning="&6Are you sure you want to abandon this claim? It will no longer be protected from grief." + adjust-accrued-blocks-success="&aAdjusted &6{player}&a's accrued claim blocks by &6{amount}&a. New total accrued blocks: &6{total}&a." + adjust-bonus-blocks-success="&aAdjusted &6{player}&a's bonus claim blocks by &6{amount}&a. New total bonus blocks: &6{total}&a." + bank-click-view-transactions="Click here to view bank transactions" + bank-deposit="&aSuccessful deposit of &6{amount}&a into bank." + bank-deposit-no-funds="&cYou do not have enough funds to deposit into the bank." + bank-info="&aBalance: &6{balance}&a \nTax: &6{tax-amount}&f due in &7{time-remaining}&a \nTax Owed: &6{tax-balance}." + bank-no-permission="&cYou don't have permission to manage &6{player}&c's claim bank." + bank-tax-system-disabled="&cThe bank/tax system is not enabled. If you want it enabled, set 'bank-tax-system' to true in config." + bank-title-transactions="Bank Transactions" + bank-withdraw="&aSuccessful withdraw of &6{amount} &afrom bank." + bank-withdraw-no-funds="&cThe claim bank has a remaining balance of &a{balance}&c and does not have enough funds to withdraw &a{amount}&c." + block-claimed="&aThat block has been claimed by &6{player}&a." + block-not-claimed="&cNo one has claimed this block." + block-sale-value="&aEach claim block is worth &6{amount}&a. You have &6{total}&a available for sale." + claim-above-level="&cUnable to claim block as it is above your maximum claim level limit of &a{limit}&c." + claim-action-not-available="&cThis action is not available in {type}&c." + claim-automatic-notification="&cThis chest and nearby blocks are protected." + claim-below-level="&cUnable to claim block as it is below your minimum claim level limit of &a{limit}&c." + claim-chest-confirmation="&cThis chest is protected." + claim-chest-outside-level="&cThis chest can't be protected as the position is outside your claim level limits of &a{min-level}&c and &a{max-level}&c." + claim-children-warning="&6This claim includes child claims. If you're sure you want to delete it, use &f/deleteclaim&6 again." + claim-context-not-found="&cContext &f{context}&c was not found." + claim-disabled-world="&cClaims are disabled in this world." + claim-farewell="&aSet claim farewell to {farewell}&a." + claim-farewell-clear="&aThe claim farewell message has been cleared." + claim-farewell-invalid="&cClaim flag &f{flag}&c is invalid." + claim-greeting="&aSet claim greeting to {greeting}&a." + claim-greeting-clear="&aThe claim greeting message has been cleared." + claim-ignore="&aNow ignoring claims." + claim-last-active="&aClaim last active &6{date}&a." + claim-name="&aSet claim name to {name}&a." + claim-no-claims="&cYou don't have any land claims." + claim-no-set-home="&cYou must be trusted in order to use /sethome here." + claim-not-found="&cThere's no claim here." + claim-not-yours="&cThis isn't your claim." + claim-owner-already="&cYou are already the claim owner." + claim-owner-only="&cOnly &6{player}&c can modify this claim." + claim-protected-entity="&cThat belongs to &6{player}&c." + claim-respecting="&aNow respecting claims." + claim-restore-success="&aSuccessfully restored claim." + claim-show-nearby="&aFound &6{amount}&a nearby claims." + claim-size-max="&cThe claim &6{axis}&c size of &a{size}&c exceeds the max size of &a{max-size}&c.\nThe area needs to be a minimum of &a{min-area}&c and a max of &a{max-area}" + claim-size-min="&cThe claim &6{axis}&c size of &a{size}&c is below the min size of &a{min-size}&c.\nThe area needs to be a minimum of &a{min-area}&c and a max of &a{max-area}" + claim-size-need-blocks-2d="&cYou don't have enough blocks for this claim size.\nYou need &a{block-amount}&c more blocks." + claim-size-need-blocks-3d="&cYou don't have enough blocks for this claim size.\nYou need &a{chunk-amount}&c more chunks. &f({block-amount})" + claim-size-too-small="&cThe selected claim size of &a{width}&fx&a{length}&c would be too small. A claim must be at least &a{min-width}&fx&a{min-length}&c in size." + claim-start="{type}&a corner set! Use the shovel again at the opposite corner to claim a rectangle of land. To cancel, put your shovel away." + claim-too-far="&cThat's too far away." + claim-transfer-exceeds-limit="&cClaim could not be transferred as it would exceed the new owner's creation limit." + claim-transfer-success="&aClaim transferred." + claim-type-not-found="&cNo {type}&c claims found." + claiminfo-ui-admin-settings="Admin Settings" + claiminfo-ui-bank-info="Bank Info" + claiminfo-ui-claim-expiration="Claim Expiration" + claiminfo-ui-click-admin="Click here to view admin settings" + claiminfo-ui-click-bank="Click here to check bank information" + claiminfo-ui-click-change-claim="Click here to change claim to {type}" + claiminfo-ui-click-toggle="Click here to toggle value" + claiminfo-ui-deny-messages="Deny Messages" + claiminfo-ui-flag-overrides="Flag Overrides" + claiminfo-ui-for-sale="For Sale" + claiminfo-ui-inherit-parent="Inherit Parent" + claiminfo-ui-last-active="Last Active" + claiminfo-ui-north-corners="North Corners" + claiminfo-ui-pvp-override="PvP Override" + claiminfo-ui-requires-claim-blocks="Requires Claim Blocks" + claiminfo-ui-return-bankinfo="Return to bank info" + claiminfo-ui-return-claiminfo="Return to claim info" + claiminfo-ui-return-settings="Return to standard Settings" + claiminfo-ui-size-restrictions="Size Restrictions" + claiminfo-ui-south-corners="South Corners" + claiminfo-ui-teleport-direction="Click here to teleport to {direction}&f corner of claim" + claiminfo-ui-teleport-feature="You do not have permission to use the teleport feature in this claim" + claiminfo-ui-teleport-spawn="Click here to teleport to claim spawn" + claiminfo-ui-title-claiminfo="Claim Info" + claiminfo-ui-town-settings="Town Settings" + claimlist-ui-click-info="Click to check more info" + claimlist-ui-click-purchase="Click here to purchase claim" + claimlist-ui-click-teleport-target="Click here to teleport to {name}&f {target}&f in &6{world}" + claimlist-ui-click-toggle-value="Click here to toggle {type} value" + claimlist-ui-click-view-children="Click here to view child claim list" + claimlist-ui-click-view-claims="Click here to view the claims you own" + claimlist-ui-no-claims-found="No claims found in world." + claimlist-ui-return-claimlist="Return to claims list" + claimlist-ui-title="Claim list" + claimlist-ui-title-child-claims="Child Claims" + command-blocked="&cThe command &f{command}&c has been blocked by claim owner &6{player}&c." + command-claimbuy-title="&bClaims for sale" + command-claimclear-killed="&cKilled &6{amount}&a entities of type {type}&f." + command-claimclear-no-entities="&cCould not locate any entities of type {type}&c." + command-claimclear-uuid-deny="&cOnly administrators may clear claims by UUID." + command-claimflagdebug-disabled="Claim flags debug &cOFF" + command-claimflagdebug-enabled="Claim flags debug &aON" + command-claiminfo-not-found="&cNo valid player or claim UUID found." + command-claiminfo-uuid-required="&cClaim UUID is required if executing from non-player source." + command-claiminherit-disabled="Parent claim inheritance &cOFF" + command-claiminherit-enabled="Parent claim inheritance &aON" + command-cuboid-disabled="&aNow claiming in &d2D&a mode." + command-cuboid-enabled="&aNow claiming in &d3D&a mode." + command-execute-failed="&cFailed to execute command '{command} {args}'" + command-inherit-only-child="&cThis command can only be used in child claims." + command-invalid="&cNo valid command entered." + command-invalid-claim="&cThis command cannot be used in {type}&c claims." + command-invalid-group="&cGroup &6{group}&c is not valid." + command-invalid-player="&cPlayer &6{player}&c is not valid." + command-invalid-player-group="&cNot a valid player or group." + command-not-available-economy="&cThis command is not available while server is in economy mode." + command-option-exceeds-admin="&cOption value of &a'{value}&c' exceeds admin set value of '&a{admin-value}&c'. Adjusting to admin value..." + command-player-not-found="&cPlayer '&6{player}&c' could not be found." + command-world-not-found="&cWorld '&6{world}&c' could not be found." + command-worldedit-missing="&cThis command requires WorldEdit to be installed on server." + create-cancel="&cThe creation of this claim has been cancelled." + create-cuboid-disabled="&cThe creation of &d3D&c cuboid claims has been disabled by an administrator.\nYou can only create &d3D&c claims as an Admin or on a &d2D&c claim that you own." + create-failed-claim-limit="&cYou've reached your limit of &a{limit}&c on {type}&c claims. Use &f/abandon&c to remove one before creating another." + create-insufficient-blocks-2d="&cYou don't have enough blocks to claim this area.\nYou need &a{amount}&c more blocks." + create-insufficient-blocks-3d="&cYou don't have enough blocks to claim this area.\nYou need &a{amount}&c more chunks. &f({block-amount})" + create-overlap="&cYou can't create a claim here because it would overlap your other claim. Use &f/abandonclaim&c to delete it, or use your shovel at a corner to resize it." + create-overlap-player="&cYou can't create a claim here because it would overlap &6{player}&c's claim." + create-overlap-short="&cYour selected area overlaps an existing claim." + create-subdivision-fail="&cNo claim exists at selected corner. Please click a valid block location within parent claim in order to create your subdivision." + create-subdivision-only="&cUnable to create claim. Only subdivisions can be created at a single block location." + create-success="{type}&a created! Use &f/trust&a to share it with friends." + debug-error-upload="&cError uploading content {content}&c." + debug-no-records="&cNo debug records to paste!" + debug-paste-success="&aPaste success!" + debug-record-end="Record end" + debug-record-start="Record start" + debug-time-elapsed="Time elapsed" + delete-all-player-success="&aDeleted all of &6{player}&a's claims." + delete-all-player-warning="&6Are you sure you want to delete all of &6{player}&6's claims?" + delete-all-type-deny="&cCould not delete all {type}&c claims. A plugin has denied it." + delete-all-type-success="&cDeleted all {type}&c claims." + delete-all-type-warning="&6Are you sure you want to delete all {type}&6 claims?" + delete-claim="&aClaim deleted." + economy-block-buy-invalid="&cBlock count must be greater than 0." + economy-block-buy-sell-disabled="&cSorry, buying and selling claim blocks is disabled." + economy-block-not-available="&cYou don't have that many claim blocks available for sale." + economy-block-only-buy="&cClaim blocks may only be purchased, not sold." + economy-block-only-sell="&cClaim blocks may only be sold, not purchased." + economy-block-purchase-confirmation="&aWithdrew &6{amount}&a from your account. You now have &6{balance}&a available claim blocks." + economy-block-purchase-cost="&aEach claim block costs &6{amount}&a. Your balance is &6{balance}&a." + economy-block-purchase-limit="&cThe new claim block total of &a{total}&c will exceed your claim block limit of &a{limit}&c. The transaction has been cancelled." + economy-block-sale-confirmation="&aDeposited &6{deposit}&a in your account. You now have &6{amount}&a available claim blocks." + economy-block-sell-error="&cCould not sell blocks. Reason: &f{reason}&c." + economy-claim-abandon-success="&aClaim(s) abandoned. You have been refunded a total of '&6{amount}&a'." + economy-claim-buy-cancelled="&cBuy cancelled! Could not buy claim from &6{player}&c. Result was &a{result}" + economy-claim-buy-confirmation="&6Are you sure you want to buy this claim for &a{amount}&6? Click confirm to proceed." + economy-claim-buy-confirmed="&aYou have successfully bought the claim for &6{amount}&a." + economy-claim-buy-not-enough-funds="&cYou do not have enough funds to purchase this claim for &a{amount}&c. You currently have a balance of &a{balance}&c and need &a{amount_required}&c more for purchase." + economy-claim-buy-transfer-cancelled="&cClaim transfer cancelled! Could not transfer owner &6{owner}&c to &6{player}&c. Result was &a{result}" + economy-claim-not-for-sale="&cThis claim is not for sale." + economy-claim-sale-cancelled="&aYou have cancelled your claim sale." + economy-claim-sale-confirmation="&6Are you sure you want to sell your claim for &a{amount}&6 ? If your claim is sold, all items and blocks will be transferred to the buyer. Click confirm if this is OK." + economy-claim-sale-confirmed="&aYou have successfully put your claim up for sale for the amount of &6{amount}&a." + economy-claim-sale-invalid-price="&cThe sale price of &a{amount}&c must be greater than or equal to &a0&c." + economy-claim-sold="&aYour claim sold! The amount of &6{amount}&a has been deposited into your account. Your total available balance is now &6{balance}&a." + economy-not-enough-funds="&cYou do not have enough funds to purchase this land. Your current economy balance is '&a{balance}&c' but you require '&a{amount}&c' to complete the purchase." + economy-not-installed="&cEconomy plugin not installed!." + economy-player-not-found="&cNo economy account found for player &6{player}&c." + economy-virtual-not-supported="&cEconomy plugin does not support virtual accounts which is required. Use another economy plugin or contact plugin dev for virtual account support." + economy-withdraw-error="&cCould not withdraw funds. Reason: &f{reason}&c." + feature-not-available="&cThis feature is currently being worked on and will be available in a future release." + flag-description-block-break="Controls whether a block can be broken.\n&dExample&f : To prevent any source from breaking dirt blocks, enter\n&a/cf block-break minecraft:dirt false\n&bNote&f : minecraft represents the modid and dirt represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-grow="Controls whether a block can grow.\n&dExample&f : To prevent a cactus from growing, enter\n&a/cf block-grow minecraft:cactus false\n&bNote&f : minecraft represents the modid and cactus represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-modify="Controls whether a block can be modified.\n&dExample&f : To prevent any source from igniting a block, enter\n&a/cf block-modify minecraft:fire false\n&bNote&f : minecraft represents the modid and fire represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-place="Controls whether a block can be placed.\n&dExample&f : To prevent any source from placing dirt blocks, enter\n&a/cf block-place minecraft:dirt false\n&bNote&f : minecraft represents the modid and dirt represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-collide-block="Controls whether an entity can collide with a block.\n&dExample&f : To prevent entity collisions with stone pressure plates, enter\n&a/cf collide-block minecraft:stone_pressure_plate false\n&bNote&f : minecraft represents the modid and stone_pressure_plate represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-collide-entity="Controls whether an entity can collide with an entity.\n&dExample&f : To prevent entity collisions with item frames, enter\n&a/cf collide-entity minecraft:item_frame false\n&bNote&f : minecraft represents the modid and item_frame represents the entity id.\nSpecifying no modid will always default to minecraft." + flag-description-command-execute="Controls whether a command can be executed.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft." + flag-description-command-execute-pvp="Controls whether a command can be executed while engaged in PvP.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft." + flag-description-enter-claim="Controls whether an entity can enter a claim.\n&dExample&f : To prevent players from entering a claim, enter\n&a/cf enter-claim player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-entity-chunk-spawn="Controls whether a saved entity can be spawned during chunk load.\n&dExample&f : To prevent horses from spawning during chunk load, enter\n&a/cf entity-chunk-spawn minecraft:horse false\n&bNote&f : This will remove &cALL&f saved entities when a chunk loads. If a chunk is already loaded, it will take affect after it reloads. Use with extreme caution." + flag-description-entity-damage="Controls whether an entity can be damaged.\n&dExample&f : To prevent animals from being damaged, enter\n&a/cf entity-damage minecraft:animal false." + flag-description-entity-riding="Controls whether an entity can be mounted.\n&dExample&f : To prevent horses from being mounted, enter\n&a/cf entity-riding minecraft:horse false." + flag-description-entity-spawn="Controls whether an entity can be spawned into the world.\n&dExample&f : To prevent pigs from spawning, enter\n&a/cf entity-spawn minecraft:pig false\n&bNote&f : This does not include entity items. See item-spawn flag" + flag-description-entity-teleport-from="Controls whether an entity can teleport from a claim.\n&dExample&f : To prevent players from teleporting from this claim, enter\n&a/cf entity-teleport-from player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-entity-teleport-to="Controls whether an entity can teleport to a claim.\n&dExample&f : To prevent players from teleporting to this claim, enter\n&a/cf entity-teleport-to player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-exit-claim="Controls whether an entity can exit a claim.\n&dExample&f : To prevent players from exiting this claim, enter\n&a/cf exit-claim player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-explosion-block="Controls whether an explosion can damage blocks in a claim.\n&dExample&f : To prevent an explosion from affecting any block, enter\n&a/cf explosion-block any false" + flag-description-explosion-entity="Controls whether an explosion can damage entities in a claim.\n&dExample&f : To prevent an explosion from affecting any entity, enter\n&a/cf explosion-entity any false" + flag-description-fire-spread="Controls whether fire can spread in a claim.\n&dExample&f : To prevent fire from spreading, enter\n&a/cf fire-spread any false\n&bNote&f : This does not prevent the initial fire from being placed, only spread." + flag-description-interact-block-primary="Controls whether a player can left-click(attack) a block.\n&dExample&f : To prevent players from left-clicking chests, enter\n&a/cf interact-block-primary minecraft:chest false" + flag-description-interact-block-secondary="Controls whether a player can right-click a block.\n&dExample&f : To prevent players from right-clicking(opening) chests, enter\n&a/cf interact-block-secondary minecraft:chest false" + flag-description-interact-entity-primary="Controls whether a player can left-click(attack) an entity.\n&dExample&f : To prevent players from left-clicking cows, enter\n&a/cf interact-entity-primary minecraft:cow false" + flag-description-interact-entity-secondary="Controls whether a player can right-click on an entity.\n&dExample&f : To prevent players from interacting with villagers, enter\n&a/cf interact-entity-secondary minecraft:villager false" + flag-description-interact-inventory="Controls whether a player can right-click(open) a block that contains inventory such as a chest.\n&dExample&f : To prevent players from opening chests, enter\n&a/cf interact-inventory minecraft:chest false" + flag-description-interact-inventory-click="Controls whether a player can click on an inventory slot.\n&dExample&f : To prevent players from clicking on an inventory slot that contains a diamond, enter\n&a/cf interact-inventory-click minecraft:diamond false" + flag-description-interact-item-primary="Controls whether a player can left-click(attack) with an item.\n&dExample&f : To prevent players from left-clicking with a diamond sword, enter\n&a/cf interact-item-primary minecraft:diamond_sword false" + flag-description-interact-item-secondary="Controls whether a player can right-click with an item.\n&dExample&f : To prevent players from right-clicking with flint and steel, enter\n&a/cf interact-item-secondary minecraft:flint_and_steel false" + flag-description-item-drop="Controls whether an item can be dropped in a claim.\n&dExample&f : To prevent diamond's from being dropped by players in this claim, enter\n&a/cf item-drop minecraft:flint_and_steel false context[source=player]" + flag-description-item-pickup="Controls whether an item can be picked up in a claim.\n&dExample&f : To prevent diamond's from being picked up by players, enter\n&a/cf item-pickup minecraft:diamond false" + flag-description-item-spawn="Controls whether an item can be spawned in a claim.\n&dExample&f : To prevent feather's from being spawned in this claim, enter\n&a/cf item-spawn minecraft:feather false" + flag-description-item-use="Controls whether an item can be used.\n&dExample&f : To prevent apples from being eaten in this claim, enter\n&a/cf item-use minecraft:apple false" + flag-description-leaf-decay="Controls whether leaves can decay in a claim.\n&dExample&f : To prevent leaves from decaying in this claim, enter\n&a/cf leaf-decay any false" + flag-description-liquid-flow="Controls whether liquid, such as lava and water, is allowed to flow in a claim.\n&dExample&f : To prevent any type of liquid flow in this claim, enter\n&a/cf liquid-flow any false" + flag-description-portal-use="Controls whether a portal can be used.\n&dExample&f : To prevent only players from using portal without affecting non-players, enter\n&a/cf portal-use any false context[source=player]" + flag-description-projectile-impact-block="Controls whether a projectile can impact(collide) with a block.\n&dExample&f : To prevent pixelmon pokeball's from impacting blocks, enter\n&a/cf projectile-impact-block any false[source=pixelmon:occupiedpokeball]\n&bNote&f : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc." + flag-description-projectile-impact-entity="Controls whether a projectile can impact(collide) with an entity.\n&dExample&f : To prevent arrows shot by players from impacting entities, enter\n&a/cf projectile-impact-entity minecraft:arrow false[source=player]\n&bNote&f : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc." + flag-invalid-context="&cInvalid context '&f{context}&c' entered for base flag &f{flag}&c." + flag-invalid-meta="&cInvalid target meta '&f{value}&c' entered for base flag &f{flag}&c." + flag-invalid-target="&cInvalid target '&f{target}&c' entered for base flag &f{flag}&c." + flag-not-found="&cFlag {flag}&c not found." + flag-not-set="{flag}&f is currently not set.\nThe default claim value of {value}&f will be active until set." + flag-overridden="&cFailed to set claim flag. The flag &f{flag}&c has been overridden by an admin." + flag-override-not-supported="&cClaim type {type}&c does not support flag overrides." + flag-reset-success="&aClaim flags reset to defaults successfully." + flag-set-permission-target="&aSet {type}&a permission &b{permission}&a with contexts &7{contexts}&a to {value}&a on &6{target}&a." + flag-ui-click-allow="Click here to allow this flag." + flag-ui-click-deny="Click here to deny this flag." + flag-ui-click-remove="Click here to remove this flag." + flag-ui-click-toggle="Click here to toggle {flag}&f value." + flag-ui-info-claim="Claim is checked before default values. Allows claim owners to specify flag settings in claim only." + flag-ui-info-default="Default is last to be checked. Both claim and override take priority over this." + flag-ui-info-inherit="Inherit is an enforced flag set by a parent claim that cannot changed." + flag-ui-info-override="Override has highest priority and is checked above both default and claim values. Allows admins to override all basic and admin claims." + flag-ui-inherit-parent="This flag is inherited from parent claim {name}&f and &ncannot&f be changed." + flag-ui-override-no-permission="This flag has been overridden by an administrator and can &n&cNOT&f be changed." + flag-ui-override-permission="{flag}&f is currently being &coverridden&f by an administrator.\nClick here to remove this flag." + flag-ui-return-flags="Return to flags" + label-accessors="Accessors" + label-area="Area" + label-blocks="Blocks" + label-builders="Builders" + label-buy="Buy" + label-children="children" + label-confirm="Confirm" + label-containers="Containers" + label-context="Context" + label-created="Created" + label-displaying="Displaying" + label-expired="Expired" + label-farewell="Farewell" + label-flag="Flag" + label-greeting="Greeting" + label-group="Group" + label-location="Location" + label-managers="Managers" + label-name="Name" + label-no="No" + label-output="Output" + label-owner="Owner" + label-permission="Permission" + label-player="Player" + label-price="Price" + label-resizable="Resizable" + label-result="Result" + label-schematic="Schematic" + label-source="Source" + label-spawn="Spawn" + label-target="Target" + label-trust="Trust" + label-type="Type" + label-unknown="Unknown" + label-user="User" + label-world="World" + label-yes="Yes" + mode-admin="&aAdministrative claims mode active. Any claims created will be free and editable by other administrators." + mode-basic="&aBasic claim creation mode enabled." + mode-nature="&aReady to restore claim! Right click on a block to restore, and use &f/modebasic&c to stop." + mode-subdivision="&aSubdivision mode. Use your shovel to create subdivisions in your existing claims. Use &f/modebasic&a to exit." + mode-town="&aTown creation mode enabled." + owner-admin="an administrator" + permission-access="&cYou don't have &6{player}&c's permission to access that." + permission-assign-without-having="&cYou are not allowed to assign a permission that you do not have." + permission-build="&cYou don't have &6{player}&c's permission to build." + permission-build-near-claim="&cYou don't have &6{player}&c's permission to build near claim." + permission-claim-create="&cYou don't have permission to claim land." + permission-claim-delete="&cYou don't have permission to delete {type}&c claims." + permission-claim-enter="&cYou don't have permission to enter this claim." + permission-claim-exit="&cYou don't have permission to exit this claim." + permission-claim-ignore="&cYou do not have permission to ignore {type}&c claims." + permission-claim-list="&cYou don't have permission to get information about another player's land claims." + permission-claim-manage="&cYou don't have permission to manage {type}&c claims." + permission-claim-reset-flags="&cYou don't have permission to reset {type}&c claims to flag defaults." + permission-claim-reset-flags-self="&cYou don't have permission to reset your claim flags to defaults." + permission-claim-resize="&cYou don't have permission to resize this claim." + permission-claim-sale="&cYou don't have permission to sell this claim." + permission-claim-transfer-admin="&cYou don't have permission to transfer admin claims." + permission-clear="&cCleared permissions in this claim. To set permission for ALL your claims, stand outside them." + permission-clear-all="&cOnly the claim owner can clear all permissions." + permission-command-trust="&cYou don't have permission to use this type of trust." + permission-cuboid="&cYou don't have permission to create/resize basic claims in 3D mode." + permission-edit-claim="&cYou don't have permission to edit this claim." + permission-fire-spread="&cYou don't have permission to spread fire in this claim." + permission-flag-defaults="&cYou don't have permission to manage flag defaults." + permission-flag-overrides="&cYou don't have permission to manage flag overrides." + permission-flag-use="&cYou don't have permission to use this flag." + permission-flow-liquid="&cYou don't have permission to flow liquid in this claim." + permission-global-option="&cYou don't have permission to manage global options." + permission-grant="&cYou can't grant a permission you don't have yourself." + permission-group-option="&cYou don't have permission to assign an option to a group." + permission-interact-block="&cYou don't have &6{player}'s &cpermission to interact with the block &d{block}&c." + permission-interact-entity="&cYou don't have &6{player}'s &cpermission to interact with the entity &d{entity}&c." + permission-interact-item="&cYou don't have &6{player}'s &cpermission to interact with the item &d{item}&c." + permission-interact-item-block="&cYou don't have permission to use &d{item}&c on a &b{block}&c." + permission-interact-item-entity="&cYou don't have permission to use &d{item}&c on a &b{entity}&c." + permission-inventory-open="&cYou don't have &6{player}'s&c permission to open &d{block}&c." + permission-item-drop="&cYou don't have &6{player}'s&c permission to drop the item &d{item}&c in this claim." + permission-item-use="&cYou can't use the item &d{item}&c in this claim." + permission-override-deny="&cThe action you are attempting to perform has been denied by an administrator's override flag." + permission-player-admin-flags="&cYou don't have permission to change flags on an admin player." + permission-player-option="&cYou don't have permission to assign an option to a player." + permission-player-view-others="&cYou don't have permission to view other players." + permission-portal-enter="&cYou can't use this portal because you don't have &6{player}'s &cpermission to enter the destination claim." + permission-portal-exit="&cYou can't use this portal because you don't have &6{player}'s &cpermission to exit the destination claim." + permission-protected-portal="&cYou don't have permission to use portals in this claim owned by &6{player}'s&c." + permission-trust="&cYou don't have &6{player}'s&c permission to manage permissions here." + permission-visual-claims-nearby="&cYou don't have permission to visualize nearby claims." + player-accrued-blocks-exceeded="&cPlayer &6{player}&c has a total of &6{total}&c and will exceed the maximum allowed accrued claim blocks if granted an additional &6{amount}&c of blocks.\nEither lower the amount or have an admin grant the user with an override." + player-remaining-blocks-2d="&aYou may claim up to &6{block-amount}&a more blocks." + player-remaining-blocks-3d="&aYou may claim up to &6{chunk-amount}&a more chunks. &f({block-amount})" + playerinfo-ui-abandon-return-ratio="&eAbandoned Return Ratio&f : &a{ratio}" + playerinfo-ui-block-accrued="&eAccrued Blocks&f : &a{amount}&7(&d{block_amount}&f per hour&7)" + playerinfo-ui-block-bonus="&eBonus Blocks&f : &a{amount}" + playerinfo-ui-claim-level="&eMin/Max Claim Level&f : &a{level}" + playerinfo-ui-claim-size-limit="&eClaim Size Limits&f : &a{limit}" + playerinfo-ui-block-initial="&eInitial Blocks&f : &a{amount}" + playerinfo-ui-block-max-accrued="&eMax Accrued Blocks&f : &a{amount}" + playerinfo-ui-block-remaining="&eRemaining Blocks&f : &a{amount}" + playerinfo-ui-block-total="&eTotal Blocks&f : &a{amount}" + playerinfo-ui-claim-total="&eTotal Claims&f : &a{amount}" + playerinfo-ui-last-active="&eLast Active&f : {date}" + playerinfo-ui-tax-current-rate="&eCurrent Claim Tax Rate&f : &a{rate}" + playerinfo-ui-tax-global-claim-rate="&eGlobal Claim Tax Rate&f : &a{rate}" + playerinfo-ui-tax-global-town-rate="&eGlobal Town Tax Rate&f : &a{rate}" + playerinfo-ui-tax-total="&eTotal Tax&f : &a{amount}" + playerinfo-ui-title="Player Info" + playerinfo-ui-uuid="&eUUID&f : &7{id}" + playerinfo-ui-world="&eWorld&f : &7{name}" + plugin-command-not-found="&cCould not locate the command '&a{command}&c' for plugin &b{id}&a." + plugin-event-cancel="&cA plugin has cancelled this action." + plugin-reload="&aGriefDefender has been reloaded." + resize-overlap="&cCan't resize here because it would overlap another nearby claim." + resize-overlap-subdivision="&cYou can't create a subdivision here because it would overlap another subdivision. Consider &f/abandon&c to delete it, or use your shovel at a corner to resize it." + resize-same-location="&cYou must select a different block location to resize claim." + resize-start="&aResizing claim. Use your shovel again at the new location for this corner." + resize-success-2d="&aClaim resized. You have &6{amount} &amore blocks remaining." + resize-success-3d="&aClaim resized. You have &6{amount} &amore chunks remaining. &f({block-amount})" + result-type-change-deny="&cYou cannot change a claim to {type}." + result-type-change-not-admin="&cYou do not have administrative permissions to change type to {type}&c." + result-type-child-same="{type}&c claims cannot have direct {type}&c children claims." + result-type-create-deny="{type}'s&c cannot be created in the {target_type}." + result-type-no-children="{type}'s&c cannot contain children claims." + result-type-only-subdivision="{type}'s&c can only contain subdivisions." + result-type-requires-owner="&cCould not convert {type} claim to {target_type}. Owner is required." + schematic-create="&aCreating schematic backup..." + schematic-create-complete="&aSchematic backup complete." + schematic-create-fail="&cSchematic could not be created." + schematic-deleted="&aSchematic {name} has been deleted." + schematic-none="&aThere are no schematic backups for this claim." + schematic-restore-click="&aClick here to restore claim schematic.\nName: {name}\nCreated: {date}" + schematic-restore-confirmation="&6Are you sure you want to restore? Clicking confirm will restore &cALL&6 claim data with schematic. Use cautiously!" + schematic-restore-confirmed="&aYou have successfully restored your claim from schematic backup &b{name}&a." + spawn-not-set="&cNo claim spawn has been set." + spawn-set-success="&aSuccessfully set claim spawn to &b{location}&a." + spawn-teleport="&aTeleported to claim spawn at &b{location}&a." + tax-claim-expired="&cThis claim has been frozen due to unpaid taxes. The current amount owed is '&a{amount}&c'.\nThere are '&a{days}&c' days left to deposit payment to claim bank in order to unfreeze this claim.\nFailure to pay this debt will result in deletion of claim.\nNote: To deposit funds to claimbank, use &f/claimbank&c deposit ." + tax-claim-paid-balance="&aThe tax debt of '&6{amount}&a' has been paid. Your claim has been unfrozen and is now available for use." + tax-claim-paid-partial="&aThe tax debt of '&6{amount}&a' has been partially paid. In order to unfreeze your claim, the remaining tax owed balance of '&6{balance}&a' must be paid." + tax-info="&aYour next scheduled tax payment of &6{amount}&a will be withdrawn from your account on &b{date}&a." + tax-past-due="&cYou currently have a past due tax balance of &a{balance}&c that must be paid by &b{date}&c. Failure to pay off your tax balance will result in losing your property." + title-accessor="ACCESSOR" + title-all="ALL" + title-builder="BUILDER" + title-claim="CLAIM" + title-container="CONTAINER" + title-default="DEFAULT" + title-inherit="INHERIT" + title-manager="MANAGER" + title-own="OWN" + title-override="OVERRIDE" + tool-not-equipped="&cYou do not have {tool}&c equipped." + town-chat-disabled="&aTown chat disabled." + town-chat-enabled="&aTown chat enabled." + town-create-not-enough-funds="&cYou do not have enough funds to create this town for &a{amount}&c. You currently have a balance of &a{balance}&c and need &a{amount-needed}&c more for creation." + town-name="&aSet town name to {name}&a." + town-not-found="&cTown not found." + town-not-in="&cYou are not in a town." + town-owner="&cThat belongs to the town." + town-tag="&aSet town tag to {tag}." + town-tag-clear="&aThe town tag has been cleared." + town-tax-no-claims="&cYou must own property in this town in order to be taxed." + trust-already-has="&c{target} already has {type}&c permission." + trust-click-show-list="Click here to show list of all players and groups trusted in claim." + trust-grant="&aGranted &6{target}&a permission to {type}&a in current claim." + trust-individual-all-claims="&aGranted &6{player}'s&a full trust to all your claims. To unset permissions for ALL your claims, use &f/untrustall&a." + trust-invalid="&cInvalid trust type entered.\nThe allowed types are : accessor, builder, container, and manager." + trust-list-header="Explicit permissions here:" + trust-no-claims="&cYou have no claims to trust." + trust-plugin-cancel="&cCould not trust {target}&c. A plugin has denied it." + trust-self="&cYou cannot trust yourself." + tutorial-claim-basic="&eClick for Land Claim Help: &ahttp://bit.ly/mcgpuser" + ui-click-filter-type="Click here to filter by {type}&f." + untrust-individual-all-claims="&aRevoked &6{target}'s&a access to ALL your claims. To set permissions for a single claim, stand inside it and use &f/untrust&a." + untrust-individual-single-claim="&aRevoked &6{target}'s&a access to this claim. To unset permissions for ALL your claims, use &f/untrustall&a." + untrust-no-claims="&cYou have no claims to untrust." + untrust-owner="&6{owner}&a is owner of claim and cannot be untrusted." + untrust-self="&cYou cannot untrust yourself." + } +} \ No newline at end of file diff --git a/bukkit/src/main/resources/assets/lang/en_US.conf b/bukkit/src/main/resources/assets/lang/en_US.conf index 87ac1d2..283a32f 100644 --- a/bukkit/src/main/resources/assets/lang/en_US.conf +++ b/bukkit/src/main/resources/assets/lang/en_US.conf @@ -33,7 +33,7 @@ GriefDefender { mode-admin="Switches the shovel tool to administrative claims mode" mode-basic="Switches the shovel tool back to basic claims mode." mode-nature="Switches the shovel tool to restoration mode." - mode-subdivide="Switches the shovel tool to subdivision mode, used to subdivide your claims." + mode-subdivision="Switches the shovel tool to subdivision mode, used to subdivide your claims." mode-town="Switches the shovel tool to town claims mode." option-claim="Gets/Sets claim options in the claim you are standing in." permission-group="Sets a permission on a group with a claim context." @@ -66,17 +66,20 @@ GriefDefender { abandon-warning="&6Are you sure you want to abandon this claim? It will no longer be protected from grief." adjust-accrued-blocks-success="&aAdjusted &6{player}&a's accrued claim blocks by &6{amount}&a. New total accrued blocks: &6{total}&a." adjust-bonus-blocks-success="&aAdjusted &6{player}&a's bonus claim blocks by &6{amount}&a. New total bonus blocks: &6{total}&a." + bank-click-view-transactions="Click here to view bank transactions" bank-deposit="&aSuccessful deposit of &6{amount}&a into bank." bank-deposit-no-funds="&cYou do not have enough funds to deposit into the bank." bank-info="&aBalance: &6{balance}&a \nTax: &6{tax-amount}&f due in &7{time-remaining}&a \nTax Owed: &6{tax-balance}." bank-no-permission="&cYou don't have permission to manage &6{player}&c's claim bank." bank-tax-system-disabled="&cThe bank/tax system is not enabled. If you want it enabled, set 'bank-tax-system' to true in config." + bank-title-transactions="Bank Transactions" bank-withdraw="&aSuccessful withdraw of &6{amount} &afrom bank." bank-withdraw-no-funds="&cThe claim bank has a remaining balance of &a{balance}&c and does not have enough funds to withdraw &a{amount}&c." block-claimed="&aThat block has been claimed by &6{player}&a." block-not-claimed="&cNo one has claimed this block." block-sale-value="&aEach claim block is worth &6{amount}&a. You have &6{total}&a available for sale." claim-above-level="&cUnable to claim block as it is above your maximum claim level limit of &a{limit}&c." + claim-action-not-available="&cThis action is not available in {type}&c." claim-automatic-notification="&cThis chest and nearby blocks are protected." claim-below-level="&cUnable to claim block as it is below your minimum claim level limit of &a{limit}&c." claim-chest-confirmation="&cThis chest is protected." @@ -100,7 +103,6 @@ GriefDefender { claim-owner-only="&cOnly &6{player}&c can modify this claim." claim-protected-entity="&cThat belongs to &6{player}&c." claim-respecting="&aNow respecting claims." - claim-restore-nature-activate="&aReady to restore claim! Right click on a block to restore, and use &f/modebasic&c to stop." claim-restore-success="&aSuccessfully restored claim." claim-show-nearby="&aFound &6{amount}&a nearby claims." claim-size-max="&cThe claim &6{axis}&c size of &a{size}&c exceeds the max size of &a{max-size}&c.\nThe area needs to be a minimum of &a{min-area}&c and a max of &a{max-area}" @@ -113,15 +115,66 @@ GriefDefender { claim-transfer-exceeds-limit="&cClaim could not be transferred as it would exceed the new owner's creation limit." claim-transfer-success="&aClaim transferred." claim-type-not-found="&cNo {type}&c claims found." + claiminfo-ui-admin-settings="Admin Settings" + claiminfo-ui-bank-info="Bank Info" + claiminfo-ui-claim-expiration="Claim Expiration" + claiminfo-ui-click-admin="Click here to view admin settings" + claiminfo-ui-click-bank="Click here to check bank information" + claiminfo-ui-click-change-claim="Click here to change claim to {type}" + claiminfo-ui-click-toggle="Click here to toggle value" + claiminfo-ui-deny-messages="Deny Messages" + claiminfo-ui-flag-overrides="Flag Overrides" + claiminfo-ui-for-sale="For Sale" + claiminfo-ui-inherit-parent="Inherit Parent" + claiminfo-ui-last-active="Last Active" + claiminfo-ui-north-corners="North Corners" + claiminfo-ui-pvp-override="PvP Override" + claiminfo-ui-requires-claim-blocks="Requires Claim Blocks" + claiminfo-ui-return-bankinfo="Return to bank info" + claiminfo-ui-return-claiminfo="Return to claim info" + claiminfo-ui-return-settings="Return to standard Settings" + claiminfo-ui-size-restrictions="Size Restrictions" + claiminfo-ui-south-corners="South Corners" + claiminfo-ui-teleport-direction="Click here to teleport to {direction}&f corner of claim" + claiminfo-ui-teleport-feature="You do not have permission to use the teleport feature in this claim" + claiminfo-ui-teleport-spawn="Click here to teleport to claim spawn" + claiminfo-ui-title-claiminfo="Claim Info" + claiminfo-ui-town-settings="Town Settings" + claimlist-ui-click-info="Click to check more info" + claimlist-ui-click-purchase="Click here to purchase claim" + claimlist-ui-click-teleport-target="Click here to teleport to {name}&f {target}&f in &6{world}" + claimlist-ui-click-toggle-value="Click here to toggle {type} value" + claimlist-ui-click-view-children="Click here to view child claim list" + claimlist-ui-click-view-claims="Click here to view the claims you own" + claimlist-ui-no-claims-found="No claims found in world." + claimlist-ui-return-claimlist="Return to claims list" + claimlist-ui-title="Claim list" + claimlist-ui-title-child-claims="Child Claims" command-blocked="&cThe command &f{command}&c has been blocked by claim owner &6{player}&c." + command-claimbuy-title="&bClaims for sale" + command-claimclear-killed="&cKilled &6{amount}&a entities of type {type}&f." + command-claimclear-no-entities="&cCould not locate any entities of type {type}&c." + command-claimclear-uuid-deny="&cOnly administrators may clear claims by UUID." + command-claimflagdebug-disabled="Claim flags debug &cOFF" + command-claimflagdebug-enabled="Claim flags debug &aON" + command-claiminfo-not-found="&cNo valid player or claim UUID found." + command-claiminfo-uuid-required="&cClaim UUID is required if executing from non-player source." + command-claiminherit-disabled="Parent claim inheritance &cOFF" + command-claiminherit-enabled="Parent claim inheritance &aON" command-cuboid-disabled="&aNow claiming in &d2D&a mode." command-cuboid-enabled="&aNow claiming in &d3D&a mode." - command-inherit="&cThis command can only be used in child claims." + command-execute-failed="&cFailed to execute command '{command} {args}'" + command-inherit-only-child="&cThis command can only be used in child claims." + command-invalid="&cNo valid command entered." command-invalid-claim="&cThis command cannot be used in {type}&c claims." command-invalid-group="&cGroup &6{group}&c is not valid." command-invalid-player="&cPlayer &6{player}&c is not valid." command-invalid-player-group="&cNot a valid player or group." + command-not-available-economy="&cThis command is not available while server is in economy mode." command-option-exceeds-admin="&cOption value of &a'{value}&c' exceeds admin set value of '&a{admin-value}&c'. Adjusting to admin value..." + command-player-not-found="&cPlayer '&6{player}&c' could not be found." + command-world-not-found="&cWorld '&6{world}&c' could not be found." + command-worldedit-missing="&cThis command requires WorldEdit to be installed on server." create-cancel="&cThe creation of this claim has been cancelled." create-cuboid-disabled="&cThe creation of &d3D&c cuboid claims has been disabled by an administrator.\nYou can only create &d3D&c claims as an Admin or on a &d2D&c claim that you own." create-failed-claim-limit="&cYou've reached your limit of &a{limit}&c on {type}&c claims. Use &f/abandon&c to remove one before creating another." @@ -133,13 +186,20 @@ GriefDefender { create-subdivision-fail="&cNo claim exists at selected corner. Please click a valid block location within parent claim in order to create your subdivision." create-subdivision-only="&cUnable to create claim. Only subdivisions can be created at a single block location." create-success="{type}&a created! Use &f/trust&a to share it with friends." - create-worldedit-missing="&cThis command requires WorldEdit to be installed on server." - delete-all-admin-success="&cDeleted all administrative claims." - delete-all-admin-warning="&6Are you sure you want to delete all admin claims?" - delete-all-success="&aDeleted all of &6{player}&a's claims." - delete-all-warning="&6Are you sure you want to delete all of &6{player}&6's claims?" + debug-error-upload="&cError uploading content {content}&c." + debug-no-records="&cNo debug records to paste!" + debug-paste-success="&aPaste success!" + debug-record-end="Record end" + debug-record-start="Record start" + debug-time-elapsed="Time elapsed" + delete-all-player-success="&aDeleted all of &6{player}&a's claims." + delete-all-player-warning="&6Are you sure you want to delete all of &6{player}&6's claims?" + delete-all-type-deny="&cCould not delete all {type}&c claims. A plugin has denied it." + delete-all-type-success="&cDeleted all {type}&c claims." + delete-all-type-warning="&6Are you sure you want to delete all {type}&6 claims?" delete-claim="&aClaim deleted." economy-block-buy-invalid="&cBlock count must be greater than 0." + economy-block-buy-sell-disabled="&cSorry, buying and selling claim blocks is disabled." economy-block-not-available="&cYou don't have that many claim blocks available for sale." economy-block-only-buy="&cClaim blocks may only be purchased, not sold." economy-block-only-sell="&cClaim blocks may only be sold, not purchased." @@ -148,11 +208,12 @@ GriefDefender { economy-block-purchase-limit="&cThe new claim block total of &a{total}&c will exceed your claim block limit of &a{limit}&c. The transaction has been cancelled." economy-block-sale-confirmation="&aDeposited &6{deposit}&a in your account. You now have &6{amount}&a available claim blocks." economy-block-sell-error="&cCould not sell blocks. Reason: &f{reason}&c." - economy-buy-sell-disabled="&cSorry, buying and selling claim blocks is disabled." economy-claim-abandon-success="&aClaim(s) abandoned. You have been refunded a total of '&6{amount}&a'." + economy-claim-buy-cancelled="&cBuy cancelled! Could not buy claim from &6{player}&c. Result was &a{result}" economy-claim-buy-confirmation="&6Are you sure you want to buy this claim for &a{amount}&6? Click confirm to proceed." economy-claim-buy-confirmed="&aYou have successfully bought the claim for &6{amount}&a." economy-claim-buy-not-enough-funds="&cYou do not have enough funds to purchase this claim for &a{amount}&c. You currently have a balance of &a{balance}&c and need &a{amount_required}&c more for purchase." + economy-claim-buy-transfer-cancelled="&cClaim transfer cancelled! Could not transfer owner &6{owner}&c to &6{player}&c. Result was &a{result}" economy-claim-not-for-sale="&cThis claim is not for sale." economy-claim-sale-cancelled="&aYou have cancelled your claim sale." economy-claim-sale-confirmation="&6Are you sure you want to sell your claim for &a{amount}&6 ? If your claim is sold, all items and blocks will be transferred to the buyer. Click confirm if this is OK." @@ -164,15 +225,105 @@ GriefDefender { economy-player-not-found="&cNo economy account found for player &6{player}&c." economy-virtual-not-supported="&cEconomy plugin does not support virtual accounts which is required. Use another economy plugin or contact plugin dev for virtual account support." economy-withdraw-error="&cCould not withdraw funds. Reason: &f{reason}&c." + feature-not-available="&cThis feature is currently being worked on and will be available in a future release." + flag-description-block-break="Controls whether a block can be broken.\n&dExample&f : To prevent any source from breaking dirt blocks, enter\n&a/cf block-break minecraft:dirt false\n&bNote&f : minecraft represents the modid and dirt represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-grow="Controls whether a block can grow.\n&dExample&f : To prevent a cactus from growing, enter\n&a/cf block-grow minecraft:cactus false\n&bNote&f : minecraft represents the modid and cactus represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-modify="Controls whether a block can be modified.\n&dExample&f : To prevent any source from igniting a block, enter\n&a/cf block-modify minecraft:fire false\n&bNote&f : minecraft represents the modid and fire represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-place="Controls whether a block can be placed.\n&dExample&f : To prevent any source from placing dirt blocks, enter\n&a/cf block-place minecraft:dirt false\n&bNote&f : minecraft represents the modid and dirt represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-collide-block="Controls whether an entity can collide with a block.\n&dExample&f : To prevent entity collisions with stone pressure plates, enter\n&a/cf collide-block minecraft:stone_pressure_plate false\n&bNote&f : minecraft represents the modid and stone_pressure_plate represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-collide-entity="Controls whether an entity can collide with an entity.\n&dExample&f : To prevent entity collisions with item frames, enter\n&a/cf collide-entity minecraft:item_frame false\n&bNote&f : minecraft represents the modid and item_frame represents the entity id.\nSpecifying no modid will always default to minecraft." + flag-description-command-execute="Controls whether a command can be executed.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft." + flag-description-command-execute-pvp="Controls whether a command can be executed while engaged in PvP.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft." + flag-description-enter-claim="Controls whether an entity can enter a claim.\n&dExample&f : To prevent players from entering a claim, enter\n&a/cf enter-claim player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-entity-chunk-spawn="Controls whether a saved entity can be spawned during chunk load.\n&dExample&f : To prevent horses from spawning during chunk load, enter\n&a/cf entity-chunk-spawn minecraft:horse false\n&bNote&f : This will remove &cALL&f saved entities when a chunk loads. If a chunk is already loaded, it will take affect after it reloads. Use with extreme caution." + flag-description-entity-damage="Controls whether an entity can be damaged.\n&dExample&f : To prevent animals from being damaged, enter\n&a/cf entity-damage minecraft:animal false." + flag-description-entity-riding="Controls whether an entity can be mounted.\n&dExample&f : To prevent horses from being mounted, enter\n&a/cf entity-riding minecraft:horse false." + flag-description-entity-spawn="Controls whether an entity can be spawned into the world.\n&dExample&f : To prevent pigs from spawning, enter\n&a/cf entity-spawn minecraft:pig false\n&bNote&f : This does not include entity items. See item-spawn flag" + flag-description-entity-teleport-from="Controls whether an entity can teleport from a claim.\n&dExample&f : To prevent players from teleporting from this claim, enter\n&a/cf entity-teleport-from player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-entity-teleport-to="Controls whether an entity can teleport to a claim.\n&dExample&f : To prevent players from teleporting to this claim, enter\n&a/cf entity-teleport-to player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-exit-claim="Controls whether an entity can exit a claim.\n&dExample&f : To prevent players from exiting this claim, enter\n&a/cf exit-claim player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-explosion-block="Controls whether an explosion can damage blocks in a claim.\n&dExample&f : To prevent an explosion from affecting any block, enter\n&a/cf explosion-block any false" + flag-description-explosion-entity="Controls whether an explosion can damage entities in a claim.\n&dExample&f : To prevent an explosion from affecting any entity, enter\n&a/cf explosion-entity any false" + flag-description-fire-spread="Controls whether fire can spread in a claim.\n&dExample&f : To prevent fire from spreading, enter\n&a/cf fire-spread any false\n&bNote&f : This does not prevent the initial fire from being placed, only spread." + flag-description-interact-block-primary="Controls whether a player can left-click(attack) a block.\n&dExample&f : To prevent players from left-clicking chests, enter\n&a/cf interact-block-primary minecraft:chest false" + flag-description-interact-block-secondary="Controls whether a player can right-click a block.\n&dExample&f : To prevent players from right-clicking(opening) chests, enter\n&a/cf interact-block-secondary minecraft:chest false" + flag-description-interact-entity-primary="Controls whether a player can left-click(attack) an entity.\n&dExample&f : To prevent players from left-clicking cows, enter\n&a/cf interact-entity-primary minecraft:cow false" + flag-description-interact-entity-secondary="Controls whether a player can right-click on an entity.\n&dExample&f : To prevent players from interacting with villagers, enter\n&a/cf interact-entity-secondary minecraft:villager false" + flag-description-interact-inventory="Controls whether a player can right-click(open) a block that contains inventory such as a chest.\n&dExample&f : To prevent players from opening chests, enter\n&a/cf interact-inventory minecraft:chest false" + flag-description-interact-inventory-click="Controls whether a player can click on an inventory slot.\n&dExample&f : To prevent players from clicking on an inventory slot that contains a diamond, enter\n&a/cf interact-inventory-click minecraft:diamond false" + flag-description-interact-item-primary="Controls whether a player can left-click(attack) with an item.\n&dExample&f : To prevent players from left-clicking with a diamond sword, enter\n&a/cf interact-item-primary minecraft:diamond_sword false" + flag-description-interact-item-secondary="Controls whether a player can right-click with an item.\n&dExample&f : To prevent players from right-clicking with flint and steel, enter\n&a/cf interact-item-secondary minecraft:flint_and_steel false" + flag-description-item-drop="Controls whether an item can be dropped in a claim.\n&dExample&f : To prevent diamond's from being dropped by players in this claim, enter\n&a/cf item-drop minecraft:flint_and_steel false context[source=player]" + flag-description-item-pickup="Controls whether an item can be picked up in a claim.\n&dExample&f : To prevent diamond's from being picked up by players, enter\n&a/cf item-pickup minecraft:diamond false" + flag-description-item-spawn="Controls whether an item can be spawned in a claim.\n&dExample&f : To prevent feather's from being spawned in this claim, enter\n&a/cf item-spawn minecraft:feather false" + flag-description-item-use="Controls whether an item can be used.\n&dExample&f : To prevent apples from being eaten in this claim, enter\n&a/cf item-use minecraft:apple false" + flag-description-leaf-decay="Controls whether leaves can decay in a claim.\n&dExample&f : To prevent leaves from decaying in this claim, enter\n&a/cf leaf-decay any false" + flag-description-liquid-flow="Controls whether liquid, such as lava and water, is allowed to flow in a claim.\n&dExample&f : To prevent any type of liquid flow in this claim, enter\n&a/cf liquid-flow any false" + flag-description-portal-use="Controls whether a portal can be used.\n&dExample&f : To prevent only players from using portal without affecting non-players, enter\n&a/cf portal-use any false context[source=player]" + flag-description-projectile-impact-block="Controls whether a projectile can impact(collide) with a block.\n&dExample&f : To prevent pixelmon pokeball's from impacting blocks, enter\n&a/cf projectile-impact-block any false[source=pixelmon:occupiedpokeball]\n&bNote&f : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc." + flag-description-projectile-impact-entity="Controls whether a projectile can impact(collide) with an entity.\n&dExample&f : To prevent arrows shot by players from impacting entities, enter\n&a/cf projectile-impact-entity minecraft:arrow false[source=player]\n&bNote&f : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc." flag-invalid-context="&cInvalid context '&f{context}&c' entered for base flag &f{flag}&c." flag-invalid-meta="&cInvalid target meta '&f{value}&c' entered for base flag &f{flag}&c." - flag-invalid-target="&cInvalid target '&f{target}&c' enterd for base flag &f{flag}&c." + flag-invalid-target="&cInvalid target '&f{target}&c' entered for base flag &f{flag}&c." + flag-not-found="&cFlag {flag}&c not found." + flag-not-set="{flag}&f is currently not set.\nThe default claim value of {value}&f will be active until set." flag-overridden="&cFailed to set claim flag. The flag &f{flag}&c has been overridden by an admin." flag-override-not-supported="&cClaim type {type}&c does not support flag overrides." flag-reset-success="&aClaim flags reset to defaults successfully." + flag-set-permission-target="&aSet {type}&a permission &b{permission}&a with contexts &7{contexts}&a to {value}&a on &6{target}&a." + flag-ui-click-allow="Click here to allow this flag." + flag-ui-click-deny="Click here to deny this flag." + flag-ui-click-remove="Click here to remove this flag." + flag-ui-click-toggle="Click here to toggle {flag}&f value." + flag-ui-info-claim="Claim is checked before default values. Allows claim owners to specify flag settings in claim only." + flag-ui-info-default="Default is last to be checked. Both claim and override take priority over this." + flag-ui-info-inherit="Inherit is an enforced flag set by a parent claim that cannot changed." + flag-ui-info-override="Override has highest priority and is checked above both default and claim values. Allows admins to override all basic and admin claims." + flag-ui-inherit-parent="This flag is inherited from parent claim {name}&f and &ncannot&f be changed." + flag-ui-override-no-permission="This flag has been overridden by an administrator and can &n&cNOT&f be changed." + flag-ui-override-permission="{flag}&f is currently being &coverridden&f by an administrator.\nClick here to remove this flag." + flag-ui-return-flags="Return to flags" + label-accessors="Accessors" + label-area="Area" + label-blocks="Blocks" + label-builders="Builders" + label-buy="Buy" + label-children="children" + label-confirm="Confirm" + label-containers="Containers" + label-context="Context" + label-created="Created" + label-displaying="Displaying" + label-expired="Expired" + label-farewell="Farewell" + label-flag="Flag" + label-greeting="Greeting" + label-group="Group" + label-location="Location" + label-managers="Managers" + label-name="Name" + label-no="No" + label-output="Output" + label-owner="Owner" + label-permission="Permission" + label-player="Player" + label-price="Price" + label-resizable="Resizable" + label-result="Result" + label-schematic="Schematic" + label-source="Source" + label-spawn="Spawn" + label-target="Target" + label-trust="Trust" + label-type="Type" + label-unknown="Unknown" + label-user="User" + label-world="World" + label-yes="Yes" mode-admin="&aAdministrative claims mode active. Any claims created will be free and editable by other administrators." mode-basic="&aBasic claim creation mode enabled." - mode-subdivision="&aSubdivision mode. Use your shovel to create subdivisions in your existing claims. Use &f/modebasic&a to exit." + mode-nature="&aReady to restore claim! Right click on a block to restore, and use &f/modebasic&c to stop." + mode-subdivision="&aSubdivision mode. Use your shovel to create subdivisions in your existing claims. Use &f/modebasic&a to exit." mode-town="&aTown creation mode enabled." owner-admin="an administrator" permission-access="&cYou don't have &6{player}&c's permission to access that." @@ -215,13 +366,35 @@ GriefDefender { permission-override-deny="&cThe action you are attempting to perform has been denied by an administrator's override flag." permission-player-admin-flags="&cYou don't have permission to change flags on an admin player." permission-player-option="&cYou don't have permission to assign an option to a player." + permission-player-view-others="&cYou don't have permission to view other players." permission-portal-enter="&cYou can't use this portal because you don't have &6{player}'s &cpermission to enter the destination claim." permission-portal-exit="&cYou can't use this portal because you don't have &6{player}'s &cpermission to exit the destination claim." permission-protected-portal="&cYou don't have permission to use portals in this claim owned by &6{player}'s&c." permission-trust="&cYou don't have &6{player}'s&c permission to manage permissions here." permission-visual-claims-nearby="&cYou don't have permission to visualize nearby claims." + player-accrued-blocks-exceeded="&cPlayer &6{player}&c has a total of &6{total}&c and will exceed the maximum allowed accrued claim blocks if granted an additional &6{amount}&c of blocks.\nEither lower the amount or have an admin grant the user with an override." player-remaining-blocks-2d="&aYou may claim up to &6{block-amount}&a more blocks." player-remaining-blocks-3d="&aYou may claim up to &6{chunk-amount}&a more chunks. &f({block-amount})" + playerinfo-ui-abandon-return-ratio="&eAbandoned Return Ratio&f : &a{ratio}" + playerinfo-ui-block-accrued="&eAccrued Blocks&f : &a{amount}&7(&d{block_amount}&f per hour&7)" + playerinfo-ui-block-bonus="&eBonus Blocks&f : &a{amount}" + playerinfo-ui-block-initial="&eInitial Blocks&f : &a{amount}" + playerinfo-ui-block-max-accrued="&eMax Accrued Blocks&f : &a{amount}" + playerinfo-ui-block-remaining="&eRemaining Blocks&f : &a{amount}" + playerinfo-ui-block-total="&eTotal Blocks&f : &a{amount}" + playerinfo-ui-chunk-total="&eTotal Claimable Chunks&f : %a{amount}" + playerinfo-ui-claim-level="&eMin/Max Claim Level&f : &a{level}" + playerinfo-ui-claim-size-limit="&eClaim Size Limits&f : &a{limit}" + playerinfo-ui-claim-total="&eTotal Claims&f : &a{amount}" + playerinfo-ui-last-active="&eLast Active&f : {date}" + playerinfo-ui-tax-current-rate="&eCurrent Claim Tax Rate&f : &a{rate}" + playerinfo-ui-tax-global-claim-rate="&eGlobal Claim Tax Rate&f : &a{rate}" + playerinfo-ui-tax-global-town-rate="&eGlobal Town Tax Rate&f : &a{rate}" + playerinfo-ui-tax-total="&eTotal Tax&f : &a{amount}" + playerinfo-ui-title="&bPlayer Info" + playerinfo-ui-uuid="&eUUID&f : &7{id}" + playerinfo-ui-world="&eWorld&f : &7{name}" + plugin-command-not-found="&cCould not locate the command '&a{command}&c' for plugin &b{id}&a." plugin-event-cancel="&cA plugin has cancelled this action." plugin-reload="&aGriefDefender has been reloaded." resize-overlap="&cCan't resize here because it would overlap another nearby claim." @@ -230,6 +403,20 @@ GriefDefender { resize-start="&aResizing claim. Use your shovel again at the new location for this corner." resize-success-2d="&aClaim resized. You have &6{amount} &amore blocks remaining." resize-success-3d="&aClaim resized. You have &6{amount} &amore chunks remaining. &f({block-amount})" + result-type-change-deny="&cYou cannot change a claim to {type}." + result-type-change-not-admin="&cYou do not have administrative permissions to change type to {type}&c." + result-type-child-same="{type}&c claims cannot have direct {type}&c children claims." + result-type-create-deny="{type}'s&c cannot be created in the {target_type}." + result-type-no-children="{type}'s&c cannot contain children claims." + result-type-only-subdivision="{type}'s&c can only contain subdivisions." + result-type-requires-owner="&cCould not convert {type} claim to {target_type}. Owner is required." + schematic-create="&aCreating schematic backup..." + schematic-create-complete="&aSchematic backup complete." + schematic-create-fail="&cSchematic could not be created." + schematic-deleted="&aSchematic {name} has been deleted." + schematic-none="&aThere are no schematic backups for this claim." + schematic-restore-click="&aClick here to restore claim schematic.\nName: {name}\nCreated: {date}" + schematic-restore-confirmation="&6Are you sure you want to restore? Clicking confirm will restore &cALL&6 claim data with schematic. Use cautiously!" schematic-restore-confirmed="&aYou have successfully restored your claim from schematic backup &b{name}&a." spawn-not-set="&cNo claim spawn has been set." spawn-set-success="&aSuccessfully set claim spawn to &b{location}&a." @@ -239,6 +426,17 @@ GriefDefender { tax-claim-paid-partial="&aThe tax debt of '&6{amount}&a' has been partially paid. In order to unfreeze your claim, the remaining tax owed balance of '&6{balance}&a' must be paid." tax-info="&aYour next scheduled tax payment of &6{amount}&a will be withdrawn from your account on &b{date}&a." tax-past-due="&cYou currently have a past due tax balance of &a{balance}&c that must be paid by &b{date}&c. Failure to pay off your tax balance will result in losing your property." + title-accessor="ACCESSOR" + title-all="ALL" + title-builder="BUILDER" + title-claim="CLAIM" + title-container="CONTAINER" + title-default="DEFAULT" + title-inherit="INHERIT" + title-manager="MANAGER" + title-override="OVERRIDE" + title-own="OWN" + tool-not-equipped="&cYou do not have {tool}&c equipped." town-chat-disabled="&aTown chat disabled." town-chat-enabled="&aTown chat enabled." town-create-not-enough-funds="&cYou do not have enough funds to create this town for &a{amount}&c. You currently have a balance of &a{balance}&c and need &a{amount-needed}&c more for creation." @@ -250,13 +448,16 @@ GriefDefender { town-tag-clear="&aThe town tag has been cleared." town-tax-no-claims="&cYou must own property in this town in order to be taxed." trust-already-has="&c{target} already has {type}&c permission." + trust-click-show-list="Click here to show list of all players and groups trusted in claim." trust-grant="&aGranted &6{target}&a permission to {type}&a in current claim." trust-individual-all-claims="&aGranted &6{player}'s&a full trust to all your claims. To unset permissions for ALL your claims, use &f/untrustall&a." trust-invalid="&cInvalid trust type entered.\nThe allowed types are : accessor, builder, container, and manager." trust-list-header="Explicit permissions here:" trust-no-claims="&cYou have no claims to trust." + trust-plugin-cancel="&cCould not trust {target}&c. A plugin has denied it." trust-self="&cYou cannot trust yourself." tutorial-claim-basic="&eClick for Land Claim Help: &ahttp://bit.ly/mcgpuser" + ui-click-filter-type="Click here to filter by {type}&f." untrust-individual-all-claims="&aRevoked &6{target}'s&a access to ALL your claims. To set permissions for a single claim, stand inside it and use &f/untrust&a." untrust-individual-single-claim="&aRevoked &6{target}'s&a access to this claim. To unset permissions for ALL your claims, use &f/untrustall&a." untrust-no-claims="&cYou have no claims to untrust." diff --git a/bukkit/src/main/resources/assets/lang/ru_RU.conf b/bukkit/src/main/resources/assets/lang/ru_RU.conf new file mode 100644 index 0000000..e33093c --- /dev/null +++ b/bukkit/src/main/resources/assets/lang/ru_RU.conf @@ -0,0 +1,466 @@ +GriefDefender { + descriptions { + abandon-all="Abandons ALL your claims." + abandon-claim="Abandons a claim." + abandon-top="Abandons top level claim." + buy-blocks="Purchases additional claim blocks with server money.\nNote: Requires economy plugin." + callback="Execute a callback registered as part of a Text object. Primarily for internal use." + claim-bank="Used to withdraw or deposit money for use in claim." + claim-clear="Allows clearing of entities within one or more claims." + claim-debug="Toggles claim flag debug mode." + claim-farewell="Sets the farewell message of your claim." + claim-greeting="Sets the greeting message of your claim." + claim-ignore="Toggles ignore claims mode." + claim-info="Displays all known information for claim you are standing in." + claim-inherit="Toggles whether this claim should inherit permissions from parent(s)." + claim-list="Lists all known claims in area." + claim-name="Sets the claim name." + claim-restore="Restores claim to its natural state. Use with caution." + claim-setspawn="Sets the claim spawn for players." + claim-spawn="Teleports you to claim spawn if available." + claim-transfer="Transfers a basic or admin claim to another player." + claim-worldedit="Uses the worldedit selection to create a claim." + cuboid="Toggles cuboid claims mode." + debug="Captures all GD actions for debugging purposes." + delete-all="Delete all of another player's claims." + delete-all-admin="Deletes all administrative claims." + delete-claim="Deletes the claim you're standing in, even if it's not your claim." + delete-top="Deletes the claim you're standing in, even if it's not your claim." + flag-claim="Gets/Sets claim flags in the claim you are standing in." + flag-group="Gets/Sets flag permission for a group in claim you are standing in." + flag-player="Gets/Sets flag permission for a player in claim you are standing in." + flag-reset="Resets a claim to flag defaults." + mode-admin="Switches the shovel tool to administrative claims mode" + mode-basic="Switches the shovel tool back to basic claims mode." + mode-nature="Switches the shovel tool to restoration mode." + mode-subdivision="Switches the shovel tool to subdivision mode, used to subdivide your claims." + mode-town="Switches the shovel tool to town claims mode." + option-claim="Gets/Sets claim options in the claim you are standing in." + permission-group="Sets a permission on a group with a claim context." + permission-player="Sets a permission on a player with a claim context." + player-adjust-bonus-blocks="Updates a player's bonus claim block total." + player-info="Shows information about a player." + player-set-accrued-blocks="Updates a player's accrued claim block total." + reload="Reloads GriefDefender's configuration settings." + schematic="Manages claim schematics. Use '/claimschematic create ' to create a live backup of claim." + sell-blocks="Sell your claim blocks for server money.\nNote: Requires economy plugin." + sell-claim="Puts your claim up for sale. Use /claimsell amount.\nNote: Requires economy plugin." + town-chat="Toggles town chat." + town-tag="Sets the tag of your town." + trust-group="Grants a group access to your claim.\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + trust-group-all="Grants a group access to ALL your claim(s).\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + trust-player="Grants a player access to your claim.\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + trust-player-all="Grants a player access to ALL your claim(s).\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + untrust-group="Revokes group access to your claim." + untrust-group-all="Revokes group access to all your claims." + untrust-player="Revokes player access to your claim." + untrust-player-all="Revokes player access to all your claims." + version="Displays GriefDefender's version information." + } + messages { + abandon-claim-missing="&cNo claim found. Stand in the claim you want to abandon, or consider &f/abandonall&c." + abandon-other-success="&6{player}&a's claim has been abandoned. &6{player}&a now has &6{amount}&a available claim blocks." + abandon-success="&aClaim abandoned. You now have &6{amount}&a available claim blocks." + abandon-top-level="&cThis claim cannot be abandoned as it contains one or more child claims. In order to abandon a claim with child claims, you must use &f/abandontop&c instead." + abandon-town-children="&cYou do not have permission to abandon a town with child claims you do not own. Use &f/ignoreclaims&c or have the child claim owner abandon their claim first. If you just want to abandon the town without affecting children then use &f/abandon&c instead." + abandon-warning="&6Are you sure you want to abandon this claim? It will no longer be protected from grief." + adjust-accrued-blocks-success="&aAdjusted &6{player}&a's accrued claim blocks by &6{amount}&a. New total accrued blocks: &6{total}&a." + adjust-bonus-blocks-success="&aAdjusted &6{player}&a's bonus claim blocks by &6{amount}&a. New total bonus blocks: &6{total}&a." + bank-click-view-transactions="Click here to view bank transactions" + bank-deposit="&aSuccessful deposit of &6{amount}&a into bank." + bank-deposit-no-funds="&cYou do not have enough funds to deposit into the bank." + bank-info="&aBalance: &6{balance}&a \nTax: &6{tax-amount}&f due in &7{time-remaining}&a \nTax Owed: &6{tax-balance}." + bank-no-permission="&cYou don't have permission to manage &6{player}&c's claim bank." + bank-tax-system-disabled="&cThe bank/tax system is not enabled. If you want it enabled, set 'bank-tax-system' to true in config." + bank-title-transactions="Bank Transactions" + bank-withdraw="&aSuccessful withdraw of &6{amount} &afrom bank." + bank-withdraw-no-funds="&cThe claim bank has a remaining balance of &a{balance}&c and does not have enough funds to withdraw &a{amount}&c." + block-claimed="&aThat block has been claimed by &6{player}&a." + block-not-claimed="&cNo one has claimed this block." + block-sale-value="&aEach claim block is worth &6{amount}&a. You have &6{total}&a available for sale." + claim-above-level="&cUnable to claim block as it is above your maximum claim level limit of &a{limit}&c." + claim-action-not-available="&cThis action is not available in {type}&c." + claim-automatic-notification="&cThis chest and nearby blocks are protected." + claim-below-level="&cUnable to claim block as it is below your minimum claim level limit of &a{limit}&c." + claim-chest-confirmation="&cThis chest is protected." + claim-chest-outside-level="&cThis chest can't be protected as the position is outside your claim level limits of &a{min-level}&c and &a{max-level}&c." + claim-children-warning="&6This claim includes child claims. If you're sure you want to delete it, use &f/deleteclaim&6 again." + claim-context-not-found="&cContext &f{context}&c was not found." + claim-disabled-world="&cClaims are disabled in this world." + claim-farewell="&aSet claim farewell to {farewell}&a." + claim-farewell-clear="&aThe claim farewell message has been cleared." + claim-farewell-invalid="&cClaim flag &f{flag}&c is invalid." + claim-greeting="&aSet claim greeting to {greeting}&a." + claim-greeting-clear="&aThe claim greeting message has been cleared." + claim-ignore="&aNow ignoring claims." + claim-last-active="&aClaim last active &6{date}&a." + claim-name="&aSet claim name to {name}&a." + claim-no-claims="&cYou don't have any land claims." + claim-no-set-home="&cYou must be trusted in order to use /sethome here." + claim-not-found="&cThere's no claim here." + claim-not-yours="&cThis isn't your claim." + claim-owner-already="&cYou are already the claim owner." + claim-owner-only="&cOnly &6{player}&c can modify this claim." + claim-protected-entity="&cThat belongs to &6{player}&c." + claim-respecting="&aNow respecting claims." + claim-restore-success="&aSuccessfully restored claim." + claim-show-nearby="&aFound &6{amount}&a nearby claims." + claim-size-max="&cThe claim &6{axis}&c size of &a{size}&c exceeds the max size of &a{max-size}&c.\nThe area needs to be a minimum of &a{min-area}&c and a max of &a{max-area}" + claim-size-min="&cThe claim &6{axis}&c size of &a{size}&c is below the min size of &a{min-size}&c.\nThe area needs to be a minimum of &a{min-area}&c and a max of &a{max-area}" + claim-size-need-blocks-2d="&cYou don't have enough blocks for this claim size.\nYou need &a{block-amount}&c more blocks." + claim-size-need-blocks-3d="&cYou don't have enough blocks for this claim size.\nYou need &a{chunk-amount}&c more chunks. &f({block-amount})" + claim-size-too-small="&cThe selected claim size of &a{width}&fx&a{length}&c would be too small. A claim must be at least &a{min-width}&fx&a{min-length}&c in size." + claim-start="{type}&a corner set! Use the shovel again at the opposite corner to claim a rectangle of land. To cancel, put your shovel away." + claim-too-far="&cThat's too far away." + claim-transfer-exceeds-limit="&cClaim could not be transferred as it would exceed the new owner's creation limit." + claim-transfer-success="&aClaim transferred." + claim-type-not-found="&cNo {type}&c claims found." + claiminfo-ui-admin-settings="Admin Settings" + claiminfo-ui-bank-info="Bank Info" + claiminfo-ui-claim-expiration="Claim Expiration" + claiminfo-ui-click-admin="Click here to view admin settings" + claiminfo-ui-click-bank="Click here to check bank information" + claiminfo-ui-click-change-claim="Click here to change claim to {type}" + claiminfo-ui-click-toggle="Click here to toggle value" + claiminfo-ui-deny-messages="Deny Messages" + claiminfo-ui-flag-overrides="Flag Overrides" + claiminfo-ui-for-sale="For Sale" + claiminfo-ui-inherit-parent="Inherit Parent" + claiminfo-ui-last-active="Last Active" + claiminfo-ui-north-corners="North Corners" + claiminfo-ui-pvp-override="PvP Override" + claiminfo-ui-requires-claim-blocks="Requires Claim Blocks" + claiminfo-ui-return-bankinfo="Return to bank info" + claiminfo-ui-return-claiminfo="Return to claim info" + claiminfo-ui-return-settings="Return to standard Settings" + claiminfo-ui-size-restrictions="Size Restrictions" + claiminfo-ui-south-corners="South Corners" + claiminfo-ui-teleport-direction="Click here to teleport to {direction}&f corner of claim" + claiminfo-ui-teleport-feature="You do not have permission to use the teleport feature in this claim" + claiminfo-ui-teleport-spawn="Click here to teleport to claim spawn" + claiminfo-ui-title-claiminfo="Claim Info" + claiminfo-ui-town-settings="Town Settings" + claimlist-ui-click-info="Click to check more info" + claimlist-ui-click-purchase="Click here to purchase claim" + claimlist-ui-click-teleport-target="Click here to teleport to {name}&f {target}&f in &6{world}" + claimlist-ui-click-toggle-value="Click here to toggle {type} value" + claimlist-ui-click-view-children="Click here to view child claim list" + claimlist-ui-click-view-claims="Click here to view the claims you own" + claimlist-ui-no-claims-found="No claims found in world." + claimlist-ui-return-claimlist="Return to claims list" + claimlist-ui-title="Claim list" + claimlist-ui-title-child-claims="Child Claims" + command-blocked="&cThe command &f{command}&c has been blocked by claim owner &6{player}&c." + command-claimbuy-title="&bClaims for sale" + command-claimclear-killed="&cKilled &6{amount}&a entities of type {type}&f." + command-claimclear-no-entities="&cCould not locate any entities of type {type}&c." + command-claimclear-uuid-deny="&cOnly administrators may clear claims by UUID." + command-claimflagdebug-disabled="Claim flags debug &cOFF" + command-claimflagdebug-enabled="Claim flags debug &aON" + command-claiminfo-not-found="&cNo valid player or claim UUID found." + command-claiminfo-uuid-required="&cClaim UUID is required if executing from non-player source." + command-claiminherit-disabled="Parent claim inheritance &cOFF" + command-claiminherit-enabled="Parent claim inheritance &aON" + command-cuboid-disabled="&aNow claiming in &d2D&a mode." + command-cuboid-enabled="&aNow claiming in &d3D&a mode." + command-execute-failed="&cFailed to execute command '{command} {args}'" + command-inherit-only-child="&cThis command can only be used in child claims." + command-invalid="&cNo valid command entered." + command-invalid-claim="&cThis command cannot be used in {type}&c claims." + command-invalid-group="&cGroup &6{group}&c is not valid." + command-invalid-player="&cPlayer &6{player}&c is not valid." + command-invalid-player-group="&cNot a valid player or group." + command-not-available-economy="&cThis command is not available while server is in economy mode." + command-option-exceeds-admin="&cOption value of &a'{value}&c' exceeds admin set value of '&a{admin-value}&c'. Adjusting to admin value..." + command-player-not-found="&cPlayer '&6{player}&c' could not be found." + command-world-not-found="&cWorld '&6{world}&c' could not be found." + command-worldedit-missing="&cThis command requires WorldEdit to be installed on server." + create-cancel="&cThe creation of this claim has been cancelled." + create-cuboid-disabled="&cThe creation of &d3D&c cuboid claims has been disabled by an administrator.\nYou can only create &d3D&c claims as an Admin or on a &d2D&c claim that you own." + create-failed-claim-limit="&cYou've reached your limit of &a{limit}&c on {type}&c claims. Use &f/abandon&c to remove one before creating another." + create-insufficient-blocks-2d="&cYou don't have enough blocks to claim this area.\nYou need &a{amount}&c more blocks." + create-insufficient-blocks-3d="&cYou don't have enough blocks to claim this area.\nYou need &a{amount}&c more chunks. &f({block-amount})" + create-overlap="&cYou can't create a claim here because it would overlap your other claim. Use &f/abandonclaim&c to delete it, or use your shovel at a corner to resize it." + create-overlap-player="&cYou can't create a claim here because it would overlap &6{player}&c's claim." + create-overlap-short="&cYour selected area overlaps an existing claim." + create-subdivision-fail="&cNo claim exists at selected corner. Please click a valid block location within parent claim in order to create your subdivision." + create-subdivision-only="&cUnable to create claim. Only subdivisions can be created at a single block location." + create-success="{type}&a created! Use &f/trust&a to share it with friends." + debug-error-upload="&cError uploading content {content}&c." + debug-no-records="&cNo debug records to paste!" + debug-paste-success="&aPaste success!" + debug-record-end="Record end" + debug-record-start="Record start" + debug-time-elapsed="Time elapsed" + delete-all-player-success="&aDeleted all of &6{player}&a's claims." + delete-all-player-warning="&6Are you sure you want to delete all of &6{player}&6's claims?" + delete-all-type-deny="&cCould not delete all {type}&c claims. A plugin has denied it." + delete-all-type-success="&cDeleted all {type}&c claims." + delete-all-type-warning="&6Are you sure you want to delete all {type}&6 claims?" + delete-claim="&aClaim deleted." + economy-block-buy-invalid="&cBlock count must be greater than 0." + economy-block-buy-sell-disabled="&cSorry, buying and selling claim blocks is disabled." + economy-block-not-available="&cYou don't have that many claim blocks available for sale." + economy-block-only-buy="&cClaim blocks may only be purchased, not sold." + economy-block-only-sell="&cClaim blocks may only be sold, not purchased." + economy-block-purchase-confirmation="&aWithdrew &6{amount}&a from your account. You now have &6{balance}&a available claim blocks." + economy-block-purchase-cost="&aEach claim block costs &6{amount}&a. Your balance is &6{balance}&a." + economy-block-purchase-limit="&cThe new claim block total of &a{total}&c will exceed your claim block limit of &a{limit}&c. The transaction has been cancelled." + economy-block-sale-confirmation="&aDeposited &6{deposit}&a in your account. You now have &6{amount}&a available claim blocks." + economy-block-sell-error="&cCould not sell blocks. Reason: &f{reason}&c." + economy-claim-abandon-success="&aClaim(s) abandoned. You have been refunded a total of '&6{amount}&a'." + economy-claim-buy-cancelled="&cBuy cancelled! Could not buy claim from &6{player}&c. Result was &a{result}" + economy-claim-buy-confirmation="&6Are you sure you want to buy this claim for &a{amount}&6? Click confirm to proceed." + economy-claim-buy-confirmed="&aYou have successfully bought the claim for &6{amount}&a." + economy-claim-buy-not-enough-funds="&cYou do not have enough funds to purchase this claim for &a{amount}&c. You currently have a balance of &a{balance}&c and need &a{amount_required}&c more for purchase." + economy-claim-buy-transfer-cancelled="&cClaim transfer cancelled! Could not transfer owner &6{owner}&c to &6{player}&c. Result was &a{result}" + economy-claim-not-for-sale="&cThis claim is not for sale." + economy-claim-sale-cancelled="&aYou have cancelled your claim sale." + economy-claim-sale-confirmation="&6Are you sure you want to sell your claim for &a{amount}&6 ? If your claim is sold, all items and blocks will be transferred to the buyer. Click confirm if this is OK." + economy-claim-sale-confirmed="&aYou have successfully put your claim up for sale for the amount of &6{amount}&a." + economy-claim-sale-invalid-price="&cThe sale price of &a{amount}&c must be greater than or equal to &a0&c." + economy-claim-sold="&aYour claim sold! The amount of &6{amount}&a has been deposited into your account. Your total available balance is now &6{balance}&a." + economy-not-enough-funds="&cYou do not have enough funds to purchase this land. Your current economy balance is '&a{balance}&c' but you require '&a{amount}&c' to complete the purchase." + economy-not-installed="&cEconomy plugin not installed!." + economy-player-not-found="&cNo economy account found for player &6{player}&c." + economy-virtual-not-supported="&cEconomy plugin does not support virtual accounts which is required. Use another economy plugin or contact plugin dev for virtual account support." + economy-withdraw-error="&cCould not withdraw funds. Reason: &f{reason}&c." + feature-not-available="&cThis feature is currently being worked on and will be available in a future release." + flag-description-block-break="Controls whether a block can be broken.\n&dExample&f : To prevent any source from breaking dirt blocks, enter\n&a/cf block-break minecraft:dirt false\n&bNote&f : minecraft represents the modid and dirt represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-grow="Controls whether a block can grow.\n&dExample&f : To prevent a cactus from growing, enter\n&a/cf block-grow minecraft:cactus false\n&bNote&f : minecraft represents the modid and cactus represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-modify="Controls whether a block can be modified.\n&dExample&f : To prevent any source from igniting a block, enter\n&a/cf block-modify minecraft:fire false\n&bNote&f : minecraft represents the modid and fire represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-place="Controls whether a block can be placed.\n&dExample&f : To prevent any source from placing dirt blocks, enter\n&a/cf block-place minecraft:dirt false\n&bNote&f : minecraft represents the modid and dirt represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-collide-block="Controls whether an entity can collide with a block.\n&dExample&f : To prevent entity collisions with stone pressure plates, enter\n&a/cf collide-block minecraft:stone_pressure_plate false\n&bNote&f : minecraft represents the modid and stone_pressure_plate represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-collide-entity="Controls whether an entity can collide with an entity.\n&dExample&f : To prevent entity collisions with item frames, enter\n&a/cf collide-entity minecraft:item_frame false\n&bNote&f : minecraft represents the modid and item_frame represents the entity id.\nSpecifying no modid will always default to minecraft." + flag-description-command-execute="Controls whether a command can be executed.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft." + flag-description-command-execute-pvp="Controls whether a command can be executed while engaged in PvP.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft." + flag-description-enter-claim="Controls whether an entity can enter a claim.\n&dExample&f : To prevent players from entering a claim, enter\n&a/cf enter-claim player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-entity-chunk-spawn="Controls whether a saved entity can be spawned during chunk load.\n&dExample&f : To prevent horses from spawning during chunk load, enter\n&a/cf entity-chunk-spawn minecraft:horse false\n&bNote&f : This will remove &cALL&f saved entities when a chunk loads. If a chunk is already loaded, it will take affect after it reloads. Use with extreme caution." + flag-description-entity-damage="Controls whether an entity can be damaged.\n&dExample&f : To prevent animals from being damaged, enter\n&a/cf entity-damage minecraft:animal false." + flag-description-entity-riding="Controls whether an entity can be mounted.\n&dExample&f : To prevent horses from being mounted, enter\n&a/cf entity-riding minecraft:horse false." + flag-description-entity-spawn="Controls whether an entity can be spawned into the world.\n&dExample&f : To prevent pigs from spawning, enter\n&a/cf entity-spawn minecraft:pig false\n&bNote&f : This does not include entity items. See item-spawn flag" + flag-description-entity-teleport-from="Controls whether an entity can teleport from a claim.\n&dExample&f : To prevent players from teleporting from this claim, enter\n&a/cf entity-teleport-from player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-entity-teleport-to="Controls whether an entity can teleport to a claim.\n&dExample&f : To prevent players from teleporting to this claim, enter\n&a/cf entity-teleport-to player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-exit-claim="Controls whether an entity can exit a claim.\n&dExample&f : To prevent players from exiting this claim, enter\n&a/cf exit-claim player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-explosion-block="Controls whether an explosion can damage blocks in a claim.\n&dExample&f : To prevent an explosion from affecting any block, enter\n&a/cf explosion-block any false" + flag-description-explosion-entity="Controls whether an explosion can damage entities in a claim.\n&dExample&f : To prevent an explosion from affecting any entity, enter\n&a/cf explosion-entity any false" + flag-description-fire-spread="Controls whether fire can spread in a claim.\n&dExample&f : To prevent fire from spreading, enter\n&a/cf fire-spread any false\n&bNote&f : This does not prevent the initial fire from being placed, only spread." + flag-description-interact-block-primary="Controls whether a player can left-click(attack) a block.\n&dExample&f : To prevent players from left-clicking chests, enter\n&a/cf interact-block-primary minecraft:chest false" + flag-description-interact-block-secondary="Controls whether a player can right-click a block.\n&dExample&f : To prevent players from right-clicking(opening) chests, enter\n&a/cf interact-block-secondary minecraft:chest false" + flag-description-interact-entity-primary="Controls whether a player can left-click(attack) an entity.\n&dExample&f : To prevent players from left-clicking cows, enter\n&a/cf interact-entity-primary minecraft:cow false" + flag-description-interact-entity-secondary="Controls whether a player can right-click on an entity.\n&dExample&f : To prevent players from interacting with villagers, enter\n&a/cf interact-entity-secondary minecraft:villager false" + flag-description-interact-inventory="Controls whether a player can right-click(open) a block that contains inventory such as a chest.\n&dExample&f : To prevent players from opening chests, enter\n&a/cf interact-inventory minecraft:chest false" + flag-description-interact-inventory-click="Controls whether a player can click on an inventory slot.\n&dExample&f : To prevent players from clicking on an inventory slot that contains a diamond, enter\n&a/cf interact-inventory-click minecraft:diamond false" + flag-description-interact-item-primary="Controls whether a player can left-click(attack) with an item.\n&dExample&f : To prevent players from left-clicking with a diamond sword, enter\n&a/cf interact-item-primary minecraft:diamond_sword false" + flag-description-interact-item-secondary="Controls whether a player can right-click with an item.\n&dExample&f : To prevent players from right-clicking with flint and steel, enter\n&a/cf interact-item-secondary minecraft:flint_and_steel false" + flag-description-item-drop="Controls whether an item can be dropped in a claim.\n&dExample&f : To prevent diamond's from being dropped by players in this claim, enter\n&a/cf item-drop minecraft:flint_and_steel false context[source=player]" + flag-description-item-pickup="Controls whether an item can be picked up in a claim.\n&dExample&f : To prevent diamond's from being picked up by players, enter\n&a/cf item-pickup minecraft:diamond false" + flag-description-item-spawn="Controls whether an item can be spawned in a claim.\n&dExample&f : To prevent feather's from being spawned in this claim, enter\n&a/cf item-spawn minecraft:feather false" + flag-description-item-use="Controls whether an item can be used.\n&dExample&f : To prevent apples from being eaten in this claim, enter\n&a/cf item-use minecraft:apple false" + flag-description-leaf-decay="Controls whether leaves can decay in a claim.\n&dExample&f : To prevent leaves from decaying in this claim, enter\n&a/cf leaf-decay any false" + flag-description-liquid-flow="Controls whether liquid, such as lava and water, is allowed to flow in a claim.\n&dExample&f : To prevent any type of liquid flow in this claim, enter\n&a/cf liquid-flow any false" + flag-description-portal-use="Controls whether a portal can be used.\n&dExample&f : To prevent only players from using portal without affecting non-players, enter\n&a/cf portal-use any false context[source=player]" + flag-description-projectile-impact-block="Controls whether a projectile can impact(collide) with a block.\n&dExample&f : To prevent pixelmon pokeball's from impacting blocks, enter\n&a/cf projectile-impact-block any false[source=pixelmon:occupiedpokeball]\n&bNote&f : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc." + flag-description-projectile-impact-entity="Controls whether a projectile can impact(collide) with an entity.\n&dExample&f : To prevent arrows shot by players from impacting entities, enter\n&a/cf projectile-impact-entity minecraft:arrow false[source=player]\n&bNote&f : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc." + flag-invalid-context="&cInvalid context '&f{context}&c' entered for base flag &f{flag}&c." + flag-invalid-meta="&cInvalid target meta '&f{value}&c' entered for base flag &f{flag}&c." + flag-invalid-target="&cInvalid target '&f{target}&c' entered for base flag &f{flag}&c." + flag-not-found="&cFlag {flag}&c not found." + flag-not-set="{flag}&f is currently not set.\nThe default claim value of {value}&f will be active until set." + flag-overridden="&cFailed to set claim flag. The flag &f{flag}&c has been overridden by an admin." + flag-override-not-supported="&cClaim type {type}&c does not support flag overrides." + flag-reset-success="&aClaim flags reset to defaults successfully." + flag-set-permission-target="&aSet {type}&a permission &b{permission}&a with contexts &7{contexts}&a to {value}&a on &6{target}&a." + flag-ui-click-allow="Click here to allow this flag." + flag-ui-click-deny="Click here to deny this flag." + flag-ui-click-remove="Click here to remove this flag." + flag-ui-click-toggle="Click here to toggle {flag}&f value." + flag-ui-info-claim="Claim is checked before default values. Allows claim owners to specify flag settings in claim only." + flag-ui-info-default="Default is last to be checked. Both claim and override take priority over this." + flag-ui-info-inherit="Inherit is an enforced flag set by a parent claim that cannot changed." + flag-ui-info-override="Override has highest priority and is checked above both default and claim values. Allows admins to override all basic and admin claims." + flag-ui-inherit-parent="This flag is inherited from parent claim {name}&f and &ncannot&f be changed." + flag-ui-override-no-permission="This flag has been overridden by an administrator and can &n&cNOT&f be changed." + flag-ui-override-permission="{flag}&f is currently being &coverridden&f by an administrator.\nClick here to remove this flag." + flag-ui-return-flags="Return to flags" + label-accessors="Accessors" + label-area="Area" + label-blocks="Blocks" + label-builders="Builders" + label-buy="Buy" + label-children="children" + label-confirm="Confirm" + label-containers="Containers" + label-context="Context" + label-created="Created" + label-displaying="Displaying" + label-expired="Expired" + label-farewell="Farewell" + label-flag="Flag" + label-greeting="Greeting" + label-group="Group" + label-location="Location" + label-managers="Managers" + label-name="Name" + label-no="No" + label-output="Output" + label-owner="Owner" + label-permission="Permission" + label-player="Player" + label-price="Price" + label-resizable="Resizable" + label-result="Result" + label-schematic="Schematic" + label-source="Source" + label-spawn="Spawn" + label-target="Target" + label-trust="Trust" + label-type="Type" + label-unknown="Unknown" + label-user="User" + label-world="World" + label-yes="Yes" + mode-admin="&aAdministrative claims mode active. Any claims created will be free and editable by other administrators." + mode-basic="&aBasic claim creation mode enabled." + mode-nature="&aReady to restore claim! Right click on a block to restore, and use &f/modebasic&c to stop." + mode-subdivision="&aSubdivision mode. Use your shovel to create subdivisions in your existing claims. Use &f/modebasic&a to exit." + mode-town="&aTown creation mode enabled." + owner-admin="an administrator" + permission-access="&cYou don't have &6{player}&c's permission to access that." + permission-assign-without-having="&cYou are not allowed to assign a permission that you do not have." + permission-build="&cYou don't have &6{player}&c's permission to build." + permission-build-near-claim="&cYou don't have &6{player}&c's permission to build near claim." + permission-claim-create="&cYou don't have permission to claim land." + permission-claim-delete="&cYou don't have permission to delete {type}&c claims." + permission-claim-enter="&cYou don't have permission to enter this claim." + permission-claim-exit="&cYou don't have permission to exit this claim." + permission-claim-ignore="&cYou do not have permission to ignore {type}&c claims." + permission-claim-list="&cYou don't have permission to get information about another player's land claims." + permission-claim-manage="&cYou don't have permission to manage {type}&c claims." + permission-claim-reset-flags="&cYou don't have permission to reset {type}&c claims to flag defaults." + permission-claim-reset-flags-self="&cYou don't have permission to reset your claim flags to defaults." + permission-claim-resize="&cYou don't have permission to resize this claim." + permission-claim-sale="&cYou don't have permission to sell this claim." + permission-claim-transfer-admin="&cYou don't have permission to transfer admin claims." + permission-clear="&cCleared permissions in this claim. To set permission for ALL your claims, stand outside them." + permission-clear-all="&cOnly the claim owner can clear all permissions." + permission-command-trust="&cYou don't have permission to use this type of trust." + permission-cuboid="&cYou don't have permission to create/resize basic claims in 3D mode." + permission-edit-claim="&cYou don't have permission to edit this claim." + permission-fire-spread="&cYou don't have permission to spread fire in this claim." + permission-flag-defaults="&cYou don't have permission to manage flag defaults." + permission-flag-overrides="&cYou don't have permission to manage flag overrides." + permission-flag-use="&cYou don't have permission to use this flag." + permission-flow-liquid="&cYou don't have permission to flow liquid in this claim." + permission-global-option="&cYou don't have permission to manage global options." + permission-grant="&cYou can't grant a permission you don't have yourself." + permission-group-option="&cYou don't have permission to assign an option to a group." + permission-interact-block="&cYou don't have &6{player}'s &cpermission to interact with the block &d{block}&c." + permission-interact-entity="&cYou don't have &6{player}'s &cpermission to interact with the entity &d{entity}&c." + permission-interact-item="&cYou don't have &6{player}'s &cpermission to interact with the item &d{item}&c." + permission-interact-item-block="&cYou don't have permission to use &d{item}&c on a &b{block}&c." + permission-interact-item-entity="&cYou don't have permission to use &d{item}&c on a &b{entity}&c." + permission-inventory-open="&cYou don't have &6{player}'s&c permission to open &d{block}&c." + permission-item-drop="&cYou don't have &6{player}'s&c permission to drop the item &d{item}&c in this claim." + permission-item-use="&cYou can't use the item &d{item}&c in this claim." + permission-override-deny="&cThe action you are attempting to perform has been denied by an administrator's override flag." + permission-player-admin-flags="&cYou don't have permission to change flags on an admin player." + permission-player-option="&cYou don't have permission to assign an option to a player." + permission-player-view-others="&cYou don't have permission to view other players." + permission-portal-enter="&cYou can't use this portal because you don't have &6{player}'s &cpermission to enter the destination claim." + permission-portal-exit="&cYou can't use this portal because you don't have &6{player}'s &cpermission to exit the destination claim." + permission-protected-portal="&cYou don't have permission to use portals in this claim owned by &6{player}'s&c." + permission-trust="&cYou don't have &6{player}'s&c permission to manage permissions here." + permission-visual-claims-nearby="&cYou don't have permission to visualize nearby claims." + player-accrued-blocks-exceeded="&cPlayer &6{player}&c has a total of &6{total}&c and will exceed the maximum allowed accrued claim blocks if granted an additional &6{amount}&c of blocks.\nEither lower the amount or have an admin grant the user with an override." + player-remaining-blocks-2d="&aYou may claim up to &6{block-amount}&a more blocks." + player-remaining-blocks-3d="&aYou may claim up to &6{chunk-amount}&a more chunks. &f({block-amount})" + playerinfo-ui-abandon-return-ratio="&eAbandoned Return Ratio&f : &a{ratio}" + playerinfo-ui-block-accrued="&eAccrued Blocks&f : &a{amount}&7(&d{block_amount}&f per hour&7)" + playerinfo-ui-block-bonus="&eBonus Blocks&f : &a{amount}" + playerinfo-ui-claim-level="&eMin/Max Claim Level&f : &a{level}" + playerinfo-ui-claim-size-limit="&eClaim Size Limits&f : &a{limit}" + playerinfo-ui-block-initial="&eInitial Blocks&f : &a{amount}" + playerinfo-ui-block-max-accrued="&eMax Accrued Blocks&f : &a{amount}" + playerinfo-ui-block-remaining="&eRemaining Blocks&f : &a{amount}" + playerinfo-ui-block-total="&eTotal Blocks&f : &a{amount}" + playerinfo-ui-claim-total="&eTotal Claims&f : &a{amount}" + playerinfo-ui-last-active="&eLast Active&f : {date}" + playerinfo-ui-tax-current-rate="&eCurrent Claim Tax Rate&f : &a{rate}" + playerinfo-ui-tax-global-claim-rate="&eGlobal Claim Tax Rate&f : &a{rate}" + playerinfo-ui-tax-global-town-rate="&eGlobal Town Tax Rate&f : &a{rate}" + playerinfo-ui-tax-total="&eTotal Tax&f : &a{amount}" + playerinfo-ui-title="Player Info" + playerinfo-ui-uuid="&eUUID&f : &7{id}" + playerinfo-ui-world="&eWorld&f : &7{name}" + plugin-command-not-found="&cCould not locate the command '&a{command}&c' for plugin &b{id}&a." + plugin-event-cancel="&cA plugin has cancelled this action." + plugin-reload="&aGriefDefender has been reloaded." + resize-overlap="&cCan't resize here because it would overlap another nearby claim." + resize-overlap-subdivision="&cYou can't create a subdivision here because it would overlap another subdivision. Consider &f/abandon&c to delete it, or use your shovel at a corner to resize it." + resize-same-location="&cYou must select a different block location to resize claim." + resize-start="&aResizing claim. Use your shovel again at the new location for this corner." + resize-success-2d="&aClaim resized. You have &6{amount} &amore blocks remaining." + resize-success-3d="&aClaim resized. You have &6{amount} &amore chunks remaining. &f({block-amount})" + result-type-change-deny="&cYou cannot change a claim to {type}." + result-type-change-not-admin="&cYou do not have administrative permissions to change type to {type}&c." + result-type-child-same="{type}&c claims cannot have direct {type}&c children claims." + result-type-create-deny="{type}'s&c cannot be created in the {target_type}." + result-type-no-children="{type}'s&c cannot contain children claims." + result-type-only-subdivision="{type}'s&c can only contain subdivisions." + result-type-requires-owner="&cCould not convert {type} claim to {target_type}. Owner is required." + schematic-create="&aCreating schematic backup..." + schematic-create-complete="&aSchematic backup complete." + schematic-create-fail="&cSchematic could not be created." + schematic-deleted="&aSchematic {name} has been deleted." + schematic-none="&aThere are no schematic backups for this claim." + schematic-restore-click="&aClick here to restore claim schematic.\nName: {name}\nCreated: {date}" + schematic-restore-confirmation="&6Are you sure you want to restore? Clicking confirm will restore &cALL&6 claim data with schematic. Use cautiously!" + schematic-restore-confirmed="&aYou have successfully restored your claim from schematic backup &b{name}&a." + spawn-not-set="&cNo claim spawn has been set." + spawn-set-success="&aSuccessfully set claim spawn to &b{location}&a." + spawn-teleport="&aTeleported to claim spawn at &b{location}&a." + tax-claim-expired="&cThis claim has been frozen due to unpaid taxes. The current amount owed is '&a{amount}&c'.\nThere are '&a{days}&c' days left to deposit payment to claim bank in order to unfreeze this claim.\nFailure to pay this debt will result in deletion of claim.\nNote: To deposit funds to claimbank, use &f/claimbank&c deposit ." + tax-claim-paid-balance="&aThe tax debt of '&6{amount}&a' has been paid. Your claim has been unfrozen and is now available for use." + tax-claim-paid-partial="&aThe tax debt of '&6{amount}&a' has been partially paid. In order to unfreeze your claim, the remaining tax owed balance of '&6{balance}&a' must be paid." + tax-info="&aYour next scheduled tax payment of &6{amount}&a will be withdrawn from your account on &b{date}&a." + tax-past-due="&cYou currently have a past due tax balance of &a{balance}&c that must be paid by &b{date}&c. Failure to pay off your tax balance will result in losing your property." + title-accessor="ACCESSOR" + title-all="ALL" + title-builder="BUILDER" + title-claim="CLAIM" + title-container="CONTAINER" + title-default="DEFAULT" + title-inherit="INHERIT" + title-manager="MANAGER" + title-own="OWN" + title-override="OVERRIDE" + tool-not-equipped="&cYou do not have {tool}&c equipped." + town-chat-disabled="&aTown chat disabled." + town-chat-enabled="&aTown chat enabled." + town-create-not-enough-funds="&cYou do not have enough funds to create this town for &a{amount}&c. You currently have a balance of &a{balance}&c and need &a{amount-needed}&c more for creation." + town-name="&aSet town name to {name}&a." + town-not-found="&cTown not found." + town-not-in="&cYou are not in a town." + town-owner="&cThat belongs to the town." + town-tag="&aSet town tag to {tag}." + town-tag-clear="&aThe town tag has been cleared." + town-tax-no-claims="&cYou must own property in this town in order to be taxed." + trust-already-has="&c{target} already has {type}&c permission." + trust-click-show-list="Click here to show list of all players and groups trusted in claim." + trust-grant="&aGranted &6{target}&a permission to {type}&a in current claim." + trust-individual-all-claims="&aGranted &6{player}'s&a full trust to all your claims. To unset permissions for ALL your claims, use &f/untrustall&a." + trust-invalid="&cInvalid trust type entered.\nThe allowed types are : accessor, builder, container, and manager." + trust-list-header="Explicit permissions here:" + trust-no-claims="&cYou have no claims to trust." + trust-plugin-cancel="&cCould not trust {target}&c. A plugin has denied it." + trust-self="&cYou cannot trust yourself." + tutorial-claim-basic="&eClick for Land Claim Help: &ahttp://bit.ly/mcgpuser" + ui-click-filter-type="Click here to filter by {type}&f." + untrust-individual-all-claims="&aRevoked &6{target}'s&a access to ALL your claims. To set permissions for a single claim, stand inside it and use &f/untrust&a." + untrust-individual-single-claim="&aRevoked &6{target}'s&a access to this claim. To unset permissions for ALL your claims, use &f/untrustall&a." + untrust-no-claims="&cYou have no claims to untrust." + untrust-owner="&6{owner}&a is owner of claim and cannot be untrusted." + untrust-self="&cYou cannot untrust yourself." + } +} \ No newline at end of file diff --git a/bukkit/src/main/resources/assets/lang/zh_CN.conf b/bukkit/src/main/resources/assets/lang/zh_CN.conf new file mode 100644 index 0000000..e33093c --- /dev/null +++ b/bukkit/src/main/resources/assets/lang/zh_CN.conf @@ -0,0 +1,466 @@ +GriefDefender { + descriptions { + abandon-all="Abandons ALL your claims." + abandon-claim="Abandons a claim." + abandon-top="Abandons top level claim." + buy-blocks="Purchases additional claim blocks with server money.\nNote: Requires economy plugin." + callback="Execute a callback registered as part of a Text object. Primarily for internal use." + claim-bank="Used to withdraw or deposit money for use in claim." + claim-clear="Allows clearing of entities within one or more claims." + claim-debug="Toggles claim flag debug mode." + claim-farewell="Sets the farewell message of your claim." + claim-greeting="Sets the greeting message of your claim." + claim-ignore="Toggles ignore claims mode." + claim-info="Displays all known information for claim you are standing in." + claim-inherit="Toggles whether this claim should inherit permissions from parent(s)." + claim-list="Lists all known claims in area." + claim-name="Sets the claim name." + claim-restore="Restores claim to its natural state. Use with caution." + claim-setspawn="Sets the claim spawn for players." + claim-spawn="Teleports you to claim spawn if available." + claim-transfer="Transfers a basic or admin claim to another player." + claim-worldedit="Uses the worldedit selection to create a claim." + cuboid="Toggles cuboid claims mode." + debug="Captures all GD actions for debugging purposes." + delete-all="Delete all of another player's claims." + delete-all-admin="Deletes all administrative claims." + delete-claim="Deletes the claim you're standing in, even if it's not your claim." + delete-top="Deletes the claim you're standing in, even if it's not your claim." + flag-claim="Gets/Sets claim flags in the claim you are standing in." + flag-group="Gets/Sets flag permission for a group in claim you are standing in." + flag-player="Gets/Sets flag permission for a player in claim you are standing in." + flag-reset="Resets a claim to flag defaults." + mode-admin="Switches the shovel tool to administrative claims mode" + mode-basic="Switches the shovel tool back to basic claims mode." + mode-nature="Switches the shovel tool to restoration mode." + mode-subdivision="Switches the shovel tool to subdivision mode, used to subdivide your claims." + mode-town="Switches the shovel tool to town claims mode." + option-claim="Gets/Sets claim options in the claim you are standing in." + permission-group="Sets a permission on a group with a claim context." + permission-player="Sets a permission on a player with a claim context." + player-adjust-bonus-blocks="Updates a player's bonus claim block total." + player-info="Shows information about a player." + player-set-accrued-blocks="Updates a player's accrued claim block total." + reload="Reloads GriefDefender's configuration settings." + schematic="Manages claim schematics. Use '/claimschematic create ' to create a live backup of claim." + sell-blocks="Sell your claim blocks for server money.\nNote: Requires economy plugin." + sell-claim="Puts your claim up for sale. Use /claimsell amount.\nNote: Requires economy plugin." + town-chat="Toggles town chat." + town-tag="Sets the tag of your town." + trust-group="Grants a group access to your claim.\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + trust-group-all="Grants a group access to ALL your claim(s).\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + trust-player="Grants a player access to your claim.\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + trust-player-all="Grants a player access to ALL your claim(s).\nAccessor: access to interact with all blocks except inventory.\nContainer: access to interact with all blocks including inventory.\nBuilder: access to everything above including ability to place and break blocks.\nManager: access to everything above including ability to manage claim settings." + untrust-group="Revokes group access to your claim." + untrust-group-all="Revokes group access to all your claims." + untrust-player="Revokes player access to your claim." + untrust-player-all="Revokes player access to all your claims." + version="Displays GriefDefender's version information." + } + messages { + abandon-claim-missing="&cNo claim found. Stand in the claim you want to abandon, or consider &f/abandonall&c." + abandon-other-success="&6{player}&a's claim has been abandoned. &6{player}&a now has &6{amount}&a available claim blocks." + abandon-success="&aClaim abandoned. You now have &6{amount}&a available claim blocks." + abandon-top-level="&cThis claim cannot be abandoned as it contains one or more child claims. In order to abandon a claim with child claims, you must use &f/abandontop&c instead." + abandon-town-children="&cYou do not have permission to abandon a town with child claims you do not own. Use &f/ignoreclaims&c or have the child claim owner abandon their claim first. If you just want to abandon the town without affecting children then use &f/abandon&c instead." + abandon-warning="&6Are you sure you want to abandon this claim? It will no longer be protected from grief." + adjust-accrued-blocks-success="&aAdjusted &6{player}&a's accrued claim blocks by &6{amount}&a. New total accrued blocks: &6{total}&a." + adjust-bonus-blocks-success="&aAdjusted &6{player}&a's bonus claim blocks by &6{amount}&a. New total bonus blocks: &6{total}&a." + bank-click-view-transactions="Click here to view bank transactions" + bank-deposit="&aSuccessful deposit of &6{amount}&a into bank." + bank-deposit-no-funds="&cYou do not have enough funds to deposit into the bank." + bank-info="&aBalance: &6{balance}&a \nTax: &6{tax-amount}&f due in &7{time-remaining}&a \nTax Owed: &6{tax-balance}." + bank-no-permission="&cYou don't have permission to manage &6{player}&c's claim bank." + bank-tax-system-disabled="&cThe bank/tax system is not enabled. If you want it enabled, set 'bank-tax-system' to true in config." + bank-title-transactions="Bank Transactions" + bank-withdraw="&aSuccessful withdraw of &6{amount} &afrom bank." + bank-withdraw-no-funds="&cThe claim bank has a remaining balance of &a{balance}&c and does not have enough funds to withdraw &a{amount}&c." + block-claimed="&aThat block has been claimed by &6{player}&a." + block-not-claimed="&cNo one has claimed this block." + block-sale-value="&aEach claim block is worth &6{amount}&a. You have &6{total}&a available for sale." + claim-above-level="&cUnable to claim block as it is above your maximum claim level limit of &a{limit}&c." + claim-action-not-available="&cThis action is not available in {type}&c." + claim-automatic-notification="&cThis chest and nearby blocks are protected." + claim-below-level="&cUnable to claim block as it is below your minimum claim level limit of &a{limit}&c." + claim-chest-confirmation="&cThis chest is protected." + claim-chest-outside-level="&cThis chest can't be protected as the position is outside your claim level limits of &a{min-level}&c and &a{max-level}&c." + claim-children-warning="&6This claim includes child claims. If you're sure you want to delete it, use &f/deleteclaim&6 again." + claim-context-not-found="&cContext &f{context}&c was not found." + claim-disabled-world="&cClaims are disabled in this world." + claim-farewell="&aSet claim farewell to {farewell}&a." + claim-farewell-clear="&aThe claim farewell message has been cleared." + claim-farewell-invalid="&cClaim flag &f{flag}&c is invalid." + claim-greeting="&aSet claim greeting to {greeting}&a." + claim-greeting-clear="&aThe claim greeting message has been cleared." + claim-ignore="&aNow ignoring claims." + claim-last-active="&aClaim last active &6{date}&a." + claim-name="&aSet claim name to {name}&a." + claim-no-claims="&cYou don't have any land claims." + claim-no-set-home="&cYou must be trusted in order to use /sethome here." + claim-not-found="&cThere's no claim here." + claim-not-yours="&cThis isn't your claim." + claim-owner-already="&cYou are already the claim owner." + claim-owner-only="&cOnly &6{player}&c can modify this claim." + claim-protected-entity="&cThat belongs to &6{player}&c." + claim-respecting="&aNow respecting claims." + claim-restore-success="&aSuccessfully restored claim." + claim-show-nearby="&aFound &6{amount}&a nearby claims." + claim-size-max="&cThe claim &6{axis}&c size of &a{size}&c exceeds the max size of &a{max-size}&c.\nThe area needs to be a minimum of &a{min-area}&c and a max of &a{max-area}" + claim-size-min="&cThe claim &6{axis}&c size of &a{size}&c is below the min size of &a{min-size}&c.\nThe area needs to be a minimum of &a{min-area}&c and a max of &a{max-area}" + claim-size-need-blocks-2d="&cYou don't have enough blocks for this claim size.\nYou need &a{block-amount}&c more blocks." + claim-size-need-blocks-3d="&cYou don't have enough blocks for this claim size.\nYou need &a{chunk-amount}&c more chunks. &f({block-amount})" + claim-size-too-small="&cThe selected claim size of &a{width}&fx&a{length}&c would be too small. A claim must be at least &a{min-width}&fx&a{min-length}&c in size." + claim-start="{type}&a corner set! Use the shovel again at the opposite corner to claim a rectangle of land. To cancel, put your shovel away." + claim-too-far="&cThat's too far away." + claim-transfer-exceeds-limit="&cClaim could not be transferred as it would exceed the new owner's creation limit." + claim-transfer-success="&aClaim transferred." + claim-type-not-found="&cNo {type}&c claims found." + claiminfo-ui-admin-settings="Admin Settings" + claiminfo-ui-bank-info="Bank Info" + claiminfo-ui-claim-expiration="Claim Expiration" + claiminfo-ui-click-admin="Click here to view admin settings" + claiminfo-ui-click-bank="Click here to check bank information" + claiminfo-ui-click-change-claim="Click here to change claim to {type}" + claiminfo-ui-click-toggle="Click here to toggle value" + claiminfo-ui-deny-messages="Deny Messages" + claiminfo-ui-flag-overrides="Flag Overrides" + claiminfo-ui-for-sale="For Sale" + claiminfo-ui-inherit-parent="Inherit Parent" + claiminfo-ui-last-active="Last Active" + claiminfo-ui-north-corners="North Corners" + claiminfo-ui-pvp-override="PvP Override" + claiminfo-ui-requires-claim-blocks="Requires Claim Blocks" + claiminfo-ui-return-bankinfo="Return to bank info" + claiminfo-ui-return-claiminfo="Return to claim info" + claiminfo-ui-return-settings="Return to standard Settings" + claiminfo-ui-size-restrictions="Size Restrictions" + claiminfo-ui-south-corners="South Corners" + claiminfo-ui-teleport-direction="Click here to teleport to {direction}&f corner of claim" + claiminfo-ui-teleport-feature="You do not have permission to use the teleport feature in this claim" + claiminfo-ui-teleport-spawn="Click here to teleport to claim spawn" + claiminfo-ui-title-claiminfo="Claim Info" + claiminfo-ui-town-settings="Town Settings" + claimlist-ui-click-info="Click to check more info" + claimlist-ui-click-purchase="Click here to purchase claim" + claimlist-ui-click-teleport-target="Click here to teleport to {name}&f {target}&f in &6{world}" + claimlist-ui-click-toggle-value="Click here to toggle {type} value" + claimlist-ui-click-view-children="Click here to view child claim list" + claimlist-ui-click-view-claims="Click here to view the claims you own" + claimlist-ui-no-claims-found="No claims found in world." + claimlist-ui-return-claimlist="Return to claims list" + claimlist-ui-title="Claim list" + claimlist-ui-title-child-claims="Child Claims" + command-blocked="&cThe command &f{command}&c has been blocked by claim owner &6{player}&c." + command-claimbuy-title="&bClaims for sale" + command-claimclear-killed="&cKilled &6{amount}&a entities of type {type}&f." + command-claimclear-no-entities="&cCould not locate any entities of type {type}&c." + command-claimclear-uuid-deny="&cOnly administrators may clear claims by UUID." + command-claimflagdebug-disabled="Claim flags debug &cOFF" + command-claimflagdebug-enabled="Claim flags debug &aON" + command-claiminfo-not-found="&cNo valid player or claim UUID found." + command-claiminfo-uuid-required="&cClaim UUID is required if executing from non-player source." + command-claiminherit-disabled="Parent claim inheritance &cOFF" + command-claiminherit-enabled="Parent claim inheritance &aON" + command-cuboid-disabled="&aNow claiming in &d2D&a mode." + command-cuboid-enabled="&aNow claiming in &d3D&a mode." + command-execute-failed="&cFailed to execute command '{command} {args}'" + command-inherit-only-child="&cThis command can only be used in child claims." + command-invalid="&cNo valid command entered." + command-invalid-claim="&cThis command cannot be used in {type}&c claims." + command-invalid-group="&cGroup &6{group}&c is not valid." + command-invalid-player="&cPlayer &6{player}&c is not valid." + command-invalid-player-group="&cNot a valid player or group." + command-not-available-economy="&cThis command is not available while server is in economy mode." + command-option-exceeds-admin="&cOption value of &a'{value}&c' exceeds admin set value of '&a{admin-value}&c'. Adjusting to admin value..." + command-player-not-found="&cPlayer '&6{player}&c' could not be found." + command-world-not-found="&cWorld '&6{world}&c' could not be found." + command-worldedit-missing="&cThis command requires WorldEdit to be installed on server." + create-cancel="&cThe creation of this claim has been cancelled." + create-cuboid-disabled="&cThe creation of &d3D&c cuboid claims has been disabled by an administrator.\nYou can only create &d3D&c claims as an Admin or on a &d2D&c claim that you own." + create-failed-claim-limit="&cYou've reached your limit of &a{limit}&c on {type}&c claims. Use &f/abandon&c to remove one before creating another." + create-insufficient-blocks-2d="&cYou don't have enough blocks to claim this area.\nYou need &a{amount}&c more blocks." + create-insufficient-blocks-3d="&cYou don't have enough blocks to claim this area.\nYou need &a{amount}&c more chunks. &f({block-amount})" + create-overlap="&cYou can't create a claim here because it would overlap your other claim. Use &f/abandonclaim&c to delete it, or use your shovel at a corner to resize it." + create-overlap-player="&cYou can't create a claim here because it would overlap &6{player}&c's claim." + create-overlap-short="&cYour selected area overlaps an existing claim." + create-subdivision-fail="&cNo claim exists at selected corner. Please click a valid block location within parent claim in order to create your subdivision." + create-subdivision-only="&cUnable to create claim. Only subdivisions can be created at a single block location." + create-success="{type}&a created! Use &f/trust&a to share it with friends." + debug-error-upload="&cError uploading content {content}&c." + debug-no-records="&cNo debug records to paste!" + debug-paste-success="&aPaste success!" + debug-record-end="Record end" + debug-record-start="Record start" + debug-time-elapsed="Time elapsed" + delete-all-player-success="&aDeleted all of &6{player}&a's claims." + delete-all-player-warning="&6Are you sure you want to delete all of &6{player}&6's claims?" + delete-all-type-deny="&cCould not delete all {type}&c claims. A plugin has denied it." + delete-all-type-success="&cDeleted all {type}&c claims." + delete-all-type-warning="&6Are you sure you want to delete all {type}&6 claims?" + delete-claim="&aClaim deleted." + economy-block-buy-invalid="&cBlock count must be greater than 0." + economy-block-buy-sell-disabled="&cSorry, buying and selling claim blocks is disabled." + economy-block-not-available="&cYou don't have that many claim blocks available for sale." + economy-block-only-buy="&cClaim blocks may only be purchased, not sold." + economy-block-only-sell="&cClaim blocks may only be sold, not purchased." + economy-block-purchase-confirmation="&aWithdrew &6{amount}&a from your account. You now have &6{balance}&a available claim blocks." + economy-block-purchase-cost="&aEach claim block costs &6{amount}&a. Your balance is &6{balance}&a." + economy-block-purchase-limit="&cThe new claim block total of &a{total}&c will exceed your claim block limit of &a{limit}&c. The transaction has been cancelled." + economy-block-sale-confirmation="&aDeposited &6{deposit}&a in your account. You now have &6{amount}&a available claim blocks." + economy-block-sell-error="&cCould not sell blocks. Reason: &f{reason}&c." + economy-claim-abandon-success="&aClaim(s) abandoned. You have been refunded a total of '&6{amount}&a'." + economy-claim-buy-cancelled="&cBuy cancelled! Could not buy claim from &6{player}&c. Result was &a{result}" + economy-claim-buy-confirmation="&6Are you sure you want to buy this claim for &a{amount}&6? Click confirm to proceed." + economy-claim-buy-confirmed="&aYou have successfully bought the claim for &6{amount}&a." + economy-claim-buy-not-enough-funds="&cYou do not have enough funds to purchase this claim for &a{amount}&c. You currently have a balance of &a{balance}&c and need &a{amount_required}&c more for purchase." + economy-claim-buy-transfer-cancelled="&cClaim transfer cancelled! Could not transfer owner &6{owner}&c to &6{player}&c. Result was &a{result}" + economy-claim-not-for-sale="&cThis claim is not for sale." + economy-claim-sale-cancelled="&aYou have cancelled your claim sale." + economy-claim-sale-confirmation="&6Are you sure you want to sell your claim for &a{amount}&6 ? If your claim is sold, all items and blocks will be transferred to the buyer. Click confirm if this is OK." + economy-claim-sale-confirmed="&aYou have successfully put your claim up for sale for the amount of &6{amount}&a." + economy-claim-sale-invalid-price="&cThe sale price of &a{amount}&c must be greater than or equal to &a0&c." + economy-claim-sold="&aYour claim sold! The amount of &6{amount}&a has been deposited into your account. Your total available balance is now &6{balance}&a." + economy-not-enough-funds="&cYou do not have enough funds to purchase this land. Your current economy balance is '&a{balance}&c' but you require '&a{amount}&c' to complete the purchase." + economy-not-installed="&cEconomy plugin not installed!." + economy-player-not-found="&cNo economy account found for player &6{player}&c." + economy-virtual-not-supported="&cEconomy plugin does not support virtual accounts which is required. Use another economy plugin or contact plugin dev for virtual account support." + economy-withdraw-error="&cCould not withdraw funds. Reason: &f{reason}&c." + feature-not-available="&cThis feature is currently being worked on and will be available in a future release." + flag-description-block-break="Controls whether a block can be broken.\n&dExample&f : To prevent any source from breaking dirt blocks, enter\n&a/cf block-break minecraft:dirt false\n&bNote&f : minecraft represents the modid and dirt represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-grow="Controls whether a block can grow.\n&dExample&f : To prevent a cactus from growing, enter\n&a/cf block-grow minecraft:cactus false\n&bNote&f : minecraft represents the modid and cactus represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-modify="Controls whether a block can be modified.\n&dExample&f : To prevent any source from igniting a block, enter\n&a/cf block-modify minecraft:fire false\n&bNote&f : minecraft represents the modid and fire represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-block-place="Controls whether a block can be placed.\n&dExample&f : To prevent any source from placing dirt blocks, enter\n&a/cf block-place minecraft:dirt false\n&bNote&f : minecraft represents the modid and dirt represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-collide-block="Controls whether an entity can collide with a block.\n&dExample&f : To prevent entity collisions with stone pressure plates, enter\n&a/cf collide-block minecraft:stone_pressure_plate false\n&bNote&f : minecraft represents the modid and stone_pressure_plate represents the block id.\nSpecifying no modid will always default to minecraft." + flag-description-collide-entity="Controls whether an entity can collide with an entity.\n&dExample&f : To prevent entity collisions with item frames, enter\n&a/cf collide-entity minecraft:item_frame false\n&bNote&f : minecraft represents the modid and item_frame represents the entity id.\nSpecifying no modid will always default to minecraft." + flag-description-command-execute="Controls whether a command can be executed.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft." + flag-description-command-execute-pvp="Controls whether a command can be executed while engaged in PvP.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft." + flag-description-enter-claim="Controls whether an entity can enter a claim.\n&dExample&f : To prevent players from entering a claim, enter\n&a/cf enter-claim player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-entity-chunk-spawn="Controls whether a saved entity can be spawned during chunk load.\n&dExample&f : To prevent horses from spawning during chunk load, enter\n&a/cf entity-chunk-spawn minecraft:horse false\n&bNote&f : This will remove &cALL&f saved entities when a chunk loads. If a chunk is already loaded, it will take affect after it reloads. Use with extreme caution." + flag-description-entity-damage="Controls whether an entity can be damaged.\n&dExample&f : To prevent animals from being damaged, enter\n&a/cf entity-damage minecraft:animal false." + flag-description-entity-riding="Controls whether an entity can be mounted.\n&dExample&f : To prevent horses from being mounted, enter\n&a/cf entity-riding minecraft:horse false." + flag-description-entity-spawn="Controls whether an entity can be spawned into the world.\n&dExample&f : To prevent pigs from spawning, enter\n&a/cf entity-spawn minecraft:pig false\n&bNote&f : This does not include entity items. See item-spawn flag" + flag-description-entity-teleport-from="Controls whether an entity can teleport from a claim.\n&dExample&f : To prevent players from teleporting from this claim, enter\n&a/cf entity-teleport-from player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-entity-teleport-to="Controls whether an entity can teleport to a claim.\n&dExample&f : To prevent players from teleporting to this claim, enter\n&a/cf entity-teleport-to player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-exit-claim="Controls whether an entity can exit a claim.\n&dExample&f : To prevent players from exiting this claim, enter\n&a/cf exit-claim player false\n&bNote&f : If you want to use this for groups, use the /cfg command." + flag-description-explosion-block="Controls whether an explosion can damage blocks in a claim.\n&dExample&f : To prevent an explosion from affecting any block, enter\n&a/cf explosion-block any false" + flag-description-explosion-entity="Controls whether an explosion can damage entities in a claim.\n&dExample&f : To prevent an explosion from affecting any entity, enter\n&a/cf explosion-entity any false" + flag-description-fire-spread="Controls whether fire can spread in a claim.\n&dExample&f : To prevent fire from spreading, enter\n&a/cf fire-spread any false\n&bNote&f : This does not prevent the initial fire from being placed, only spread." + flag-description-interact-block-primary="Controls whether a player can left-click(attack) a block.\n&dExample&f : To prevent players from left-clicking chests, enter\n&a/cf interact-block-primary minecraft:chest false" + flag-description-interact-block-secondary="Controls whether a player can right-click a block.\n&dExample&f : To prevent players from right-clicking(opening) chests, enter\n&a/cf interact-block-secondary minecraft:chest false" + flag-description-interact-entity-primary="Controls whether a player can left-click(attack) an entity.\n&dExample&f : To prevent players from left-clicking cows, enter\n&a/cf interact-entity-primary minecraft:cow false" + flag-description-interact-entity-secondary="Controls whether a player can right-click on an entity.\n&dExample&f : To prevent players from interacting with villagers, enter\n&a/cf interact-entity-secondary minecraft:villager false" + flag-description-interact-inventory="Controls whether a player can right-click(open) a block that contains inventory such as a chest.\n&dExample&f : To prevent players from opening chests, enter\n&a/cf interact-inventory minecraft:chest false" + flag-description-interact-inventory-click="Controls whether a player can click on an inventory slot.\n&dExample&f : To prevent players from clicking on an inventory slot that contains a diamond, enter\n&a/cf interact-inventory-click minecraft:diamond false" + flag-description-interact-item-primary="Controls whether a player can left-click(attack) with an item.\n&dExample&f : To prevent players from left-clicking with a diamond sword, enter\n&a/cf interact-item-primary minecraft:diamond_sword false" + flag-description-interact-item-secondary="Controls whether a player can right-click with an item.\n&dExample&f : To prevent players from right-clicking with flint and steel, enter\n&a/cf interact-item-secondary minecraft:flint_and_steel false" + flag-description-item-drop="Controls whether an item can be dropped in a claim.\n&dExample&f : To prevent diamond's from being dropped by players in this claim, enter\n&a/cf item-drop minecraft:flint_and_steel false context[source=player]" + flag-description-item-pickup="Controls whether an item can be picked up in a claim.\n&dExample&f : To prevent diamond's from being picked up by players, enter\n&a/cf item-pickup minecraft:diamond false" + flag-description-item-spawn="Controls whether an item can be spawned in a claim.\n&dExample&f : To prevent feather's from being spawned in this claim, enter\n&a/cf item-spawn minecraft:feather false" + flag-description-item-use="Controls whether an item can be used.\n&dExample&f : To prevent apples from being eaten in this claim, enter\n&a/cf item-use minecraft:apple false" + flag-description-leaf-decay="Controls whether leaves can decay in a claim.\n&dExample&f : To prevent leaves from decaying in this claim, enter\n&a/cf leaf-decay any false" + flag-description-liquid-flow="Controls whether liquid, such as lava and water, is allowed to flow in a claim.\n&dExample&f : To prevent any type of liquid flow in this claim, enter\n&a/cf liquid-flow any false" + flag-description-portal-use="Controls whether a portal can be used.\n&dExample&f : To prevent only players from using portal without affecting non-players, enter\n&a/cf portal-use any false context[source=player]" + flag-description-projectile-impact-block="Controls whether a projectile can impact(collide) with a block.\n&dExample&f : To prevent pixelmon pokeball's from impacting blocks, enter\n&a/cf projectile-impact-block any false[source=pixelmon:occupiedpokeball]\n&bNote&f : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc." + flag-description-projectile-impact-entity="Controls whether a projectile can impact(collide) with an entity.\n&dExample&f : To prevent arrows shot by players from impacting entities, enter\n&a/cf projectile-impact-entity minecraft:arrow false[source=player]\n&bNote&f : This involves things such as potions, arrows, throwables, pixelmon pokeballs, etc." + flag-invalid-context="&cInvalid context '&f{context}&c' entered for base flag &f{flag}&c." + flag-invalid-meta="&cInvalid target meta '&f{value}&c' entered for base flag &f{flag}&c." + flag-invalid-target="&cInvalid target '&f{target}&c' entered for base flag &f{flag}&c." + flag-not-found="&cFlag {flag}&c not found." + flag-not-set="{flag}&f is currently not set.\nThe default claim value of {value}&f will be active until set." + flag-overridden="&cFailed to set claim flag. The flag &f{flag}&c has been overridden by an admin." + flag-override-not-supported="&cClaim type {type}&c does not support flag overrides." + flag-reset-success="&aClaim flags reset to defaults successfully." + flag-set-permission-target="&aSet {type}&a permission &b{permission}&a with contexts &7{contexts}&a to {value}&a on &6{target}&a." + flag-ui-click-allow="Click here to allow this flag." + flag-ui-click-deny="Click here to deny this flag." + flag-ui-click-remove="Click here to remove this flag." + flag-ui-click-toggle="Click here to toggle {flag}&f value." + flag-ui-info-claim="Claim is checked before default values. Allows claim owners to specify flag settings in claim only." + flag-ui-info-default="Default is last to be checked. Both claim and override take priority over this." + flag-ui-info-inherit="Inherit is an enforced flag set by a parent claim that cannot changed." + flag-ui-info-override="Override has highest priority and is checked above both default and claim values. Allows admins to override all basic and admin claims." + flag-ui-inherit-parent="This flag is inherited from parent claim {name}&f and &ncannot&f be changed." + flag-ui-override-no-permission="This flag has been overridden by an administrator and can &n&cNOT&f be changed." + flag-ui-override-permission="{flag}&f is currently being &coverridden&f by an administrator.\nClick here to remove this flag." + flag-ui-return-flags="Return to flags" + label-accessors="Accessors" + label-area="Area" + label-blocks="Blocks" + label-builders="Builders" + label-buy="Buy" + label-children="children" + label-confirm="Confirm" + label-containers="Containers" + label-context="Context" + label-created="Created" + label-displaying="Displaying" + label-expired="Expired" + label-farewell="Farewell" + label-flag="Flag" + label-greeting="Greeting" + label-group="Group" + label-location="Location" + label-managers="Managers" + label-name="Name" + label-no="No" + label-output="Output" + label-owner="Owner" + label-permission="Permission" + label-player="Player" + label-price="Price" + label-resizable="Resizable" + label-result="Result" + label-schematic="Schematic" + label-source="Source" + label-spawn="Spawn" + label-target="Target" + label-trust="Trust" + label-type="Type" + label-unknown="Unknown" + label-user="User" + label-world="World" + label-yes="Yes" + mode-admin="&aAdministrative claims mode active. Any claims created will be free and editable by other administrators." + mode-basic="&aBasic claim creation mode enabled." + mode-nature="&aReady to restore claim! Right click on a block to restore, and use &f/modebasic&c to stop." + mode-subdivision="&aSubdivision mode. Use your shovel to create subdivisions in your existing claims. Use &f/modebasic&a to exit." + mode-town="&aTown creation mode enabled." + owner-admin="an administrator" + permission-access="&cYou don't have &6{player}&c's permission to access that." + permission-assign-without-having="&cYou are not allowed to assign a permission that you do not have." + permission-build="&cYou don't have &6{player}&c's permission to build." + permission-build-near-claim="&cYou don't have &6{player}&c's permission to build near claim." + permission-claim-create="&cYou don't have permission to claim land." + permission-claim-delete="&cYou don't have permission to delete {type}&c claims." + permission-claim-enter="&cYou don't have permission to enter this claim." + permission-claim-exit="&cYou don't have permission to exit this claim." + permission-claim-ignore="&cYou do not have permission to ignore {type}&c claims." + permission-claim-list="&cYou don't have permission to get information about another player's land claims." + permission-claim-manage="&cYou don't have permission to manage {type}&c claims." + permission-claim-reset-flags="&cYou don't have permission to reset {type}&c claims to flag defaults." + permission-claim-reset-flags-self="&cYou don't have permission to reset your claim flags to defaults." + permission-claim-resize="&cYou don't have permission to resize this claim." + permission-claim-sale="&cYou don't have permission to sell this claim." + permission-claim-transfer-admin="&cYou don't have permission to transfer admin claims." + permission-clear="&cCleared permissions in this claim. To set permission for ALL your claims, stand outside them." + permission-clear-all="&cOnly the claim owner can clear all permissions." + permission-command-trust="&cYou don't have permission to use this type of trust." + permission-cuboid="&cYou don't have permission to create/resize basic claims in 3D mode." + permission-edit-claim="&cYou don't have permission to edit this claim." + permission-fire-spread="&cYou don't have permission to spread fire in this claim." + permission-flag-defaults="&cYou don't have permission to manage flag defaults." + permission-flag-overrides="&cYou don't have permission to manage flag overrides." + permission-flag-use="&cYou don't have permission to use this flag." + permission-flow-liquid="&cYou don't have permission to flow liquid in this claim." + permission-global-option="&cYou don't have permission to manage global options." + permission-grant="&cYou can't grant a permission you don't have yourself." + permission-group-option="&cYou don't have permission to assign an option to a group." + permission-interact-block="&cYou don't have &6{player}'s &cpermission to interact with the block &d{block}&c." + permission-interact-entity="&cYou don't have &6{player}'s &cpermission to interact with the entity &d{entity}&c." + permission-interact-item="&cYou don't have &6{player}'s &cpermission to interact with the item &d{item}&c." + permission-interact-item-block="&cYou don't have permission to use &d{item}&c on a &b{block}&c." + permission-interact-item-entity="&cYou don't have permission to use &d{item}&c on a &b{entity}&c." + permission-inventory-open="&cYou don't have &6{player}'s&c permission to open &d{block}&c." + permission-item-drop="&cYou don't have &6{player}'s&c permission to drop the item &d{item}&c in this claim." + permission-item-use="&cYou can't use the item &d{item}&c in this claim." + permission-override-deny="&cThe action you are attempting to perform has been denied by an administrator's override flag." + permission-player-admin-flags="&cYou don't have permission to change flags on an admin player." + permission-player-option="&cYou don't have permission to assign an option to a player." + permission-player-view-others="&cYou don't have permission to view other players." + permission-portal-enter="&cYou can't use this portal because you don't have &6{player}'s &cpermission to enter the destination claim." + permission-portal-exit="&cYou can't use this portal because you don't have &6{player}'s &cpermission to exit the destination claim." + permission-protected-portal="&cYou don't have permission to use portals in this claim owned by &6{player}'s&c." + permission-trust="&cYou don't have &6{player}'s&c permission to manage permissions here." + permission-visual-claims-nearby="&cYou don't have permission to visualize nearby claims." + player-accrued-blocks-exceeded="&cPlayer &6{player}&c has a total of &6{total}&c and will exceed the maximum allowed accrued claim blocks if granted an additional &6{amount}&c of blocks.\nEither lower the amount or have an admin grant the user with an override." + player-remaining-blocks-2d="&aYou may claim up to &6{block-amount}&a more blocks." + player-remaining-blocks-3d="&aYou may claim up to &6{chunk-amount}&a more chunks. &f({block-amount})" + playerinfo-ui-abandon-return-ratio="&eAbandoned Return Ratio&f : &a{ratio}" + playerinfo-ui-block-accrued="&eAccrued Blocks&f : &a{amount}&7(&d{block_amount}&f per hour&7)" + playerinfo-ui-block-bonus="&eBonus Blocks&f : &a{amount}" + playerinfo-ui-claim-level="&eMin/Max Claim Level&f : &a{level}" + playerinfo-ui-claim-size-limit="&eClaim Size Limits&f : &a{limit}" + playerinfo-ui-block-initial="&eInitial Blocks&f : &a{amount}" + playerinfo-ui-block-max-accrued="&eMax Accrued Blocks&f : &a{amount}" + playerinfo-ui-block-remaining="&eRemaining Blocks&f : &a{amount}" + playerinfo-ui-block-total="&eTotal Blocks&f : &a{amount}" + playerinfo-ui-claim-total="&eTotal Claims&f : &a{amount}" + playerinfo-ui-last-active="&eLast Active&f : {date}" + playerinfo-ui-tax-current-rate="&eCurrent Claim Tax Rate&f : &a{rate}" + playerinfo-ui-tax-global-claim-rate="&eGlobal Claim Tax Rate&f : &a{rate}" + playerinfo-ui-tax-global-town-rate="&eGlobal Town Tax Rate&f : &a{rate}" + playerinfo-ui-tax-total="&eTotal Tax&f : &a{amount}" + playerinfo-ui-title="Player Info" + playerinfo-ui-uuid="&eUUID&f : &7{id}" + playerinfo-ui-world="&eWorld&f : &7{name}" + plugin-command-not-found="&cCould not locate the command '&a{command}&c' for plugin &b{id}&a." + plugin-event-cancel="&cA plugin has cancelled this action." + plugin-reload="&aGriefDefender has been reloaded." + resize-overlap="&cCan't resize here because it would overlap another nearby claim." + resize-overlap-subdivision="&cYou can't create a subdivision here because it would overlap another subdivision. Consider &f/abandon&c to delete it, or use your shovel at a corner to resize it." + resize-same-location="&cYou must select a different block location to resize claim." + resize-start="&aResizing claim. Use your shovel again at the new location for this corner." + resize-success-2d="&aClaim resized. You have &6{amount} &amore blocks remaining." + resize-success-3d="&aClaim resized. You have &6{amount} &amore chunks remaining. &f({block-amount})" + result-type-change-deny="&cYou cannot change a claim to {type}." + result-type-change-not-admin="&cYou do not have administrative permissions to change type to {type}&c." + result-type-child-same="{type}&c claims cannot have direct {type}&c children claims." + result-type-create-deny="{type}'s&c cannot be created in the {target_type}." + result-type-no-children="{type}'s&c cannot contain children claims." + result-type-only-subdivision="{type}'s&c can only contain subdivisions." + result-type-requires-owner="&cCould not convert {type} claim to {target_type}. Owner is required." + schematic-create="&aCreating schematic backup..." + schematic-create-complete="&aSchematic backup complete." + schematic-create-fail="&cSchematic could not be created." + schematic-deleted="&aSchematic {name} has been deleted." + schematic-none="&aThere are no schematic backups for this claim." + schematic-restore-click="&aClick here to restore claim schematic.\nName: {name}\nCreated: {date}" + schematic-restore-confirmation="&6Are you sure you want to restore? Clicking confirm will restore &cALL&6 claim data with schematic. Use cautiously!" + schematic-restore-confirmed="&aYou have successfully restored your claim from schematic backup &b{name}&a." + spawn-not-set="&cNo claim spawn has been set." + spawn-set-success="&aSuccessfully set claim spawn to &b{location}&a." + spawn-teleport="&aTeleported to claim spawn at &b{location}&a." + tax-claim-expired="&cThis claim has been frozen due to unpaid taxes. The current amount owed is '&a{amount}&c'.\nThere are '&a{days}&c' days left to deposit payment to claim bank in order to unfreeze this claim.\nFailure to pay this debt will result in deletion of claim.\nNote: To deposit funds to claimbank, use &f/claimbank&c deposit ." + tax-claim-paid-balance="&aThe tax debt of '&6{amount}&a' has been paid. Your claim has been unfrozen and is now available for use." + tax-claim-paid-partial="&aThe tax debt of '&6{amount}&a' has been partially paid. In order to unfreeze your claim, the remaining tax owed balance of '&6{balance}&a' must be paid." + tax-info="&aYour next scheduled tax payment of &6{amount}&a will be withdrawn from your account on &b{date}&a." + tax-past-due="&cYou currently have a past due tax balance of &a{balance}&c that must be paid by &b{date}&c. Failure to pay off your tax balance will result in losing your property." + title-accessor="ACCESSOR" + title-all="ALL" + title-builder="BUILDER" + title-claim="CLAIM" + title-container="CONTAINER" + title-default="DEFAULT" + title-inherit="INHERIT" + title-manager="MANAGER" + title-own="OWN" + title-override="OVERRIDE" + tool-not-equipped="&cYou do not have {tool}&c equipped." + town-chat-disabled="&aTown chat disabled." + town-chat-enabled="&aTown chat enabled." + town-create-not-enough-funds="&cYou do not have enough funds to create this town for &a{amount}&c. You currently have a balance of &a{balance}&c and need &a{amount-needed}&c more for creation." + town-name="&aSet town name to {name}&a." + town-not-found="&cTown not found." + town-not-in="&cYou are not in a town." + town-owner="&cThat belongs to the town." + town-tag="&aSet town tag to {tag}." + town-tag-clear="&aThe town tag has been cleared." + town-tax-no-claims="&cYou must own property in this town in order to be taxed." + trust-already-has="&c{target} already has {type}&c permission." + trust-click-show-list="Click here to show list of all players and groups trusted in claim." + trust-grant="&aGranted &6{target}&a permission to {type}&a in current claim." + trust-individual-all-claims="&aGranted &6{player}'s&a full trust to all your claims. To unset permissions for ALL your claims, use &f/untrustall&a." + trust-invalid="&cInvalid trust type entered.\nThe allowed types are : accessor, builder, container, and manager." + trust-list-header="Explicit permissions here:" + trust-no-claims="&cYou have no claims to trust." + trust-plugin-cancel="&cCould not trust {target}&c. A plugin has denied it." + trust-self="&cYou cannot trust yourself." + tutorial-claim-basic="&eClick for Land Claim Help: &ahttp://bit.ly/mcgpuser" + ui-click-filter-type="Click here to filter by {type}&f." + untrust-individual-all-claims="&aRevoked &6{target}'s&a access to ALL your claims. To set permissions for a single claim, stand inside it and use &f/untrust&a." + untrust-individual-single-claim="&aRevoked &6{target}'s&a access to this claim. To unset permissions for ALL your claims, use &f/untrustall&a." + untrust-no-claims="&cYou have no claims to untrust." + untrust-owner="&6{owner}&a is owner of claim and cannot be untrusted." + untrust-self="&cYou cannot untrust yourself." + } +} \ No newline at end of file