From 9314e144e01bb4ba5f2742b2352152475aa5cd81 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 7 Oct 2022 00:30:26 +0200 Subject: [PATCH] Fixed zap apples not growing and fixed wolf howl not howling --- .../unicopia/block/ZapAppleLeavesBlock.java | 9 ++++++--- .../unicopia/block/data/ZapAppleStageStore.java | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLeavesBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLeavesBlock.java index ee5cc025..a716baa7 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLeavesBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLeavesBlock.java @@ -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); } } diff --git a/src/main/java/com/minelittlepony/unicopia/block/data/ZapAppleStageStore.java b/src/main/java/com/minelittlepony/unicopia/block/data/ZapAppleStageStore.java index 33b16fd0..a85bf82d 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/data/ZapAppleStageStore.java +++ b/src/main/java/com/minelittlepony/unicopia/block/data/ZapAppleStageStore.java @@ -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)); } }