Protect shared profiles from stale Lobby Builder snapshots
This commit is contained in:
parent
31dbf92e9c
commit
8251851bc8
1 changed files with 294 additions and 0 deletions
|
|
@ -133,6 +133,7 @@ public final class BuilderTransfer implements Listener {
|
|||
private void restore(Player player, boolean travel) throws IOException {
|
||||
Path file = snapshot(player);
|
||||
if (!Files.exists(file)) return;
|
||||
if (BuilderSharedProfiles.restore(player, file, travel, inBuilder(player.getWorld()), returning)) return;
|
||||
var state = YamlConfiguration.loadConfiguration(file.toFile());
|
||||
Location destination = state.getLocation("return");
|
||||
GameMode mode = GameMode.valueOf(state.getString("mode"));
|
||||
|
|
@ -161,6 +162,7 @@ public final class BuilderTransfer implements Listener {
|
|||
restore(player, true);
|
||||
return;
|
||||
}
|
||||
if (!BuilderSharedProfiles.allowTransfer(player, snapshot(player))) return;
|
||||
World world = loadWorld();
|
||||
if (world == null) {
|
||||
player.sendMessage("The Arrakis build world is unavailable.");
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff