Skip to content

Commit

Permalink
fix some inverted checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed May 26, 2024
1 parent 240e5a5 commit d8f6beb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit d8f6beb

Please sign in to comment.