question - ConfigurableMessages

Discussion in 'Plugin Development' started by Sicka_gp, Jun 10, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Sicka_gp

    Hi, I need advice. My plugin receives an error message (for someone). And I would like to ask if I have something bad in code. Or it could be poor compatibility with some plugins.

    Here is the error message that I received from one user:
    2013-06-08 19:35:47 [INFO] N1T3SLAY3R logged in from 216.197.170.207:54392 in world "world" (Entity #881) 2013-06-08 19:35:47 [SEVERE] Could not pass event PlayerJoinEvent to ConfigurableMessages v0.3 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463) at net.minecraft.server.v1_5_R3.PlayerList.c(PlayerList.java:204) at net.minecraft.server.v1_5_R3.PlayerList.a(PlayerList.java:100) at net.minecraft.server.v1_5_R3.PendingConnection.d(PendingConnection.java:134) at net.minecraft.server.v1_5_R3.PendingConnection.c(PendingConnection.java:49) at org.spigotmc.MultiplexingServerConnection.b(MultiplexingServerConnection.java:77) at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:583) at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:227) at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:472) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:404) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573) Caused by: java.lang.NullPointerException at cz.Sicka_gp.ConfigurableMessages.Settings.ConfMsfStringSetings.replacer(ConfMsfStringSetings.java:24) at cz.Sicka_gp.ConfigurableMessages.ConfigurableMessagesListener.onPlayerJoin(ConfigurableMessagesListener.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ... 14 more

    Classes which shows the error message:
    ConfMsfStringSetings: https://github.com/Sickagp/Configur...leMessages/Settings/ConfMsfStringSetings.java
    ConfigurableMessagesListener: https://github.com/Sickagp/Configur...bleMessages/ConfigurableMessagesListener.java

    Thank you for any help
     
  2. Offline

    chasechocolate

    When you are creating the "str" variable, you are passing the null "plugin" variable inside the constructor. Instantiate it after you instantiate the "plugin" variable.
     
  3. Offline

    Sicka_gp

    If I understand you well, so it should look something like this?

    Code:
        ConfigurableMessages plugin;
        public ConfigurableMessagesListener(ConfigurableMessages instance) {
            plugin = instance;
        }
        ConfMsfBooleanSetings s = new ConfMsfBooleanSetings(this.plugin);
        ConfMsfStringSetings str = new ConfMsfStringSetings(this.plugin);
        ScoreBoardManager score = new ScoreBoardManager(this.plugin);
     
Thread Status:
Not open for further replies.

Share This Page