Some more comments

This commit is contained in:
Bjarne Koll
2025-05-31 14:28:59 +02:00
parent 4a903d8124
commit 4fe0ac240b
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@
Optional<GameProfile> optional;
if (this.id.isPresent()) {
- optional = SkullBlockEntity.fetchGameProfile(this.id.get()).getNow(null);
+ optional = SkullBlockEntity.fetchGameProfile(this.id.get(), this.name.orElse(null)).getNow(null); // Paper
+ optional = SkullBlockEntity.fetchGameProfile(this.id.get(), this.name.orElse(null)).getNow(null); // Paper - player profile events - pass name
} else {
optional = SkullBlockEntity.fetchGameProfile(this.name.orElseThrow()).getNow(null);
}
@@ -26,7 +26,7 @@
} else {
return this.id.isPresent()
- ? SkullBlockEntity.fetchGameProfile(this.id.get()).thenApply(this::createProfile)
+ ? SkullBlockEntity.fetchGameProfile(this.id.get(), this.name.orElse(null)).thenApply(this::createProfile) // Paper
+ ? SkullBlockEntity.fetchGameProfile(this.id.get(), this.name.orElse(null)).thenApply(this::createProfile) // Paper - player profile events - pass name
: SkullBlockEntity.fetchGameProfile(this.name.orElseThrow()).thenApply(this::createProfile);
}
}

View File

@@ -70,7 +70,7 @@
);
public static final GameRules.Key<GameRules.BooleanValue> RULE_LOCATOR_BAR = register(
- "locatorBar", GameRules.Category.PLAYER, GameRules.BooleanValue.create(true, (server, value) -> server.getAllLevels().forEach(level -> {
+ "locatorBar", GameRules.Category.PLAYER, GameRules.BooleanValue.create(true, (server, value) -> java.util.Optional.of(server).ifPresent(level -> { // Paper
+ "locatorBar", GameRules.Category.PLAYER, GameRules.BooleanValue.create(true, (server, value) -> java.util.Optional.of(server).ifPresent(level -> { // Paper - per world game rules
ServerWaypointManager waypointManager = level.getWaypointManager();
if (value.get()) {
level.players().forEach(waypointManager::updatePlayer);