What would be the best option?

Discussion in 'Plugin Development' started by Streammz, May 18, 2011.

Thread Status:
Not open for further replies.
  1. I'm currently remaking tetris for minecraft, and i'm starting to think about how i should handle the game timers.
    I first thought of using simple timers (bukkit's build-in timer, new Timer() etc), but i'm not sure if that would work well
    Second i thought of starting an thread, which i suppose is the best option becouse it doesn't eat from the main thread.

    Maybe theres even an better option, but i'm not 100% into java yet, so if you know better solutions, tell me ^^

    FYI, this is for the main game loop (checking for lines, letting the blocks fall etc)
     
  2. Maybe just a main thread (every 500ms), that ticks your scripts?
     
  3. Offline

    SpaceManiac

    No. Always, always use Bukkit's scheduler. Minecraft's code is not thread-safe and doing almost anything in a separate thread will lead to calamity.
     
  4. Offline

    The_Tree_Maker

    I would suggest calling it something other than "Tetris" Copyrights hehe, but cool idea. I agree with SpaceManiac. I tried to use separate threads and it didn't work real well, massive problems.
     
Thread Status:
Not open for further replies.

Share This Page