Skip to content

Commit

Permalink
Update FlowerCow.java
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Dec 29, 2024
1 parent a402f6a commit 691d1f8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/java/net/frozenblock/wilderwild/entity/FlowerCow.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void shear(SoundSource soundSource) {
this.level().playSound(null, this, SoundEvents.MOOSHROOM_SHEAR, soundSource, 1F, 1F);
if (this.level() instanceof ServerLevel serverLevel) {
BlockState flowerState = this.getVariantByLocation().getFlowerBlockState();
serverLevel.sendParticles(new BlockParticleOption(ParticleTypes.BLOCK, flowerState), this.getX(), this.getY(0.5D), this.getZ(), 1, 0D, 0D, 0D, 0D);
spawnShearParticles(serverLevel, this, flowerState);
this.level().addFreshEntity(
new ItemEntity(
this.level(),
Expand All @@ -151,6 +151,20 @@ public void shear(SoundSource soundSource) {
}
}

private static void spawnShearParticles(@NotNull ServerLevel serverLevel, @NotNull FlowerCow flowerCow, BlockState flowerBlockState) {
serverLevel.sendParticles(
new BlockParticleOption(ParticleTypes.BLOCK, flowerBlockState),
flowerCow.getX(),
flowerCow.getY(0.6666666666666666),
flowerCow.getZ(),
10,
flowerCow.getBbWidth() / 4D,
flowerCow.getBbHeight() / 4D,
flowerCow.getBbWidth() / 4D,
0.05D
);
}

@Override
public void handleEntityEvent(byte b) {
if (b == GROW_FLOWER_EVENT_ID) {
Expand Down

0 comments on commit 691d1f8

Please sign in to comment.