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:
parent
45486a7eea
commit
81e4111359
@ -110,10 +110,10 @@ public class ArmoredElytra extends JavaPlugin implements Listener
|
||||
if (config.noFlightDurability())
|
||||
{
|
||||
Bukkit.getPluginManager().registerEvents(new FlyDurabilityHandler(nbtEditor), this);
|
||||
myLogger(Level.INFO, "Durability penalty for flying disabled!");
|
||||
myLogger(Level.INFO, "Durability penalty for flying enabled!");
|
||||
}
|
||||
else
|
||||
myLogger(Level.INFO, "Durability penalty for flying enabled!");
|
||||
myLogger(Level.INFO, "Durability penalty for flying disabled!");
|
||||
|
||||
// Log all allowed enchantments.
|
||||
myLogger(Level.INFO, ("Allowed enchantments:"));
|
||||
|
@ -303,9 +303,11 @@ public class EventHandlers implements Listener
|
||||
enchantments = combineEnchantments(enchantments, meta.getStoredEnchants());
|
||||
break;
|
||||
}
|
||||
//$FALL-THROUGH$
|
||||
case BLOCK:
|
||||
event.setResult(null);
|
||||
player.updateInventory();
|
||||
//$FALL-THROUGH$
|
||||
case NONE:
|
||||
return;
|
||||
}
|
||||
|
@ -22,9 +22,12 @@ public class FlyDurabilityHandler implements Listener
|
||||
@EventHandler
|
||||
public void onItemDamage(PlayerItemDamageEvent e)
|
||||
{
|
||||
if (e.getItem().getType() == Material.ELYTRA)
|
||||
if (nbtEditor.getArmorTier(e.getItem()) != ArmorTier.NONE)
|
||||
if (e.getPlayer().isFlying())
|
||||
e.setCancelled(true);
|
||||
if (e.getItem().getType() != Material.ELYTRA)
|
||||
return;
|
||||
if (!e.getPlayer().isFlying())
|
||||
return;
|
||||
|
||||
if (nbtEditor.getArmorTier(e.getItem()) != ArmorTier.NONE)
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class Messages
|
||||
value = messageMap.get(key);
|
||||
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);
|
||||
}
|
||||
return value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user