-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
是否考虑游戏结束自动刷新世界 #3
Comments
合理,但是懒得写( |
能说一下大佬是怎么删除的吗 如果有能游戏结束自动刷新的办法自然也没必要去写了 (doge) |
我写的分支里加了这个功能(虽然很傻的样子 @Override
public void onDisable() {
// Plugin shutdown logic
if (getConfig().getBoolean("changeMap")) {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
File world = new File(getDataFolder(), "..\\..\\world");
DeleteFile(world);
world = new File(getDataFolder(), "..\\..\\world_nether");
DeleteFile(world);
world = new File(getDataFolder(), "..\\..\\world_the_end");
DeleteFile(world);
System.out.println("地图清理完成");
}));
}
} |
看起来可行,但是我记得插件onDisable的执行应该是再保存世界前面?如果我没记错的话 |
所以注册了一个ShutdownHook |
噢看到了 瞎了 合理 |
今天常识了大佬的插件 但是对于这种一局一重启的游戏是否加上一个游戏结束自动刷新世界的功能比较合理呢
The text was updated successfully, but these errors were encountered: