Compare commits

...

4 Commits

Author SHA1 Message Date
Nick Hulston aeafc9e368
Merge df3dcbe98b into ac97dad5ed 2023-11-20 19:50:02 -05:00
mfnalex ac97dad5ed
Merge remote-tracking branch 'origin/master' 2023-11-12 21:58:25 +01:00
mfnalex a43daf27d0
13.6.4 2023-11-12 21:56:41 +01:00
Nick Hulston df3dcbe98b
Update Hotkey.java
Auto Sort was using chestsort.use. As a result, if any player had permission 'chestsort.automatic' set to false, they would still see the automatic sort in the GUI, instead of the nopermission barrier.
2023-03-07 15:44:55 -05:00
4 changed files with 17 additions and 6 deletions

View File

@ -9,7 +9,7 @@
<name>ChestSort</name>
<url>https://www.chestsort.de</url>
<description>Allows automatic chest sorting!</description>
<version>13.6.3</version>
<version>13.6.4</version>
<packaging>jar</packaging>
<properties>
@ -216,6 +216,13 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.jeff-media.cesspool.modules</groupId>
<artifactId>yaml-commands</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.jeff_media</groupId>
<artifactId>JeffLib</artifactId>

View File

@ -40,7 +40,7 @@ public enum Hotkey {
public static String getPermission(Hotkey hotkey) {
if(hotkey == AUTO_SORT) {
return "chestsort.use";
return "chestsort.automatic";
}
if(hotkey == AUTO_INV_SORT) {

View File

@ -34,13 +34,15 @@ public class NewUI {
String buttonName = conf.getString("slots." + slot);
//if(!player.hasPermission("chestsort.hotkey." + buttonName)) {
Hotkey key = Hotkey.fromPermission(buttonName);
if(!Hotkey.fromPermission(buttonName).hasPermission(player)) {
if(key != null && !Hotkey.fromPermission(buttonName).hasPermission(player)) {
buttonName = buttonName + "-nopermission";
} else {
boolean enabled = Hotkey.fromPermission(buttonName).hasEnabled(player);
boolean enabled = true;
if(key != null) enabled = Hotkey.fromPermission(buttonName).hasEnabled(player);
//System.out.println(buttonName + " is enabled: " + enabled);
buttonName = buttonName + (enabled ? "-enabled" : "-disabled");
if(key != null) buttonName = buttonName + (enabled ? "-enabled" : "-disabled");
}
if(main.isDebug()) System.out.println("Button name: " + buttonName);
ItemStack button = ItemStackUtils.fromConfigurationSection(conf.getConfigurationSection("items." + buttonName));
//System.out.println(button);
if(button.hasItemMeta() && !buttonName.endsWith("-nopermission")) {

View File

@ -5,7 +5,7 @@
# over and over again. I wrote a tiny explanation about them here:
# https://wiki.jeff-media.com/books/general-information/page/yaml-anchors
# Items can be defined using the following values:
# Items can be defined inside the "items" section using the following values:
# material: DIAMOND
# display-name: "My Diamond"
# lore:
@ -27,6 +27,8 @@
# console:
# - "tell {player} Hello" # command that will be run as the console
# You can then reference the item in the "slots" section using their defined name.
title: "<#000000>&l[<#007700>&lChest<#339933>&lSort<#000000>&l] &rSettings"
size: 45
items: