Custom lore on furnace recipes crash server

Discussion in 'Spigot Plugin Development' started by Hmmcrunchy, Jun 19, 2015.

  1. HI all I wonder if anyone has come across this before?

    I have a custom furnace recipe coded below

    Code (Text):
    void createLeavesTobacco(String name, String loredata){
           
            getLogger().info("[SmokingPipes] Creating "+name+" custom recipe"+loredata);
           
            ItemStack LeavesTobacco = new ItemStack(Material.DEAD_BUSH,2);
            ItemMeta lt = LeavesTobacco.getItemMeta();
           
            //set lore
           ArrayList<String> lore = new ArrayList<String>();
           lore.add(loredata);
           
            //set name for output of recipe
            lt.setDisplayName(ChatColor.DARK_GREEN+"Dried leaves");
            lt.setLore(lore);
           
            LeavesTobacco.setItemMeta(lt);
           
            //set furnace recipe
            FurnaceRecipe leavesRecipe = new FurnaceRecipe(LeavesTobacco, Material.LEAVES);
           
            Bukkit.addRecipe(leavesRecipe);
        }
     

    now im trying to add configurable lore to the created item through the string loredata when I do this the whole server crashes with this error

    Code (Text):
    [10:18:40 ERROR]: Encountered an unexpected exception
    net.minecraft.server.v1_8_R1.ReportedException: Ticking block entity
            at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:7
    83) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:3
    16) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:6
    34) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java
    :537) [spigot.jar:git-Spigot-550ebac-7019900]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]
    Caused by: java.lang.NullPointerException
            at net.minecraft.server.v1_8_R1.RecipesFurnace.a(RecipesFurnace.java:103
    ) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.RecipesFurnace.getResult(RecipesFurnace.
    java:97) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.TileEntityFurnace.canBurn(TileEntityFurn
    ace.java:272) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.TileEntityFurnace.c(TileEntityFurnace.ja
    va:187) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.World.tickEntities(World.java:1486) ~[sp
    igot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.WorldServer.tickEntities(WorldServer.jav
    a:576) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:7
    72) ~[spigot.jar:git-Spigot-550ebac-7019900]
            ... 4 more
    [10:18:40 ERROR]:       Cause of unexpected exception was
    java.lang.NullPointerException
            at net.minecraft.server.v1_8_R1.RecipesFurnace.a(RecipesFurnace.java:103
    ) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.RecipesFurnace.getResult(RecipesFurnace.
    java:97) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.TileEntityFurnace.canBurn(TileEntityFurn
    ace.java:272) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.TileEntityFurnace.c(TileEntityFurnace.ja
    va:187) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.World.tickEntities(World.java:1486) ~[sp
    igot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.WorldServer.tickEntities(WorldServer.jav
    a:576) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:7
    72) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:3
    16) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:6
    34) ~[spigot.jar:git-Spigot-550ebac-7019900]
            at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java
    :537) [spigot.jar:git-Spigot-550ebac-7019900]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]
    [10:18:40 ERROR]: This crash report has been saved to: C:\Users\Paul\Desktop\old
    desktop\othergames\bukkit\.\crash-reports\crash-2015-06-19_10.18.40-server.txt
    [10:18:40 INFO]: Stopping server

    when I take this variable out and use lore.add("Dried smoking grass") it works fine.

    Im sure I have the same lore variable in other plugins and they seem to work fine

    the shaped recipe which I use the same method works ok.. its a null error but the line

    getLogger().info("[SmokingPipes] Creating "+name+" custom recipe"+loredata);

    shows the variables come through ok from the config

    any help would be most handy
     
  2. Scratch that -

    Solution =

    oddly I had a recipe which contained netherwarts item not netherroot

    just having that recipe in there broke every other furnace recipe in the game :eek:

    XD