Brewing inventory has duplicate slot numbers..

Discussion in 'Plugin Development' started by nala3, May 13, 2012.

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

    nala3

    I am currently working on a plugin to stop the brewing of certain potions, however I realized that the brewing stand inventory has duplicate slot number entries that both return as a BREWING inventory.t

    To better explain this here is a picture:
    [​IMG]

    The problem I am having here, is that there is now way to differentiate between the two... If there is a way to, just tell me and I will be on my merry way, but if not, I really think there should because it creates false positives when players click the hotbar instead of the brewing inventory.
     
  2. Offline

    arnie231

    I havent Really looked into the Brewing API yet but surely you could just cancel the Result event if it equals a certain potion ?
     
  3. Offline

    nala3

    I don't think there is a "Result" event that tells you what the resulting potion would be. That is the first thing I looked for xD

    http://jd.bukkit.org/apidocs/org/bukkit/event/inventory/BrewEvent.html

    So I am just using InvetoryClickEvent
     
  4. the .getRawSlot() in the click event gives you the unique slot id, so you can see whether it's from the brewing stand or the player's inv. I can't remember which number belongs to which inventory (player inventory or brewing stand inventory), that's what you need to test out ;)
     
  5. Offline

    arnie231

  6. Offline

    nala3

    Ohh, ok I guess that makes sense xD
     
Thread Status:
Not open for further replies.

Share This Page