Updated gen features (except trees)

This commit is contained in:
Adubbz 2020-07-04 00:22:59 +10:00
parent ccf63a6bc0
commit 814c9226b1
78 changed files with 219 additions and 377 deletions

View File

@ -23,6 +23,6 @@ public class DoublePlantBlockBOP extends DoublePlantBlock
@Override
public PlantType getPlantType(IBlockReader world, BlockPos pos)
{
return PlantType.Plains;
return PlantType.PLAINS;
}
}

View File

@ -87,7 +87,7 @@ public class DoubleWaterPlantBlock extends DoublePlantBlock implements IWaterLog
@Override
public PlantType getPlantType(IBlockReader world, BlockPos pos)
{
return PlantType.Plains;
return PlantType.PLAINS;
}
@Override

View File

@ -31,7 +31,7 @@ public class DoubleWatersidePlantBlock extends DoublePlantBlockBOP
@Override
public PlantType getPlantType(IBlockReader world, BlockPos pos)
{
return PlantType.Beach;
return PlantType.BEACH;
}
@Override

View File

@ -104,6 +104,6 @@ public class FoliageBlockBOP extends BushBlock implements IPlantable
@Override
public PlantType getPlantType(IBlockReader world, BlockPos pos)
{
return PlantType.Plains;
return PlantType.PLAINS;
}
}

View File

@ -66,6 +66,6 @@ public class PlantBlockBOP extends BushBlock implements IPlantable
@Override
public PlantType getPlantType(IBlockReader world, BlockPos pos)
{
return PlantType.Plains;
return PlantType.PLAINS;
}
}

View File

@ -22,6 +22,6 @@ public class TallFlowerBlockBOP extends TallFlowerBlock
@Override
public PlantType getPlantType(IBlockReader world, BlockPos pos)
{
return PlantType.Plains;
return PlantType.PLAINS;
}
}

View File

@ -32,7 +32,7 @@ public class WatersidePlantBlock extends PlantBlockBOP
{
Block block = world.getBlockState(pos).getBlock();
return PlantType.Beach;
return PlantType.BEACH;
}
@Override

View File

