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:
Pim van der Loos 2019-05-21 13:09:59 +02:00
parent 45486a7eea
commit 81e4111359
No known key found for this signature in database
GPG Key ID: C16F020ADAE6D5A8
4 changed files with 12 additions and 7 deletions

View File

@ -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:"));

View File

@ -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;
} }

View File

@ -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)
if (nbtEditor.getArmorTier(e.getItem()) != ArmorTier.NONE) return;
if (e.getPlayer().isFlying()) if (!e.getPlayer().isFlying())
e.setCancelled(true); return;
if (nbtEditor.getArmorTier(e.getItem()) != ArmorTier.NONE)
e.setCancelled(true);
} }
} }

View File

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