Skip to content

Commit

Permalink
null check for new player loading method
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Jul 29, 2024
1 parent a1e5f08 commit a6626ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ org.gradle.configureondemand=true
# Enable advanced multi-module optimizations (share tiny-remaper instance between projects)
fabric.loom.multiProjectOptimisation=true
# Mod Properties
baseVersion = 0.6.14
baseVersion = 0.6.15
defaultBranch = 1.20
branch = 1.20
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.Optional;

@Mixin(PlayerManager.class)
public class MixinPlayerManager {
@Inject(method = "loadPlayerData", at = @At("RETURN"))
public void loadPlayerSummary(ServerPlayerEntity player, CallbackInfoReturnable<NbtCompound> cir) {
ServerSummary.of(player.getServer()).updatePlayer(Surveyor.getUuid(player), cir.getReturnValue(), true, player.getServer());
ServerSummary.of(player.getServer()).updatePlayer(Surveyor.getUuid(player), Optional.ofNullable(cir.getReturnValue()).orElse(new NbtCompound()), true, player.getServer());
}
}

0 comments on commit a6626ff

Please sign in to comment.