Blossom berry

This commit is contained in:
paulevsGitch 2021-01-06 16:05:20 +03:00
parent 2a2641eea3
commit ca769ebc66
30 changed files with 257 additions and 36 deletions

View file

@ -4,7 +4,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.PlantWithAgeBlock;
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper;
@ -26,10 +26,10 @@ public class BlueVineFeature extends ScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
if (small) {
BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.BLUE_VINE_SEED.getDefaultState().with(PlantWithAgeBlock.AGE, random.nextInt(4)));
BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.BLUE_VINE_SEED.getDefaultState().with(EndPlantWithAgeBlock.AGE, random.nextInt(4)));
}
else {
PlantWithAgeBlock seed = ((PlantWithAgeBlock) EndBlocks.BLUE_VINE_SEED);
EndPlantWithAgeBlock seed = ((EndPlantWithAgeBlock) EndBlocks.BLUE_VINE_SEED);
seed.growAdult(world, random, blockPos);
}
}

View file

@ -4,7 +4,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.PlantWithAgeBlock;
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
import ru.betterend.registry.EndBlocks;
public class GlowPillarFeature extends ScatterFeature {
@ -19,7 +19,7 @@ public class GlowPillarFeature extends ScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
PlantWithAgeBlock seed = ((PlantWithAgeBlock) EndBlocks.GLOWING_PILLAR_SEED);
EndPlantWithAgeBlock seed = ((EndPlantWithAgeBlock) EndBlocks.GLOWING_PILLAR_SEED);
seed.growAdult(world, random, blockPos);
}

View file

@ -4,7 +4,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.PlantWithAgeBlock;
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
import ru.betterend.registry.EndBlocks;
public class LanceleafFeature extends ScatterFeature {
@ -19,7 +19,7 @@ public class LanceleafFeature extends ScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
PlantWithAgeBlock seed = ((PlantWithAgeBlock) EndBlocks.LANCELEAF_SEED);
EndPlantWithAgeBlock seed = ((EndPlantWithAgeBlock) EndBlocks.LANCELEAF_SEED);
seed.growAdult(world, random, blockPos);
}

View file

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