[SOLVED] [Spout] Custom blocks give NPE

Discussion in 'Plugin Development' started by Darkman2412, Nov 28, 2011.

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

    Darkman2412

    Hi!

    This is my first try at custom blocks with Spout, but every time the blockclass gets initialised, it throws a NPE at the super keyword.
    I also tried to just copy paste the code from the spout wiki, but that gives the same error:
    Code:
    2011-11-28 21:37:37 [SEVERE] Error occurred while enabling xxx valpha 0.1 (Is it up to date?): null
    java.lang.NullPointerException
    	at org.getspout.spout.inventory.SimpleMaterialManager.updateCustomBlockDesigns(SimpleMaterialManager.java:316)
    	at org.getspout.spout.inventory.SimpleMaterialManager.setCustomBlockDesign(SimpleMaterialManager.java:294)
    	at org.getspout.spoutapi.material.block.GenericCustomBlock.setBlockDesign(GenericCustomBlock.java:102)
    	at org.getspout.spoutapi.material.block.GenericCubeCustomBlock.<init>(GenericCubeCustomBlock.java:30)
    	at me.darkman2412.xxx.blocks.Haystack.<init>(Haystack.java:11)
    	at me.darkman2412.xxx.onEnable(xxx.java:43)
    	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
    	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
    	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
    	at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:182)
    	at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:165)
    	at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:337)
    	at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:324)
    	at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:161)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:388)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    My code to initialize it:
    Code:java
    1. public Haystack(xxx plugin, String name, String texture) {
    2. super(plugin, name, new GenericCubeBlockDesign(plugin, texture, 16));
    3. this.setOpaque(false);
    4. }

    Code:java
    1. haystack = new Haystack(this, "Haystack", "[URL]http://cdn.getspout.org/img/icon/spout_16x16.png[/URL]");


    I'm using Spout 555 and SpoutAPI 309.

    PS: Looks like Xenforo screws my code a bit.
     
  2. Offline

    Ranzdo

    Darkman2412 likes this.
  3. Offline

    Darkman2412

  4. Offline

    Raphfrk

    It should work now with the latest of both.
     
    Darkman2412 likes this.
Thread Status:
Not open for further replies.

Share This Page