From d8f6beb2728e7c63a572241ec760aff2e9e4174d Mon Sep 17 00:00:00 2001 From: ix0rai Date: Sat, 25 May 2024 20:43:46 -0500 Subject: [PATCH] fix some inverted checks --- .../io/ix0rai/bodacious_berries/block/BasicBerryBush.java | 2 +- .../io/ix0rai/bodacious_berries/block/SpikedBerryBush.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/BasicBerryBush.java b/src/main/java/io/ix0rai/bodacious_berries/block/BasicBerryBush.java index 6943d4c..72c6b9d 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/BasicBerryBush.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/BasicBerryBush.java @@ -95,7 +95,7 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random */ @Override public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { - if (entity instanceof LivingEntity && !UNSLOWED_ENTITIES.contains(entity.getType()) && state.get(getAge()) < sizeChangeAge) { + if (entity instanceof LivingEntity && !UNSLOWED_ENTITIES.contains(entity.getType()) && state.get(getAge()) >= sizeChangeAge) { entity.setMovementMultiplier(state, BERRY_BUSH_SLOWING_VECTOR); } } diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/SpikedBerryBush.java b/src/main/java/io/ix0rai/bodacious_berries/block/SpikedBerryBush.java index f71a34f..1f587a7 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/SpikedBerryBush.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/SpikedBerryBush.java @@ -32,8 +32,11 @@ public SpikedBerryBush(Berry berry, int maxAge, VoxelShape smallShape, VoxelShap public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { super.onEntityCollision(state, world, pos, entity); - if (!(world.isClient) && movedMinDistance(entity) && !UNSLOWED_ENTITIES.contains(entity.getType()) && state.get(getAge()) < sizeChangeAge) { - entity.damage(world.getDamageSources().sweetBerryBush(), damage); + if (!(world.isClient) && !UNSLOWED_ENTITIES.contains(entity.getType()) && state.get(getAge()) >= sizeChangeAge) { + boolean movedMinDistance = movedMinDistance(entity); + if (movedMinDistance) { + entity.damage(world.getDamageSources().sweetBerryBush(), damage); + } } }