Minor update
- Fixed startup message saying noFlightDurability is disabled when it's actually enabled and vice-versa. - Improved order of noFlightDurability checking. It's faster now. - Fixed default message saying that BigDoors couldn't find the message.
This commit is contained in:
		@@ -110,10 +110,10 @@ public class ArmoredElytra extends JavaPlugin implements Listener
 | 
				
			|||||||
            if (config.noFlightDurability())
 | 
					            if (config.noFlightDurability())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Bukkit.getPluginManager().registerEvents(new FlyDurabilityHandler(nbtEditor), this);
 | 
					                Bukkit.getPluginManager().registerEvents(new FlyDurabilityHandler(nbtEditor), this);
 | 
				
			||||||
                myLogger(Level.INFO, "Durability penalty for flying disabled!");
 | 
					                myLogger(Level.INFO, "Durability penalty for flying enabled!");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
                myLogger(Level.INFO, "Durability penalty for flying enabled!");
 | 
					                myLogger(Level.INFO, "Durability penalty for flying disabled!");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Log all allowed enchantments.
 | 
					            // Log all allowed enchantments.
 | 
				
			||||||
            myLogger(Level.INFO, ("Allowed enchantments:"));
 | 
					            myLogger(Level.INFO, ("Allowed enchantments:"));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -303,9 +303,11 @@ public class EventHandlers implements Listener
 | 
				
			|||||||
                    enchantments = combineEnchantments(enchantments, meta.getStoredEnchants());
 | 
					                    enchantments = combineEnchantments(enchantments, meta.getStoredEnchants());
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                //$FALL-THROUGH$
 | 
				
			||||||
            case BLOCK:
 | 
					            case BLOCK:
 | 
				
			||||||
                event.setResult(null);
 | 
					                event.setResult(null);
 | 
				
			||||||
                player.updateInventory();
 | 
					                player.updateInventory();
 | 
				
			||||||
 | 
					                //$FALL-THROUGH$
 | 
				
			||||||
            case NONE:
 | 
					            case NONE:
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,9 +22,12 @@ public class FlyDurabilityHandler implements Listener
 | 
				
			|||||||
    @EventHandler
 | 
					    @EventHandler
 | 
				
			||||||
    public void onItemDamage(PlayerItemDamageEvent e)
 | 
					    public void onItemDamage(PlayerItemDamageEvent e)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (e.getItem().getType() == Material.ELYTRA)
 | 
					        if (e.getItem().getType() != Material.ELYTRA)
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        if (!e.getPlayer().isFlying())
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (nbtEditor.getArmorTier(e.getItem()) != ArmorTier.NONE)
 | 
					        if (nbtEditor.getArmorTier(e.getItem()) != ArmorTier.NONE)
 | 
				
			||||||
                if (e.getPlayer().isFlying())
 | 
					 | 
				
			||||||
            e.setCancelled(true);
 | 
					            e.setCancelled(true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -87,7 +87,7 @@ public class Messages
 | 
				
			|||||||
        value = messageMap.get(key);
 | 
					        value = messageMap.get(key);
 | 
				
			||||||
        if (value == null)
 | 
					        if (value == null)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            value = "BigDoors: Translation not found! Contact server admin!";
 | 
					            value = "ArmoredElytra: Translation not found! Contact server admin!";
 | 
				
			||||||
            plugin.myLogger(Level.WARNING, "Failed to get translation for key " + key);
 | 
					            plugin.myLogger(Level.WARNING, "Failed to get translation for key " + key);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return value;
 | 
					        return value;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user