Glowing grasslands update
This commit is contained in:
parent
31163e7658
commit
77c56433cc
57 changed files with 382 additions and 107 deletions
|
@ -121,9 +121,10 @@ public class BlockProperties {
|
|||
}
|
||||
|
||||
public static enum LumecornShape implements StringIdentifiable {
|
||||
LIGHT1("light1", 15),
|
||||
LIGHT2("light2", 14),
|
||||
LIGHT3("light3", 13),
|
||||
LIGHT_TOP("light_top", 10),
|
||||
LIGHT_TOP_MIDDLE("light_top_middle", 13),
|
||||
LIGHT_MIDDLE("light_middle", 15),
|
||||
LIGHT_BOTTOM("light_bottom", 10),
|
||||
MIDDLE("middle", 0),
|
||||
BOTTOM_BIG("bottom_big", 0),
|
||||
BOTTOM_SMALL("bottom_small", 0);
|
||||
|
|
|
@ -46,10 +46,10 @@ public class LumecornBlock extends BaseBlockNotFull implements IRenderTypeable {
|
|||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) {
|
||||
LumecornShape shape = state.get(SHAPE);
|
||||
if (shape == LumecornShape.LIGHT3) {
|
||||
if (shape == LumecornShape.LIGHT_MIDDLE) {
|
||||
return SHAPE_SMALL;
|
||||
}
|
||||
else if (shape == LumecornShape.LIGHT2) {
|
||||
else if (shape == LumecornShape.LIGHT_TOP_MIDDLE) {
|
||||
return SHAPE_MEDIUM;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -206,6 +206,10 @@ public class EndBlocks {
|
|||
public static final Block TWISTED_UMBRELLA_MOSS = registerBlock("twisted_umbrella_moss", new TwistedUmbrellaMossBlock());
|
||||
public static final Block TWISTED_UMBRELLA_MOSS_TALL = registerBlock("twisted_umbrella_moss_tall", new TwistedUmbrellaMossTallBlock());
|
||||
public static final Block JUNGLE_GRASS = registerBlock("jungle_grass", new TerrainPlantBlock(JUNGLE_MOSS));
|
||||
public static final Block BLOOMING_COOKSONIA = registerBlock("blooming_cooksonia", new TerrainPlantBlock(END_MOSS));
|
||||
public static final Block SALTEAGO = registerBlock("salteago", new TerrainPlantBlock(END_MOSS));
|
||||
public static final Block VAIOLUSH_FERN = registerBlock("vaiolush_fern", new TerrainPlantBlock(END_MOSS));
|
||||
public static final Block FRACTURN = registerBlock("fracturn", new TerrainPlantBlock(END_MOSS));
|
||||
|
||||
public static final Block BLUE_VINE_SEED = registerBlock("blue_vine_seed", new BlueVineSeedBlock());
|
||||
public static final Block BLUE_VINE = registerBlockNI("blue_vine", new BlueVineBlock());
|
||||
|
|
|
@ -91,6 +91,13 @@ public class EndFeatures {
|
|||
public static final EndFeature JUNGLE_GRASS = new EndFeature("jungle_grass", new SinglePlantFeature(EndBlocks.JUNGLE_GRASS, 7, 3), 8);
|
||||
public static final EndFeature SMALL_JELLYSHROOM_FLOOR = new EndFeature("small_jellyshroom_floor", new SinglePlantFeature(EndBlocks.SMALL_JELLYSHROOM, 5, 5), 4);
|
||||
public static final EndFeature BLOSSOM_BERRY = new EndFeature("blossom_berry", new SinglePlantFeature(EndBlocks.BLOSSOM_BERRY, 3, 3), 2);
|
||||
public static final EndFeature BLOOMING_COOKSONIA = new EndFeature("blooming_cooksonia", new SinglePlantFeature(EndBlocks.BLOOMING_COOKSONIA, 5), 5);
|
||||
public static final EndFeature SALTEAGO = new EndFeature("salteago", new SinglePlantFeature(EndBlocks.SALTEAGO, 5), 5);
|
||||
public static final EndFeature VAIOLUSH_FERN = new EndFeature("vaiolush_fern", new SinglePlantFeature(EndBlocks.VAIOLUSH_FERN, 5), 5);
|
||||
public static final EndFeature FRACTURN = new EndFeature("fracturn", new SinglePlantFeature(EndBlocks.FRACTURN, 5), 5);
|
||||
public static final EndFeature UMBRELLA_MOSS_RARE = new EndFeature("umbrella_moss_rare", new SinglePlantFeature(EndBlocks.UMBRELLA_MOSS, 3), 2);
|
||||
public static final EndFeature CREEPING_MOSS_RARE = new EndFeature("creeping_moss_rare", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 3), 2);
|
||||
public static final EndFeature TWISTED_UMBRELLA_MOSS_RARE = new EndFeature("twisted_umbrella_moss_rare", new SinglePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, 3), 2);
|
||||
|
||||
// Vines //
|
||||
public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3);
|
||||
|
|
|
@ -16,9 +16,13 @@ public class GlowingGrasslandsBiome extends EndBiome {
|
|||
.setSurface(EndBlocks.END_MOSS)
|
||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
||||
.addFeature(EndFeatures.LUMECORN)
|
||||
.addFeature(EndFeatures.UMBRELLA_MOSS)
|
||||
.addFeature(EndFeatures.CREEPING_MOSS)
|
||||
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS)
|
||||
.addFeature(EndFeatures.BLOOMING_COOKSONIA)
|
||||
.addFeature(EndFeatures.SALTEAGO)
|
||||
.addFeature(EndFeatures.VAIOLUSH_FERN)
|
||||
.addFeature(EndFeatures.FRACTURN)
|
||||
.addFeature(EndFeatures.UMBRELLA_MOSS_RARE)
|
||||
.addFeature(EndFeatures.CREEPING_MOSS_RARE)
|
||||
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE)
|
||||
.addFeature(EndFeatures.CHARNIA_CYAN)
|
||||
.addFeature(EndFeatures.CHARNIA_GREEN)
|
||||
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
|
|
|
@ -2,10 +2,10 @@ package ru.betterend.world.features.bushes;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos.Mutable;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
|
@ -22,7 +22,7 @@ public class Lumecorn extends DefaultFeature {
|
|||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||
if (!world.getBlockState(pos.down()).getBlock().isIn(EndTags.END_GROUND)) return false;
|
||||
|
||||
int height = MHelper.randRange(3, 6, random);
|
||||
int height = MHelper.randRange(4, 7, random);
|
||||
Mutable mut = new Mutable().set(pos);
|
||||
for (int i = 1; i < height; i++) {
|
||||
mut.move(Direction.UP);
|
||||
|
@ -31,39 +31,31 @@ public class Lumecorn extends DefaultFeature {
|
|||
}
|
||||
}
|
||||
mut.set(pos);
|
||||
if (height == 3) {
|
||||
BlockState topMiddle = EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP_MIDDLE);
|
||||
BlockState middle = EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.LIGHT_MIDDLE);
|
||||
BlockState bottom = EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.LIGHT_BOTTOM);
|
||||
BlockState top = EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP);
|
||||
if (height == 4) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL));
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.LIGHT2));
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.LIGHT3));
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), bottom);
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), topMiddle);
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), top);
|
||||
return true;
|
||||
}
|
||||
boolean tall = random.nextBoolean();
|
||||
if (tall) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.BOTTOM_BIG));
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.MIDDLE));
|
||||
height -= 2;
|
||||
if (random.nextBoolean()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL));
|
||||
}
|
||||
else {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL));
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.BOTTOM_BIG));
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.MIDDLE));
|
||||
height --;
|
||||
}
|
||||
boolean smallBottom = height > 2 && random.nextBoolean();
|
||||
for (int i = 0; i < height; i++) {
|
||||
int size = i - height + 4;
|
||||
size = MathHelper.clamp(size, 1, 3);
|
||||
if (smallBottom && i == 0) {
|
||||
size ++;
|
||||
}
|
||||
if (size == 1) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.LIGHT1));
|
||||
}
|
||||
else if (size == 2) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.LIGHT2));
|
||||
}
|
||||
else {
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.getDefaultState().with(LumecornBlock.SHAPE, LumecornShape.LIGHT3));
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), bottom);
|
||||
for (int i = 4; i < height; i++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), middle);
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), topMiddle);
|
||||
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), top);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue