dropItem and dropItemNaturally - NoSuchMethod???

Discussion in 'Plugin Development' started by Nohup, Feb 24, 2011.

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

    Nohup

    I am currently getting a NoSuchMethod exception for either of these methods. I have seen the stack trace from the same exception in several threads, but haven't seen anything directed at those posts so I figured I would post a thread specifically for this as I am hitting it as well.

    I have tried this on 420 and 432 and received the error in both places. Looking at the CraftBukkit and Bukkit code snapshots the methods appear to still be there, and the signatures do not appear to have changed. My code is:

    Code:
                    Location l = event.getBlock().getLocation();
                    ItemStack is = new ItemStack(Material.X);
                    event.getPlayer().getWorld().dropItem(l, is);
    
    Has anyone gotten around this?
     
  2. Offline

    Archelaus

    "Material.X"?

    Also, this works fine for me.
     
  3. Offline

    Edward Hand

    I too have a plugin, which worked find before 1.3 that now generates the error nohup mentioned.
     
  4. Offline

    Nohup

    Material.X as in, "insert whatever material you like here". I have seen this in posts on WorldGuard and WorldEdit so it seems like several folks are hitting this.

    @RightLegRed - Which version of CraftBukkit are you running? It seems this worked for folks prior to the 1.3 changes but doesn't now so I am curious if you are on 1.3 and if so are you using later than the recommended 432?
    --- merged: Feb 24, 2011 6:31 PM ---
    Follow - up:

    I compiled against Bukkit 412 and deployed into CraftBukkit 432 and now everything is working. Odd... Not sure what changed where, but now it is working.

    But now I have to ask, if I don't specify a stack size is it intended to give me an infinite stack? I had assumed excluding the stack size would default to 1 but apparently that is not correct?
     
  5. Offline

    Edward Hand

    It seems to default it to zero. You need to pass the stack size to the constructor.

    And thanks for reporting back with a solution.
     
Thread Status:
Not open for further replies.

Share This Page