Merge branch 'master' of https://github.com/paulevsGitch/BetterEnd
This commit is contained in:
commit
dd10f6edfb
13 changed files with 378 additions and 46 deletions
|
@ -43,7 +43,7 @@ public class BlockBrimstone extends BlockBase {
|
|||
if (deactivate) {
|
||||
world.setBlockState(pos, getDefaultState().with(ACTIVATED, false));
|
||||
}
|
||||
else if (state.get(ACTIVATED)) {
|
||||
else if (state.get(ACTIVATED) && random.nextInt(16) == 0) {
|
||||
Direction dir = BlocksHelper.randomDirection(random);
|
||||
BlockPos side = pos.offset(dir);
|
||||
BlockState sideState = world.getBlockState(side);
|
||||
|
|
|
@ -37,6 +37,7 @@ import net.minecraft.world.WorldView;
|
|||
import ru.betterend.blocks.basis.BlockAttached;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
|
@ -102,6 +103,13 @@ public class BlockSulphurCrystal extends BlockAttached implements IRenderTypeabl
|
|||
return BOUNDING_SHAPES.get(state.get(FACING));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||
Direction direction = (Direction) state.get(FACING);
|
||||
BlockPos blockPos = pos.offset(direction.getOpposite());
|
||||
return world.getBlockState(blockPos).isOf(EndBlocks.BRIMSTONE);
|
||||
}
|
||||
|
||||
static {
|
||||
BOUNDING_SHAPES.put(Direction.UP, VoxelShapes.cuboid(0.125, 0.0, 0.125, 0.875F, 0.5, 0.875F));
|
||||
BOUNDING_SHAPES.put(Direction.DOWN, VoxelShapes.cuboid(0.125, 0.5, 0.125, 0.875F, 1.0, 0.875F));
|
||||
|
|
104
src/main/java/ru/betterend/blocks/BlockSulphuricGeyser.java
Normal file
104
src/main/java/ru/betterend/blocks/BlockSulphuricGeyser.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.FluidFillable;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.block.Waterloggable;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
import ru.betterend.blocks.basis.BlockBaseNotFull;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
public class BlockSulphuricGeyser extends BlockBaseNotFull implements FluidFillable, Waterloggable {
|
||||
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
||||
private static final VoxelShape SHAPE = Block.createCuboidShape(1, 1, 1, 15, 16, 15);
|
||||
|
||||
public BlockSulphuricGeyser() {
|
||||
super(FabricBlockSettings.of(Material.STONE)
|
||||
.breakByTool(FabricToolTags.PICKAXES)
|
||||
.sounds(BlockSoundGroup.STONE)
|
||||
.noCollision()
|
||||
.requiresTool());
|
||||
this.setDefaultState(getDefaultState().with(WATERLOGGED, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
builder.add(WATERLOGGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFillWithFluid(BlockView world, BlockPos pos, BlockState state, Fluid fluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean tryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||
state = world.getBlockState(pos.down());
|
||||
return state.isOf(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction facing, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
|
||||
if (!canPlaceAt(state, world, pos)) {
|
||||
return Blocks.WATER.getDefaultState();
|
||||
}
|
||||
else {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPlacementState(ItemPlacementContext ctx) {
|
||||
WorldAccess worldAccess = ctx.getWorld();
|
||||
BlockPos blockPos = ctx.getBlockPos();
|
||||
return this.getDefaultState().with(WATERLOGGED, worldAccess.getFluidState(blockPos).getFluid() == Fluids.WATER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidState getFluidState(BlockState state) {
|
||||
return (Boolean) state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state);
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
|
||||
super.randomDisplayTick(state, world, pos, random);
|
||||
double x = pos.getX() + random.nextDouble();
|
||||
double y = pos.getY() + 0.9 + random.nextDouble() * 0.3;
|
||||
double z = pos.getZ() + random.nextDouble();
|
||||
world.addParticle(ParticleTypes.CAMPFIRE_SIGNAL_SMOKE, x, y, z, 0, 0, 0);
|
||||
}
|
||||
}
|
|
@ -39,6 +39,7 @@ import ru.betterend.blocks.BlockPythadendronSapling;
|
|||
import ru.betterend.blocks.BlockShadowBerry;
|
||||
import ru.betterend.blocks.BlockShadowGrass;
|
||||
import ru.betterend.blocks.BlockSulphurCrystal;
|
||||
import ru.betterend.blocks.BlockSulphuricGeyser;
|
||||
import ru.betterend.blocks.BlockTenaneaFlowers;
|
||||
import ru.betterend.blocks.BlockTenaneaSapling;
|
||||
import ru.betterend.blocks.BlockTerrain;
|
||||
|
@ -111,6 +112,8 @@ public class EndBlocks {
|
|||
public static final Block QUARTZ_PEDESTAL = registerBlock("quartz_pedestal", new PedestalVanilla(Blocks.QUARTZ_BLOCK));
|
||||
public static final Block PURPUR_PEDESTAL = registerBlock("purpur_pedestal", new PedestalVanilla(Blocks.PURPUR_BLOCK));
|
||||
|
||||
public static final Block SULPHURIC_GEYSER = registerBlock("sulphuric_geyser", new BlockSulphuricGeyser());
|
||||
|
||||
// Wooden Materials And Trees //
|
||||
public static final Block MOSSY_GLOWSHROOM_SAPLING = registerBlock("mossy_glowshroom_sapling", new BlockMossyGlowshroomSapling());
|
||||
public static final Block MOSSY_GLOWSHROOM_CAP = registerBlock("mossy_glowshroom_cap", new BlockMossyGlowshroomCap());
|
||||
|
|
|
@ -97,7 +97,7 @@ public class EndFeatures {
|
|||
public static final EndFeature FLOATING_SPIRE = EndFeature.makeRawGenFeature("floating_spire", new FloatingSpireFeature(), 8);
|
||||
public static final EndFeature GEYSER = EndFeature.makeRawGenFeature("geyser", new GeyserFeature(), 8);
|
||||
public static final EndFeature SULPHURIC_LAKE = EndFeature.makeLakeFeature("sulphuric_lake", new SulphuricLakeFeature(), 8);
|
||||
public static final EndFeature SULPHURIC_CAVE = EndFeature.makeRawGenFeature("sulphuric_cave", new SulphuricCaveFeature(), 1);
|
||||
public static final EndFeature SULPHURIC_CAVE = EndFeature.makeCountRawFeature("sulphuric_cave", new SulphuricCaveFeature(), 2);
|
||||
|
||||
// Ores //
|
||||
public static final EndFeature ENDER_ORE = EndFeature.makeOreFeature("ender_ore", EndBlocks.ENDER_ORE, 6, 3, 0, 4, 96);
|
||||
|
|
|
@ -103,6 +103,11 @@ public class EndFeature {
|
|||
return new EndFeature(name, feature, GenerationStep.Feature.SURFACE_STRUCTURES, configured);
|
||||
}
|
||||
|
||||
public static EndFeature makeCountRawFeature(String name, Feature<DefaultFeatureConfig> feature, int chance) {
|
||||
ConfiguredFeature<?, ?> configured = feature.configure(FeatureConfig.DEFAULT).decorate(Decorator.COUNT.configure(new CountConfig(chance)));
|
||||
return new EndFeature(name, feature, GenerationStep.Feature.RAW_GENERATION, configured);
|
||||
}
|
||||
|
||||
public Feature<?> getFeature() {
|
||||
return feature;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ import ru.betterend.world.features.DefaultFeature;
|
|||
public class GeyserFeature extends DefaultFeature {
|
||||
protected static final Function<BlockState, Boolean> REPLACE1;
|
||||
protected static final Function<BlockState, Boolean> REPLACE2;
|
||||
private static final Function<BlockState, Boolean> IGNORE;
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||
|
@ -56,19 +57,6 @@ public class GeyserFeature extends DefaultFeature {
|
|||
float delta = (float) i / (float) (count - 1);
|
||||
float radius = MathHelper.lerp(delta, radius1, radius2) * 1.3F;
|
||||
|
||||
/*SDF bowl = new SDFCapedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.SULFURIC_ROCK.stone);
|
||||
SDF cut = new SDFTranslate().setTranslate(0, 2, 0).setSource(bowl);
|
||||
bowl = new SDFSubtraction().setSourceA(bowl).setSourceB(cut);
|
||||
|
||||
SDF inner = new SDFCapedCone().setHeight(radius - 2).setRadius1(0).setRadius2(radius - 1).setBlock(EndBlocks.BRIMSTONE);
|
||||
cut = new SDFTranslate().setTranslate(0, 4, 0).setSource(inner);
|
||||
inner = new SDFSubtraction().setSourceA(inner).setSourceB(cut);
|
||||
inner = new SDFTranslate().setTranslate(0, 1.99F, 0).setSource(inner);
|
||||
bowl = new SDFUnion().setSourceA(inner).setSourceB(bowl);
|
||||
|
||||
SDF water = new SDFCapedCone().setHeight(radius - 4).setRadius1(0).setRadius2(radius - 3).setBlock(Blocks.WATER);
|
||||
bowl = new SDFUnion().setSourceA(water).setSourceB(bowl);*/
|
||||
|
||||
SDF bowl = new SDFCapedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
|
||||
SDF brimstone = new SDFCapedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.BRIMSTONE);
|
||||
|
@ -83,9 +71,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
|
||||
final OpenSimplexNoise noise1 = new OpenSimplexNoise(random.nextLong());
|
||||
final OpenSimplexNoise noise2 = new OpenSimplexNoise(random.nextLong());
|
||||
/*bowl = new SDFDisplacement().setFunction((vec) -> {
|
||||
return (float) noise.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1);
|
||||
}).setSource(bowl);*/
|
||||
|
||||
bowl = new SDFCoordModify().setFunction((vec) -> {
|
||||
float dx = (float) noise1.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1);
|
||||
float dz = (float) noise2.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1);
|
||||
|
@ -99,7 +85,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
|
||||
bowl = new SDFTranslate().setTranslate(radius, py - radius, 0).setSource(bowl);
|
||||
bowl = new SDFRotation().setRotation(Vector3f.POSITIVE_Y, i * 4F).setSource(bowl);
|
||||
sdf = /*new SDFSmoothUnion()*/new SDFUnion()/*.setRadius(3)*/.setSourceA(sdf).setSourceB(bowl);
|
||||
sdf = new SDFUnion().setSourceA(sdf).setSourceB(bowl);
|
||||
}
|
||||
sdf.setReplaceFunction(REPLACE2).fillRecursive(world, pos);
|
||||
|
||||
|
@ -127,22 +113,28 @@ public class GeyserFeature extends DefaultFeature {
|
|||
|
||||
sdf = new SDFSmoothUnion().setRadius(5).setSourceA(cave).setSourceB(sdf);
|
||||
|
||||
obj1.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
obj2.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
new SDFDisplacement().setFunction((vec) -> {
|
||||
return -4F;
|
||||
}).setSource(sdf).setReplaceFunction(REPLACE1).fillRecursive(world, pos);
|
||||
obj1.setBlock(WATER);
|
||||
obj2.setBlock(WATER);
|
||||
sdf.setReplaceFunction(REPLACE2);
|
||||
sdf.fillRecursive(world, pos);
|
||||
|
||||
obj1.setBlock(EndBlocks.BRIMSTONE);
|
||||
obj2.setBlock(EndBlocks.BRIMSTONE);
|
||||
new SDFDisplacement().setFunction((vec) -> {
|
||||
return -2F;
|
||||
}).setSource(sdf).setReplaceFunction(REPLACE1).fillRecursive(world, pos);
|
||||
}).setSource(sdf).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE);
|
||||
|
||||
obj1.setBlock(WATER);
|
||||
obj2.setBlock(WATER);
|
||||
sdf.setReplaceFunction(REPLACE2);
|
||||
sdf.fillRecursive(world, pos);
|
||||
obj1.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
obj2.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
new SDFDisplacement().setFunction((vec) -> {
|
||||
return -4F;
|
||||
}).setSource(sdf).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE);
|
||||
|
||||
obj1.setBlock(Blocks.END_STONE);
|
||||
obj2.setBlock(Blocks.END_STONE);
|
||||
new SDFDisplacement().setFunction((vec) -> {
|
||||
return -6F;
|
||||
}).setSource(sdf).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE);
|
||||
|
||||
Mutable mut = new Mutable().set(pos);
|
||||
for (int i = 0; i < halfHeight + 5; i++) {
|
||||
|
@ -164,7 +156,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE1 = (state) -> {
|
||||
return state.isAir() || (state.isIn(EndTags.GEN_TERRAIN) && !state.isOf(EndBlocks.SULPHURIC_ROCK.stone) && !state.isOf(EndBlocks.BRIMSTONE));
|
||||
return state.isAir() || (state.isIn(EndTags.GEN_TERRAIN));
|
||||
};
|
||||
|
||||
REPLACE2 = (state) -> {
|
||||
|
@ -179,5 +171,9 @@ public class GeyserFeature extends DefaultFeature {
|
|||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
};
|
||||
|
||||
IGNORE = (state) -> {
|
||||
return state.isOf(Blocks.WATER) || state.isOf(Blocks.CAVE_AIR) || state.isOf(EndBlocks.SULPHURIC_ROCK.stone) || state.isOf(EndBlocks.BRIMSTONE);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,22 @@
|
|||
package ru.betterend.world.features.terrain;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos.Mutable;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.BlockSulphurCrystal;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
@ -24,7 +30,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||
int radius = MHelper.randRange(20, 40, random);
|
||||
int radius = MHelper.randRange(10, 30, random);
|
||||
int bottom = BlocksHelper.upRay(world, new BlockPos(pos.getX(), 0, pos.getZ()), 32) + radius + 5;
|
||||
int top = world.getTopY(Heightmap.Type.WORLD_SURFACE_WG, pos.getX(), pos.getZ()) - radius - 5;
|
||||
|
||||
|
@ -47,10 +53,9 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
double hr = radius * 0.75;
|
||||
double nr = radius * 0.25;
|
||||
|
||||
BlockState terrain = EndBlocks.BRIMSTONE.getDefaultState();
|
||||
Set<BlockPos> brimstone = Sets.newHashSet();
|
||||
BlockState rock = EndBlocks.SULPHURIC_ROCK.stone.getDefaultState();
|
||||
int waterLevel = random.nextBoolean() ? -200 : MHelper.floor(pos.getY() - radius * 0.3F);
|
||||
|
||||
int waterLevel = pos.getY() + MHelper.randRange(MHelper.floor(radius * 0.8), radius, random);
|
||||
for (int x = x1; x <= x2; x++) {
|
||||
int xsq = x - pos.getX();
|
||||
xsq *= xsq;
|
||||
|
@ -71,32 +76,66 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
BlockState state = world.getBlockState(bpos);
|
||||
if (isReplaceable(state)) {
|
||||
BlocksHelper.setWithoutUpdate(world, bpos, y < waterLevel ? WATER : CAVE_AIR);
|
||||
world.getFluidTickScheduler().schedule(bpos, Fluids.WATER, random.nextInt(16));
|
||||
}
|
||||
int depth = MHelper.randRange(2, 4, random);
|
||||
for (int i = 0; i < depth; i++) {
|
||||
bpos.setY(y - 1);
|
||||
if (world.getBlockState(bpos).isIn(EndTags.GEN_TERRAIN)) {
|
||||
BlocksHelper.setWithoutUpdate(world, bpos, terrain);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (dist < r2 * r2) {
|
||||
if (world.getBlockState(bpos).isIn(EndTags.GEN_TERRAIN)) {
|
||||
double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval(x * 0.03, y * 0.03, z * 0.03) * 0.5;
|
||||
if (v > 0.4) {
|
||||
brimstone.add(bpos.toImmutable());
|
||||
}
|
||||
else {
|
||||
BlocksHelper.setWithoutUpdate(world, bpos, rock);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
brimstone.forEach((blockPos) -> {
|
||||
placeBrimstone(world, blockPos, random);
|
||||
});
|
||||
|
||||
BlocksHelper.fixBlocks(world, new BlockPos(x1, y1, z1), new BlockPos(x2, y2, z2));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isReplaceable(BlockState state) {
|
||||
return state.isIn(EndTags.GEN_TERRAIN)
|
||||
|| state.isOf(EndBlocks.SULPHUR_CRYSTAL)
|
||||
|| state.getMaterial().isReplaceable()
|
||||
|| state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().equals(Material.LEAVES);
|
||||
}
|
||||
|
||||
private void placeBrimstone(StructureWorldAccess world, BlockPos pos, Random random) {
|
||||
BlockState state = getBrimstone(world, pos);
|
||||
BlocksHelper.setWithoutUpdate(world, pos, state);
|
||||
if (state.get(BlockProperties.ACTIVATED)) {
|
||||
makeShards(world, pos, random);
|
||||
}
|
||||
}
|
||||
|
||||
private BlockState getBrimstone(StructureWorldAccess world, BlockPos pos) {
|
||||
for (Direction dir: BlocksHelper.DIRECTIONS) {
|
||||
if (world.getBlockState(pos.offset(dir)).isOf(Blocks.WATER)) {
|
||||
return EndBlocks.BRIMSTONE.getDefaultState().with(BlockProperties.ACTIVATED, true);
|
||||
}
|
||||
}
|
||||
return EndBlocks.BRIMSTONE.getDefaultState();
|
||||
}
|
||||
|
||||
private void makeShards(StructureWorldAccess world, BlockPos pos, Random random) {
|
||||
for (Direction dir: BlocksHelper.DIRECTIONS) {
|
||||
BlockPos side;
|
||||
if (random.nextInt(16) == 0 && world.getBlockState((side = pos.offset(dir))).isOf(Blocks.WATER)) {
|
||||
BlockState state = EndBlocks.SULPHUR_CRYSTAL.getDefaultState()
|
||||
.with(BlockSulphurCrystal.WATERLOGGED, true)
|
||||
.with(BlockSulphurCrystal.FACING, dir)
|
||||
.with(BlockSulphurCrystal.AGE, random.nextInt(3));
|
||||
BlocksHelper.setWithoutUpdate(world, side, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
|
|||
private void makeShards(StructureWorldAccess world, BlockPos pos, Random random) {
|
||||
for (Direction dir: BlocksHelper.DIRECTIONS) {
|
||||
BlockPos side;
|
||||
if (random.nextInt(3) == 0 && world.getBlockState((side = pos.offset(dir))).isOf(Blocks.WATER)) {
|
||||
if (random.nextInt(16) == 0 && world.getBlockState((side = pos.offset(dir))).isOf(Blocks.WATER)) {
|
||||
BlockState state = EndBlocks.SULPHUR_CRYSTAL.getDefaultState()
|
||||
.with(BlockSulphurCrystal.WATERLOGGED, true)
|
||||
.with(BlockSulphurCrystal.FACING, dir)
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"variants": {
|
||||
"": [
|
||||
{ "model": "betterend:block/sulphuric_geyser" },
|
||||
{ "model": "betterend:block/sulphuric_geyser", "y": 90 },
|
||||
{ "model": "betterend:block/sulphuric_geyser", "y": 180 },
|
||||
{ "model": "betterend:block/sulphuric_geyser", "y": 270 }
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,164 @@
|
|||
{
|
||||
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
|
||||
"parent": "block/block",
|
||||
"textures": {
|
||||
"particle": "betterend:block/sulphuric_rock",
|
||||
"texture": "betterend:block/sulphuric_rock",
|
||||
"rock_top": "betterend:block/sulphuric_rock_top",
|
||||
"geyser_top": "betterend:block/geyser_top"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"__comment": "Box1",
|
||||
"from": [ 9, 10, 8 ],
|
||||
"to": [ 13, 16, 12 ],
|
||||
"faces": {
|
||||
"up": { "uv": [ 0, 0, 4, 4 ], "texture": "#geyser_top", "cullface": "up" },
|
||||
"north": { "uv": [ 3, 0, 7, 6 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 9, 0, 13, 6 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 8, 0, 12, 6 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 4, 0, 8, 6 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box1",
|
||||
"from": [ 8, 0, 7 ],
|
||||
"to": [ 14, 10, 13 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 5, 5, 11, 11 ], "texture": "#rock_top", "cullface": "down" },
|
||||
"up": { "uv": [ 10, 5, 16, 11 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 5, 6, 11, 16 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 5, 6, 11, 16 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 5, 6, 11, 16 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 5, 6, 11, 16 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box1",
|
||||
"from": [ 4, 0, 1 ],
|
||||
"to": [ 8, 5, 5 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 4, 11, 8, 15 ], "texture": "#rock_top", "cullface": "down" },
|
||||
"up": { "uv": [ 4, 1, 8, 5 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 8, 11, 12, 16 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 1, 11, 5, 16 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 11, 11, 15, 16 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box1",
|
||||
"from": [ 5, 5, 2 ],
|
||||
"to": [ 7, 11, 4 ],
|
||||
"faces": {
|
||||
"up": { "uv": [ 0, 4, 2, 6 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 8, 5, 10, 11 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 6, 5, 8, 11 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 1, 5, 3, 11 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 13, 5, 15, 11 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box1",
|
||||
"from": [ 1, 0, 8 ],
|
||||
"to": [ 5, 8, 12 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 1, 4, 5, 8 ], "texture": "#rock_top", "cullface": "down" },
|
||||
"up": { "uv": [ 5, 12, 9, 16 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 11, 8, 15, 16 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 1, 8, 5, 16 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 8, 8, 12, 16 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 4, 8, 8, 16 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box1",
|
||||
"from": [ 2, 8, 9 ],
|
||||
"to": [ 4, 14, 11 ],
|
||||
"faces": {
|
||||
"up": { "uv": [ 0, 4, 2, 6 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 12, 2, 14, 8 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 2, 2, 4, 8 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 9, 2, 11, 8 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 5, 2, 7, 8 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box7",
|
||||
"from": [ 2, 0, 4 ],
|
||||
"to": [ 5, 4, 7 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 2, 9, 5, 12 ], "texture": "#rock_top", "cullface": "down" },
|
||||
"up": { "uv": [ 9, 13, 12, 16 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 11, 12, 14, 16 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 2, 12, 5, 16 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 4, 12, 7, 16 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 9, 12, 12, 16 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box7",
|
||||
"from": [ 3, 0, 13 ],
|
||||
"to": [ 6, 4, 16 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 3, 0, 6, 3 ], "texture": "#rock_top", "cullface": "down" },
|
||||
"up": { "uv": [ 9, 0, 12, 3 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 10, 12, 13, 16 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 3, 12, 6, 16 ], "texture": "#texture", "cullface": "south" },
|
||||
"west": { "uv": [ 13, 12, 16, 16 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 0, 12, 3, 16 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box7",
|
||||
"from": [ 12, 0, 2 ],
|
||||
"to": [ 15, 4, 5 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 12, 11, 15, 14 ], "texture": "#rock_top", "cullface": "down" },
|
||||
"up": { "uv": [ 9, 13, 12, 16 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 1, 12, 4, 16 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 12, 12, 15, 16 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 2, 12, 5, 16 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 11, 12, 14, 16 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box7",
|
||||
"from": [ 7, 0, 3 ],
|
||||
"to": [ 12, 7, 8 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 7, 8, 12, 13 ], "texture": "#rock_top", "cullface": "down" },
|
||||
"up": { "uv": [ 4, 0, 9, 5 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 4, 9, 9, 16 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 7, 9, 12, 16 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 3, 9, 8, 16 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 8, 9, 13, 16 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box7",
|
||||
"from": [ 4, 0, 9 ],
|
||||
"to": [ 9, 7, 14 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 4, 2, 9, 7 ], "texture": "#rock_top", "cullface": "down" },
|
||||
"up": { "uv": [ 4, 0, 9, 5 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 7, 9, 12, 16 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 4, 9, 9, 16 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 9, 9, 14, 16 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 2, 9, 7, 16 ], "texture": "#texture" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"__comment": "Box7",
|
||||
"from": [ 3, 0, 5 ],
|
||||
"to": [ 8, 9, 10 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 3, 6, 8, 11 ], "texture": "#rock_top", "cullface": "down" },
|
||||
"up": { "uv": [ 4, 0, 9, 5 ], "texture": "#geyser_top" },
|
||||
"north": { "uv": [ 8, 7, 13, 16 ], "texture": "#texture" },
|
||||
"south": { "uv": [ 3, 7, 8, 16 ], "texture": "#texture" },
|
||||
"west": { "uv": [ 5, 7, 10, 16 ], "texture": "#texture" },
|
||||
"east": { "uv": [ 6, 7, 11, 16 ], "texture": "#texture" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "betterend:block/sulphuric_geyser"
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
Loading…
Add table
Add a link
Reference in a new issue