@ -22,13 +22,13 @@ public class WhiteSandBlock extends SandBlock
PlantType type = plantable.getPlantType(world, pos.relative(facing));
switch (type) {
case Desert: return true;
case Nether: return false;
case Crop: return false;
case Cave: return true;
case Plains: return false;
case Water: return false;
case Beach:
case DESERT: return true;
case NETHER: return false;
case CROP: return false;
case CAVE: return true;
case PLAINS: return false;
case WATER: return false;
case BEACH:
boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
world.getBlockState(pos.north()).getMaterial() == Material.WATER ||

View File

@ -62,7 +62,7 @@ public class CommandTpBiome
double y = (double) BlockUtil.getTopSolidOrLiquidBlock(world, closestBiomePos.getX(), closestBiomePos.getZ()).getY();
double z = (double)closestBiomePos.getZ();
if (!world.getDimension().isNaturalDimension())
if (!world.dimensionType().natural())
{
y = (double)getTopBlockNonOverworld(world, closestBiomePos).getY();
}

View File

@ -8,7 +8,7 @@
package biomesoplenty.common.util.block;
import net.minecraft.block.BlockState;
import net.minecraft.state.IProperty;
import net.minecraft.state.Property;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
@ -21,9 +21,9 @@ import java.util.Collection;
public class BlockUtil
{
// Given a blockstate for some block which has an axis orientation (such as logs), try to determine the axis property
public static IProperty getAxisProperty(BlockState log)
public static Property getAxisProperty(BlockState log)
{
for (IProperty property : log.getProperties())
for (Property property : log.getProperties())
{
Collection allowedValues = property.getPossibleValues();
if (allowedValues.contains(Direction.Axis.X) && allowedValues.contains(Direction.Axis.Y) && allowedValues.contains(Direction.Axis.Z))

View File

@ -1,21 +1,17 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
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.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class AshSplatterFeature extends Feature<NoFeatureConfig> {
public AshSplatterFeature(Codec<NoFeatureConfig> deserializer) {
@ -23,7 +19,7 @@ public class AshSplatterFeature extends Feature<NoFeatureConfig> {
}
@Override
public boolean place(IWorld worldIn, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random rand, BlockPos pos, NoFeatureConfig config)
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;

View File

@ -7,8 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.core.BiomesOPlenty;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
@ -21,11 +20,10 @@ import net.minecraft.world.gen.feature.BigBrownMushroomFeature;
import net.minecraft.world.gen.feature.BigMushroomFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class BOPBigBrownMushroomFeature extends BigBrownMushroomFeature
{
public BOPBigBrownMushroomFeature(Function<Dynamic<?>, ? extends BigMushroomFeatureConfig> deserializer)
public BOPBigBrownMushroomFeature(Codec<BigMushroomFeatureConfig> deserializer)
{
super(deserializer);
}
@ -80,7 +78,7 @@ public class BOPBigBrownMushroomFeature extends BigBrownMushroomFeature
protected boolean isValidPosition(IWorld world, BlockPos pos, int height, BlockPos.Mutable mutablePos, BigMushroomFeatureConfig config)
{
int i = pos.getY();
if (i >= 1 && i + height + 1 < world.getMaxHeight())
if (i >= 1 && i + height + 1 < world.getMaxBuildHeight())
{
Block groundBlock = world.getBlockState(pos.below()).getBlock();
// Allow growth in the nether

View File

@ -7,8 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.core.BiomesOPlenty;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
@ -21,11 +20,10 @@ import net.minecraft.world.gen.feature.BigMushroomFeatureConfig;
import net.minecraft.world.gen.feature.BigRedMushroomFeature;
import java.util.Random;
import java.util.function.Function;
public class BOPBigRedMushroomFeature extends BigRedMushroomFeature
{
public BOPBigRedMushroomFeature(Function<Dynamic<?>, ? extends BigMushroomFeatureConfig> deserializer)
public BOPBigRedMushroomFeature(Codec<BigMushroomFeatureConfig> deserializer)
{
super(deserializer);
}
@ -80,7 +78,7 @@ public class BOPBigRedMushroomFeature extends BigRedMushroomFeature
protected boolean isValidPosition(IWorld world, BlockPos pos, int height, BlockPos.Mutable mutablePos, BigMushroomFeatureConfig config)
{
int i = pos.getY();
if (i >= 1 && i + height + 1 < world.getMaxHeight())
if (i >= 1 && i + height + 1 < world.getMaxBuildHeight())
{
Block groundBlock = world.getBlockState(pos.below()).getBlock();
// Allow growth in the Nether

View File

@ -8,13 +8,15 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.world.gen.feature.tree.BigTreeFeature;
import biomesoplenty.common.world.gen.feature.tree.*;
import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.SaplingBlock;
import net.minecraft.util.Direction;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.feature.BaseTreeFeatureConfig;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
@ -159,19 +161,19 @@ public class BOPBiomeFeatures
public static final FlowersFeature WETLAND_FLOWERS = new WetlandFlowersFeature();
//Surfaces
public static final SurfaceBuilder<SurfaceBuilderConfig> BOG_SURFACE_BUILDER = new BogSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> BRUSHLAND_SURFACE_BUILDER = new BrushlandSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> CHAPARRAL_SURFACE_BUILDER = new ChaparralSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> COLD_DESERT_SURFACE_BUILDER = new ColdDesertSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> TERRACOTTA_SURFACE_BUILDER = new TerracottaSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> MARSH_SURFACE_BUILDER = new MarshSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> MANGROVE_SURFACE_BUILDER = new MangroveSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> MUD_SURFACE_BUILDER = new MudSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> PODZOL_SURFACE_BUILDER = new PodzolSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> VOLCANO_SURFACE_BUILDER = new VolcanoSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> VOLCANO_EDGE_SURFACE_BUILDER = new VolcanoEdgeSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> DEEP_TOP_LAYER = new DeepTopLayerSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> POPPY_FIELD_SURFACE_BUILDER = new PoppyFieldSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> BOG_SURFACE_BUILDER = new BogSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> BRUSHLAND_SURFACE_BUILDER = new BrushlandSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> CHAPARRAL_SURFACE_BUILDER = new ChaparralSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> COLD_DESERT_SURFACE_BUILDER = new ColdDesertSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> TERRACOTTA_SURFACE_BUILDER = new TerracottaSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> MARSH_SURFACE_BUILDER = new MarshSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> MANGROVE_SURFACE_BUILDER = new MangroveSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> MUD_SURFACE_BUILDER = new MudSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> PODZOL_SURFACE_BUILDER = new PodzolSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> VOLCANO_SURFACE_BUILDER = new VolcanoSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> VOLCANO_EDGE_SURFACE_BUILDER = new VolcanoEdgeSurfaceBuilder(SurfaceBuilderConfig.CODEC);
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 TERRACOTTA_SURFACE = new SurfaceBuilderConfig(Blocks.TERRACOTTA.defaultBlockState(), Blocks.TERRACOTTA.defaultBlockState(), Blocks.GRAVEL.defaultBlockState());

View File

@ -1,16 +1,17 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
@ -26,7 +27,7 @@ public class BigPumpkinFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos startPos, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config)
{
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.below();}

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
@ -17,11 +17,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class BogSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public BogSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public BogSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -2,20 +2,18 @@ package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.RotatedPillarBlock;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class BoneSpineFeature extends Feature<NoFeatureConfig>
{
@ -29,7 +27,7 @@ public class BoneSpineFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos startPos, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager p_230362_2_, ChunkGenerator p_230362_3_, Random rand, BlockPos startPos, NoFeatureConfig p_230362_6_)
{
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.below();}
@ -47,7 +45,7 @@ public class BoneSpineFeature extends Feature<NoFeatureConfig>
BlockPos pos = startPos.above();
int height = 1 + p_212245_3_.nextInt(maxHeight - 1);
int height = 1 + rand.nextInt(maxHeight - 1);
for (int y = 0; y <= height; y++)
{

View File

@ -11,7 +11,7 @@ import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.block.BrambleBlock;
import biomesoplenty.common.util.biome.GeneratorUtil;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;
@ -19,14 +19,13 @@ import net.minecraft.block.SaplingBlock;
import net.minecraft.block.material.Material;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class BrambleFeature extends Feature<NoFeatureConfig>
{
@ -35,7 +34,7 @@ public class BrambleFeature extends Feature<NoFeatureConfig>
super(deserializer);
}
protected IBlockPosQuery placeOn = (world, pos) ->
protected IBlockPosQuery placeOn = (world, pos) ->
{
BlockState state = world.getBlockState(pos);
return state.canSustainPlant(world, pos, Direction.UP, (SaplingBlock)Blocks.OAK_SAPLING) || state.getBlock() == Blocks.NETHERRACK;
@ -44,7 +43,7 @@ public class BrambleFeature extends Feature<NoFeatureConfig>
protected IBlockPosQuery replace = (world, pos) -> world.getBlockState(pos).getMaterial() == Material.AIR;
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2, Random rand, BlockPos startPos, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config)
{
for (int i = 0; i < 128; ++i)
{

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
@ -15,11 +15,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class BrushlandSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public BrushlandSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public BrushlandSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -8,20 +8,15 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class ChaparralFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
@ -15,11 +15,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class ChaparralSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public ChaparralSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public ChaparralSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -8,17 +8,12 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class CherryBlossomGroveFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
@ -15,11 +15,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class ColdDesertSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public ColdDesertSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public ColdDesertSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -7,17 +7,12 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class ConiferousForestFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -1,6 +1,6 @@
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
@ -10,10 +10,9 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class DeepTopLayerSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig> {
public DeepTopLayerSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> p_i51315_1_) {
public DeepTopLayerSurfaceBuilder(Codec<SurfaceBuilderConfig> p_i51315_1_) {
super(p_i51315_1_);
}

View File

@ -7,17 +7,12 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.IFeatureConfig;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public abstract class DefaultFlowersFeatureNoConfig extends FlowersFeature<NoFeatureConfig>
{

View File

@ -7,17 +7,12 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class ExtendedFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -7,19 +7,18 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class FernGrassFeature extends Feature<NoFeatureConfig>
{
@ -34,7 +33,7 @@ public class FernGrassFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> generator, Random rand, BlockPos pos, NoFeatureConfig config)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
BlockState BlockState = this.chooseGrassState(rand);

View File

@ -1,18 +1,17 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
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.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class FleshSplatterFeature extends Feature<NoFeatureConfig>
{
@ -22,7 +21,7 @@ public class FleshSplatterFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld worldIn, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random rand, BlockPos pos, NoFeatureConfig config)
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;

View File

@ -7,20 +7,15 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class FlowerMeadowFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -1,18 +1,17 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class HeathFeature extends Feature<NoFeatureConfig>
{
@ -22,16 +21,16 @@ public class HeathFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld p_212245_1_, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos p_212245_4_, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
int i = 0;
for(int j = 0; j < 64; ++j)
{
BlockPos blockpos = p_212245_4_.offset(p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8));
if (p_212245_1_.getBlockState(blockpos).canBeReplacedByLeaves(p_212245_1_, blockpos) && p_212245_1_.getBlockState(blockpos.below()).getBlock() == Blocks.GRASS_BLOCK)
BlockPos blockpos = pos.offset(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
if (world.getBlockState(blockpos).canBeReplacedByLeaves(world, blockpos) && world.getBlockState(blockpos.below()).getBlock() == Blocks.GRASS_BLOCK)
{
p_212245_1_.setBlock(blockpos, BOPBlocks.jacaranda_leaves.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
world.setBlock(blockpos, BOPBlocks.jacaranda_leaves.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
++i;
}

View File

@ -2,20 +2,20 @@ package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.BushBlock;
import net.minecraft.block.HugeMushroomBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class HugeGlowshroomFeature extends Feature<NoFeatureConfig>
{
@ -28,7 +28,7 @@ public class HugeGlowshroomFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos startPos, NoFeatureConfig p_212245_5_) {
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) {
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
startPos = startPos.below();
}
@ -45,8 +45,8 @@ public class HugeGlowshroomFeature extends Feature<NoFeatureConfig>
BlockPos pos = startPos.above();
int height = 6 + p_212245_3_.nextInt(10);
int radius = 2 + p_212245_3_.nextInt(2);
int height = 6 + rand.nextInt(10);
int radius = 2 + rand.nextInt(2);
for (int y = 0; y < height; y++) {
this.setBlock(world, pos.above(y), Blocks.MUSHROOM_STEM.defaultBlockState());

View File

@ -2,20 +2,20 @@ package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.BushBlock;
import net.minecraft.block.HugeMushroomBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class HugeToadstoolFeature extends Feature<NoFeatureConfig>
{
@ -28,7 +28,7 @@ public class HugeToadstoolFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos startPos, NoFeatureConfig p_212245_5_) {
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) {
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
startPos = startPos.below();
}
@ -45,7 +45,7 @@ public class HugeToadstoolFeature extends Feature<NoFeatureConfig>
BlockPos pos = startPos.above();
int height = 3 + p_212245_3_.nextInt(5);
int height = 3 + rand.nextInt(5);
int radius = 2;
for (int y = 0; y < height; y++) {

View File

@ -8,17 +8,12 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class JungleFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -8,19 +8,14 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class LavenderFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -8,17 +8,12 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class LushGrasslandFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -7,20 +7,15 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class LushSwampFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -1,21 +1,20 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.DoublePlantBlock;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.material.Material;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class MangroveFeature extends Feature<NoFeatureConfig> {
@ -25,16 +24,16 @@ public class MangroveFeature extends Feature<NoFeatureConfig> {
}
@Override
public boolean place(IWorld p_212245_1_, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos p_212245_4_, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
int i = 0;
BlockState blockstate = BOPBlocks.mangrove_root.defaultBlockState();
for(int j = 0; j < 64; ++j) {
BlockPos blockpos = p_212245_4_.offset(p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8));
if (p_212245_1_.getBlockState(blockpos).getMaterial() == Material.WATER && p_212245_1_.isEmptyBlock(blockpos.above()) && (!p_212245_1_.getDimension().isHasCeiling() || blockpos.getY() < p_212245_1_.getLevel().getHeight() - 1) && blockstate.canSurvive(p_212245_1_, blockpos)) {
p_212245_1_.setBlock(blockpos, blockstate, 2);
((DoublePlantBlock)blockstate.getBlock()).placeAt(p_212245_1_, blockpos, 2);
BlockPos blockpos = pos.offset(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
if (world.getBlockState(blockpos).getMaterial() == Material.WATER && world.isEmptyBlock(blockpos.above()) && (!world.dimensionType().hasCeiling() || blockpos.getY() < world.getLevel().getHeight() - 1) && blockstate.canSurvive(world, blockpos)) {
world.setBlock(blockpos, blockstate, 2);
((DoublePlantBlock)blockstate.getBlock()).placeAt(world, blockpos, 2);
BlockPos leaves1 = blockpos.above().above();
BlockPos leaves2 = leaves1.north();
@ -43,32 +42,32 @@ public class MangroveFeature extends Feature<NoFeatureConfig> {
BlockPos leaves5 = leaves1.west();
BlockPos leaves6 = leaves1.above();
if (p_212245_1_.getBlockState(leaves1).canBeReplacedByLeaves(p_212245_1_, leaves1))
if (world.getBlockState(leaves1).canBeReplacedByLeaves(world, leaves1))
{
p_212245_1_.setBlock(leaves1, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
world.setBlock(leaves1, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
}
if (p_212245_3_.nextInt(2) == 0)
if (rand.nextInt(2) == 0)
{
if (p_212245_1_.getBlockState(leaves2).canBeReplacedByLeaves(p_212245_1_, leaves2))
if (world.getBlockState(leaves2).canBeReplacedByLeaves(world, leaves2))
{
p_212245_1_.setBlock(leaves2, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
world.setBlock(leaves2, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
}
if (p_212245_1_.getBlockState(leaves3).canBeReplacedByLeaves(p_212245_1_, leaves3))
if (world.getBlockState(leaves3).canBeReplacedByLeaves(world, leaves3))
{
p_212245_1_.setBlock(leaves3, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
world.setBlock(leaves3, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
}
if (p_212245_1_.getBlockState(leaves4).canBeReplacedByLeaves(p_212245_1_, leaves4))
if (world.getBlockState(leaves4).canBeReplacedByLeaves(world, leaves4))
{
p_212245_1_.setBlock(leaves4, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
world.setBlock(leaves4, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
}
if (p_212245_1_.getBlockState(leaves5).canBeReplacedByLeaves(p_212245_1_, leaves5))
if (world.getBlockState(leaves5).canBeReplacedByLeaves(world, leaves5))
{
p_212245_1_.setBlock(leaves5, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
world.setBlock(leaves5, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
}
if (p_212245_1_.getBlockState(leaves6).canBeReplacedByLeaves(p_212245_1_, leaves6))
if (world.getBlockState(leaves6).canBeReplacedByLeaves(world, leaves6))
{
p_212245_1_.setBlock(leaves6, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
world.setBlock(leaves6, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
}
}
++i;

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
@ -16,11 +16,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class MangroveSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public MangroveSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public MangroveSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
@ -16,11 +16,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class MarshSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public MarshSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public MarshSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -7,20 +7,15 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class MeadowFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -8,17 +8,12 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class MoorFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
@ -15,11 +15,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class MudSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public MudSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public MudSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -1,17 +1,16 @@
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
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.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class MyceliumSplatterFeature extends Feature<NoFeatureConfig>
{
@ -21,7 +20,7 @@ public class MyceliumSplatterFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld worldIn, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random rand, BlockPos pos, NoFeatureConfig config)
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;

View File

@ -8,20 +8,15 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class MysticGroveFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -2,21 +2,21 @@ package biomesoplenty.common.world.gen.feature;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.google.common.collect.Lists;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.VineBlock;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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.List;
import java.util.Random;
import java.util.function.Function;
public class NetherVinesFeature extends Feature<NoFeatureConfig>
{
@ -31,7 +31,7 @@ public class NetherVinesFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random rand, BlockPos startPos, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config)
{
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.below();}

View File

@ -1,17 +1,16 @@
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.Blocks;
import net.minecraft.block.NetherWartBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class NetherWartFeature extends Feature<NoFeatureConfig>
{
@ -21,17 +20,17 @@ public class NetherWartFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld p_212245_1_, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos p_212245_4_, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
int i = 0;
for(int j = 0; j < 64; ++j)
{
BlockPos blockpos = p_212245_4_.offset(p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4));
if (p_212245_1_.getBlockState(blockpos).isAir(p_212245_1_, blockpos) && p_212245_1_.getBlockState(blockpos.below()).getBlock() == Blocks.NETHERRACK && p_212245_1_.getBlockState(blockpos.below().east()).getBlock() == Blocks.NETHERRACK && p_212245_1_.getBlockState(blockpos.below().west()).getBlock() == Blocks.NETHERRACK && p_212245_1_.getBlockState(blockpos.below().north()).getBlock() == Blocks.NETHERRACK && p_212245_1_.getBlockState(blockpos.below().south()).getBlock() == Blocks.NETHERRACK)
BlockPos blockpos = pos.offset(rand.nextInt(4) - rand.nextInt(4), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(4) - rand.nextInt(4));
if (world.getBlockState(blockpos).isAir(world, blockpos) && world.getBlockState(blockpos.below()).getBlock() == Blocks.NETHERRACK && world.getBlockState(blockpos.below().east()).getBlock() == Blocks.NETHERRACK && world.getBlockState(blockpos.below().west()).getBlock() == Blocks.NETHERRACK && world.getBlockState(blockpos.below().north()).getBlock() == Blocks.NETHERRACK && world.getBlockState(blockpos.below().south()).getBlock() == Blocks.NETHERRACK)
{
p_212245_1_.setBlock(blockpos.below(), Blocks.SOUL_SAND.defaultBlockState(), 2);
p_212245_1_.setBlock(blockpos, Blocks.NETHER_WART.defaultBlockState().setValue(NetherWartBlock.AGE, p_212245_3_.nextInt(4)), 2);
world.setBlock(blockpos.below(), Blocks.SOUL_SAND.defaultBlockState(), 2);
world.setBlock(blockpos, Blocks.NETHER_WART.defaultBlockState().setValue(NetherWartBlock.AGE, rand.nextInt(4)), 2);
++i;
}

View File

@ -7,20 +7,15 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class OminousWoodsFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -8,19 +8,14 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class OrangeCosmosFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -8,17 +8,12 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class OriginFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -1,18 +1,16 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
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.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class PodzolSplatterFeature extends Feature<NoFeatureConfig>
{
@ -22,7 +20,7 @@ public class PodzolSplatterFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld worldIn, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random rand, BlockPos pos, NoFeatureConfig config)
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;

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
@ -15,11 +15,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class PodzolSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public PodzolSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public PodzolSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -7,7 +7,6 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
@ -15,11 +15,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class PoppyFieldSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public PoppyFieldSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public PoppyFieldSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -1,19 +1,18 @@
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.Blocks;
import net.minecraft.block.CarvedPumpkinBlock;
import net.minecraft.block.LeavesBlock;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class PumpkinPatchFeature extends Feature<NoFeatureConfig>
{
@ -23,36 +22,36 @@ public class PumpkinPatchFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld p_212245_1_, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos p_212245_4_, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
int i = 0;
for(int j = 0; j < 64; ++j)
{
BlockPos blockpos = p_212245_4_.offset(p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8));
if (p_212245_1_.getBlockState(blockpos).canBeReplacedByLeaves(p_212245_1_, blockpos) && p_212245_1_.getBlockState(blockpos.below()).getBlock() == Blocks.GRASS_BLOCK)
BlockPos blockpos = pos.offset(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
if (world.getBlockState(blockpos).canBeReplacedByLeaves(world, blockpos) && world.getBlockState(blockpos.below()).getBlock() == Blocks.GRASS_BLOCK)
{
if (p_212245_3_.nextInt(3) == 0)
if (rand.nextInt(3) == 0)
{
int rand = p_212245_3_.nextInt(50);
int num = rand.nextInt(50);
if (rand > 10)
if (num > 10)
{
p_212245_1_.setBlock(blockpos, Blocks.PUMPKIN.defaultBlockState(), 2);
world.setBlock(blockpos, Blocks.PUMPKIN.defaultBlockState(), 2);
}
else if (rand > 1)
else if (num > 1)
{
p_212245_1_.setBlock(blockpos, Blocks.CARVED_PUMPKIN.defaultBlockState().setValue(CarvedPumpkinBlock.FACING, Direction.from3DDataValue(2 + p_212245_3_.nextInt(4))), 2);
world.setBlock(blockpos, Blocks.CARVED_PUMPKIN.defaultBlockState().setValue(CarvedPumpkinBlock.FACING, Direction.from3DDataValue(2 + rand.nextInt(4))), 2);
}
else
{
p_212245_1_.setBlock(blockpos, Blocks.JACK_O_LANTERN.defaultBlockState().setValue(CarvedPumpkinBlock.FACING, Direction.from3DDataValue(2 + p_212245_3_.nextInt(4))), 2);
world.setBlock(blockpos, Blocks.JACK_O_LANTERN.defaultBlockState().setValue(CarvedPumpkinBlock.FACING, Direction.from3DDataValue(2 + rand.nextInt(4))), 2);
}
}
else
{
p_212245_1_.setBlock(blockpos, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
world.setBlock(blockpos, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
}
++i;

View File

@ -8,20 +8,15 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class RainforestFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -1,16 +1,15 @@
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class ScatteredRocksFeature extends Feature<NoFeatureConfig>
{
@ -20,23 +19,23 @@ public class ScatteredRocksFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld p_212245_1_, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos p_212245_4_, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
int i = 0;
for(int j = 0; j < 32; ++j)
{
BlockPos blockpos = p_212245_4_.offset(p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8));
if (p_212245_1_.getBlockState(blockpos).canBeReplacedByLeaves(p_212245_1_, blockpos) && p_212245_1_.getBlockState(blockpos.below()).getBlock() == Blocks.GRASS_BLOCK)
BlockPos blockpos = pos.offset(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
if (world.getBlockState(blockpos).canBeReplacedByLeaves(world, blockpos) && world.getBlockState(blockpos.below()).getBlock() == Blocks.GRASS_BLOCK)
{
if (p_212245_3_.nextInt(3) == 0)
if (rand.nextInt(3) == 0)
{
p_212245_1_.setBlock(blockpos, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 2);
world.setBlock(blockpos, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 2);
}
else
{
p_212245_1_.setBlock(blockpos, Blocks.COBBLESTONE.defaultBlockState(), 2);
world.setBlock(blockpos, Blocks.COBBLESTONE.defaultBlockState(), 2);
}
++i;

View File

@ -1,17 +1,16 @@
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class ScrubFeature extends Feature<NoFeatureConfig>
{
@ -21,16 +20,16 @@ public class ScrubFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld p_212245_1_, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos p_212245_4_, NoFeatureConfig p_212245_5_)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
int i = 0;
for(int j = 0; j < 64; ++j)
{
BlockPos blockpos = p_212245_4_.offset(p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8));
if (p_212245_1_.getBlockState(blockpos).canBeReplacedByLeaves(p_212245_1_, blockpos) && p_212245_1_.getBlockState(blockpos.below()).getBlock() == Blocks.GRASS_BLOCK)
BlockPos blockpos = pos.offset(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
if (world.getBlockState(blockpos).canBeReplacedByLeaves(world, blockpos) && world.getBlockState(blockpos.below()).getBlock() == Blocks.GRASS_BLOCK)
{
p_212245_1_.setBlock(blockpos, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
world.setBlock(blockpos, Blocks.OAK_LEAVES.defaultBlockState().setValue(LeavesBlock.PERSISTENT, true), 2);
++i;
}

View File

@ -1,21 +1,20 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BambooBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.state.properties.BambooLeaves;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class ShortBambooFeature extends Feature<NoFeatureConfig>
{
@ -32,7 +31,7 @@ public class ShortBambooFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> generator, Random rand, BlockPos pos, NoFeatureConfig config)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
while (pos.getY() > 1 && this.replace.matches(world, pos)) {pos = pos.below();}
@ -44,7 +43,7 @@ public class ShortBambooFeature extends Feature<NoFeatureConfig>
pos = pos.above();
BlockPos.Mutable blockpos$mutableblockpos = new BlockPos.Mutable(pos);
BlockPos.Mutable blockpos$mutableblockpos = new BlockPos.Mutable(pos.getX(), pos.getY(), pos.getZ());
if (world.isEmptyBlock(blockpos$mutableblockpos))
{
if (Blocks.BAMBOO.defaultBlockState().canSurvive(world, blockpos$mutableblockpos))

View File

@ -7,20 +7,15 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class ShrublandFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -1,17 +1,20 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.*;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.BushBlock;
import net.minecraft.block.HugeMushroomBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class SmallBrownMushroomFeature extends Feature<NoFeatureConfig>
{
@ -24,7 +27,7 @@ public class SmallBrownMushroomFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos startPos, NoFeatureConfig p_212245_5_) {
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) {
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
startPos = startPos.below();
}
@ -41,7 +44,7 @@ public class SmallBrownMushroomFeature extends Feature<NoFeatureConfig>
BlockPos pos = startPos.above();
int height = 1 + p_212245_3_.nextInt(2);
int height = 1 + rand.nextInt(2);
for (int y = 0; y < height; y++) {
this.setBlock(world, pos.above(y), Blocks.MUSHROOM_STEM.defaultBlockState());
@ -53,7 +56,7 @@ public class SmallBrownMushroomFeature extends Feature<NoFeatureConfig>
this.setBlock(world, pos.offset(0, height, -1), Blocks.BROWN_MUSHROOM_BLOCK.defaultBlockState().setValue(HugeMushroomBlock.DOWN, false));
this.setBlock(world, pos.offset(0, height, 1), Blocks.BROWN_MUSHROOM_BLOCK.defaultBlockState().setValue(HugeMushroomBlock.DOWN, false));
if (p_212245_3_.nextInt(2) == 0)
if (rand.nextInt(2) == 0)
{
this.setBlock(world, pos.offset(1, height, 1), Blocks.BROWN_MUSHROOM_BLOCK.defaultBlockState().setValue(HugeMushroomBlock.DOWN, false));
this.setBlock(world, pos.offset(-1, height, -1), Blocks.BROWN_MUSHROOM_BLOCK.defaultBlockState().setValue(HugeMushroomBlock.DOWN, false));

View File

@ -2,20 +2,20 @@ package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.BushBlock;
import net.minecraft.block.HugeMushroomBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class SmallGlowshroomFeature extends Feature<NoFeatureConfig>
{
@ -28,7 +28,7 @@ public class SmallGlowshroomFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos startPos, NoFeatureConfig p_212245_5_) {
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) {
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
startPos = startPos.below();
}
@ -45,7 +45,7 @@ public class SmallGlowshroomFeature extends Feature<NoFeatureConfig>
BlockPos pos = startPos.above();
int height = 1 + p_212245_3_.nextInt(4);
int height = 1 + rand.nextInt(4);
for (int y = 0; y < height; y++) {
this.setBlock(world, pos.above(y), Blocks.MUSHROOM_STEM.defaultBlockState());

View File

@ -1,20 +1,20 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.BushBlock;
import net.minecraft.block.HugeMushroomBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class SmallRedMushroomFeature extends Feature<NoFeatureConfig>
{
@ -27,7 +27,7 @@ public class SmallRedMushroomFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos startPos, NoFeatureConfig p_212245_5_) {
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) {
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
startPos = startPos.below();
}
@ -44,7 +44,7 @@ public class SmallRedMushroomFeature extends Feature<NoFeatureConfig>
BlockPos pos = startPos.above();
int height = 1 + p_212245_3_.nextInt(2);
int height = 1 + rand.nextInt(2);
for (int y = 0; y < height; y++) {
this.setBlock(world, pos.above(y), Blocks.MUSHROOM_STEM.defaultBlockState());

View File

@ -2,20 +2,20 @@ package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.util.block.IBlockPosQuery;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.BushBlock;
import net.minecraft.block.HugeMushroomBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class SmallToadstoolFeature extends Feature<NoFeatureConfig>
{
@ -28,7 +28,7 @@ public class SmallToadstoolFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> p_212245_2_, Random p_212245_3_, BlockPos startPos, NoFeatureConfig p_212245_5_) {
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) {
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
startPos = startPos.below();
}
@ -45,7 +45,7 @@ public class SmallToadstoolFeature extends Feature<NoFeatureConfig>
BlockPos pos = startPos.above();
int height = 1 + p_212245_3_.nextInt(2);
int height = 1 + rand.nextInt(2);
for (int y = 0; y < height; y++) {
this.setBlock(world, pos.above(y), Blocks.MUSHROOM_STEM.defaultBlockState());

View File

@ -8,17 +8,12 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class SnowyFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -7,23 +7,21 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class StandardGrassFeature extends Feature<NoFeatureConfig>
{Codec<NoFeatureConfig>
{
public StandardGrassFeature(Codec<NoFeatureConfig> deserializer)
{
super(deserializer);
@ -35,7 +33,7 @@ public class StandardGrassFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> generator, Random rand, BlockPos pos, NoFeatureConfig config)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
BlockState BlockState = this.chooseGrassState(rand);

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
@ -15,11 +15,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class TerracottaSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public TerracottaSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public TerracottaSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -8,20 +8,15 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class TropicsFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -8,19 +8,14 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class VioletFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -7,7 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
@ -15,11 +15,10 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
import java.util.function.Function;
public class VolcanoEdgeSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public VolcanoEdgeSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
public VolcanoEdgeSurfaceBuilder(Codec<SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}

View File

@ -8,19 +8,14 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class WastelandFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -8,18 +8,17 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
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;
import java.util.function.Function;
public class WastelandGrassFeature extends Feature<NoFeatureConfig>
{
@ -34,7 +33,7 @@ public class WastelandGrassFeature extends Feature<NoFeatureConfig>
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> generator, Random rand, BlockPos pos, NoFeatureConfig config)
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
BlockState BlockState = this.chooseGrassState(rand);

View File

@ -7,20 +7,15 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class WetlandFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -8,19 +8,14 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class WildflowerFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -8,19 +8,14 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BlockClusterFeatureConfig;
import net.minecraft.world.gen.feature.DefaultFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import java.util.Random;
import java.util.function.Function;
public class XericShrublandFlowersFeature extends DefaultFlowersFeatureNoConfig
{

View File

@ -100,7 +100,7 @@ public abstract class TreeFeatureBase extends AbstractTreeFeature<BaseTreeFeatur
protected TreeFeatureBase(IBlockPosQuery placeOn, IBlockPosQuery replace, BlockState log, BlockState leaves, BlockState altLeaves, BlockState vine, BlockState hanging, BlockState trunkFruit, int minHeight, int maxHeight)
{
super(BaseTreeFeatureConfig::deserialize);
super(BaseTreeFeatureConfig.CODEC);
this.placeOn = placeOn;
this.replace = replace;

View File

@ -21,6 +21,6 @@ public enum NetherBiomeLayer implements IAreaTransformer0, IDimOffset0Transforme
@Override
public int applyPixel(INoiseRandom context, int x, int z)
{
return Registry.BIOME.getId(BOPClimates.NETHER.getRandomBiome(context, Biomes.NETHER));
return Registry.BIOME.getId(BOPClimates.NETHER.getRandomBiome(context, Biomes.NETHER_WASTES));
}
}

View File

@ -17,7 +17,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.FoliageColors;
import net.minecraft.world.GrassColors;
import net.minecraft.world.ILightReader;
import net.minecraft.world.IBlockDisplayReader;
import net.minecraft.world.biome.BiomeColors;
import java.awt.*;
@ -65,7 +65,7 @@ public class ClientProxy extends CommonProxy
BOPBlocks.palm_leaves, BOPBlocks.willow_leaves, BOPBlocks.willow_vine);
}
public static int getRainbowBirchColor(ILightReader world, BlockPos pos)
public static int getRainbowBirchColor(IBlockDisplayReader world, BlockPos pos)
{
Color foliage = Color.getHSBColor((((float)pos.getX() + MathHelper.sin(((float)pos.getZ() + (float)pos.getX()) / 35) * 35) % 150) / 150, 0.6F, 1.0F);
if (isAprilFools) { foliage = Color.WHITE; }