A light logic for rollback blocks

Discussion in 'Spigot Plugin Development' started by Fr33styler, Jun 3, 2015.

  1. I'm trying to make my arena rollback without lag but i don't know how i should achive this, i have an List<BlockState> blocks = new ArrayList<BlockState>(); which store block informations, any idea?
     
  2. Do simple, make an LinkedList (String) and store locations, data, material, state etc in a String and when you need to rollback get everything from the string and say world.getBlockAt(x, y, z).setType(material);
    world.getBlockAt(x, y, z).setData(data);
     
  3. Simpliest way: Disable autosave for a world :D
     
  4. Is a multi arena game, i can't just stop for every arena :))
     
  5. Use my method indeed..
     
  6. I know about your method, but it will make lag on a lot of block change, i need to use a schelder
     
  7. Your method is just manually applying changes which a BlockState#update(true) call would do as well.

    @Fr33stylerTC you might also reduce the block changes a bit if you use a LinkedHashMap. At the end, iterate from back to front.