Mobs pathfinding issues fix

This commit is contained in:
paulevsGitch 2020-11-03 23:40:33 +03:00
parent 2105988554
commit 0301be97af
5 changed files with 38 additions and 3 deletions

View file

@ -7,6 +7,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockDoublePlant;
import ru.betterend.blocks.basis.BlockPlantWithAge;
import ru.betterend.util.BlocksHelper;
public class SinglePlantFeature extends ScatterFeature {
@ -41,6 +42,11 @@ public class SinglePlantFeature extends ScatterFeature {
BlocksHelper.setWithoutUpdate(world, blockPos, state);
BlocksHelper.setWithoutUpdate(world, blockPos.up(), state.with(BlockDoublePlant.TOP, true));
}
else if (plant instanceof BlockPlantWithAge) {
int age = random.nextInt(4);
BlockState state = plant.getDefaultState().with(BlockPlantWithAge.AGE, age);
BlocksHelper.setWithoutUpdate(world, blockPos, state);
}
else {
BlocksHelper.setWithoutUpdate(world, blockPos, plant);
}