Move some platform stuff to load, put enable back to postworld.

This commit is contained in:
wizjany 2019-03-15 22:38:38 -04:00
parent 678a78a982
commit d1c2a029bf
2 changed files with 7 additions and 3 deletions

View File

@ -110,6 +110,8 @@ public void onLoad() {
*/
@Override
public void onEnable() {
setupTags(); // these have to be done post-world since they rely on MC registries. the other ones just use Bukkit enums
PermissionsResolverManager.initialize(this); // Setup permission resolver
// Register CUI
@ -168,12 +170,15 @@ public void setupRegistries() {
EntityType.REGISTRY.register("minecraft:" + mcid.toLowerCase(), new EntityType("minecraft:" + mcid.toLowerCase()));
}
}
}
private void setupTags() {
// Tags
try {
for (org.bukkit.Tag<Material> blockTag : Bukkit.getTags(Tag.REGISTRY_BLOCKS, Material.class)) {
for (Tag<Material> blockTag : Bukkit.getTags(Tag.REGISTRY_BLOCKS, Material.class)) {
BlockCategory.REGISTRY.register(blockTag.getKey().toString(), new BlockCategory(blockTag.getKey().toString()));
}
for (org.bukkit.Tag<Material> itemTag : Bukkit.getTags(Tag.REGISTRY_ITEMS, Material.class)) {
for (Tag<Material> itemTag : Bukkit.getTags(Tag.REGISTRY_ITEMS, Material.class)) {
ItemCategory.REGISTRY.register(itemTag.getKey().toString(), new ItemCategory(itemTag.getKey().toString()));
}
} catch (NoSuchMethodError e) {

View File

@ -1,7 +1,6 @@
name: WorldEdit
main: com.sk89q.worldedit.bukkit.WorldEditPlugin
version: "${internalVersion}"
load: STARTUP
api-version: 1.13
# Permissions aren't here. Read http://wiki.sk89q.com/wiki/WEPIF/DinnerPerms