Major bug please help! Redstone + TNT = boom! But how to stop this!

Discussion in 'Plugin Development' started by Liam Allan, Aug 5, 2011.

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

    Liam Allan

    Hello there. My plugin, BlockBlock has a major bug:
    View after 19 seconds!


    Basicly, When you place TNT down. It kicks you, Like its meant to. But when you place it next to a redstone torch/a powered redstone wire/a lever it explodes!

    If you can fix this. I will allow you to enter the competition without answering the questions! So you could win for just helping me do this! Here are the competition details: Click Me!

    Please help!
     
  2. Offline

    Adamki11s

    Just check all adjacent blocks and if one is redstone kick then, else let them and do the same but vice versa when placing redstone.
     
  3. Offline

    Pencil

    Mind posting your code? The playerlistener to be exact.

    You could check wether the blocks next to it is redstone stuff then cancel the event, do the same for placing redstone and torches.

    or

    I'm not 100% sure but I think you can stop the explosion with this http://jd.bukkit.org/apidocs/org/bukkit/event/entity/ExplosionPrimeEvent.html

    I guess thats not really what you are trying to do so you could also see if this:

    http://jd.bukkit.org/apidocs/org/bukkit/event/player/PlayerInteractEvent.html

    Then

    1. Check if the player is holding TNT in his hand with this

    getItem()
    Returns the item in hand represented by this event

    2. Check if the player didn't click a lever/button/etc.

    3. Cancel the event

    This would probably be the hard & complicated way, I guess regular onblockplace event would work aswell, but I can't really tell you why it's not working without the source :) Oh yeah and I cant watch the vid :p


     
  4. Offline

    Liam Allan

    Is there any chance you could make the player listener. Since I'm new the java. I don't know what todo. But heres the source:

    BlockBlock: http://pastebin.com/Jg55srgT
    BlockBlockBlockListener: http://pastebin.com/RvF844T5
    I'll give you a high chance of winning if you do this!
     
  5. Offline

    tips48

    I'll look at it in a sec. do you have teamviewer or skype? PM me
     
Thread Status:
Not open for further replies.

Share This Page