Skip to content

Commit 1b5c758

Browse files
committed
Small serialization fixes
1 parent ee00287 commit 1b5c758

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

common/src/main/java/dev/ryanhcode/sable/api/sublevel/SubLevelTicketLoadingSystem.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import it.unimi.dsi.fastutil.objects.ObjectArraySet;
88
import org.jetbrains.annotations.ApiStatus;
99

10+
import java.util.UUID;
11+
1012
/**
1113
* Manages the {@code activeTickets} map in {@link ServerSubLevelContainer}
1214
*/
@@ -30,17 +32,18 @@ public void onSubLevelAdded(final SubLevel subLevel) {
3032
@Override
3133
public void onSubLevelRemoved(final SubLevel subLevel, final SubLevelRemovalReason reason) {
3234
final ServerSubLevel serverSubLevel = ((ServerSubLevel) subLevel);
35+
final UUID uuid = subLevel.getUniqueId();
3336

3437
if (reason == SubLevelRemovalReason.UNLOADED) {
3538
this.container.activeTickets.remove(serverSubLevel);
3639

37-
final SubLevelTicketInfo info = this.container.allTickets.get(serverSubLevel);
40+
final SubLevelTicketInfo info = this.container.allTickets.get(uuid);
3841

3942
if (info != null) {
4043
info.setPointer(serverSubLevel.getLastSerializationPointer());
4144
}
4245
} else if (reason == SubLevelRemovalReason.REMOVED) {
43-
this.container.allTickets.remove(subLevel.getUniqueId());
46+
this.container.allTickets.remove(uuid);
4447
this.container.activeTickets.remove(serverSubLevel);
4548
}
4649
}

common/src/main/java/dev/ryanhcode/sable/sublevel/storage/serialization/SubLevelSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public static ServerSubLevel fullyLoad(final ServerLevel level, final SubLevelDa
156156
try {
157157
subLevel = (ServerSubLevel) plotContainer.allocateSubLevel(halfLoadedSubLevel.uuid(), plotX, plotZ, pose);
158158
} catch (final IllegalArgumentException e) {
159-
Sable.LOGGER.error("Failed to load sub-level, skipping", halfLoadedSubLevel, e);
159+
Sable.LOGGER.error("Failed to load sub-level {}, skipping", halfLoadedSubLevel, e);
160160
return null;
161161
}
162162

0 commit comments

Comments
 (0)