mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-26 01:59:20 +00:00
Cancel inventory edits when editing is disabled, tweak listener logic for better compatibility
This commit is contained in:
@@ -65,7 +65,7 @@ public class DataEditor {
|
||||
* @param user The online user with an inventory open to check
|
||||
* @return {@code true} if edits to the inventory or ender chest menu are allowed; {@code false} otherwise, including if they don't have an inventory open
|
||||
*/
|
||||
public boolean cancelInventoryEdit(@NotNull OnlineUser user) {
|
||||
public boolean cancelMenuEdit(@NotNull OnlineUser user) {
|
||||
if (this.openInventoryMenus.containsKey(user.uuid)) {
|
||||
return !this.openInventoryMenus.get(user.uuid).canEdit;
|
||||
}
|
||||
|
||||
@@ -165,11 +165,8 @@ public abstract class EventListener {
|
||||
plugin.getDataEditor().closeInventoryMenu(user, menuInventory);
|
||||
}
|
||||
|
||||
public final boolean cancelMenuClick(@NotNull OnlineUser user) {
|
||||
if (disabling) {
|
||||
return true;
|
||||
}
|
||||
return plugin.getDataEditor().cancelInventoryEdit(user);
|
||||
public final boolean cancelInventoryClick(@NotNull OnlineUser user) {
|
||||
return plugin.getDataEditor().cancelMenuEdit(user) || cancelPlayerEvent(user);
|
||||
}
|
||||
|
||||
public final boolean cancelPlayerEvent(@NotNull OnlineUser user) {
|
||||
|
||||
Reference in New Issue
Block a user