diff --git a/README.md b/README.md index 726f2ae2..60f514f6 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Aliases in case of command conflicts: /ps, /protectionstone, /protectionstones, protectionstones.home - Access to the /ps home command. protectionstones.sethome - Access to /ps sethome. protectionstones.tp - Access to /ps tp command. - protectionstones.tp.bypasswait - Bypass the wait time set in the config for /ps home + protectionstones.tp.bypasswait - Bypass the wait time set in the config for /ps home and /ps tp protectionstones.tp.bypassprevent - Bypass prevent_teleport_in option in config protectionstones.priority - Allows players to set their region's priority. protectionstones.owners - Allows players to add or remove region owners. Allows players to use /ps info owners command. diff --git a/src/main/java/me/vik1395/ProtectionStones/Config.java b/src/main/java/me/vik1395/ProtectionStones/Config.java index b7fc7fe4..59464e5f 100644 --- a/src/main/java/me/vik1395/ProtectionStones/Config.java +++ b/src/main/java/me/vik1395/ProtectionStones/Config.java @@ -45,10 +45,10 @@ public class Config { Boolean uuidupdated; @Path("placing_cooldown") int placingCooldown; - @Path("allow_dangerous_commands") - Boolean allowDangerousCommands; - @Path("base_command") - String baseCommand; + //@Path("allow_dangerous_commands") + //Boolean allowDangerousCommands; + //@Path("base_command") + //String baseCommand; public static void initConfig() { diff --git a/src/main/java/me/vik1395/ProtectionStones/ListenerClass.java b/src/main/java/me/vik1395/ProtectionStones/ListenerClass.java index 26d864a8..4b288da6 100644 --- a/src/main/java/me/vik1395/ProtectionStones/ListenerClass.java +++ b/src/main/java/me/vik1395/ProtectionStones/ListenerClass.java @@ -362,7 +362,7 @@ public void onPistonRetract(BlockPistonRetractEvent e) { public void onPlayerTeleport(PlayerTeleportEvent event) { if (event.getCause() == TeleportCause.ENDER_PEARL || event.getCause() == TeleportCause.CHORUS_FRUIT) return; - if (event.getPlayer().hasPermission("protectionstones.tp.bypasswait")) return; + if (event.getPlayer().hasPermission("protectionstones.tp.bypassprevent")) return; WorldGuardPlugin wg = (WorldGuardPlugin) ProtectionStones.wgd; RegionManager rgm = WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(event.getTo().getWorld())); diff --git a/src/main/java/me/vik1395/ProtectionStones/commands/ArgAdmin.java b/src/main/java/me/vik1395/ProtectionStones/commands/ArgAdmin.java index b9c42c11..db066278 100644 --- a/src/main/java/me/vik1395/ProtectionStones/commands/ArgAdmin.java +++ b/src/main/java/me/vik1395/ProtectionStones/commands/ArgAdmin.java @@ -62,11 +62,9 @@ public static boolean argumentAdmin(CommandSender p, String[] args) { case "lastlogons": return ArgAdminLastlogon.argumentAdminLastLogons(p, args); case "fixregions": - Bukkit.getScheduler().runTaskAsynchronously(ProtectionStones.getPlugin(), () -> { - p.sendMessage(ChatColor.YELLOW + "Fixing..."); - ProtectionStones.upgradeRegions(); - p.sendMessage(ChatColor.YELLOW + "Done!"); - }); + p.sendMessage(ChatColor.YELLOW + "Fixing..."); + ProtectionStones.upgradeRegions(); + p.sendMessage(ChatColor.YELLOW + "Done!"); break; } return true; diff --git a/src/main/java/me/vik1395/ProtectionStones/commands/ArgGet.java b/src/main/java/me/vik1395/ProtectionStones/commands/ArgGet.java index d3ca3dbc..fff04fc6 100644 --- a/src/main/java/me/vik1395/ProtectionStones/commands/ArgGet.java +++ b/src/main/java/me/vik1395/ProtectionStones/commands/ArgGet.java @@ -26,6 +26,11 @@ public static boolean argumentGet(Player p, String[] args) { return true; } + if (!cp.permission.equals("") && !p.hasPermission(cp.permission)) { + p.sendMessage(PSL.NO_PERMISSION_GET.msg()); + return true; + } + // check if player has enough money if (ProtectionStones.isVaultEnabled && !ProtectionStones.vaultEconomy.has(p, cp.price)) { p.sendMessage(PSL.NOT_ENOUGH_MONEY.msg().replace("%price%", String.format("%.2f", cp.price))); diff --git a/src/main/resources/block1.toml b/src/main/resources/block1.toml index f699f010..529fe4bc 100644 --- a/src/main/resources/block1.toml +++ b/src/main/resources/block1.toml @@ -86,6 +86,7 @@ worlds = [ [player] # Whether or not to prevent teleporting into a protected region if the player doesn't own it (except with ender pearl and chorus fruit) + # Bypass with protectionstones.tp.bypasstp prevent_teleport_in = false # Can't move for x seconds before teleporting with /ps home or /ps tp. Can be disabled with 0.