5555public abstract class IllegalItemModule extends AEFModule implements Listener {
5656
5757 protected final AEFPermission bypassPermission ;
58- protected final IllegalHandling handling ;
58+ protected final IllegalHandling illegalHandling ;
5959 protected final boolean guiPluginsSupported ;
6060
6161 protected final Set <Listener > optionalListeners ;
@@ -82,11 +82,11 @@ public IllegalItemModule(String configPath, boolean defEnabled, AEFPermission by
8282 handling = IllegalHandling .PREVENT_USE_ONLY ;
8383 warn ("Handling option '" + configuredHandling + "' not recognized. Defaulting to " + handling .name ());
8484 }
85- this .handling = handling ;
85+ this .illegalHandling = handling ;
8686
8787 this .guiPluginsSupported = config .getBoolean (configPath + ".gui-plugins-supported" , false , """
8888 Enable this if you have problems with the plugin removing items from chest guis.""" );
89- if (this .handling == IllegalHandling .STRICT ) {
89+ if (this .illegalHandling == IllegalHandling .STRICT ) {
9090 optionalListeners .add (new Listener () {
9191 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
9292 private void onInventoryOpen (InventoryOpenEvent event ) {
@@ -206,7 +206,7 @@ public ItemLegality legalityOf(@Nullable Iterable<ItemStack> itemStacks) {
206206
207207 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
208208 public void onPlayerItemConsume (PlayerItemConsumeEvent event ) {
209- if (event .isCancelled () && handling == IllegalHandling .PREVENT_USE_ONLY ) return ;
209+ if (event .isCancelled () && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
210210
211211 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getPlayer ().getUniqueId ())) {
212212 event .setCancelled (true );
@@ -223,7 +223,7 @@ public void onPlayerItemConsume(PlayerItemConsumeEvent event) {
223223
224224 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
225225 public void onBlockDispense (BlockDispenseEvent event ) {
226- if (event .isCancelled () && handling == IllegalHandling .PREVENT_USE_ONLY ) return ;
226+ if (event .isCancelled () && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
227227
228228 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getBlock ().getLocation ())) {
229229 event .setCancelled (true );
@@ -238,7 +238,7 @@ public void onBlockDispense(BlockDispenseEvent event) {
238238
239239 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
240240 public void onPlayerArmorChange (PlayerArmorChangeEvent event ) {
241- if (handling == IllegalHandling .PREVENT_USE_ONLY ) return ; // Cant cancel this event
241+ if (illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ; // Cant cancel this event
242242
243243 if (!AnarchyExploitFixes .permissions ().permissionValue (event .getPlayer (), bypassPermission .node ()).toBoolean ()) {
244244 handleItem (event .getNewItem (), legalityOf (event .getNewItem ()));
@@ -250,7 +250,7 @@ public void onPlayerArmorChange(PlayerArmorChangeEvent event) {
250250 public void onInventoryClick (InventoryClickEvent event ) {
251251 if (guiPluginsSupported && event .getInventory ().getLocation () == null ) return ;
252252
253- if (handling == IllegalHandling .PREVENT_USE_ONLY ) {
253+ if (illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) {
254254 if ( event .isCancelled ()
255255 || event .getClick () == ClickType .DROP
256256 || event .getClick () == ClickType .CONTROL_DROP
@@ -286,7 +286,7 @@ public void onInventoryClick(InventoryClickEvent event) {
286286
287287 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
288288 public void onInventoryDrag (InventoryDragEvent event ) {
289- if (handling == IllegalHandling .PREVENT_USE_ONLY ) return ;
289+ if (illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
290290 if (guiPluginsSupported && event .getInventory ().getLocation () == null ) return ;
291291
292292 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getWhoClicked ().getUniqueId ())) {
@@ -308,7 +308,7 @@ public void onInventoryDrag(InventoryDragEvent event) {
308308
309309 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
310310 public void onPrePlayerAttackEntity (PrePlayerAttackEntityEvent event ) {
311- if (event .isCancelled () && handling == IllegalHandling .PREVENT_USE_ONLY ) return ;
311+ if (event .isCancelled () && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
312312
313313 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getPlayer ().getUniqueId ())) {
314314 event .setCancelled (true );
@@ -336,7 +336,7 @@ public void onPrePlayerAttackEntity(PrePlayerAttackEntityEvent event) {
336336
337337 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
338338 public void onEntityDamageByEntity (EntityDamageByEntityEvent event ) {
339- if (event .isCancelled () && handling == IllegalHandling .PREVENT_USE_ONLY ) return ;
339+ if (event .isCancelled () && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
340340
341341 if (event .getDamager ().getType () == EntityType .PLAYER ) {
342342 final Player player = (Player ) event .getDamager ();
@@ -369,7 +369,7 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
369369 if (EntityUtil .isLivingEntity (event .getDamager ())) {
370370 if (legalityOf (((LivingEntity ) event .getDamager ()).getActiveItem ()) != ItemLegality .LEGAL ) {
371371 event .setCancelled (true );
372- if (handling != IllegalHandling .PREVENT_USE_ONLY )
372+ if (illegalHandling != IllegalHandling .PREVENT_USE_ONLY )
373373 event .getDamager ().getScheduler ().execute (plugin , event .getDamager ()::remove , null , 1L );
374374 return ;
375375 }
@@ -378,15 +378,15 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
378378 if (EntityUtil .isInventoryHolder (event .getDamager ())) {
379379 if (legalityOf (((InventoryHolder ) event .getDamager ()).getInventory ()) != ItemLegality .LEGAL ) {
380380 event .setCancelled (true );
381- if (handling != IllegalHandling .PREVENT_USE_ONLY )
381+ if (illegalHandling != IllegalHandling .PREVENT_USE_ONLY )
382382 event .getDamager ().getScheduler ().execute (plugin , event .getDamager ()::remove , null , 1L );
383383 }
384384 }
385385 }
386386
387387 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
388388 public void onPlayerAttemptPickupItem (PlayerAttemptPickupItemEvent event ) {
389- if (event .isCancelled () && handling == IllegalHandling .PREVENT_USE_ONLY ) return ;
389+ if (event .isCancelled () && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
390390
391391 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getPlayer ().getUniqueId ())) {
392392 event .setCancelled (true );
@@ -407,7 +407,7 @@ public void onPlayerAttemptPickupItem(PlayerAttemptPickupItemEvent event) {
407407
408408 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
409409 public void onPlayerDropItem (PlayerDropItemEvent event ) {
410- if (event .isCancelled () && handling == IllegalHandling .PREVENT_USE_ONLY ) return ;
410+ if (event .isCancelled () && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
411411
412412 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getPlayer ().getUniqueId ())) {
413413 event .setCancelled (true );
@@ -427,7 +427,7 @@ public void onPlayerDropItem(PlayerDropItemEvent event) {
427427
428428 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
429429 public void onPlayerInteract (PlayerInteractEvent event ) {
430- if (event .useItemInHand () == Event .Result .DENY && handling == IllegalHandling .PREVENT_USE_ONLY ) return ;
430+ if (event .useItemInHand () == Event .Result .DENY && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
431431
432432 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getPlayer ().getUniqueId ())) {
433433 event .setCancelled (true );
@@ -447,7 +447,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {
447447
448448 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = false )
449449 public void onPlayerInteractEntity (PlayerInteractEntityEvent event ) {
450- if (event .isCancelled () && handling == IllegalHandling .PREVENT_USE_ONLY ) return ;
450+ if (event .isCancelled () && illegalHandling == IllegalHandling .PREVENT_USE_ONLY ) return ;
451451
452452 if (listenerCooldowns .get (event .getClass (), createIfAbsent ).contains (event .getPlayer ().getUniqueId ())) {
453453 event .setCancelled (true );
0 commit comments