diff --git a/bukkit/src/main/java/com/griefdefender/command/CommandHelper.java b/bukkit/src/main/java/com/griefdefender/command/CommandHelper.java index e890171..2f4ca84 100644 --- a/bukkit/src/main/java/com/griefdefender/command/CommandHelper.java +++ b/bukkit/src/main/java/com/griefdefender/command/CommandHelper.java @@ -989,15 +989,27 @@ public static Consumer createTeleportConsumer(CommandSender src, return; } Player player = (Player) src; - GDClaim gpClaim = (GDClaim) claim; - GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getPlayerData(player.getWorld(), player.getUniqueId()); - if (!playerData.canIgnoreClaim(gpClaim) && !playerData.canManageAdminClaims) { + GDClaim gdClaim = (GDClaim) claim; + final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getPlayerData(player.getWorld(), player.getUniqueId()); + if (!playerData.canIgnoreClaim(gdClaim) && !playerData.canManageAdminClaims) { // 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)) { + if (!player.hasPermission(GDPermissions.COMMAND_CLAIM_INFO_TELEPORT_OTHERS)) { TextAdapter.sendComponent(player, MessageCache.getInstance().CLAIMINFO_UI_TELEPORT_FEATURE.color(TextColor.RED)); return; } + if (!gdClaim.isUserTrusted(player, TrustTypes.ACCESSOR)) { + if (GriefDefenderPlugin.getInstance().getVaultProvider() != null) { + // Allow non-trusted to TP to claims for sale + if (!gdClaim.getEconomyData().isForSale()) { + TextAdapter.sendComponent(player, MessageCache.getInstance().CLAIMINFO_UI_TELEPORT_FEATURE.color(TextColor.RED)); + return; + } + } else { + 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, MessageCache.getInstance().CLAIMINFO_UI_TELEPORT_FEATURE.color(TextColor.RED)); return; diff --git a/sponge/src/main/java/com/griefdefender/command/CommandHelper.java b/sponge/src/main/java/com/griefdefender/command/CommandHelper.java index 1fb4052..e5f5166 100644 --- a/sponge/src/main/java/com/griefdefender/command/CommandHelper.java +++ b/sponge/src/main/java/com/griefdefender/command/CommandHelper.java @@ -1000,15 +1000,27 @@ public static Consumer createTeleportConsumer(CommandSource src, return; } Player player = (Player) src; - GDClaim gpClaim = (GDClaim) claim; - GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getPlayerData(player.getWorld(), player.getUniqueId()); - if (!playerData.canIgnoreClaim(gpClaim) && !playerData.canManageAdminClaims) { + GDClaim gdClaim = (GDClaim) claim; + final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getPlayerData(player.getWorld(), player.getUniqueId()); + if (!playerData.canIgnoreClaim(gdClaim) && !playerData.canManageAdminClaims) { // 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)) { + if (!player.hasPermission(GDPermissions.COMMAND_CLAIM_INFO_TELEPORT_OTHERS)) { TextAdapter.sendComponent(player, MessageCache.getInstance().CLAIMINFO_UI_TELEPORT_FEATURE.color(TextColor.RED)); return; } + if (!gdClaim.isUserTrusted(player, TrustTypes.ACCESSOR)) { + if (GriefDefenderPlugin.getInstance().economyService.isPresent()) { + // Allow non-trusted to TP to claims for sale + if (!gdClaim.getEconomyData().isForSale()) { + TextAdapter.sendComponent(player, MessageCache.getInstance().CLAIMINFO_UI_TELEPORT_FEATURE.color(TextColor.RED)); + return; + } + } else { + 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, MessageCache.getInstance().CLAIMINFO_UI_TELEPORT_FEATURE.color(TextColor.RED)); return;