This commit is contained in:
mfnalex 2023-11-12 21:56:41 +01:00
parent a28996b161
commit a43daf27d0
No known key found for this signature in database
GPG Key ID: 4A5852356225BAE1
3 changed files with 16 additions and 5 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

@ -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: