1.16.x IMPORTANT NEED HELP!!

Discussion in 'Spigot Plugin Development' started by Nitishking, May 5, 2021 at 5:43 AM.

  1. Hey Guys so I needed PerWorldPluign for my 1.16 server so I decided to Update it for personal use but i have a problem now it is loading but it disables every plugin command in every world. Code is in attached file
     

    Attached Files:

  2. just give a snippet of codes and post the actual error logs.
     
  3. There are no Error in the Console
     
  4. If you do /pl, is your plugin red?
     
  5. no
     
  6. Hmm, maybe check your code if it has any mistakes.
     
  7. its like it disables all plugin commands like if i put essentials, all essentails commands will not get registered and it will say "Unknown Command "
     
  8. I did but i don't see any error
     
  9. It does not have to be an error, it could be just something that you wrote wrong.
     
  10. The code its not full I will send full if you want


    PerWorldPlugin.java:

    Code (Text):
    package me.nitish;

    import java.lang.reflect.Field;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.List;
    import java.util.Map;
    import java.util.logging.Level;
    import java.util.regex.Pattern;

    import me.nitish.transparentlisteners.PerWorldPluginLoader;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.World;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.SimpleCommandMap;
    import org.bukkit.configuration.ConfigurationSection;
    import org.bukkit.configuration.file.FileConfiguration;
    import org.bukkit.craftbukkit.v1_16_R3.command.CraftCommandMap;
    import org.bukkit.event.Event;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.block.BlockEvent;
    import org.bukkit.event.entity.EntityEvent;
    import org.bukkit.event.hanging.HangingEvent;
    import org.bukkit.event.inventory.InventoryEvent;
    import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
    import org.bukkit.event.player.PlayerEvent;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.event.player.PlayerKickEvent;
    import org.bukkit.event.player.PlayerLoginEvent;
    import org.bukkit.event.player.PlayerPreLoginEvent;
    import org.bukkit.event.player.PlayerQuitEvent;
    import org.bukkit.event.server.ServerEvent;
    import org.bukkit.event.vehicle.VehicleEvent;
    import org.bukkit.event.weather.WeatherEvent;
    import org.bukkit.event.world.WorldEvent;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.PluginLoader;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.plugin.java.JavaPluginLoader;

    public class PerWorldPlugins extends JavaPlugin
    {
        public static PerWorldPlugins instance;
        public List<Class<?>> exemptEvents;
        private boolean isExemptEnabled;
        public String blockedMessage;
        public boolean isUpdatesEnabled;
       
        public PerWorldPlugins() {
            this.exemptEvents = Arrays.asList(AsyncPlayerPreLoginEvent.class, PlayerJoinEvent.class, PlayerKickEvent.class, PlayerLoginEvent.class, PlayerPreLoginEvent.class, PlayerQuitEvent.class);
            this.isExemptEnabled = true;
            this.isUpdatesEnabled = true;
        }
       
        public void onLoad() {
            (PerWorldPlugins.instance = this).$("Registering event interceptor...");
            final PerWorldPluginLoader pwpLoader = new PerWorldPluginLoader(Bukkit.getServer());
            this.injectExistingPlugins(pwpLoader);
            this.cleanJavaPluginLoaders(pwpLoader);
        }
       
        private void injectExistingPlugins(final PerWorldPluginLoader pwpLoader) {
            Plugin[] plugins;
            for (int length = (plugins = Bukkit.getPluginManager().getPlugins()).length, i = 0; i < length; ++i) {
                final Plugin p = plugins[i];
                if (p instanceof JavaPlugin) {
                    final JavaPlugin jp = (JavaPlugin)p;
                    try {
                        final Field f = JavaPlugin.class.getDeclaredField("loader");
                        f.setAccessible(true);
                        f.set(jp, pwpLoader);
                    }
                    catch (Exception e) {
                        Bukkit.getServer().getLogger().log(Level.SEVERE, "PerWorldPlugins failed injecting " + jp.getDescription().getFullName() + " with the new PluginLoader, contact the developers on BukkitDev!", e);
                    }
                }
            }
        }
       
        private void cleanJavaPluginLoaders(final PerWorldPluginLoader pwpLoader) {
            final PluginManager spm = Bukkit.getPluginManager();
            try {
                final Field field = spm.getClass().getDeclaredField("fileAssociations");
                field.setAccessible(true);
                final Field modifiersField = Field.class.getDeclaredField("modifiers");
                modifiersField.setAccessible(true);
                modifiersField.setInt(field, field.getModifiers() & 0xFFFFFFEF);
                final Map<Pattern, PluginLoader> map = (Map<Pattern, PluginLoader>)field.get(spm);
                for (final Map.Entry<Pattern, PluginLoader> entry : map.entrySet()) {
                    if (entry.getValue() instanceof JavaPluginLoader) {
                        entry.setValue((PluginLoader)pwpLoader);
                    }
                }
                field.set(spm, map);
            }
            catch (Exception e) {
                Bukkit.getServer().getLogger().log(Level.SEVERE, "PerWorldPlugins failed replacing the existing PluginLoader, contact the developers on BukkitDev!", e);
            }
        }
       
        public void onEnable() {
            this.getCommand("pwp").setExecutor((CommandExecutor)new PWPCommandExecutor());
            this.reloadConfig();
            this.loadConfig();
            final boolean isInjected = false;
            this.$("Enabled, attempting to inject CommandHandler...");
            try {
                final Field f = Bukkit.getServer().getClass().getDeclaredField("commandMap");
                if (f.getType().getClass().getPackage().getName().contains("Myles")) {
                    Bukkit.getServer().getLogger().log(Level.SEVERE, "Looks like the FakeSimpleCommandMap has already been injected, If this is a reload please ignore.");
                    return;
                }
                if (!isInjected) {
                    f.setAccessible(true);
                    final SimpleCommandMap oldCommandMap = (SimpleCommandMap)f.get(Bukkit.getServer());
                    f.set(Bukkit.getServer(), new FakeSimpleCommandMap((CraftCommandMap) oldCommandMap));
                }
            }
            catch (Exception e) {
                Bukkit.getServer().getLogger().log(Level.SEVERE, "PerWorldPlugins failed replacing the existing PluginLoader, contact the developers on BukkitDev!", e);
            }
        }
       
        public void $(final String s) {
            System.out.println("[PerWorldPlugins] " + s);
        }
       
        @SuppressWarnings("rawtypes")
        public void loadConfig() {
            this.saveDefaultConfig();
            final FileConfiguration c = this.getConfig();
            if (!c.isBoolean("exempt-login-events") || !c.contains("exempt-login-events") || !c.isSet("exempt-login-events")) {
                c.set("exempt-login-events", (Object)true);
            }
            this.isExemptEnabled = c.getBoolean("exempt-login-events", true);
            if (!c.isBoolean("check-for-updates") || !c.contains("check-for-updates") || !c.isSet("check-for-updates")) {
                c.set("check-for-updates", (Object)true);
            }
            this.isUpdatesEnabled = c.getBoolean("check-for-updates", true);
            if (!c.isString("blocked-msg") || !c.contains("blocked-msg") || !c.isSet("blocked-msg")) {
                c.set("blocked-msg", (Object)"&c[Error] This command cannot be performed in this world.");
            }
            this.blockedMessage = c.getString("blocked-msg", "&c[Error] This command cannot be performed in this world.");
            ConfigurationSection ul = c.getConfigurationSection("limit");
            if (ul == null) {
                ul = c.createSection("limit");
            }
            Plugin[] plugins;
            for (int length = (plugins = Bukkit.getPluginManager().getPlugins()).length, i = 0; i < length; ++i) {
                final Plugin plug = plugins[i];
                if (!plug.equals(this)) {
                    if (!ul.isList(plug.getDescription().getName())) {
                        ul.set(plug.getDescription().getName(), (Object)new ArrayList());
                    }
                }
            }
            this.saveConfig();
        }
       
        public boolean checkWorld(final Plugin plugin, final World w) {
            if (plugin == null) {
                return true;
            }
            if (w == null) {
                return true;
            }
            final ConfigurationSection limit = this.getConfig().getConfigurationSection("limit");
            if (!limit.isList(plugin.getDescription().getName())) {
                return true;
            }
            final List<String> worlds = (List<String>)limit.getStringList(plugin.getDescription().getName());
            if (worlds.size() == 0) {
                return true;
            }
            for (final String s : worlds) {
                if (w.getName().equalsIgnoreCase(s)) {
                    return true;
                }
            }
            return false;
        }
       
        @EventHandler
        public boolean checkWorld(final Plugin plugin, final Event e) {
            if (e instanceof PlayerEvent) {
                final PlayerEvent e2 = (PlayerEvent)e;
                return (this.exemptEvents.contains(e.getClass()) && PerWorldPlugins.instance.isExemptEnabled()) || this.checkWorld(plugin, e2.getPlayer().getWorld());
            }
            if (e instanceof BlockEvent) {
                final BlockEvent e3 = (BlockEvent)e;
                return e3.getBlock() == null || e3.getBlock().getWorld() == null || this.checkWorld(plugin, e3.getBlock().getWorld());
            }
            if (e instanceof InventoryEvent) {
                final InventoryEvent e4 = (InventoryEvent)e;
                return e4.getView().getPlayer() == null || e4.getView().getPlayer().getWorld() == null || this.checkWorld(plugin, e4.getView().getPlayer().getWorld());
            }
            if (e instanceof EntityEvent) {
                final EntityEvent e5 = (EntityEvent)e;
                return e5.getEntity() == null || e5.getEntity().getWorld() == null || this.checkWorld(plugin, e5.getEntity().getWorld());
            }
            if (e instanceof HangingEvent) {
                final HangingEvent e6 = (HangingEvent)e;
                return e6.getEntity() == null || e6.getEntity().getWorld() == null || this.checkWorld(plugin, e6.getEntity().getWorld());
            }
            if (e instanceof VehicleEvent) {
                final VehicleEvent e7 = (VehicleEvent)e;
                return e7.getVehicle() == null || e7.getVehicle().getWorld() == null || this.checkWorld(plugin, e7.getVehicle().getWorld());
            }
            if (e instanceof WeatherEvent) {
                final WeatherEvent e8 = (WeatherEvent)e;
                return e8.getWorld() == null || this.checkWorld(plugin, e8.getWorld());
            }
            if (e instanceof WorldEvent) {
                final WorldEvent e9 = (WorldEvent)e;
                return e9.getWorld() == null || this.checkWorld(plugin, e9.getWorld());
            }
            return !(e instanceof ServerEvent) || true;
        }
       
        public boolean isExemptEnabled() {
            return this.isExemptEnabled;
        }
       
        public static String color(final String s) {
            return ChatColor.translateAlternateColorCodes('&', s);
        }
    }
     

    PWPCommandExecutor.java:

    Code (Text):
    package me.nitish;

    import org.bukkit.Sound;
    import org.bukkit.entity.Player;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.command.CommandExecutor;

    public class PWPCommandExecutor implements CommandExecutor
    {
        public boolean onCommand(final CommandSender sender, final Command arg1, final String arg2, final String[] args) {
            if (sender.isOp() || sender.hasPermission("pwp.admin")) {
                if (args.length == 0) {
                    sender.sendMessage(PerWorldPlugins.color("&c[&4PWP&c] &fUsage: &7/pwp reload|version"));
                }
                else {
                    if (args[0].equalsIgnoreCase("reload")) {
                        PerWorldPlugins.instance.reloadConfig();
                        PerWorldPlugins.instance.loadConfig();
                        sender.sendMessage(PerWorldPlugins.color("&a[&2PWP&a] &fPerWorldPlugins successfully reloaded!"));
                        if (sender instanceof Player) {
                            final Player p = (Player)sender;
                        }
                    }
                    else if (args[0].equalsIgnoreCase("version")) {
                        sender.sendMessage(PerWorldPlugins.color("&a[&2PWP&a] &fYou are currently running version &l" + PerWorldPlugins.instance.getDescription().getVersion() + "&f of PerWorldPlugins."));
                    }
                    else {
                        sender.sendMessage(PerWorldPlugins.color("&c[&4PWP&c] &fUsage: &7/pwp reload|version"));
                    }
                    if (args.length >= 2) {
                        sender.sendMessage(PerWorldPlugins.color("&c[&4PWP&c] &fUsage: &7/pwp reload|version"));
                    }
                }
            }
            else {
                sender.sendMessage(PerWorldPlugins.color("&c[&4PWP&c] &fNo permission! &7(Required node: &opwp.admin&7)"));
            }
            return true;
        }
    }
     
    FakeSimpleCommandMap:

    Code (Text):


    package me.nitish;

    import java.lang.reflect.Field;
    import java.util.logging.Level;
    import java.util.regex.Pattern;

    import org.bukkit.Bukkit;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandException;
    import org.bukkit.command.CommandSender;
    import org.bukkit.command.PluginIdentifiableCommand;
    import org.bukkit.command.SimpleCommandMap;
    import org.bukkit.craftbukkit.v1_16_R3.command.CraftCommandMap;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.Plugin;

    public class FakeSimpleCommandMap extends CraftCommandMap
    {
        public SimpleCommandMap oldMap;
        private static final Pattern PATTERN_ON_SPACE;
       
        static {
            PATTERN_ON_SPACE = Pattern.compile(" ", 16);
        }
       
        public FakeSimpleCommandMap(final CraftCommandMap oldCommandMap) {
             super(Bukkit.getServer());
            this.oldMap = oldCommandMap;
            Class c = this.oldMap.getClass();
            if (this.oldMap instanceof FakeSimpleCommandMap) {
                c = c.getSuperclass();
            }
            Field[] declaredFields;
            for (int length = (declaredFields = c.getDeclaredFields()).length, i = 0; i < length; ++i) {
                final Field f = declaredFields[i];
                try {
                    if (this.getClass().getSuperclass().getDeclaredField(f.getName()) != null) {
                        this.transferValue(f.getName(), this.oldMap, c);
                    }
                }
                catch (Exception e) {
                    Bukkit.getServer().getLogger().log(Level.SEVERE, "PerWorldPlugins failed finding fields in the CommandMap, contact the Dev on BukkitDev", e);
                }
            }
        }
       
        private void transferValue(final String field, final SimpleCommandMap oldMap, final Class c) {
            try {
                final Field modifiers = Field.class.getDeclaredField("modifiers");
                modifiers.setAccessible(true);
                final Field oldField = c.getDeclaredField(field);
                oldField.setAccessible(true);
                modifiers.setInt(oldField, oldField.getModifiers() & 0xFFFFFFEF);
                final Object oldObject = oldField.get(oldMap);
                final Field newField = this.getClass().getSuperclass().getDeclaredField(field);
                newField.setAccessible(true);
                modifiers.setInt(newField, newField.getModifiers() & 0xFFFFFFEF);
                newField.set(this, oldObject);
            }
            catch (Exception e) {
                Bukkit.getServer().getLogger().log(Level.SEVERE, "PerWorldPlugins failed transferring CommandMap, contact the Dev on BukkitDev", e);
            }
        }
       
        public boolean dispatch(final CommandSender sender, final String commandLine) throws CommandException {
            final String[] args = FakeSimpleCommandMap.PATTERN_ON_SPACE.split(commandLine);
            if (args.length == 0) {
                return false;
            }
            final String sentCommandLabel = args[0].toLowerCase();
            final Command target = this.getCommand(sentCommandLabel);
            if (target == null) {
                return false;
            }
            try {
                if (sender instanceof Player) {
                    final Player p = (Player)sender;
                    Plugin plugin = null;
                    if (target instanceof PluginIdentifiableCommand) {
                        final PluginIdentifiableCommand t = (PluginIdentifiableCommand)target;
                        if (!PerWorldPlugins.instance.checkWorld(t.getPlugin(), p.getWorld())) {
                            plugin = t.getPlugin();
                        }
                    }
                    if (target.getClass().getSimpleName().equals("MCoreBukkitCommand") && Bukkit.getPluginManager().getPlugin("MassiveCore") != null) {
                        plugin = Bukkit.getPluginManager().getPlugin("MassiveCore");
                    }
                    if (!PerWorldPlugins.instance.checkWorld(plugin, p.getWorld())) {
                        p.sendMessage(PerWorldPlugins.instance.blockedMessage.replace("%world%", p.getWorld().getName()).replace("%player%", p.getName()).replace("%plugin%", plugin.getName()).replace("&", "ยง"));
                        return true;
                    }
           
                }
           
            }
            catch (CommandException ex) {
                throw ex;
            }
            catch (Throwable ex2) {
                throw new CommandException("Unhandled exception executing '" + commandLine + "' in " + target, ex2);
            }
            return true;
        }
    }
     
     
  11. I cant help you with that, sorry. Maybe someone else knows the problem.
     
  12. Now the code is full

    PerWorldPluginLoader:

    Code (Text):


    package me.nitish.transparentlisteners;

    import org.bukkit.plugin.UnknownDependencyException;
    import org.bukkit.plugin.InvalidPluginException;
    import java.util.regex.Pattern;
    import org.bukkit.plugin.InvalidDescriptionException;
    import org.bukkit.plugin.PluginDescriptionFile;
    import java.io.File;
    import java.util.Iterator;
    import java.lang.reflect.InvocationTargetException;
    import org.bukkit.event.EventException;
    import org.bukkit.plugin.EventExecutor;
    import org.bukkit.plugin.AuthorNagException;
    import java.util.Arrays;
    import java.util.logging.Level;
    import org.bukkit.Warning;
    import org.bukkit.event.EventHandler;
    import java.lang.reflect.Method;
    import java.util.HashSet;
    import java.util.HashMap;
    import org.apache.commons.lang.Validate;
    import org.bukkit.plugin.RegisteredListener;
    import java.util.Set;
    import org.bukkit.event.Event;
    import java.util.Map;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.event.Listener;
    import org.bukkit.Server;
    import org.bukkit.plugin.java.JavaPluginLoader;
    import org.bukkit.plugin.PluginLoader;

    public class PerWorldPluginLoader implements PluginLoader
    {
        private JavaPluginLoader internal_loader;
        private Server server;
       
        public PerWorldPluginLoader(final Server instance) {
            this.server = instance;
            this.internal_loader = new JavaPluginLoader(instance);
        }
       
        public Map<Class<? extends Event>, Set<RegisteredListener>> createRegisteredListeners(final Listener listener, final Plugin plugin) {
            Validate.notNull((Object)plugin, "Plugin can not be null");
            Validate.notNull((Object)listener, "Listener can not be null");
            final boolean useTimings = this.server.getPluginManager().useTimings();
            final Map<Class<? extends Event>, Set<RegisteredListener>> ret = new HashMap<Class<? extends Event>, Set<RegisteredListener>>();
            Set<Method> methods;
            try {
                final Method[] publicMethods = listener.getClass().getMethods();
                methods = new HashSet<Method>(publicMethods.length, Float.MAX_VALUE);
                Method[] array;
                for (int length = (array = publicMethods).length, i = 0; i < length; ++i) {
                    final Method method = array[i];
                    methods.add(method);
                }
                Method[] declaredMethods;
                for (int length2 = (declaredMethods = listener.getClass().getDeclaredMethods()).length, j = 0; j < length2; ++j) {
                    final Method method = declaredMethods[j];
                    methods.add(method);
                }
            }
            catch (NoClassDefFoundError e) {
                plugin.getLogger().severe("Plugin " + plugin.getDescription().getFullName() + " has failed to register events for " + listener.getClass() + " because " + e.getMessage() + " does not exist.");
                return ret;
            }
            for (final Method method2 : methods) {
                final EventHandler eh = method2.getAnnotation(EventHandler.class);
                if (eh == null) {
                    continue;
                }
                final Class<?> checkClass;
                if (method2.getParameterTypes().length != 1 || !Event.class.isAssignableFrom(checkClass = method2.getParameterTypes()[0])) {
                    plugin.getLogger().severe(String.valueOf(plugin.getDescription().getFullName()) + " attempted to register an invalid EventHandler method signature \"" + method2.toGenericString() + "\" in " + listener.getClass());
                }
                else {
                    final Class<? extends Event> eventClass = checkClass.asSubclass(Event.class);
                    method2.setAccessible(true);
                    Set<RegisteredListener> eventSet = ret.get(eventClass);
                    if (eventSet == null) {
                        eventSet = new HashSet<RegisteredListener>();
                        ret.put(eventClass, eventSet);
                    }
                    Class<?> clazz = eventClass;
                    while (Event.class.isAssignableFrom(clazz)) {
                        if (clazz.getAnnotation(Deprecated.class) != null) {
                            final Warning warning = clazz.getAnnotation(Warning.class);
                            final Warning.WarningState warningState = this.server.getWarningState();
                            if (!warningState.printFor(warning)) {
                                break;
                            }
                            plugin.getLogger().log(Level.WARNING, String.format("\"%s\" has registered a listener for %s on method \"%s\", but the event is Deprecated. \"%s\"; please notify the authors %s.", plugin.getDescription().getFullName(), clazz.getName(), method2.toGenericString(), (warning != null && warning.reason().length() != 0) ? warning.reason() : "Server performance will be affected", Arrays.toString(plugin.getDescription().getAuthors().toArray())), (Throwable)((warningState == Warning.WarningState.ON) ? new AuthorNagException((String)null) : null));
                            break;
                        }
                        else {
                            clazz = clazz.getSuperclass();
                        }
                    }
                    final EventExecutor executor = (EventExecutor)new EventExecutor() {
                        public void execute(final Listener listener, final Event event) throws EventException {
                            try {
                                if (!eventClass.isAssignableFrom(event.getClass())) {
                                    return;
                                }
                                method2.invoke(listener, event);
                            }
                            catch (InvocationTargetException ex) {
                                throw new EventException(ex.getCause());
                            }
                            catch (Throwable t) {
                                throw new EventException(t);
                            }
                        }
                    };
                    if (useTimings) {
                        eventSet.add((RegisteredListener)new PWPTimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
                    }
                    else {
                        eventSet.add(new PWPRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
                    }
                }
            }
            return ret;
        }
       
        public void disablePlugin(final Plugin arg0) {
            this.internal_loader.disablePlugin(arg0);
        }
       
        public void enablePlugin(final Plugin arg0) {
            this.internal_loader.enablePlugin(arg0);
        }
       
        public PluginDescriptionFile getPluginDescription(final File arg0) throws InvalidDescriptionException {
            return this.internal_loader.getPluginDescription(arg0);
        }
       
        public Pattern[] getPluginFileFilters() {
            return this.internal_loader.getPluginFileFilters();
        }
       
        public Plugin loadPlugin(final File arg0) throws InvalidPluginException, UnknownDependencyException {
            return this.internal_loader.loadPlugin(arg0);
        }
    }
     
    PWPRegisteredListener:

    Code (Text):

    package me.nitish.transparentlisteners;

    import java.util.logging.Level;

    import org.bukkit.Bukkit;
    import org.bukkit.event.Event;
    import org.bukkit.event.EventException;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.EventExecutor;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.RegisteredListener;

    public class PWPRegisteredListener extends RegisteredListener
    {
        public PWPRegisteredListener(final Listener listener, final EventExecutor executor, final EventPriority priority, final Plugin plugin, final boolean ignoreCancelled) {
            super(listener, executor, priority, plugin, ignoreCancelled);
        }
       
        public void callEvent(final Event event) throws EventException {
            if (!me.nitish.PerWorldPlugins.instance.checkWorld(super.getPlugin(), event)) {
                return;
            }
            try {
                super.callEvent(event);
            }
            catch (Throwable ex) {
                Bukkit.getServer().getLogger().log(Level.SEVERE, "**** THIS IS NOT AN ISSUE TO DO WITH PER WORLD PLUGINS ****\nCould not pass event " + event.getEventName() + " to " + this.getPlugin().getDescription().getFullName(), ex);
            }
        }
    }
     
    PWPTimedRegisteredListener.java:

    Code (Text):


    package me.nitish.transparentlisteners;

    import java.util.logging.Level;

    import org.bukkit.Bukkit;
    import org.bukkit.event.Event;
    import org.bukkit.event.EventException;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.EventExecutor;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.TimedRegisteredListener;

    public class PWPTimedRegisteredListener extends TimedRegisteredListener
    {
        public PWPTimedRegisteredListener(final Listener pluginListener, final EventExecutor eventExecutor, final EventPriority eventPriority, final Plugin registeredPlugin, final boolean listenCancelled) {
            super(pluginListener, eventExecutor, eventPriority, registeredPlugin, listenCancelled);
        }
       
        public void callEvent(final Event event) throws EventException {
            if (!me.nitish.PerWorldPlugins.instance.checkWorld(this.getPlugin(), event)) {
                return;
            }
            try {
                super.callEvent(event);
            }
            catch (Throwable ex) {
                Bukkit.getServer().getLogger().log(Level.SEVERE, "**** THIS IS NOT AN ISSUE TO DO WITH PER WORLD PLUGINS ****\nCould not pass event " + event.getEventName() + " to " + this.getPlugin().getDescription().getFullName(), ex);
            }
        }
    }
     
     
  13. Okay :(
     
  14. The full server logs of a freshly started server could be helpful. There might be some log messages that give insights on why all plugins are disabled.