added permission support

This commit is contained in:
mfnalex 2018-08-13 18:32:33 +02:00
parent 1d85716207
commit 4968553a4a
3 changed files with 25 additions and 14 deletions

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="J:/BuildTools/Spigot/Spigot-API/target/spigot-api-1.13-R0.1-SNAPSHOT-shaded.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="/Users/alex/BuildTools/Spigot/Spigot-API/target/spigot-api-1.13-R0.1-SNAPSHOT-shaded.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,13 +1,19 @@
main: de.jeffclan.JeffChestSort.JeffChestSortPlugin
name: ChestSort
version: 1.4
version: 1.5
api-version: 1.13
description: Allows automatic chest sorting
author: mfnalex
website: www.jeff-media.de
prefix: ChestSort
prefix: ChestSort
database: false
commands:
chestsort:
description: Toggle automatic chest sorting
usage: /<command>
aliases: sort
aliases: sort
permission: chestsort.use
permissions:
chestsort.use:
description: Allows usage of automatic chest sorting
default: op

View File

@ -62,6 +62,11 @@ public class JeffChestSortListener implements Listener {
}
Player p = (Player) event.getPlayer();
if(!p.hasPermission("chestsort.use")) {
return;
}
JeffChestSortPlayerSetting setting = plugin.PerPlayerSettings.get(p.getUniqueId().toString());
if (!(event.getInventory().getHolder() instanceof Chest)