From d1c2a029bf87b77e7e774da7dadad4887dfb6ae9 Mon Sep 17 00:00:00 2001 From: wizjany Date: Fri, 15 Mar 2019 22:38:38 -0400 Subject: [PATCH] Move some platform stuff to load, put enable back to postworld. --- .../java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 9 +++++++-- worldedit-bukkit/src/main/resources/plugin.yml | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 9b50aa982..54de04928 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -110,6 +110,8 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { */ @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 class WorldEditPlugin extends JavaPlugin implements TabCompleter { EntityType.REGISTRY.register("minecraft:" + mcid.toLowerCase(), new EntityType("minecraft:" + mcid.toLowerCase())); } } + } + + private void setupTags() { // Tags try { - for (org.bukkit.Tag blockTag : Bukkit.getTags(Tag.REGISTRY_BLOCKS, Material.class)) { + for (Tag blockTag : Bukkit.getTags(Tag.REGISTRY_BLOCKS, Material.class)) { BlockCategory.REGISTRY.register(blockTag.getKey().toString(), new BlockCategory(blockTag.getKey().toString())); } - for (org.bukkit.Tag itemTag : Bukkit.getTags(Tag.REGISTRY_ITEMS, Material.class)) { + for (Tag itemTag : Bukkit.getTags(Tag.REGISTRY_ITEMS, Material.class)) { ItemCategory.REGISTRY.register(itemTag.getKey().toString(), new ItemCategory(itemTag.getKey().toString())); } } catch (NoSuchMethodError e) { diff --git a/worldedit-bukkit/src/main/resources/plugin.yml b/worldedit-bukkit/src/main/resources/plugin.yml index 27808257f..e64d26bdc 100644 --- a/worldedit-bukkit/src/main/resources/plugin.yml +++ b/worldedit-bukkit/src/main/resources/plugin.yml @@ -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