Added Nether Crystals, removed Ash Blocks

This commit is contained in:
Forstride 2020-07-05 07:34:50 -04:00
parent 435ee8fbb0
commit 965aa0551f
20 changed files with 107 additions and 108 deletions

View File

@ -30,8 +30,9 @@ public class BOPBlocks
public static Block mud_brick_wall;
public static Block dried_salt;
public static Block ash_block;
public static Block flesh;
public static Block nether_crystal_block;
public static Block nether_crystal;
public static Block toadstool_block;
public static Block glowshroom_block;

View File

@ -36,7 +36,7 @@ public class VolcanoBiome extends BiomeBOP
{
public VolcanoBiome()
{
super((new Biome.Builder()).surfaceBuilder(new ConfiguredSurfaceBuilder(BOPBiomeFeatures.VOLCANO_SURFACE_BUILDER, BOPBiomeFeatures.ASH_SURFACE)).precipitation(Biome.RainType.RAIN).biomeCategory(Biome.Category.NONE).depth(4.5F).scale(0.0F).temperature(0.95F).downfall(0.3F).specialEffects((new BiomeAmbience.Builder()).waterColor(4566514).waterFogColor(267827).fogColor(12638463).ambientMoodSound(MoodSoundAmbience.LEGACY_CAVE_SETTINGS).build()).parent((String)null));
super((new Biome.Builder()).surfaceBuilder(new ConfiguredSurfaceBuilder(BOPBiomeFeatures.VOLCANO_SURFACE_BUILDER, BOPBiomeFeatures.BASALT_SURFACE)).precipitation(Biome.RainType.RAIN).biomeCategory(Biome.Category.NONE).depth(4.5F).scale(0.0F).temperature(0.95F).downfall(0.3F).specialEffects((new BiomeAmbience.Builder()).waterColor(4566514).waterFogColor(267827).fogColor(12638463).ambientMoodSound(MoodSoundAmbience.LEGACY_CAVE_SETTINGS).build()).parent((String)null));
// Structures
DefaultBiomeFeatures.addDefaultOverworldLandStructures(this);

View File

@ -0,0 +1,92 @@
/*******************************************************************************
* Copyright 2014-2019, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.block;
import biomesoplenty.api.block.BOPBlocks;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import net.minecraft.block.*;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.AttachFace;
import net.minecraft.util.Direction;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader;
import javax.annotation.Nullable;
import java.util.Map;
public class NetherCrystalBlock extends HorizontalFaceBlock
{
protected static final VoxelShape FLOOR_AABB = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected static final VoxelShape CEILING_AABB = Block.box(2.0D, 3.0D, 2.0D, 14.0D, 16.0D, 14.0D);
protected static final VoxelShape NORTH_AABB = Block.box(2.0D, 2.0D, 3.0D, 14.0D, 14.0D, 16.0D);
protected static final VoxelShape SOUTH_AABB = Block.box(2.0D, 2.0D, 0.0D, 14.0D, 14.0D, 13.0D);
protected static final VoxelShape EAST_AABB = Block.box(0.0D, 2.0D, 2.0D, 13.0D, 14.0D, 14.0D);
protected static final VoxelShape WEST_AABB = Block.box(3.0D, 2.0D, 2.0D, 16.0D, 14.0D, 14.0D);
public NetherCrystalBlock(Block.Properties properties)
{
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(FACE, AttachFace.FLOOR).setValue(FACING, Direction.NORTH));
}
protected static boolean mayPlaceOn(BlockState state, IBlockReader worldIn, BlockPos pos) {
Block block = state.getBlock();
return block == Blocks.NETHERRACK || block == BOPBlocks.nether_crystal_block;
}
@Override
public boolean canSurvive(BlockState state, IWorldReader worldIn, BlockPos pos) {
return canAttach(worldIn, pos, getConnectedDirection(state).getOpposite());
}
public static boolean canAttach(IWorldReader p_220185_0_, BlockPos p_220185_1_, Direction p_220185_2_) {
BlockPos blockpos = p_220185_1_.relative(p_220185_2_);
return mayPlaceOn(p_220185_0_.getBlockState(blockpos), p_220185_0_, blockpos);
}
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
Direction direction = state.getValue(FACING);
switch(state.getValue(FACE))
{
case FLOOR:
return FLOOR_AABB;
case WALL:
switch(direction)
{
case EAST:
return EAST_AABB;
case WEST:
return WEST_AABB;
case SOUTH:
return SOUTH_AABB;
case NORTH:
default:
return NORTH_AABB;
}
case CEILING:
default:
return CEILING_AABB;
}
}
@Override
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builderIn) {
builderIn.add(FACING, FACE);
}
}

View File

@ -1,54 +0,0 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.feature.structure.StructureManager;
import java.util.Random;
public class AshSplatterFeature extends Feature<NoFeatureConfig> {
public AshSplatterFeature(Codec<NoFeatureConfig> deserializer) {
super(deserializer);
}
@Override
public boolean place(ISeedReader worldIn, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
int i = 0;
int j = rand.nextInt(8 - 2) + 2;
for (int k = pos.getX() - j; k <= pos.getX() + j; ++k)
{
for (int l = pos.getZ() - j; l <= pos.getZ() + j; ++l)
{
int i1 = k - pos.getX();
int j1 = l - pos.getZ();
if (i1 * i1 + j1 * j1 <= j * j)
{
for (int k1 = pos.getY() - 2; k1 <= pos.getY() + 2; ++k1)
{
BlockPos blockpos = new BlockPos(k, k1, l);
BlockState blockstate = worldIn.getBlockState(blockpos);
BlockState blockstate1 = worldIn.getBlockState(blockpos.above());
if (blockstate.getBlock() == Blocks.NETHERRACK && blockstate1.isAir(worldIn, blockpos.above()))
{
worldIn.setBlock(blockpos, BOPBlocks.ash_block.defaultBlockState(), 2);
++i;
break;
}
}
}
}
}
return i > 0;
}
}

View File

@ -127,7 +127,6 @@ public class BOPBiomeFeatures
public static final Feature<NoFeatureConfig> NETHER_VINES = new NetherVinesFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> FLESH_SPLATTER = new FleshSplatterFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> BONE_SPINE = new BoneSpineFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> ASH_SPLATTER = new AshSplatterFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> PODZOL_SPLATTER = new PodzolSplatterFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> MYCELIUM_SPLATTER = new MyceliumSplatterFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> SMALL_RED_MUSHROOM = new SmallRedMushroomFeature(NoFeatureConfig.CODEC);
@ -175,9 +174,9 @@ public class BOPBiomeFeatures
public static final SurfaceBuilder<SurfaceBuilderConfig> DEEP_TOP_LAYER = new DeepTopLayerSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> POPPY_FIELD_SURFACE_BUILDER = new PoppyFieldSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilderConfig ASH_SURFACE = new SurfaceBuilderConfig(BOPBlocks.ash_block.defaultBlockState(), BOPBlocks.ash_block.defaultBlockState(), Blocks.GRAVEL.defaultBlockState());
public static final SurfaceBuilderConfig BASALT_SURFACE = new SurfaceBuilderConfig(Blocks.BASALT.defaultBlockState(), Blocks.BASALT.defaultBlockState(), Blocks.GRAVEL.defaultBlockState());
public static final SurfaceBuilderConfig TERRACOTTA_SURFACE = new SurfaceBuilderConfig(Blocks.TERRACOTTA.defaultBlockState(), Blocks.TERRACOTTA.defaultBlockState(), Blocks.GRAVEL.defaultBlockState());
public static final SurfaceBuilderConfig MAGMA_SURFACE = new SurfaceBuilderConfig(Blocks.MAGMA_BLOCK.defaultBlockState(), Blocks.MAGMA_BLOCK.defaultBlockState(), BOPBlocks.ash_block.defaultBlockState());
public static final SurfaceBuilderConfig MAGMA_SURFACE = new SurfaceBuilderConfig(Blocks.MAGMA_BLOCK.defaultBlockState(), Blocks.MAGMA_BLOCK.defaultBlockState(), Blocks.BASALT.defaultBlockState());
public static final SurfaceBuilderConfig MUD_SURFACE = new SurfaceBuilderConfig(BOPBlocks.mud.defaultBlockState(), BOPBlocks.mud.defaultBlockState(), BOPBlocks.mud.defaultBlockState());
public static final SurfaceBuilderConfig RED_SAND_SURFACE = new SurfaceBuilderConfig(Blocks.RED_SAND.defaultBlockState(), Blocks.RED_SAND.defaultBlockState(), Blocks.RED_SAND.defaultBlockState());
public static final SurfaceBuilderConfig SNOW_SNOW_GRAVEL_SURFACE = new SurfaceBuilderConfig(Blocks.SNOW_BLOCK.defaultBlockState(), Blocks.SNOW_BLOCK.defaultBlockState(), Blocks.GRAVEL.defaultBlockState());

View File

@ -27,7 +27,7 @@ public class VolcanoEdgeSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConf
public void apply(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) {
if (noise > 2.6D)
{
SurfaceBuilder.DEFAULT.apply(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.ASH_SURFACE);
SurfaceBuilder.DEFAULT.apply(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.BASALT_SURFACE);
}
else if (noise > 0.8F)
{

View File

@ -32,7 +32,7 @@ public class VolcanoSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
}
else
{
BOPBiomeFeatures.DEEP_TOP_LAYER.apply(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.ASH_SURFACE);
BOPBiomeFeatures.DEEP_TOP_LAYER.apply(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.BASALT_SURFACE);
}
}
}

View File

@ -181,7 +181,7 @@ public class BasicTreeFeature extends TreeFeatureBase
{
if (random.nextInt(4) == 0)
{
this.setAltLeaves(world, leavesPos);
this.setAltLeaves(world, leavesPos, changedLeaves, boundingBox);
}
else
{

View File

@ -89,7 +89,7 @@ public class BushTreeFeature extends TreeFeatureBase
{
if (random.nextInt(4) == 0)
{
this.setAltLeaves(world, pos.offset(x, y, z));
this.setAltLeaves(world, pos.offset(x, y, z), changedLeaves, boundingBox);
}
else
{

View File

@ -119,7 +119,6 @@ public abstract class TreeFeatureBase extends TreeFeature
{
if (this.replace.matches(world, pos))
{
this.setBlock(world, pos, this.leaves);
this.placeBlock(world, pos, this.leaves, changedBlocks, boundingBox);
return true;
}
@ -177,11 +176,11 @@ public abstract class TreeFeatureBase extends TreeFeature
return false;
}
public boolean setAltLeaves(IWorld world, BlockPos pos)
public boolean setAltLeaves(IWorld world, BlockPos pos, Set<BlockPos> changedBlocks, MutableBoundingBox boundingBox)
{
if (this.replace.matches(world, pos))
{
this.setBlock(world, pos, this.altLeaves);
this.placeBlock(world, pos, this.altLeaves, changedBlocks, boundingBox);
return true;
}
return false;

View File

@ -55,9 +55,11 @@ public class ModBlocks
mud_brick_wall = registerBlock(new WallBlock(Block.Properties.copy(mud_bricks)),"mud_brick_wall");
dried_salt = registerBlock(new DriedSaltBlock(AbstractBlock.Properties.of(Material.STONE, MaterialColor.WOOD).strength(1.0F).harvestLevel(0).harvestTool(ToolType.PICKAXE).sound(new SoundType(1.0F, 0.5F, SoundEvents.GRAVEL_BREAK, SoundEvents.GRAVEL_STEP, SoundEvents.GRAVEL_PLACE, SoundEvents.GRAVEL_HIT, SoundEvents.GRAVEL_FALL))), "dried_salt");
ash_block = registerBlock(new AshBlock(AbstractBlock.Properties.of(Material.SAND, MaterialColor.TERRACOTTA_BLACK).strength(0.4F).harvestLevel(0).harvestTool(ToolType.SHOVEL).sound(SoundType.SAND)), "ash_block");
flesh = registerBlock(new FleshBlock(AbstractBlock.Properties.of(Material.SPONGE, MaterialColor.TERRACOTTA_RED).strength(0.4F).harvestLevel(0).harvestTool(ToolType.AXE).sound(new SoundType(1.0F, 0.5F, SoundEvents.CORAL_BLOCK_BREAK, SoundEvents.CORAL_BLOCK_STEP, SoundEvents.CORAL_BLOCK_PLACE, SoundEvents.CORAL_BLOCK_HIT, SoundEvents.CORAL_BLOCK_FALL))), "flesh");
nether_crystal_block = registerBlock(new Block(AbstractBlock.Properties.of(Material.GLASS, MaterialColor.CRIMSON_STEM).strength(0.4F).harvestLevel(0).harvestTool(ToolType.PICKAXE).sound(new SoundType(1.0F, 0.75F, SoundEvents.GLASS_BREAK, SoundEvents.GLASS_STEP, SoundEvents.GLASS_PLACE, SoundEvents.GLASS_HIT, SoundEvents.GLASS_FALL)).lightLevel((state) -> 10)), "nether_crystal_block");
nether_crystal = registerBlock(new NetherCrystalBlock(AbstractBlock.Properties.of(Material.GLASS, MaterialColor.CRIMSON_STEM).noCollission().strength(0.3F).harvestLevel(0).harvestTool(ToolType.PICKAXE).sound(new SoundType(1.0F, 0.75F, SoundEvents.GLASS_BREAK, SoundEvents.GLASS_STEP, SoundEvents.GLASS_PLACE, SoundEvents.GLASS_HIT, SoundEvents.GLASS_FALL)).lightLevel((state) -> 10)), "nether_crystal");
toadstool_block = registerBlock(new HugeMushroomBlock(AbstractBlock.Properties.of(Material.WOOD, MaterialColor.COLOR_ORANGE).strength(0.2F).sound(SoundType.WOOD)), "toadstool_block");
glowshroom_block = registerBlock(new HugeMushroomBlock(AbstractBlock.Properties.of(Material.WOOD, MaterialColor.DIAMOND).strength(0.2F).sound(SoundType.WOOD).lightLevel((state) -> 10)), "glowshroom_block");
@ -351,6 +353,7 @@ public class ModBlocks
RenderTypeLookup.setRenderLayer(umbran_leaves, transparentRenderType);
RenderTypeLookup.setRenderLayer(hellbark_leaves, transparentRenderType);
RenderTypeLookup.setRenderLayer(nether_crystal, cutoutRenderType);
RenderTypeLookup.setRenderLayer(origin_sapling, cutoutRenderType);
RenderTypeLookup.setRenderLayer(flowering_oak_sapling, cutoutRenderType);
RenderTypeLookup.setRenderLayer(rainbow_birch_sapling, cutoutRenderType);

View File

@ -127,7 +127,6 @@ public class ModFeatures
registerFeatures(BOPBiomeFeatures.NETHER_VINES, "nether_vines");
registerFeatures(BOPBiomeFeatures.FLESH_SPLATTER, "flesh_splatter");
registerFeatures(BOPBiomeFeatures.BONE_SPINE, "bone_spine");
registerFeatures(BOPBiomeFeatures.ASH_SPLATTER, "ash_splatter");
registerFeatures(BOPBiomeFeatures.PODZOL_SPLATTER, "podzol_splatter");
registerFeatures(BOPBiomeFeatures.MYCELIUM_SPLATTER, "mycelium_splatter");
registerFeatures(BOPBiomeFeatures.SMALL_RED_MUSHROOM, "small_red_mushroom");

View File

@ -1,10 +0,0 @@
{
"variants": {
"": [
{ "model": "biomesoplenty:block/ash_block" },
{ "model": "biomesoplenty:block/ash_block", "y": 90 },
{ "model": "biomesoplenty:block/ash_block", "y": 180 },
{ "model": "biomesoplenty:block/ash_block", "y": 270 }
]
}
}

View File

@ -46,7 +46,6 @@
"model": "biomesoplenty:block/nether_crystal",
"y": 270,
"x": 90
},
}
}
}

View File

@ -93,7 +93,6 @@
"item.biomesoplenty.umbran_boat": "Umbran Boat",
"item.biomesoplenty.willow_boat": "Willow Boat",
"block.biomesoplenty.ash_block": "Ash Block",
"block.biomesoplenty.blue_hydrangea": "Blue Hydrangea",
"block.biomesoplenty.bramble": "Bramble",
"block.biomesoplenty.burning_blossom": "Burning Blossom",

View File

@ -1,6 +0,0 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:block/ash_block"
}
}

View File

@ -1,3 +0,0 @@
{
"parent": "biomesoplenty:block/ash_block"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 233 B

View File

@ -1,19 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "biomesoplenty:ash_block"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}