Solved Making Enchanting table not able to open

Discussion in 'Plugin Development' started by trusebruse, Nov 10, 2012.

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

    trusebruse

    YES! OMG! DUDE I LOVE YOU! IT WOOOORKS! :D
    What did you do?
     
  2. Offline

    TwistedMexi


    Your yml's layout will completely make or break your plug-in, it's very important to get right, so don't get snarky.

    Turns out it is just that you need to remove plugin from getServer(). I just tested it and it works fine.
     
  3. Offline

    the_merciless

    The plugin wasnt loading, just because it said it had there was an error further down, this is why i asked you to paste your server.log

    That will give you more info on errors than your console does and tells you exaclty where your error is

    After checking my server.log i found this error

    Code:
    2012-11-12 00:12:58 [SEVERE] Error occurred while enabling test v1.0.0 (Is it up to date?)
    java.lang.NullPointerException
        at me.trusebruse.NoEnchantmentTable.NoEnchantmentTable.onEnable(NoEnchantmentTable.java:22)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:374)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:272)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:254)
        at net.minecraft.server.MinecraftServer.j(MinecraftServer.java:320)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:299)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:258)
        at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:141)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:400)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:818)
    This tells me the error is in NoEnchantmentTable on line 22

    Code:
    at me.trusebruse.NoEnchantmentTable.NoEnchantmentTable.onEnable(NoEnchantmentTable.java:22)
     
  4. Offline

    trusebruse

    I know that plugin.yml is important but there is no reason to remove the description because it dont make anything difference except that it is description in the file.
    If there is anything wrong with plugin.yml the plugin wont load. atleast from my experience from Java bukkit plugins.
     
  5. Offline

    fireblast709

    trusebruse maybe the rest was being kind of an idiot as well (including me at start btw!). The code was using a variable called 'plugin', but it was never defined to anything, so Java treats it as 'null'. In this case, the events were never registered and you could still open an enchantment table.

    TwistedMexi nope its valid
     
  6. Offline

    trusebruse

    But there was no errors for me.
     
  7. Offline

    the_merciless

    I sincerely hope you look over the code, try to understand it, re-read these posts and figure out the errors you (and us) made and learn from it

    SOMEONE PLEASE LOCK THIS THREAD

    Im not talking about in the console. Open your server file and look for a file called server or server.log

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  8. Offline

    trusebruse

    I know you were talking about the console. I checked it again and found the same error, sorry.
    But what was wrong at line 22?
     
  9. Offline

    the_merciless

    Last edited by a moderator: May 29, 2016
  10. Offline

    trusebruse

    Alright. But thank you very very very much! I've learned very much and the plugin is done! :)
    Good bye everyone!
     
Thread Status:
Not open for further replies.

Share This Page