Fixes
This commit is contained in:
parent
1494c1da2d
commit
0ea0c0f60d
6 changed files with 59 additions and 15 deletions
|
@ -137,7 +137,7 @@ public class BlockHydrothermalVent extends BlockBaseNotFull implements BlockEnti
|
||||||
world.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0);
|
world.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0);
|
world.addParticle(ParticleTypes.SMOKE, x, y, z, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,12 @@ public class BoneMealItemMixin {
|
||||||
World world = context.getWorld();
|
World world = context.getWorld();
|
||||||
BlockPos blockPos = context.getBlockPos();
|
BlockPos blockPos = context.getBlockPos();
|
||||||
if (!world.isClient) {
|
if (!world.isClient) {
|
||||||
|
BlockPos offseted = blockPos.offset(context.getSide());
|
||||||
|
boolean endBiome = world.getBiome(offseted).getCategory() == Category.THEEND;
|
||||||
|
|
||||||
if (world.getBlockState(blockPos).isIn(EndTags.END_GROUND)) {
|
if (world.getBlockState(blockPos).isIn(EndTags.END_GROUND)) {
|
||||||
boolean consume = false;
|
boolean consume = false;
|
||||||
if (world.getBlockState(blockPos).getBlock() == Blocks.END_STONE) {
|
if (world.getBlockState(blockPos).isOf(Blocks.END_STONE)) {
|
||||||
BlockState nylium = beGetNylium(world, blockPos);
|
BlockState nylium = beGetNylium(world, blockPos);
|
||||||
if (nylium != null) {
|
if (nylium != null) {
|
||||||
BlocksHelper.setWithoutUpdate(world, blockPos, nylium);
|
BlocksHelper.setWithoutUpdate(world, blockPos, nylium);
|
||||||
|
@ -44,8 +47,7 @@ public class BoneMealItemMixin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BlockPos offseted = blockPos.offset(context.getSide().getOpposite());
|
if (!world.getFluidState(offseted).isEmpty() && endBiome) {
|
||||||
if (world.getBlockState(offseted).isOf(Blocks.WATER) && world.getBiome(offseted).getCategory() == Category.THEEND) {
|
|
||||||
consume = beGrowWaterGrass(world, blockPos);
|
consume = beGrowWaterGrass(world, blockPos);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -60,20 +62,12 @@ public class BoneMealItemMixin {
|
||||||
info.cancel();
|
info.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if (!world.getFluidState(offseted).isEmpty() && endBiome) {
|
||||||
BlockPos offseted = blockPos.offset(context.getSide().getOpposite());
|
info.setReturnValue(ActionResult.FAIL);
|
||||||
if (world.getBlockState(offseted).isOf(Blocks.WATER) && world.getBiome(offseted).getCategory() == Category.THEEND) {
|
|
||||||
if (beGrowWaterGrass(world, blockPos)) {
|
|
||||||
if (!context.getPlayer().isCreative())
|
|
||||||
context.getStack().decrement(1);
|
|
||||||
world.syncWorldEvent(2005, blockPos, 0);
|
|
||||||
info.setReturnValue(ActionResult.SUCCESS);
|
|
||||||
info.cancel();
|
info.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean beGrowGrass(World world, BlockPos pos) {
|
private boolean beGrowGrass(World world, BlockPos pos) {
|
||||||
int y1 = pos.getY() + 3;
|
int y1 = pos.getY() + 3;
|
||||||
|
|
|
@ -38,6 +38,7 @@ import ru.betterend.world.features.terrain.RoundCaveFeature;
|
||||||
import ru.betterend.world.features.terrain.SpireFeature;
|
import ru.betterend.world.features.terrain.SpireFeature;
|
||||||
import ru.betterend.world.features.terrain.SulphuricCaveFeature;
|
import ru.betterend.world.features.terrain.SulphuricCaveFeature;
|
||||||
import ru.betterend.world.features.terrain.SulphuricLakeFeature;
|
import ru.betterend.world.features.terrain.SulphuricLakeFeature;
|
||||||
|
import ru.betterend.world.features.terrain.SurfaceVentFeature;
|
||||||
import ru.betterend.world.features.trees.DragonTreeFeature;
|
import ru.betterend.world.features.trees.DragonTreeFeature;
|
||||||
import ru.betterend.world.features.trees.HelixTreeFeature;
|
import ru.betterend.world.features.trees.HelixTreeFeature;
|
||||||
import ru.betterend.world.features.trees.LacugroveFeature;
|
import ru.betterend.world.features.trees.LacugroveFeature;
|
||||||
|
@ -124,6 +125,7 @@ public class EndFeatures {
|
||||||
public static final EndFeature ICE_STAR = EndFeature.makeRawGenFeature("ice_star", new IceStarFeature(5, 15, 10, 25), 15);
|
public static final EndFeature ICE_STAR = EndFeature.makeRawGenFeature("ice_star", new IceStarFeature(5, 15, 10, 25), 15);
|
||||||
public static final EndFeature ICE_STAR_SMALL = EndFeature.makeRawGenFeature("ice_star_small", new IceStarFeature(3, 5, 7, 12), 8);
|
public static final EndFeature ICE_STAR_SMALL = EndFeature.makeRawGenFeature("ice_star_small", new IceStarFeature(3, 5, 7, 12), 8);
|
||||||
public static final EndFeature ICE_STAR_GIANT = EndFeature.makeRawGenFeature("ice_star_giant", new IceStarFeature(15, 25, 20, 40), 512);
|
public static final EndFeature ICE_STAR_GIANT = EndFeature.makeRawGenFeature("ice_star_giant", new IceStarFeature(15, 25, 20, 40), 512);
|
||||||
|
public static final EndFeature SURFACE_VENT = EndFeature.makeChansedFeature("surface_vent", new SurfaceVentFeature(), 4);
|
||||||
|
|
||||||
// Ores //
|
// Ores //
|
||||||
public static final EndFeature ENDER_ORE = EndFeature.makeOreFeature("ender_ore", EndBlocks.ENDER_ORE, 6, 3, 0, 4, 96);
|
public static final EndFeature ENDER_ORE = EndFeature.makeOreFeature("ender_ore", EndBlocks.ENDER_ORE, 6, 3, 0, 4, 96);
|
||||||
|
|
|
@ -72,6 +72,7 @@ public class EndTags {
|
||||||
});
|
});
|
||||||
|
|
||||||
TagHelper.addTag(GEN_TERRAIN, EndBlocks.ENDER_ORE, EndBlocks.FLAVOLITE.stone, EndBlocks.VIOLECITE.stone, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE);
|
TagHelper.addTag(GEN_TERRAIN, EndBlocks.ENDER_ORE, EndBlocks.FLAVOLITE.stone, EndBlocks.VIOLECITE.stone, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE);
|
||||||
|
TagHelper.addTag(END_GROUND, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE);
|
||||||
|
|
||||||
ToolManagerImpl.tag(HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(
|
ToolManagerImpl.tag(HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class BiomeSulphurSprings extends EndBiome {
|
||||||
.setCaves(false)
|
.setCaves(false)
|
||||||
.setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F)
|
.setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F)
|
||||||
.addFeature(EndFeatures.GEYSER)
|
.addFeature(EndFeatures.GEYSER)
|
||||||
|
.addFeature(EndFeatures.SURFACE_VENT)
|
||||||
.addFeature(EndFeatures.SULPHURIC_LAKE)
|
.addFeature(EndFeatures.SULPHURIC_LAKE)
|
||||||
.addFeature(EndFeatures.SULPHURIC_CAVE)
|
.addFeature(EndFeatures.SULPHURIC_CAVE)
|
||||||
.addFeature(EndFeatures.HYDRALUX)
|
.addFeature(EndFeatures.HYDRALUX)
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
package ru.betterend.world.features.terrain;
|
||||||
|
|
||||||
|
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.world.StructureWorldAccess;
|
||||||
|
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||||
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
|
import ru.betterend.blocks.BlockHydrothermalVent;
|
||||||
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
import ru.betterend.registry.EndTags;
|
||||||
|
import ru.betterend.util.BlocksHelper;
|
||||||
|
import ru.betterend.util.MHelper;
|
||||||
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
|
public class SurfaceVentFeature extends DefaultFeature {
|
||||||
|
@Override
|
||||||
|
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||||
|
Mutable mut = new Mutable();
|
||||||
|
int count = MHelper.randRange(5, 20, random);
|
||||||
|
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(BlockHydrothermalVent.WATERLOGGED, false);
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
|
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 10, MHelper.floor(random.nextGaussian() * 2 + 0.5));
|
||||||
|
int dist = MHelper.floor(3 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2);
|
||||||
|
if (dist > 0) {
|
||||||
|
BlockState state = world.getBlockState(mut);
|
||||||
|
for (int n = 0; n < 20 && state.isAir(); n++) {
|
||||||
|
mut.setY(mut.getY() - 1);
|
||||||
|
state = world.getBlockState(mut);
|
||||||
|
}
|
||||||
|
if (state.isIn(EndTags.GEN_TERRAIN) && !world.getBlockState(mut.up()).isOf(EndBlocks.HYDROTHERMAL_VENT)) {
|
||||||
|
for (int j = 0; j <= dist; j++) {
|
||||||
|
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
|
||||||
|
mut.setY(mut.getY() + 1);
|
||||||
|
}
|
||||||
|
BlocksHelper.setWithoutUpdate(world, mut, vent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue