From 9dd4fe1a2f1fa9cd4b2f75d329bfee328ecdc33d Mon Sep 17 00:00:00 2001 From: Benlier Date: Wed, 11 Nov 2020 19:17:38 +0100 Subject: [PATCH] Add permission check equipment Based on asedit.invisible checks Fixes #37 + version bump --- pom.xml | 2 +- .../io/github/rypofalem/armorstandeditor/PlayerEditor.java | 1 + .../io/github/rypofalem/armorstandeditor/menu/Menu.java | 6 ++++-- src/main/resources/plugin.yml | 5 ++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 624f982f..afe56256 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.rypofalem.armorstandeditor armorstandeditor jar - 1.16-25 + 1.16-26 armorstandeditor http://maven.apache.org diff --git a/src/main/java/io/github/rypofalem/armorstandeditor/PlayerEditor.java b/src/main/java/io/github/rypofalem/armorstandeditor/PlayerEditor.java index 82b565dd..ccc718ea 100644 --- a/src/main/java/io/github/rypofalem/armorstandeditor/PlayerEditor.java +++ b/src/main/java/io/github/rypofalem/armorstandeditor/PlayerEditor.java @@ -153,6 +153,7 @@ private void resetPosition(ArmorStand armorStand) { } private void openEquipment(ArmorStand armorStand) { + if(!getPlayer().hasPermission("asedit.equipment")) return; equipMenu = new EquipmentMenu(this, armorStand); equipMenu.open(); } diff --git a/src/main/java/io/github/rypofalem/armorstandeditor/menu/Menu.java b/src/main/java/io/github/rypofalem/armorstandeditor/menu/Menu.java index d20a48c3..810937e6 100644 --- a/src/main/java/io/github/rypofalem/armorstandeditor/menu/Menu.java +++ b/src/main/java/io/github/rypofalem/armorstandeditor/menu/Menu.java @@ -123,8 +123,10 @@ private void fillInventory() { rotate = createIcon( new ItemStack(Material.COMPASS, 1), "rotate", "mode rotate"); - equipment = createIcon(new ItemStack(Material.CHEST, 1), - "equipment", "mode equipment"); + if(pe.getPlayer().hasPermission("asedit.equipment")) { + equipment = createIcon(new ItemStack(Material.CHEST, 1), + "equipment", "mode equipment"); + } copy = createIcon(new ItemStack(Material.WRITABLE_BOOK), "copy","mode copy"); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 303722c8..12674ed6 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ArmorStandEditor main: io.github.rypofalem.armorstandeditor.ArmorStandEditorPlugin -version: 1.16-24 +version: 1.16-26 api-version: "1.13" website: rypofalem.github.io author: RypoFalem @@ -20,3 +20,6 @@ permissions: asedit.rename: description: Rename armorstands default: true + asedit.equipment: + description: Access armorstand equipment GUI + default: true