NyarukoDev / ElytraBalance

Configurable options to balance the power of the elytra.
https://www.spigotmc.org/resources/elytrabalance.33518/
2 stars 1 forks source link

FixListener mending bug #1

Closed ghost closed 4 years ago

ghost commented 4 years ago

My players noticed that the mending enchantment was not being applied to Elytra.

Inspection of the FixListener class revealed that the mending enchantment is always blocked:

@EventHandler(priority = EventPriority.HIGHEST)
    public void onFix(PlayerItemMendEvent event) {
        if(event.getItem().getType() == Material.ELYTRA) {
            event.setRepairAmount(0);
        }
    }

I have added similar condition checking as is applied to anvil repairing (config permission and override permission).

I have also added canMendElytra as a seperate config option as I think some people may want to enable one type of repairing but not the other.

Finally, I refactored the config initialisation code slightly to gracefully update the user's config file if upgrading from a previous version.

NyarukoDev commented 4 years ago

Thanks for this update! Apologies for the delay in merging.