Closed robinjam closed 10 years ago
Ok had a look through the code, and I have some thoughts.
First question is.. does this stop the plugin from loading?
If it does, then this can be fixed simply by putting a try { .. } catch(e) { .. }
statement in.
E.g. Change:
getServer().getPluginManager().addPermission(p);
To:
try {
getServer().getPluginManager().addPermission(p);
} catch(IllegalArgumentException e) {
// ... already defined, so ignore ..?
}
ALSO you could easily switch this plugin over to using Vault?
It's a little more complicated than that, I'm afraid. Material.getId()
is deprecated since the concept of item IDs is being removed in a future version of Minecraft.
For forward-compatibility the KeepItems permission system really needs to be re-written to use item names rather than item IDs, but that will also require every user of KeepItems to update their permission configuration, which is less than ideal.
This is why I haven't come up with a solution yet. Ideally, I want to allow people to keep using item IDs for now to ease the transition to the next release of KeepItems. But I don't want the plugin to break when Minecraft 1.8 comes out.
As for Vault support... It's a possibility, but I'm not really sure how useful it'd be. Please open another issue if you wish to discuss it further.
I'd be more than happy to redo my permissions. Backwards compatibility isn't a big issue to me compared to a working plugin. :)
@robinjam if you'd like I could write a small script to go through each Material and make some sort of reference system?
I've put out a temporary fix for this issue, pending approval on BukkitDev. I'll re-visit the issue when Minecraft 1.8 comes out and the new item system has been finalised.
Plugin enable fails with error: