#Item durability our of sync after rapid level switch.

1 messages · Page 1 of 1 (latest)

inner basalt
#

This code unloads the world, resets it, and teleports the player back to the world. After that, durabilities are out of sync. Cannot break blocks. That may cause the issue.

                            Level level = is.getWorld();
                            for(Player player : level.getPlayers().values()) {
                                PlayerManager.toSpawn(player);
                            }
                            try {
                                level.unload(true);
                            } catch (Exception ex) {
                                ex.printStackTrace();
                            }
                            File one = new File (Server.getInstance().getDataPath() + "/worlds/" + id);
                            File two = new File("/home/CloudNet/local/Maps/Skyblock/preset");
                            File regionfolder = new File(Server.getInstance().getDataPath() + "worlds/" + id + "/db");
                            File worldfolder = new File(Server.getInstance().getDataPath() + "worlds/" + id);
                            FileUtils.deleteDirectoryContents(regionfolder);
                            FileUtils.deleteDirectoryContents(worldfolder);
                            worldfolder.delete();
                            one.delete();

                            org.iq80.leveldb.util.FileUtils.copyDirectoryContents(two, one);
                            Server.getInstance().loadLevel(String.valueOf(id));
                            p.teleport(Server.getInstance().getLevelByName(String.valueOf(id)).getSafeSpawn());


dull chasm
#

did smt that tracks the blocksbroken on an item and got the same error

hazy skiff
#

This error does not affect and check of your plugin code. Does it cancel the break

inner basalt
#

How can this be a plugin issue? My plugin doesn't mess with durabilities. Breaks are also not cancelled

hazy skiff
#

I cannot solve this problem with the current information. Can you provide this plugin

inner basalt
#

The entire plugin? Its pretty large

hazy skiff
#

yes

#

you send me the jar package

#

I don't need your source code, just tell me how to trigger it.

inner basalt
#

That wont work. Its depends on a library that requires a database and a specific folder structure..
What I sent above is what triggers that. Its a Skyblock Plugin. That code should reset the island if the player uses /is reset
World gets unloaded, deleted, the template gets copied, world loaded and player teleported back to the island.

hazy skiff
#

Can you make a minimal reproduce plugin

#

and give me the level

inner basalt
#

Sure

inner basalt
#

@hazy skiff Seems like the durability thingy doesn't happen anymore. I tested it on the og server where it happened and another with the plugin I made for you.
But another problem is now happening. You cannot collect any items you mined. Seems like the player doesn't move anymore bc if you drop something with q, the item gets dropped from the worlds spawn location.

#

I send you the world in your dms

hazy skiff
#

fixed

inner basalt
#

Still happens.. But Idk if its related to level switching,

hazy skiff
#

ignore

#

the warn not effect game

inner basalt
#

Okay. Can the message be disabled?