Twisted umbrella moss prototype
This commit is contained in:
parent
54e24d0ce7
commit
fa0c2b1869
22 changed files with 1440 additions and 0 deletions
|
@ -0,0 +1,49 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import ru.betterend.blocks.basis.BlockDoublePlant;
|
||||
import ru.betterend.blocks.basis.BlockPlant;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class BlockTwistedUmbrellaMoss extends BlockPlant {
|
||||
public BlockTwistedUmbrellaMoss() {
|
||||
super(11);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public boolean hasEmissiveLighting(BlockView world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public float getAmbientOcclusionLightLevel(BlockView world, BlockPos pos) {
|
||||
return 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) {
|
||||
return world.isAir(pos.up());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) {
|
||||
int rot = world.random.nextInt(4);
|
||||
BlockState bs = EndBlocks.TWISTED_UMBRELLA_MOSS_TALL.getDefaultState().with(BlockDoublePlant.ROTATION, rot);
|
||||
BlocksHelper.setWithoutUpdate(world, pos, bs);
|
||||
BlocksHelper.setWithoutUpdate(world, pos.up(), bs.with(BlockDoublePlant.TOP, true));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.ItemEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import ru.betterend.blocks.basis.BlockDoublePlant;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
public class BlockTwistedUmbrellaMossTall extends BlockDoublePlant {
|
||||
public BlockTwistedUmbrellaMossTall() {
|
||||
super(12);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) {
|
||||
ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(EndBlocks.TWISTED_UMBRELLA_MOSS));
|
||||
world.spawnEntity(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
|
||||
}
|
||||
}
|
|
@ -63,6 +63,8 @@ import ru.betterend.blocks.BlockTenaneaFlowers;
|
|||
import ru.betterend.blocks.BlockTenaneaSapling;
|
||||
import ru.betterend.blocks.BlockTerrain;
|
||||
import ru.betterend.blocks.BlockTerrainPlant;
|
||||
import ru.betterend.blocks.BlockTwistedUmbrellaMoss;
|
||||
import ru.betterend.blocks.BlockTwistedUmbrellaMossTall;
|
||||
import ru.betterend.blocks.BlockUmbrellaMoss;
|
||||
import ru.betterend.blocks.BlockUmbrellaMossTall;
|
||||
import ru.betterend.blocks.BlockUmbrellaTreeMembrane;
|
||||
|
@ -186,6 +188,8 @@ public class EndBlocks {
|
|||
public static final Block SHADOW_PLANT = registerBlock("shadow_plant", new BlockTerrainPlant(SHADOW_GRASS));
|
||||
public static final Block BUSHY_GRASS = registerBlock("bushy_grass", new BlockTerrainPlant(PINK_MOSS));
|
||||
public static final Block AMBER_GRASS = registerBlock("amber_grass", new BlockTerrainPlant(AMBER_MOSS));
|
||||
public static final Block TWISTED_UMBRELLA_MOSS = registerBlock("twisted_umbrella_moss", new BlockTwistedUmbrellaMoss());
|
||||
public static final Block TWISTED_UMBRELLA_MOSS_TALL = registerBlock("twisted_umbrella_moss_tall", new BlockTwistedUmbrellaMossTall());
|
||||
|
||||
public static final Block BLUE_VINE_SEED = registerBlock("blue_vine_seed", new BlockBlueVineSeed());
|
||||
public static final Block BLUE_VINE = registerBlockNI("blue_vine", new BlockBlueVine());
|
||||
|
|
|
@ -79,6 +79,7 @@ public class EndFeatures {
|
|||
public static final EndFeature AMBER_GRASS = new EndFeature("amber_grass", new SinglePlantFeature(EndBlocks.AMBER_GRASS, 6), 9);
|
||||
public static final EndFeature LANCELEAF = new EndFeature("lanceleaf", new LanceleafFeature(), 3);
|
||||
public static final EndFeature GLOW_PILLAR = new EndFeature("glow_pillar", new GlowPillarFeature(), 1);
|
||||
public static final EndFeature TWISTED_UMBRELLA_MOSS = new EndFeature("twisted_umbrella_moss", new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS_TALL, 9), 6);
|
||||
|
||||
// Vines //
|
||||
public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3);
|
||||
|
|
|
@ -12,6 +12,7 @@ public class BiomeUmbrellaJungle extends EndBiome {
|
|||
.setFogDensity(2.3F)
|
||||
.setSurface(EndBlocks.END_MOSS)
|
||||
.addFeature(EndFeatures.UMBRELLA_TREE)
|
||||
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS)
|
||||
.addFeature(EndFeatures.UMBRELLA_MOSS)
|
||||
.addFeature(EndFeatures.END_LAKE));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue