Skip to content

Commit ce3fe65

Browse files
committed
fix NPE in legacy profiles
Closes #13120
1 parent 36e0c0a commit ce3fe65

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

paper-api/src/main/java/org/bukkit/event/block/BrewingStartEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public class BrewingStartEvent extends InventoryBlockStartEvent {
1717
private int recipeBrewTime = 400;
1818

1919
@ApiStatus.Internal
20-
public BrewingStartEvent(@NotNull final Block furnace, @NotNull ItemStack source, int brewingTime) {
21-
super(furnace, source);
20+
public BrewingStartEvent(@NotNull final Block brewingStand, @NotNull ItemStack source, int brewingTime) {
21+
super(brewingStand, source);
2222
this.brewingTime = brewingTime;
2323
}
2424

paper-api/src/main/java/org/bukkit/event/block/CampfireStartEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public class CampfireStartEvent extends InventoryBlockStartEvent {
1616
private int cookingTime;
1717

1818
@ApiStatus.Internal
19-
public CampfireStartEvent(@NotNull final Block furnace, @NotNull ItemStack source, @NotNull CampfireRecipe recipe) {
20-
super(furnace, source);
19+
public CampfireStartEvent(@NotNull final Block campfire, @NotNull ItemStack source, @NotNull CampfireRecipe recipe) {
20+
super(campfire, source);
2121
this.cookingTime = recipe.getCookingTime();
2222
this.campfireRecipe = recipe;
2323
}

paper-server/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,21 @@ public ResolvableProfile buildResolvableProfile() {
197197
@Override
198198
public GameProfile buildGameProfile() {
199199
this.rebuildDirtyProperties();
200-
return new GameProfile(this.uniqueId, this.name, new PropertyMap(this.properties));
200+
return new GameProfile(
201+
this.uniqueId != null ? this.uniqueId : Util.NIL_UUID,
202+
this.name != null ? this.name : "",
203+
new PropertyMap(this.properties)
204+
);
201205
}
202206

203207
@Override
204208
public String toString() {
205209
this.rebuildDirtyProperties();
206210
StringBuilder builder = new StringBuilder();
207211
builder.append("CraftPlayerProfile [uniqueId=");
208-
builder.append(this.uniqueId);
212+
builder.append(this.getUniqueId());
209213
builder.append(", name=");
210-
builder.append(this.name);
214+
builder.append(this.getName());
211215
builder.append(", properties=");
212216
builder.append(CraftPlayerProfile.toString(this.properties));
213217
builder.append("]");

0 commit comments

Comments
 (0)