Skip to content

Commit

Permalink
fix(uni): potential android location loss
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Dec 23, 2024
1 parent 3ee5a83 commit bb4d041
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,17 @@ public Optional<UUID> getUniversalDataUUID(@Nonnull Block b) {

return uuid.map(data -> {
try {
return UUID.fromString(data);
var uniId = UUID.fromString(data);

var uniData =
Slimefun.getDatabaseManager().getBlockDataController().getUniversalBlockDataFromCache(uniId);

// Auto fix missing location
if (uniData != null && uniData.getLastPresent() == null) {
uniData.setLastPresent(b.getLocation());
}

return uniId;
} catch (IllegalArgumentException e) {
return null;
}
Expand Down

0 comments on commit bb4d041

Please sign in to comment.