Block class rename

This commit is contained in:
paulevsGitch 2021-01-05 04:02:08 +03:00
parent 4b55bf30a8
commit 5f3547de8e
157 changed files with 748 additions and 756 deletions

View file

@ -4,7 +4,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockPlantWithAge;
import ru.betterend.blocks.basis.PlantWithAgeBlock;
import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper;
@ -26,10 +26,10 @@ public class BlueVineFeature extends ScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
if (small) {
BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.BLUE_VINE_SEED.getDefaultState().with(BlockPlantWithAge.AGE, random.nextInt(4)));
BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.BLUE_VINE_SEED.getDefaultState().with(PlantWithAgeBlock.AGE, random.nextInt(4)));
}
else {
BlockPlantWithAge seed = ((BlockPlantWithAge) EndBlocks.BLUE_VINE_SEED);
PlantWithAgeBlock seed = ((PlantWithAgeBlock) EndBlocks.BLUE_VINE_SEED);
seed.growAdult(world, random, blockPos);
}
}

View file

@ -6,7 +6,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockDoublePlant;
import ru.betterend.blocks.basis.DoublePlantBlock;
import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper;
@ -30,11 +30,11 @@ public class DoublePlantFeature extends ScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
if (plant instanceof BlockDoublePlant) {
if (plant instanceof DoublePlantBlock) {
int rot = random.nextInt(4);
BlockState state = plant.getDefaultState().with(BlockDoublePlant.ROTATION, rot);
BlockState state = plant.getDefaultState().with(DoublePlantBlock.ROTATION, rot);
BlocksHelper.setWithoutUpdate(world, blockPos, state);
BlocksHelper.setWithoutUpdate(world, blockPos.up(), state.with(BlockDoublePlant.TOP, true));
BlocksHelper.setWithoutUpdate(world, blockPos.up(), state.with(DoublePlantBlock.TOP, true));
}
else {
BlocksHelper.setWithoutUpdate(world, blockPos, plant);

View file

@ -4,7 +4,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockEndLilySeed;
import ru.betterend.blocks.EndLilySeedBlock;
import ru.betterend.registry.EndBlocks;
public class EndLilyFeature extends UnderwaterPlantScatter {
@ -14,7 +14,7 @@ public class EndLilyFeature extends UnderwaterPlantScatter {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
BlockEndLilySeed seed = (BlockEndLilySeed) EndBlocks.END_LILY_SEED;
EndLilySeedBlock seed = (EndLilySeedBlock) EndBlocks.END_LILY_SEED;
seed.grow(world, random, blockPos);
}

View file

@ -4,7 +4,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockEndLotusSeed;
import ru.betterend.blocks.EndLotusSeedBlock;
import ru.betterend.registry.EndBlocks;
public class EndLotusFeature extends UnderwaterPlantScatter {
@ -14,7 +14,7 @@ public class EndLotusFeature extends UnderwaterPlantScatter {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
BlockEndLotusSeed seed = (BlockEndLotusSeed) EndBlocks.END_LOTUS_SEED;
EndLotusSeedBlock seed = (EndLotusSeedBlock) EndBlocks.END_LOTUS_SEED;
seed.grow(world, random, blockPos);
}

View file

@ -8,7 +8,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockPos.Mutable;
import net.minecraft.util.math.Direction;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockEndLotusLeaf;
import ru.betterend.blocks.EndLotusLeafBlock;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper;
@ -38,14 +38,14 @@ public class EndLotusLeafFeature extends ScatterFeature {
private void generateLeaf(StructureWorldAccess world, BlockPos pos) {
Mutable p = new Mutable();
BlockState leaf = EndBlocks.END_LOTUS_LEAF.getDefaultState();
BlocksHelper.setWithoutUpdate(world, pos, leaf.with(BlockEndLotusLeaf.SHAPE, TripleShape.BOTTOM));
BlocksHelper.setWithoutUpdate(world, pos, leaf.with(EndLotusLeafBlock.SHAPE, TripleShape.BOTTOM));
for (Direction move: BlocksHelper.HORIZONTAL) {
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.with(BlockEndLotusLeaf.HORIZONTAL_FACING, move).with(BlockEndLotusLeaf.SHAPE, TripleShape.MIDDLE));
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.with(EndLotusLeafBlock.HORIZONTAL_FACING, move).with(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE));
}
for (int i = 0; i < 4; i ++) {
Direction d1 = BlocksHelper.HORIZONTAL[i];
Direction d2 = BlocksHelper.HORIZONTAL[(i + 1) & 3];
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(d1).move(d2), leaf.with(BlockEndLotusLeaf.HORIZONTAL_FACING, d1).with(BlockEndLotusLeaf.SHAPE, TripleShape.TOP));
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(d1).move(d2), leaf.with(EndLotusLeafBlock.HORIZONTAL_FACING, d1).with(EndLotusLeafBlock.SHAPE, TripleShape.TOP));
}
}

View file

@ -4,7 +4,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockPlantWithAge;
import ru.betterend.blocks.basis.PlantWithAgeBlock;
import ru.betterend.registry.EndBlocks;
public class GlowPillarFeature extends ScatterFeature {
@ -19,7 +19,7 @@ public class GlowPillarFeature extends ScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
BlockPlantWithAge seed = ((BlockPlantWithAge) EndBlocks.GLOWING_PILLAR_SEED);
PlantWithAgeBlock seed = ((PlantWithAgeBlock) EndBlocks.GLOWING_PILLAR_SEED);
seed.growAdult(world, random, blockPos);
}

View file

@ -4,7 +4,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockHydraluxSapling;
import ru.betterend.blocks.HydraluxSaplingBlock;
import ru.betterend.registry.EndBlocks;
public class HydraluxFeature extends UnderwaterPlantScatter {
@ -14,7 +14,7 @@ public class HydraluxFeature extends UnderwaterPlantScatter {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
BlockHydraluxSapling seed = (BlockHydraluxSapling) EndBlocks.HYDRALUX_SAPLING;
HydraluxSaplingBlock seed = (HydraluxSaplingBlock) EndBlocks.HYDRALUX_SAPLING;
seed.grow(world, random, blockPos);
}

View file

@ -4,7 +4,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockPlantWithAge;
import ru.betterend.blocks.basis.PlantWithAgeBlock;
import ru.betterend.registry.EndBlocks;
public class LanceleafFeature extends ScatterFeature {
@ -19,7 +19,7 @@ public class LanceleafFeature extends ScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
BlockPlantWithAge seed = ((BlockPlantWithAge) EndBlocks.LANCELEAF_SEED);
PlantWithAgeBlock seed = ((PlantWithAgeBlock) EndBlocks.LANCELEAF_SEED);
seed.growAdult(world, random, blockPos);
}

View file

@ -8,7 +8,7 @@ import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockAttached;
import ru.betterend.blocks.basis.AttachedBlock;
import ru.betterend.util.BlocksHelper;
public class SingleInvertedScatterFeature extends InvertedScatterFeature {
@ -25,7 +25,7 @@ public class SingleInvertedScatterFeature extends InvertedScatterFeature {
return false;
}
BlockState state = block.getDefaultState();
if (block instanceof BlockAttached) {
if (block instanceof AttachedBlock) {
state = state.with(Properties.FACING, Direction.DOWN);
}
return state.canPlaceAt(world, blockPos);
@ -34,7 +34,7 @@ public class SingleInvertedScatterFeature extends InvertedScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
BlockState state = block.getDefaultState();
if (block instanceof BlockAttached) {
if (block instanceof AttachedBlock) {
state = state.with(Properties.FACING, Direction.DOWN);
}
BlocksHelper.setWithoutUpdate(world, blockPos, state);

View file

@ -6,8 +6,8 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockDoublePlant;
import ru.betterend.blocks.basis.BlockPlantWithAge;
import ru.betterend.blocks.basis.DoublePlantBlock;
import ru.betterend.blocks.basis.PlantWithAgeBlock;
import ru.betterend.util.BlocksHelper;
public class SinglePlantFeature extends ScatterFeature {
@ -50,15 +50,15 @@ public class SinglePlantFeature extends ScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
if (plant instanceof BlockDoublePlant) {
if (plant instanceof DoublePlantBlock) {
int rot = random.nextInt(4);
BlockState state = plant.getDefaultState().with(BlockDoublePlant.ROTATION, rot);
BlockState state = plant.getDefaultState().with(DoublePlantBlock.ROTATION, rot);
BlocksHelper.setWithoutUpdate(world, blockPos, state);
BlocksHelper.setWithoutUpdate(world, blockPos.up(), state.with(BlockDoublePlant.TOP, true));
BlocksHelper.setWithoutUpdate(world, blockPos.up(), state.with(DoublePlantBlock.TOP, true));
}
else if (plant instanceof BlockPlantWithAge) {
else if (plant instanceof PlantWithAgeBlock) {
int age = random.nextInt(4);
BlockState state = plant.getDefaultState().with(BlockPlantWithAge.AGE, age);
BlockState state = plant.getDefaultState().with(PlantWithAgeBlock.AGE, age);
BlocksHelper.setWithoutUpdate(world, blockPos, state);
}
else {

View file

@ -6,7 +6,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockDoublePlant;
import ru.betterend.blocks.basis.DoublePlantBlock;
import ru.betterend.util.BlocksHelper;
public class UnderwaterPlantFeature extends UnderwaterPlantScatter {
@ -24,11 +24,11 @@ public class UnderwaterPlantFeature extends UnderwaterPlantScatter {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
if (plant instanceof BlockDoublePlant) {
if (plant instanceof DoublePlantBlock) {
int rot = random.nextInt(4);
BlockState state = plant.getDefaultState().with(BlockDoublePlant.ROTATION, rot);
BlockState state = plant.getDefaultState().with(DoublePlantBlock.ROTATION, rot);
BlocksHelper.setWithoutUpdate(world, blockPos, state);
BlocksHelper.setWithoutUpdate(world, blockPos.up(), state.with(BlockDoublePlant.TOP, true));
BlocksHelper.setWithoutUpdate(world, blockPos.up(), state.with(DoublePlantBlock.TOP, true));
}
else {
BlocksHelper.setWithoutUpdate(world, blockPos, plant);

View file

@ -8,8 +8,8 @@ import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockAttached;
import ru.betterend.blocks.basis.BlockWallPlant;
import ru.betterend.blocks.basis.AttachedBlock;
import ru.betterend.blocks.basis.EndWallPlantBlock;
import ru.betterend.util.BlocksHelper;
public class WallPlantFeature extends WallScatterFeature {
@ -22,11 +22,11 @@ public class WallPlantFeature extends WallScatterFeature {
@Override
public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos pos, Direction dir) {
if (block instanceof BlockWallPlant) {
BlockState state = block.getDefaultState().with(BlockWallPlant.FACING, dir);
if (block instanceof EndWallPlantBlock) {
BlockState state = block.getDefaultState().with(EndWallPlantBlock.FACING, dir);
return block.canPlaceAt(state, world, pos);
}
else if (block instanceof BlockAttached) {
else if (block instanceof AttachedBlock) {
BlockState state = block.getDefaultState().with(Properties.FACING, dir);
return block.canPlaceAt(state, world, pos);
}
@ -36,10 +36,10 @@ public class WallPlantFeature extends WallScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos pos, Direction dir) {
BlockState state = block.getDefaultState();
if (block instanceof BlockWallPlant) {
state = state.with(BlockWallPlant.FACING, dir);
if (block instanceof EndWallPlantBlock) {
state = state.with(EndWallPlantBlock.FACING, dir);
}
else if (block instanceof BlockAttached) {
else if (block instanceof AttachedBlock) {
state = state.with(Properties.FACING, dir);
}
BlocksHelper.setWithoutUpdate(world, pos, state);

View file

@ -17,7 +17,7 @@ import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.blocks.BlockProperties;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockFur;
import ru.betterend.blocks.basis.FurBlock;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
@ -63,7 +63,7 @@ public class TenaneaBushFeature extends DefaultFeature {
MHelper.shuffle(DIRECTIONS, random);
for (Direction d: DIRECTIONS) {
if (info.getState(d).isAir()) {
info.setBlockPos(info.getPos().offset(d), EndBlocks.TENANEA_OUTER_LEAVES.getDefaultState().with(BlockFur.FACING, d));
info.setBlockPos(info.getPos().offset(d), EndBlocks.TENANEA_OUTER_LEAVES.getDefaultState().with(FurBlock.FACING, d));
}
}

View file

@ -15,7 +15,7 @@ import net.minecraft.util.math.MathHelper;
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.blocks.HydrothermalVentBlock;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;
@ -173,7 +173,7 @@ public class GeyserFeature extends DefaultFeature {
}
mut.setY(mut.getY() + 1);
}
state = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(BlockHydrothermalVent.ACTIVATED, distRaw < 2);
state = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(HydrothermalVentBlock.ACTIVATED, distRaw < 2);
BlocksHelper.setWithoutUpdate(world, mut, state);
mut.setY(mut.getY() + 1);
state = world.getBlockState(mut);
@ -201,7 +201,7 @@ public class GeyserFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
mut.setY(mut.getY() + 1);
}
state = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(BlockHydrothermalVent.ACTIVATED, distRaw < 2);
state = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(HydrothermalVentBlock.ACTIVATED, distRaw < 2);
BlocksHelper.setWithoutUpdate(world, mut, state);
mut.setY(mut.getY() + 1);
state = world.getBlockState(mut);

View file

@ -17,7 +17,7 @@ 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.blocks.SulphurCrystalBlock;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
@ -175,9 +175,9 @@ public class SulphuricCaveFeature extends DefaultFeature {
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));
.with(SulphurCrystalBlock.WATERLOGGED, true)
.with(SulphurCrystalBlock.FACING, dir)
.with(SulphurCrystalBlock.AGE, random.nextInt(3));
BlocksHelper.setWithoutUpdate(world, side, state);
}
}

View file

@ -15,7 +15,7 @@ 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.blocks.SulphurCrystalBlock;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
@ -195,9 +195,9 @@ public class SulphuricLakeFeature extends DefaultFeature {
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));
.with(SulphurCrystalBlock.WATERLOGGED, true)
.with(SulphurCrystalBlock.FACING, dir)
.with(SulphurCrystalBlock.AGE, random.nextInt(3));
BlocksHelper.setWithoutUpdate(world, side, state);
}
}

View file

@ -8,7 +8,7 @@ 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.blocks.HydrothermalVentBlock;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper;
@ -25,7 +25,7 @@ public class SurfaceVentFeature extends DefaultFeature {
Mutable mut = new Mutable();
int count = MHelper.randRange(15, 30, random);
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(BlockHydrothermalVent.WATERLOGGED, false);
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(HydrothermalVentBlock.WATERLOGGED, false);
for (int i = 0; i < count; i++) {
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5));
int dist = MHelper.floor(2 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2);

View file

@ -14,7 +14,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.blocks.BlockHelixTreeLeaves;
import ru.betterend.blocks.HelixTreeLeavesBlock;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper;
@ -121,7 +121,7 @@ public class HelixTreeFeature extends DefaultFeature {
lastPoint = point;
}
leaf = leaf.with(BlockHelixTreeLeaves.COLOR, 7);
leaf = leaf.with(HelixTreeLeavesBlock.COLOR, 7);
leafStart = leafStart.add(0, lastPoint.getY(), 0);
if (world.getBlockState(leafStart).isAir()) {
BlocksHelper.setWithoutUpdate(world, leafStart, leaf);
@ -157,7 +157,7 @@ public class HelixTreeFeature extends DefaultFeature {
int color = MHelper.floor((float) i / (float) count * 7F + 0.5F) + offset;
color = MathHelper.clamp(color, 0, 7);
if (world.getBlockState(bPos).getMaterial().isReplaceable()) {
BlocksHelper.setWithoutUpdate(world, bPos, state.with(BlockHelixTreeLeaves.COLOR, color));
BlocksHelper.setWithoutUpdate(world, bPos, state.with(HelixTreeLeavesBlock.COLOR, color));
}
x += dx;
y += dy;
@ -165,7 +165,7 @@ public class HelixTreeFeature extends DefaultFeature {
}
bPos.set(end.getX() + pos.getX(), end.getY() + pos.getY(), end.getZ() + pos.getZ());
if (world.getBlockState(bPos).getMaterial().isReplaceable()) {
BlocksHelper.setWithoutUpdate(world, bPos, state.with(BlockHelixTreeLeaves.COLOR, 7));
BlocksHelper.setWithoutUpdate(world, bPos, state.with(HelixTreeLeavesBlock.COLOR, 7));
}
}

View file

@ -14,7 +14,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.blocks.BlockJellyshroomCap;
import ru.betterend.blocks.JellyshroomCapBlock;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
import ru.betterend.util.MHelper;
@ -67,7 +67,7 @@ public class JellyshroomFeature extends DefaultFeature {
float dz = info.getPos().getZ() - pos.getZ() - last.getZ();
float distance = MHelper.length(dx, dz) / membraneRadius * 7F;
int color = MathHelper.clamp(MHelper.floor(distance), 0, 7);
return info.getState().with(BlockJellyshroomCap.COLOR, color);
return info.getState().with(JellyshroomCapBlock.COLOR, color);
}
return info.getState();
}).fillRecursive(world, pos);

View file

@ -12,8 +12,8 @@ import net.minecraft.util.math.Direction;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.blocks.BlockMossyGlowshroomCap;
import ru.betterend.blocks.basis.BlockFur;
import ru.betterend.blocks.MossyGlowshroomCapBlock;
import ru.betterend.blocks.basis.FurBlock;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
@ -83,7 +83,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
.setPostProcess((info) -> {
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) {
if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true));
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(MossyGlowshroomCapBlock.TRANSITION, true));
return info.getState();
}
else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) {
@ -93,7 +93,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
}
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true));
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(MossyGlowshroomCapBlock.TRANSITION, true));
return info.getState();
}
@ -103,12 +103,12 @@ public class MossyGlowshroomFeature extends DefaultFeature {
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
for (Direction dir: BlocksHelper.HORIZONTAL) {
if (info.getState(dir) == AIR) {
info.setBlockPos(info.getPos().offset(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockFur.FACING, dir));
info.setBlockPos(info.getPos().offset(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(FurBlock.FACING, dir));
}
}
if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
info.setBlockPos(info.getPos().down(), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockFur.FACING, Direction.DOWN));
info.setBlockPos(info.getPos().down(), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(FurBlock.FACING, Direction.DOWN));
}
}
return info.getState();

View file

@ -18,7 +18,7 @@ import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.blocks.BlockProperties;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockFur;
import ru.betterend.blocks.basis.FurBlock;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
@ -107,7 +107,7 @@ public class TenaneaFeature extends DefaultFeature {
MHelper.shuffle(DIRECTIONS, random);
for (Direction d: DIRECTIONS) {
if (info.getState(d).isAir()) {
info.setBlockPos(info.getPos().offset(d), outer.with(BlockFur.FACING, d));
info.setBlockPos(info.getPos().offset(d), outer.with(FurBlock.FACING, d));
}
}

View file

@ -16,8 +16,8 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.blocks.BlockUmbrellaTreeCluster;
import ru.betterend.blocks.BlockUmbrellaTreeMembrane;
import ru.betterend.blocks.UmbrellaTreeClusterBlock;
import ru.betterend.blocks.UmbrellaTreeMembraneBlock;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper;
@ -44,9 +44,9 @@ public class UmbrellaTreeFeature extends DefaultFeature {
if (!world.getBlockState(pos.down()).getBlock().isIn(EndTags.END_GROUND)) return false;
BlockState wood = EndBlocks.UMBRELLA_TREE.bark.getDefaultState();
BlockState membrane = EndBlocks.UMBRELLA_TREE_MEMBRANE.getDefaultState().with(BlockUmbrellaTreeMembrane.COLOR, 1);
BlockState center = EndBlocks.UMBRELLA_TREE_MEMBRANE.getDefaultState().with(BlockUmbrellaTreeMembrane.COLOR, 0);
BlockState fruit = EndBlocks.UMBRELLA_TREE_CLUSTER.getDefaultState().with(BlockUmbrellaTreeCluster.NATURAL, true);
BlockState membrane = EndBlocks.UMBRELLA_TREE_MEMBRANE.getDefaultState().with(UmbrellaTreeMembraneBlock.COLOR, 1);
BlockState center = EndBlocks.UMBRELLA_TREE_MEMBRANE.getDefaultState().with(UmbrellaTreeMembraneBlock.COLOR, 0);
BlockState fruit = EndBlocks.UMBRELLA_TREE_CLUSTER.getDefaultState().with(UmbrellaTreeClusterBlock.NATURAL, true);
float size = MHelper.randRange(10, 20, random);
int count = (int) (size * 0.15F);
@ -117,7 +117,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
}
int color = MHelper.floor(d / min.radius * 7);
color = MathHelper.clamp(color, 1, 7);
return info.getState().with(BlockUmbrellaTreeMembrane.COLOR, color);
return info.getState().with(UmbrellaTreeMembraneBlock.COLOR, color);
}
return info.getState();
}).fillRecursive(world, pos);
@ -182,7 +182,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
mut.move(Direction.DOWN);
if (world.isAir(mut)) {
BlockState state = world.getBlockState(mut.up());
if (state.isOf(EndBlocks.UMBRELLA_TREE_MEMBRANE) && state.get(BlockUmbrellaTreeMembrane.COLOR) < 2) {
if (state.isOf(EndBlocks.UMBRELLA_TREE_MEMBRANE) && state.get(UmbrellaTreeMembraneBlock.COLOR) < 2) {
BlocksHelper.setWithoutUpdate(world, mut, fruit);
}
break;