Bulb vine (WIP)

This commit is contained in:
paulevsGitch 2020-11-26 23:11:02 +03:00
parent e59af33124
commit 61538c18d3
15 changed files with 220 additions and 5 deletions

View file

@ -164,6 +164,7 @@ public class EndBlocks {
// Vines //
public static final Block DENSE_VINE = registerBlock("dense_vine", new BlockVine(15, true));
public static final Block TWISTED_VINE = registerBlock("twisted_vine", new BlockVine());
public static final Block BULB_VINE = registerBlock("bulb_vine", new BlockVine(15, true));
// Ores //
public static final Block ENDER_ORE = registerBlock("ender_ore", new BlockOre(EndItems.ENDER_DUST, 1, 3, 5));

View file

@ -62,6 +62,7 @@ public class EndFeatures {
// Vines //
public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3);
public static final EndFeature TWISTED_VINE = new EndFeature("twisted_vine", new VineFeature(EndBlocks.TWISTED_VINE, 24), 3);
public static final EndFeature BULB_VINE = new EndFeature("bulb_vine", new VineFeature(EndBlocks.BULB_VINE, 24), 5);
// Wall Plants //
public static final EndFeature PURPLE_POLYPORE = new EndFeature("purple_polypore", new WallPlantOnLogFeature(EndBlocks.PURPLE_POLYPORE, 3), 5);

View file

@ -15,6 +15,7 @@ public class BlossomingSpires extends EndBiome {
.addFeature(EndFeatures.FLOATING_SPIRE)
.addFeature(EndFeatures.TENANEA)
.addFeature(EndFeatures.TENANEA_BUSH)
.addFeature(EndFeatures.BULB_VINE)
.addFeature(EndFeatures.TWISTED_MOSS)
.addFeature(EndFeatures.TWISTED_MOSS_WOOD)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));

View file

@ -26,11 +26,13 @@ public class VineFeature extends InvertedScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
int h = BlocksHelper.downRay(world, blockPos, random.nextInt(maxLength));
BlocksHelper.setWithoutUpdate(world, blockPos, vineBlock.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
for (int i = 1; i < h; i++) {
BlocksHelper.setWithoutUpdate(world, blockPos.down(i), vineBlock.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
int h = BlocksHelper.downRay(world, blockPos, random.nextInt(maxLength)) - 1;
if (h > 2) {
BlocksHelper.setWithoutUpdate(world, blockPos, vineBlock.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
for (int i = 1; i < h; i++) {
BlocksHelper.setWithoutUpdate(world, blockPos.down(i), vineBlock.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
}
BlocksHelper.setWithoutUpdate(world, blockPos.down(h), vineBlock.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
}
BlocksHelper.setWithoutUpdate(world, blockPos.down(h), vineBlock.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
}
}