diff --git a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/ChestsPlusPlus.java b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/ChestsPlusPlus.java index 863e7c3..ec9353b 100644 --- a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/ChestsPlusPlus.java +++ b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/ChestsPlusPlus.java @@ -48,12 +48,14 @@ import org.bukkit.plugin.java.annotation.plugin.author.Author; @Command(name = "chests++", desc = "Chests++ Commands.", aliases = {"c++"}, usage = "/chests++ version")}) @Permission(name = Permissions.ADD, desc = "Gives permission to add ChestLinks!", defaultValue = PermissionDefault.TRUE) @Permission(name = Permissions.OPEN, desc = "Gives permission to open ChestLinks!", defaultValue = PermissionDefault.TRUE) +@Permission(name = Permissions.OPEN_REMOTE, desc = "Gives permission to remotely open ChestLinks!", defaultValue = PermissionDefault.TRUE) @Permission(name = Permissions.MENU, desc = "Gives permission to open the ChestLink menu!", defaultValue = PermissionDefault.TRUE) @Permission(name = Permissions.REMOVE, desc = "Gives permission to remove a ChestLink!", defaultValue = PermissionDefault.TRUE) @Permission(name = Permissions.OPEN_ANY, desc = "Gives permission to open all chests/autocraft stations, for admin use.", defaultValue = PermissionDefault.OP) @Permission(name = Permissions.MEMBER, desc = "Gives permission to add/remove a member to/from their chestlink.", defaultValue = PermissionDefault.TRUE) @Permission(name = Permissions.SORT, desc = "Gives permission to sort ChestLinks.", defaultValue = PermissionDefault.TRUE) @Permission(name = Permissions.AUTOCRAFT_OPEN, desc = "Gives permission to open AutoCrafting stations.", defaultValue = PermissionDefault.TRUE) +@Permission(name = Permissions.AUTOCRAFT_OPEN_REMOTE, desc = "Gives permission to remotely open AutoCrafting stations.", defaultValue = PermissionDefault.TRUE) @Permission(name = Permissions.AUTOCRAFT_ADD, desc = "Gives permission to add AutoCrafting stations.", defaultValue = PermissionDefault.TRUE) @Permission(name = Permissions.AUTOCRAFT_REMOVE, desc = "Gives permission to remove AutoCrafting stations.", defaultValue = PermissionDefault.TRUE) public class ChestsPlusPlus extends JavaPlugin { @@ -110,6 +112,7 @@ public class ChestsPlusPlus extends JavaPlugin { if(Settings.isUpdateCheckEnabled() && !isDev && !isBeta) { String SPIGOT_URL = "https://www.spigotmc.org/resources/chests-chest-linking-hopper-filtering-remote-chests-menus.71355/"; + String BUKKIT_URL = "https://dev.bukkit.org/projects/chests-plus-plus/files"; UpdateCheck updateChecker = UpdateCheck .of(this) .resourceId(71355) @@ -120,7 +123,7 @@ public class ChestsPlusPlus extends JavaPlugin { getLogger().warning("New version of the plugin has been found: " + version); getLogger().warning("Download at: "+SPIGOT_URL); Bukkit.broadcastMessage(ChatColor.RED + "[Chests++] New version of the plugin was found: " + version); - Bukkit.broadcastMessage(ChatColor.RED + "[Chests++] Download at: " +ChatColor.WHITE+ SPIGOT_URL); + Bukkit.broadcastMessage(ChatColor.RED + "[Chests++] Download at: " +ChatColor.WHITE+ BUKKIT_URL); break; case LATEST: if(!boot) getLogger().info("Plugin is up to date! Thank you for supporting Chests++!"); diff --git a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/commands/AutoCraftCommand.java b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/commands/AutoCraftCommand.java index e485fb3..8ca0649 100644 --- a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/commands/AutoCraftCommand.java +++ b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/commands/AutoCraftCommand.java @@ -93,7 +93,7 @@ public class AutoCraftCommand extends ServerCommand { } case OPEN: if(args.length > 1){ - if(sender.hasPermission(Permissions.AUTOCRAFT_OPEN) && !Settings.isBlacklistedWorld(player.getWorld())) { + if(sender.hasPermission(Permissions.AUTOCRAFT_OPEN) && sender.hasPermission(Permissions.AUTOCRAFT_OPEN_REMOTE) && !Settings.isBlacklistedWorld(player.getWorld())) { AutoCraftingStorage invs; if(args[1].contains(":")){ invs = Config.getAutoCraft().getStorage(player,args[1]); diff --git a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/commands/ChestLinkCommand.java b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/commands/ChestLinkCommand.java index f9bef80..a5635a9 100644 --- a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/commands/ChestLinkCommand.java +++ b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/commands/ChestLinkCommand.java @@ -97,7 +97,7 @@ public class ChestLinkCommand extends ServerCommand { } case OPEN: if(args.length > 1){ - if(sender.hasPermission(Permissions.OPEN) && !Settings.isBlacklistedWorld(player.getWorld())) { + if(sender.hasPermission(Permissions.OPEN) && sender.hasPermission(Permissions.OPEN_REMOTE) && !Settings.isBlacklistedWorld(player.getWorld())) { ChestLinkStorage invs; if(args[1].contains(":")){ invs = Config.getChestLink().getStorage(player,args[1]); diff --git a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/misc/Permissions.java b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/misc/Permissions.java index 53e229a..dc18d27 100644 --- a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/misc/Permissions.java +++ b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/misc/Permissions.java @@ -4,12 +4,14 @@ public class Permissions { public static final String ADD = "chestlink.add"; public static final String OPEN = "chestlink.open"; + public static final String OPEN_REMOTE = "chestlink.remote-open"; public static final String MENU = "chestlink.menu"; public static final String REMOVE = "chestlink.remove"; public static final String OPEN_ANY = "chestlink.openall"; public static final String MEMBER = "chestlink.member"; public static final String SORT = "chestlink.sort"; public static final String AUTOCRAFT_OPEN = "chestlink.autocraft.open"; + public static final String AUTOCRAFT_OPEN_REMOTE = "chestlink.autocraft.remote-open"; public static final String AUTOCRAFT_ADD = "chestlink.autocraft.add"; public static final String AUTOCRAFT_REMOVE = "chestlink.autocraft.remove"; }