Fixed zap apples not growing and fixed wolf howl not howling

This commit is contained in:
Sollace 2022-10-07 00:30:26 +02:00
parent 09e8f8243c
commit 9314e144e0
2 changed files with 8 additions and 4 deletions

View file

@ -40,6 +40,11 @@ public class ZapAppleLeavesBlock extends LeavesBlock implements TintedBlock {
builder.add(STAGE);
}
@Override
public boolean hasRandomTicks(BlockState state) {
return true;
}
@Override
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
super.randomTick(state, world, pos, random);
@ -96,11 +101,9 @@ public class ZapAppleLeavesBlock extends LeavesBlock implements TintedBlock {
}
if (stage == ZapAppleStageStore.Stage.RIPE) {
store.playMoonEffect(pos);
if (below.isOf(UBlocks.ZAP_BULB)) {
world.setBlockState(pos.down(), UBlocks.ZAP_APPLE.getDefaultState(), Block.NOTIFY_ALL);
store.triggerLightningStrike(pos);
store.playMoonEffect(pos);
}
}

View file

@ -86,7 +86,8 @@ public class ZapAppleStageStore extends PersistentState implements Tickable {
if (!playedMoonEffect) {
playedMoonEffect = true;
markDirty();
world.playSound(pos.getX(), pos.getY(), pos.getZ(), SoundEvents.ENTITY_WOLF_HOWL, SoundCategory.BLOCKS, 1.5F, 0.9F, true);
world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), SoundEvents.ENTITY_WOLF_HOWL, SoundCategory.BLOCKS, 1.5F, 0.3F, world.random.nextInt(1200));
}
}