Crashing bug on Player.SendBlockChange(loc, mat, byte)

Discussion in 'Plugin Development' started by yodogger, Jun 18, 2012.

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

    yodogger

    I am currently writing a plugin that allows players to hide chests by covering all sides with solid blocks. Everything works just fine, it hides and unhides just fine, no problems. It saves and loads, as well as runs a thread to send the hide packet to all once a minute. I personally do not crash, as well as most of the players who test for me. Some players do crash though, and this happens every time the server sends them the block change packet. I have tried everything I could, but still I cannot figure out what's wrong. Any suggestions?
     
  2. Offline

    Quackster

    Why not make the function a separate thread?
     
  3. Offline

    yodogger

    That works! Thanks a lot, you made my day.
     
    Quackster likes this.
  4. Offline

    Quackster

    No problem. Glad I could help :D
     
  5. Offline

    yodogger

    Well, that fixed it for some, but others still crash...
     
  6. Offline

    Njol

    I guess you should not send packets in a separate thread, but let the main server thread send the packets (using the scheduler), but I might be wrong.

    BTW: If something seems to randomly work/not work it's often a threading issue.
     
  7. Offline

    m1enkrafft_man

    Look into Destrukt's hideChest method, located in "ChestManager.class".
     
  8. Offline

    yodogger

    He uses one of my last scenario ideas, instead of faking a block change he literally does it, and saves the block to memory. I want to keep this plugin as simple as possible.
     
  9. Offline

    m1enkrafft_man

    It's the best way to do it. Unless the block is actually changed, the client can control packet flow to make a bypass.

    EDIT: Adam has a plugin for you to test.
     
  10. Offline

    yodogger

    Erm... The server will send the same packet regardless of what causes it. There is no magic hidden hideblock packet, it's the same as the one that occurs when you place a block and air turns to that block.
     
Thread Status:
Not open for further replies.

Share This Page