Help with World Rollback

Discussion in 'Spigot Plugin Development' started by CavariuX, May 21, 2015.

  1. Hi, I know this is a common asked thing but I have being looking about for 2 days and found only useless methods, I have being playing with the WorldCreator and the World but nothing achived, I really need this for a minigame Im making so it works (Waiting... => Playing => Win => Rollback => Waiting...) I dont want schematics or things ike that.
    So if you would like to help me I would really apreciate it :D

    EDIT:

    The blocks can and will be break by players
     
    #1 CavariuX, May 21, 2015
    Last edited: May 22, 2015
  2. You can just store the blocks that need to be rolled-back and the coords those blocks should be in and load em for rollback.

    I know you said you don't want to use schematics, but using schematics might be easier.
     
  3. I can't, in this minigame the map will be really modified by players and I need the server go setup in atleast 1 min and that would take some time
     
  4. so, you need to rollback the modified blocks by players too?
     
  5. Yes, I think I will edit my post with that, but yes the players will be able to break/place blocks so it would be a huge amount of blocks
     
  6. Make a HashMap(or array list, HashMap would be better in some cases) and store the block state. When you're ready to rollback update the block state. Not going to spoon feed. In case you want to be spoon fed here you go:
    PHP:
    if(player.getName().equalsIngoreCase("CavariuX")){
       player.setFoodLevel(0);
    }
     
  7. "CavariuX starved to death"

    jaja, already tried but physics get messed and also with explotions it gets messed
     
  8. Minecraft physics lol. Get the blocks in explosions too :). Use the EntityExplodeEvent(I think) and get the block list. You can go as far as saving the blocks that sheep eat grass from and Endermen pickup. This should be good enough really.
     
  9. Well, I know physics arent that grate jajaj, but what I meant is that the tnt gets buggy and the fluids too.
     
  10. Store the blocks in a List<Block> then store that in a YamlConfiguration as something like data.yml as well as HashMap<Entity, Location> to rollback entities as well.
     
  11. Please read all the thread :p