File tree Expand file tree Collapse file tree 2 files changed +8
-18
lines changed
AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/illegals/items
AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/illegals/items Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -248,16 +248,11 @@ public void onPlayerArmorChange(PlayerArmorChangeEvent event) {
248248
249249 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
250250 public void onInventoryClick (InventoryClickEvent event ) {
251+ if (event .isCancelled () && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
251252 if (guiPluginsSupported && event .getInventory ().getLocation () == null ) return ;
252-
253- if (illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) {
254- if ( event .isCancelled ()
255- || event .getClick () == ClickType .DROP
256- || event .getClick () == ClickType .CONTROL_DROP
257- || event .getClick () == ClickType .WINDOW_BORDER_LEFT
258- || event .getClick () == ClickType .WINDOW_BORDER_RIGHT ) {
259- return ;
260- }
253+ if (event .getClick () == ClickType .DROP || event .getClick () == ClickType .CONTROL_DROP
254+ || event .getClick () == ClickType .WINDOW_BORDER_LEFT || event .getClick () == ClickType .WINDOW_BORDER_RIGHT ) {
255+ return ;
261256 }
262257
263258 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getWhoClicked ().getUniqueId ())) {
Original file line number Diff line number Diff line change @@ -247,16 +247,11 @@ public void onPlayerArmorChange(PlayerArmorChangeEvent event) {
247247
248248 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
249249 public void onInventoryClick (InventoryClickEvent event ) {
250+ if (event .isCancelled () && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
250251 if (guiPluginsSupported && event .getInventory ().getLocation () == null ) return ;
251-
252- if (illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) {
253- if ( event .isCancelled ()
254- || event .getClick () == ClickType .DROP
255- || event .getClick () == ClickType .CONTROL_DROP
256- || event .getClick () == ClickType .WINDOW_BORDER_LEFT
257- || event .getClick () == ClickType .WINDOW_BORDER_RIGHT ) {
258- return ;
259- }
252+ if (event .getClick () == ClickType .DROP || event .getClick () == ClickType .CONTROL_DROP
253+ || event .getClick () == ClickType .WINDOW_BORDER_LEFT || event .getClick () == ClickType .WINDOW_BORDER_RIGHT ) {
254+ return ;
260255 }
261256
262257 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getWhoClicked ().getUniqueId ())) {
You can’t perform that action at this time.
0 commit comments