I am making a gamemode using spigot. It is a spleef gamemode, and I use WorldEdit to restore the map. However, the blocks in the spleef are beds. I restore these beds using Schematics, that I just paste using
EditSession es = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(world), -1);
SchematicFormat formatWool = SchematicFormat.getFormat(woolLayer);
CuboidClipboard wool = formatWool.load(woolLayer);
wool.paste(es, to1, false);
wool.paste(es, to2, false);
wool.paste(es, to3, false);
wool.paste(es, to4, false);
Where world is the world of the map, to1 etc are locations of the layers, and woolLayer is the file to the schematic.
My problem is: The beds restore, but they immediately disappear. I think that happens because of gravity block updates. How do I prevent this? Any help is appreciated.
PS: I already tried adding wool layers beneath, and the remove them, but that also doesn't work.
I already found a way: use Multiverse-Core to copy maps, and delete after a game.