Skip to content

Commit

Permalink
Fix balloon pick result applying default color
Browse files Browse the repository at this point in the history
  • Loading branch information
maximumpower55 committed Jun 26, 2024
1 parent f347cd1 commit bdf7b4d
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected AbstractBalloon(EntityType<?> type, Level level, ItemStack stack, @Nul
@Override
protected void defineSynchedData(Builder builder) {
builder.define(SHAPE_ID, DEFAULT_SHAPE.id);
builder.define(COLOR, AbstractBalloon.DEFAULT_COLOR);
builder.define(COLOR, DEFAULT_COLOR);
}

@Override
Expand Down Expand Up @@ -342,11 +342,12 @@ public boolean isPickable() {
@Nullable
@Override
public ItemStack getPickResult() {
return Util.make(new ItemStack(this.baseItem()), stack -> stack.applyComponents(
int color = this.color();
return Util.make(new ItemStack(this.baseItem()), color != DEFAULT_COLOR ? stack -> stack.applyComponents(
DataComponentPatch.builder()
.set(DataComponents.DYED_COLOR, new DyedItemColor(this.color(), true)).
.set(DataComponents.DYED_COLOR, new DyedItemColor(color, true)).
build()
));
) : stack -> {});
}

@Override
Expand Down

0 comments on commit bdf7b4d

Please sign in to comment.