mirror of
https://github.com/JamesPeters98/ChestsPlusPlus.git
synced 2024-11-15 07:05:45 +01:00
Added remote open permission
This commit is contained in:
parent
f0a7d3231f
commit
e12bc92019
@ -48,12 +48,14 @@ import org.bukkit.plugin.java.annotation.plugin.author.Author;
|
|||||||
@Command(name = "chests++", desc = "Chests++ Commands.", aliases = {"c++"}, usage = "/chests++ version")})
|
@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.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, 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.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.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.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.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.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, 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_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)
|
@Permission(name = Permissions.AUTOCRAFT_REMOVE, desc = "Gives permission to remove AutoCrafting stations.", defaultValue = PermissionDefault.TRUE)
|
||||||
public class ChestsPlusPlus extends JavaPlugin {
|
public class ChestsPlusPlus extends JavaPlugin {
|
||||||
@ -110,6 +112,7 @@ public class ChestsPlusPlus extends JavaPlugin {
|
|||||||
|
|
||||||
if(Settings.isUpdateCheckEnabled() && !isDev && !isBeta) {
|
if(Settings.isUpdateCheckEnabled() && !isDev && !isBeta) {
|
||||||
String SPIGOT_URL = "https://www.spigotmc.org/resources/chests-chest-linking-hopper-filtering-remote-chests-menus.71355/";
|
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
|
UpdateCheck updateChecker = UpdateCheck
|
||||||
.of(this)
|
.of(this)
|
||||||
.resourceId(71355)
|
.resourceId(71355)
|
||||||
@ -120,7 +123,7 @@ public class ChestsPlusPlus extends JavaPlugin {
|
|||||||
getLogger().warning("New version of the plugin has been found: " + version);
|
getLogger().warning("New version of the plugin has been found: " + version);
|
||||||
getLogger().warning("Download at: "+SPIGOT_URL);
|
getLogger().warning("Download at: "+SPIGOT_URL);
|
||||||
Bukkit.broadcastMessage(ChatColor.RED + "[Chests++] New version of the plugin was found: " + version);
|
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;
|
break;
|
||||||
case LATEST:
|
case LATEST:
|
||||||
if(!boot) getLogger().info("Plugin is up to date! Thank you for supporting Chests++!");
|
if(!boot) getLogger().info("Plugin is up to date! Thank you for supporting Chests++!");
|
||||||
|
@ -93,7 +93,7 @@ public class AutoCraftCommand extends ServerCommand {
|
|||||||
}
|
}
|
||||||
case OPEN:
|
case OPEN:
|
||||||
if(args.length > 1){
|
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;
|
AutoCraftingStorage invs;
|
||||||
if(args[1].contains(":")){
|
if(args[1].contains(":")){
|
||||||
invs = Config.getAutoCraft().getStorage(player,args[1]);
|
invs = Config.getAutoCraft().getStorage(player,args[1]);
|
||||||
|
@ -97,7 +97,7 @@ public class ChestLinkCommand extends ServerCommand {
|
|||||||
}
|
}
|
||||||
case OPEN:
|
case OPEN:
|
||||||
if(args.length > 1){
|
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;
|
ChestLinkStorage invs;
|
||||||
if(args[1].contains(":")){
|
if(args[1].contains(":")){
|
||||||
invs = Config.getChestLink().getStorage(player,args[1]);
|
invs = Config.getChestLink().getStorage(player,args[1]);
|
||||||
|
@ -4,12 +4,14 @@ public class Permissions {
|
|||||||
|
|
||||||
public static final String ADD = "chestlink.add";
|
public static final String ADD = "chestlink.add";
|
||||||
public static final String OPEN = "chestlink.open";
|
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 MENU = "chestlink.menu";
|
||||||
public static final String REMOVE = "chestlink.remove";
|
public static final String REMOVE = "chestlink.remove";
|
||||||
public static final String OPEN_ANY = "chestlink.openall";
|
public static final String OPEN_ANY = "chestlink.openall";
|
||||||
public static final String MEMBER = "chestlink.member";
|
public static final String MEMBER = "chestlink.member";
|
||||||
public static final String SORT = "chestlink.sort";
|
public static final String SORT = "chestlink.sort";
|
||||||
public static final String AUTOCRAFT_OPEN = "chestlink.autocraft.open";
|
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_ADD = "chestlink.autocraft.add";
|
||||||
public static final String AUTOCRAFT_REMOVE = "chestlink.autocraft.remove";
|
public static final String AUTOCRAFT_REMOVE = "chestlink.autocraft.remove";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user