GenLayers updated, misc other stuff

This commit is contained in:
Adubbz 2019-06-13 21:30:50 +10:00
parent 9ffb7c5e5f
commit 5b42883511
42 changed files with 368 additions and 330 deletions

View File

@ -7,16 +7,15 @@
******************************************************************************/
package biomesoplenty.api.enums;
import com.google.common.collect.Lists;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraftforge.common.BiomeManager.BiomeType;
import java.util.ArrayList;
import java.util.Iterator;
import com.google.common.collect.Lists;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.IContext;
import net.minecraftforge.common.BiomeManager.BiomeType;
public enum BOPClimates
{
ICE_CAP (BiomeType.ICY),
@ -70,7 +69,7 @@ public enum BOPClimates
return this;
}
public Biome getRandomBiome(IContext context, Biome fallback)
public Biome getRandomBiome(INoiseRandom context, Biome fallback)
{
if (this.totalBiomesWeight == 0)
return fallback;
@ -87,7 +86,7 @@ public enum BOPClimates
return item.biome;
}
public Biome getRandomIslandBiome(IContext context, Biome fallback)
public Biome getRandomIslandBiome(INoiseRandom context, Biome fallback)
{
if (this.totalIslandBiomesWeight == 0)
return fallback;
@ -104,7 +103,7 @@ public enum BOPClimates
return item.biome;
}
public Biome getRandomOceanBiome(IContext context, boolean deep)
public Biome getRandomOceanBiome(INoiseRandom context, boolean deep)
{
return (deep ? Biomes.DEEP_OCEAN : Biomes.OCEAN);
}

View File

@ -11,7 +11,7 @@ import biomesoplenty.common.world.BOPLayerUtil;
import biomesoplenty.common.world.BOPWorldSettings;
import biomesoplenty.common.world.layer.traits.IBOPContextExtended;
import biomesoplenty.common.world.layer.traits.LazyAreaLayerContextBOP;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.Biomes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.provider.BiomeProviderType;

View File

@ -8,8 +8,8 @@
package biomesoplenty.common.biome;
import biomesoplenty.api.enums.BOPClimates;
import net.minecraft.init.Biomes;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.world.biome.Biomes;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import java.util.HashMap;

View File

@ -13,7 +13,6 @@ import biomesoplenty.common.world.gen.feature.BOPBiomeFeatures;
import com.google.common.collect.Lists;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.state.pattern.BlockMatcher;
import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraft.fluid.Fluids;
@ -26,6 +25,7 @@ import net.minecraft.world.gen.feature.structure.MineshaftConfig;
import net.minecraft.world.gen.feature.structure.MineshaftStructure;
import net.minecraft.world.gen.placement.*;
import net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
public class AlpsBiome extends BiomeBOP
{
@ -59,7 +59,7 @@ public class AlpsBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.CLAY.getDefaultState(), 4, 1, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.CLAY.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.GRAVEL.getDefaultState(), 6, 2, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.GRASS_BLOCK.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.REPLACE_BLOCK, new ReplaceBlockConfig(BlockMatcher.forBlock(Blocks.STONE), Blocks.EMERALD_ORE.getDefaultState()), HEIGHT_4_TO_32, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.EMERALD_ORE, new ReplaceBlockConfig(Blocks.STONE.getDefaultState(), Blocks.EMERALD_ORE.getDefaultState()), Placement.EMERALD_ORE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9), Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 64)));
// Vegetation

View File

@ -62,7 +62,7 @@ public class AlpsFoothillsBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.CLAY.getDefaultState(), 4, 1, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.CLAY.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.GRAVEL.getDefaultState(), 6, 2, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.GRASS_BLOCK.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.REPLACE_BLOCK, new ReplaceBlockConfig(BlockMatcher.forBlock(Blocks.STONE), Blocks.EMERALD_ORE.getDefaultState()), HEIGHT_4_TO_32, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.EMERALD_ORE, new ReplaceBlockConfig(Blocks.STONE.getDefaultState(), Blocks.EMERALD_ORE.getDefaultState()), Placement.EMERALD_ORE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9), Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 64)));
// Vegetation

View File

@ -63,7 +63,7 @@ public class HighlandBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.CLAY.getDefaultState(), 4, 1, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.CLAY.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.GRAVEL.getDefaultState(), 6, 2, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.GRASS_BLOCK.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(4)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.REPLACE_BLOCK, new ReplaceBlockConfig(BlockMatcher.forBlock(Blocks.STONE), Blocks.EMERALD_ORE.getDefaultState()), HEIGHT_4_TO_32, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.EMERALD_ORE, new ReplaceBlockConfig(Blocks.STONE.getDefaultState(), Blocks.EMERALD_ORE.getDefaultState()), Placement.EMERALD_ORE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9), Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 64)));
// Vegetation

View File

@ -67,7 +67,7 @@ public class MoorBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(BOPBlocks.mud, 8, 2, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.GRASS_BLOCK.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(6)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.CLAY.getDefaultState(), 4, 1, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.CLAY.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.REPLACE_BLOCK, new ReplaceBlockConfig(BlockMatcher.forBlock(Blocks.STONE), Blocks.EMERALD_ORE.getDefaultState()), HEIGHT_4_TO_32, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.EMERALD_ORE, new ReplaceBlockConfig(Blocks.STONE.getDefaultState(), Blocks.EMERALD_ORE.getDefaultState()), Placement.EMERALD_ORE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9), Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 64)));
// Vegetation

View File

@ -66,7 +66,7 @@ public class OvergrownCliffsBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.CLAY.getDefaultState(), 4, 1, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.CLAY.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.GRAVEL.getDefaultState(), 6, 2, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.GRASS_BLOCK.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.REPLACE_BLOCK, new ReplaceBlockConfig(BlockMatcher.forBlock(Blocks.STONE), Blocks.EMERALD_ORE.getDefaultState()), HEIGHT_4_TO_32, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.EMERALD_ORE, new ReplaceBlockConfig(Blocks.STONE.getDefaultState(), Blocks.EMERALD_ORE.getDefaultState()), Placement.EMERALD_ORE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9), Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 64)));
// Vegetation

View File

@ -68,7 +68,7 @@ public class RainforestBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.CLAY.getDefaultState(), 4, 1, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.CLAY.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.GRAVEL.getDefaultState(), 6, 2, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.GRASS_BLOCK.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.REPLACE_BLOCK, new ReplaceBlockConfig(BlockMatcher.forBlock(Blocks.STONE), Blocks.EMERALD_ORE.getDefaultState()), HEIGHT_4_TO_32, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.EMERALD_ORE, new ReplaceBlockConfig(Blocks.STONE.getDefaultState(), Blocks.EMERALD_ORE.getDefaultState()), Placement.EMERALD_ORE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9), Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 64)));
// Vegetation

View File

@ -61,7 +61,7 @@ public class SteppeBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.CLAY.getDefaultState(), 4, 1, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.CLAY.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.GRAVEL.getDefaultState(), 6, 2, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.GRASS_BLOCK.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.REPLACE_BLOCK, new ReplaceBlockConfig(BlockMatcher.forBlock(Blocks.STONE), Blocks.EMERALD_ORE.getDefaultState()), HEIGHT_4_TO_32, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.EMERALD_ORE, new ReplaceBlockConfig(Blocks.STONE.getDefaultState(), Blocks.EMERALD_ORE.getDefaultState()), Placement.EMERALD_ORE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9), Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 64)));
// Vegetation

View File

@ -64,7 +64,7 @@ public class VolcanoBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(BOPBiomeFeatures.SPLOTCH, new SplotchConfig(Blocks.LAVA, 8, 2, Lists.newArrayList(Blocks.LAVA, Blocks.STONE, Blocks.GRANITE, Blocks.DIORITE, Blocks.ANDESITE, Blocks.GRAVEL, Blocks.MAGMA_BLOCK, BOPBlocks.ash_block)), Placement.COUNT_TOP_SOLID, new FrequencyConfig(2)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.OBSIDIAN.getDefaultState(), 33), Placement.COUNT_RANGE, new CountRangeConfig(20, 0, 0, 256)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.REPLACE_BLOCK, new ReplaceBlockConfig(BlockMatcher.forBlock(Blocks.STONE), Blocks.EMERALD_ORE.getDefaultState()), HEIGHT_4_TO_32, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.EMERALD_ORE, new ReplaceBlockConfig(Blocks.STONE.getDefaultState(), Blocks.EMERALD_ORE.getDefaultState()), Placement.EMERALD_ORE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9), Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 64)));
// Vegetation

View File

@ -60,7 +60,7 @@ public class VolcanoEdgeBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.LAPIS_ORE.getDefaultState(), 7), Placement.COUNT_DEPTH_AVERAGE, new DepthAverageConfig(1, 16, 16)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.DISK, new SphereReplaceConfig(Blocks.GRAVEL.getDefaultState(), 6, 2, Lists.newArrayList(new BlockState[]{Blocks.DIRT.getDefaultState(), Blocks.GRASS_BLOCK.getDefaultState()})), Placement.COUNT_TOP_SOLID, new FrequencyConfig(1)));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.REPLACE_BLOCK, new ReplaceBlockConfig(BlockMatcher.forBlock(Blocks.STONE), Blocks.EMERALD_ORE.getDefaultState()), HEIGHT_4_TO_32, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.EMERALD_ORE, new ReplaceBlockConfig(Blocks.STONE.getDefaultState(), Blocks.EMERALD_ORE.getDefaultState()), Placement.EMERALD_ORE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9), Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 64)));
// Vegetation

View File

@ -14,7 +14,7 @@ import biomesoplenty.common.world.gen.feature.WastelandGrassFeature;
import net.minecraft.block.Blocks;
import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.Biomes;
import net.minecraft.init.Fluids;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;

View File

@ -23,7 +23,7 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.command.CommandSource;
import net.minecraft.command.ISuggestionProvider;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.biome.Biome;
@ -40,7 +40,7 @@ public class BiomeArgument implements ArgumentType<Biome>
public <S> Biome parse(StringReader reader) throws CommandSyntaxException
{
ResourceLocation location = ResourceLocation.read(reader);
Biome biome = IRegistry.BIOME.get(location);
Biome biome = Registry.BIOME.getByValue(location);
if (biome == null)
throw INVALID_BIOME_EXCEPTION.create(location);
else return biome;
@ -49,7 +49,7 @@ public class BiomeArgument implements ArgumentType<Biome>
@Override
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder suggestionsBuilder)
{
return ISuggestionProvider.func_212476_a(Streams.stream(IRegistry.BIOME).map(biome -> IRegistry.BIOME.getKey((Biome)biome)), suggestionsBuilder);
return ISuggestionProvider.func_212476_a(Streams.stream(Registry.BIOME).map(biome -> Registry.BIOME.getByValueKey((Biome)biome)), suggestionsBuilder);
}
@Override
@ -70,8 +70,8 @@ public class BiomeArgument implements ArgumentType<Biome>
static
{
EXAMPLES = (Collection)Streams.stream(IRegistry.BIOME).map(biome -> {
return IRegistry.BIOME.getKey((Biome)biome).toString();
EXAMPLES = (Collection)Streams.stream(Registry.BIOME).map(biome -> {
return Registry.BIOME.getByValueKey((Biome)biome).toString();
}).collect(Collectors.toList());
INVALID_BIOME_EXCEPTION = new DynamicCommandExceptionType((biome) -> {
return new TextComponentTranslation("argument.biomesoplenty.biome.invalid", new Object[]{biome});

View File

@ -9,7 +9,7 @@ package biomesoplenty.common.world;
import com.google.common.collect.Sets;
import net.minecraft.block.BlockState;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.Biomes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeCache;

View File

@ -12,7 +12,7 @@ import biomesoplenty.api.biome.BOPBiomes;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import net.minecraft.block.BlockState;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.Biomes;
import net.minecraft.util.SharedSeedRandom;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;

View File

@ -10,8 +10,8 @@ package biomesoplenty.common.world;
import biomesoplenty.common.world.layer.*;
import biomesoplenty.common.world.layer.traits.LazyAreaLayerContextBOP;
import com.google.common.collect.ImmutableList;
import net.minecraft.init.Biomes;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.world.biome.Biomes;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.WorldType;
import net.minecraft.world.gen.IContextExtended;
import net.minecraft.world.gen.OverworldGenSettings;
@ -24,16 +24,16 @@ import java.util.function.LongFunction;
public class BOPLayerUtil
{
public static final int WARM_OCEAN = IRegistry.BIOME.getId(Biomes.WARM_OCEAN);
public static final int LUKEWARM_OCEAN = IRegistry.BIOME.getId(Biomes.LUKEWARM_OCEAN);
public static final int OCEAN = IRegistry.BIOME.getId(Biomes.OCEAN);
public static final int COLD_OCEAN = IRegistry.BIOME.getId(Biomes.COLD_OCEAN);
public static final int FROZEN_OCEAN = IRegistry.BIOME.getId(Biomes.FROZEN_OCEAN);
public static final int DEEP_WARM_OCEAN = IRegistry.BIOME.getId(Biomes.DEEP_WARM_OCEAN);
public static final int DEEP_LUKEWARM_OCEAN = IRegistry.BIOME.getId(Biomes.DEEP_LUKEWARM_OCEAN);
public static final int DEEP_OCEAN = IRegistry.BIOME.getId(Biomes.DEEP_OCEAN);
public static final int DEEP_COLD_OCEAN = IRegistry.BIOME.getId(Biomes.DEEP_COLD_OCEAN);
public static final int DEEP_FROZEN_OCEAN = IRegistry.BIOME.getId(Biomes.DEEP_FROZEN_OCEAN);
public static final int WARM_OCEAN = Registry.BIOME.getId(Biomes.WARM_OCEAN);
public static final int LUKEWARM_OCEAN = Registry.BIOME.getId(Biomes.LUKEWARM_OCEAN);
public static final int OCEAN = Registry.BIOME.getId(Biomes.OCEAN);
public static final int COLD_OCEAN = Registry.BIOME.getId(Biomes.COLD_OCEAN);
public static final int FROZEN_OCEAN = Registry.BIOME.getId(Biomes.FROZEN_OCEAN);
public static final int DEEP_WARM_OCEAN = Registry.BIOME.getId(Biomes.DEEP_WARM_OCEAN);
public static final int DEEP_LUKEWARM_OCEAN = Registry.BIOME.getId(Biomes.DEEP_LUKEWARM_OCEAN);
public static final int DEEP_OCEAN = Registry.BIOME.getId(Biomes.DEEP_OCEAN);
public static final int DEEP_COLD_OCEAN = Registry.BIOME.getId(Biomes.DEEP_COLD_OCEAN);
public static final int DEEP_FROZEN_OCEAN = Registry.BIOME.getId(Biomes.DEEP_FROZEN_OCEAN);
public static <T extends IArea, C extends IContextExtended<T>> IAreaFactory<T> createInitialLandAndSeaFactory(LongFunction<C> contextFactory)
{

View File

@ -11,7 +11,7 @@ import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.world.gen.feature.tree.*;
import net.minecraft.block.BlockLeaves;
import net.minecraft.block.Blocks;
import net.minecraft.world.gen.feature.AbstractFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.AbstractTreeFeature;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
@ -117,26 +117,26 @@ public class BOPBiomeFeatures
public static final Feature<NoFeatureConfig> HEATH = new HeathFeature();
//Flowers
public static final AbstractFlowersFeature CHAPARRAL_FLOWERS = new ChaparralFlowersFeature();
public static final AbstractFlowersFeature CHERRY_BLOSSOM_GROVE_FLOWERS = new CherryBlossomGroveFlowersFeature();
public static final AbstractFlowersFeature EXTENDED_FLOWERS = new ExtendedFlowersFeature();
public static final AbstractFlowersFeature FLOWER_MEADOW_FLOWERS = new FlowerMeadowFlowersFeature();
public static final AbstractFlowersFeature JUNGLE_FLOWERS = new JungleFlowersFeature();
public static final AbstractFlowersFeature LAVENDER_FLOWERS = new LavenderFlowersFeature();
public static final AbstractFlowersFeature LUSH_GRASSLAND_FLOWERS = new LushGrasslandFlowersFeature();
public static final AbstractFlowersFeature LUSH_SWAMP_FLOWERS = new LushSwampFlowersFeature();
public static final AbstractFlowersFeature MEADOW_FLOWERS = new MeadowFlowersFeature();
public static final AbstractFlowersFeature MOOR_FLOWERS = new MoorFlowersFeature();
public static final AbstractFlowersFeature MYSTIC_GROVE_FLOWERS = new MysticGroveFlowersFeature();
public static final AbstractFlowersFeature ORIGIN_FLOWERS = new OriginFlowersFeature();
public static final AbstractFlowersFeature PRAIRIE_FLOWERS = new PrairieFlowersFeature();
public static final AbstractFlowersFeature RAINFOREST_FLOWERS = new RainforestFlowersFeature();
public static final AbstractFlowersFeature SHRUBLAND_FLOWERS = new ShrublandFlowersFeature();
public static final AbstractFlowersFeature SNOWY_FLOWERS = new SnowyFlowersFeature();
public static final AbstractFlowersFeature TROPICS_FLOWERS = new TropicsFlowersFeature();
public static final AbstractFlowersFeature WASTELAND_FLOWERS = new WastelandFlowersFeature();
public static final AbstractFlowersFeature WETLAND_FLOWERS = new WetlandFlowersFeature();
public static final AbstractFlowersFeature XERIC_SHRUBLAND_FLOWERS = new XericShrublandFlowersFeature();
public static final FlowersFeature CHAPARRAL_FLOWERS = new ChaparralFlowersFeature();
public static final FlowersFeature CHERRY_BLOSSOM_GROVE_FLOWERS = new CherryBlossomGroveFlowersFeature();
public static final FlowersFeature EXTENDED_FLOWERS = new ExtendedFlowersFeature();
public static final FlowersFeature FLOWER_MEADOW_FLOWERS = new FlowerMeadowFlowersFeature();
public static final FlowersFeature JUNGLE_FLOWERS = new JungleFlowersFeature();
public static final FlowersFeature LAVENDER_FLOWERS = new LavenderFlowersFeature();
public static final FlowersFeature LUSH_GRASSLAND_FLOWERS = new LushGrasslandFlowersFeature();
public static final FlowersFeature LUSH_SWAMP_FLOWERS = new LushSwampFlowersFeature();
public static final FlowersFeature MEADOW_FLOWERS = new MeadowFlowersFeature();
public static final FlowersFeature MOOR_FLOWERS = new MoorFlowersFeature();
public static final FlowersFeature MYSTIC_GROVE_FLOWERS = new MysticGroveFlowersFeature();
public static final FlowersFeature ORIGIN_FLOWERS = new OriginFlowersFeature();
public static final FlowersFeature PRAIRIE_FLOWERS = new PrairieFlowersFeature();
public static final FlowersFeature RAINFOREST_FLOWERS = new RainforestFlowersFeature();
public static final FlowersFeature SHRUBLAND_FLOWERS = new ShrublandFlowersFeature();
public static final FlowersFeature SNOWY_FLOWERS = new SnowyFlowersFeature();
public static final FlowersFeature TROPICS_FLOWERS = new TropicsFlowersFeature();
public static final FlowersFeature WASTELAND_FLOWERS = new WastelandFlowersFeature();
public static final FlowersFeature WETLAND_FLOWERS = new WetlandFlowersFeature();
public static final FlowersFeature XERIC_SHRUBLAND_FLOWERS = new XericShrublandFlowersFeature();
//Surfaces
public static final SurfaceBuilder<SurfaceBuilderConfig> BOG_SURFACE_BUILDER = new BogSurfaceBuilder();

View File

@ -7,27 +7,36 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import java.util.Random;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
import net.minecraft.world.gen.surfacebuilders.ISurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
public class VolcanoEdgeSurfaceBuilder implements ISurfaceBuilder<SurfaceBuilderConfig> {
public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) {
if (noise > 2.6D)
{
Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.ASH_SURFACE);
}
else if (noise > 0.8F)
{
Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, Biome.STONE_STONE_GRAVEL_SURFACE);
}
else
{
Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, Biome.GRAVEL_SURFACE);
}
}
}
import java.util.Random;
import java.util.function.Function;
public class VolcanoEdgeSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public VolcanoEdgeSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}
@Override
public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) {
if (noise > 2.6D)
{
SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.ASH_SURFACE);
}
else if (noise > 0.8F)
{
SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, SurfaceBuilder.STONE_STONE_GRAVEL_CONFIG);
}
else
{
SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, SurfaceBuilder.GRAVEL_CONFIG);
}
}
}

View File

@ -7,23 +7,33 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import java.util.Random;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
import net.minecraft.world.gen.surfacebuilders.ISurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
public class VolcanoSurfaceBuilder implements ISurfaceBuilder<SurfaceBuilderConfig> {
public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) {
if (noise > 2.7F)
{
Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.MAGMA_SURFACE);
}
else
{
Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.ASH_SURFACE);
}
}
}
import java.util.Random;
import java.util.function.Function;
public class VolcanoSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig>
{
public VolcanoSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> deserializer)
{
super(deserializer);
}
@Override
public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config)
{
if (noise > 2.7F)
{
SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.MAGMA_SURFACE);
}
else
{
SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.ASH_SURFACE);
}
}
}

View File

@ -7,24 +7,33 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import java.util.Random;
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.AbstractFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
public class WastelandFlowersFeature extends AbstractFlowersFeature
import java.util.Random;
import java.util.function.Function;
public class WastelandFlowersFeature extends FlowersFeature
{
private static final Block[] FLOWERS = new Block[]{BOPBlocks.wilted_lily};
private static final Block[] FLOWERS = new Block[]{BOPBlocks.wilted_lily};
public BlockState getRandomFlower(Random p_202355_1_, BlockPos p_202355_2_)
{
double d0 = MathHelper.clamp((1.0D + Biome.INFO_NOISE.getValue((double)p_202355_2_.getX() / 48.0D, (double)p_202355_2_.getZ() / 48.0D)) / 2.0D, 0.0D, 0.9999D);
Block block = FLOWERS[(int)(d0 * (double)FLOWERS.length)];
return block.getDefaultState();
}
}
public WastelandFlowersFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> deserializer)
{
super(deserializer);
}
@Override
public BlockState getRandomFlower(Random p_202355_1_, BlockPos p_202355_2_)
{
double d0 = MathHelper.clamp((1.0D + Biome.INFO_NOISE.getValue((double)p_202355_2_.getX() / 48.0D, (double)p_202355_2_.getZ() / 48.0D)) / 2.0D, 0.0D, 0.9999D);
Block block = FLOWERS[(int)(d0 * (double)FLOWERS.length)];
return block.getDefaultState();
}
}

View File

@ -7,47 +7,54 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import java.util.Random;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.datafixers.Dynamic;
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.gen.IChunkGenSettings;
import net.minecraft.world.gen.IChunkGenerator;
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 java.util.Random;
import java.util.function.Function;
public class WastelandGrassFeature extends Feature<NoFeatureConfig>
{
public BlockState chooseGrassState(Random rand)
{
return rand.nextInt(3) == 0 ? BOPBlocks.desert_grass.getDefaultState() : BOPBlocks.dead_grass.getDefaultState();
}
public WastelandGrassFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> deserializer)
{
super(deserializer);
}
@Override
public boolean place(IWorld world, IChunkGenerator<? extends IChunkGenSettings> generator, Random rand, BlockPos pos, NoFeatureConfig config)
{
BlockState BlockState = this.chooseGrassState(rand);
public BlockState chooseGrassState(Random rand)
{
return rand.nextInt(3) == 0 ? BOPBlocks.desert_grass.getDefaultState() : BOPBlocks.dead_grass.getDefaultState();
}
for (BlockState BlockState1 = world.getBlockState(pos); (BlockState1.isAir(world, pos) || BlockState1.isIn(BlockTags.LEAVES)) && pos.getY() > 0; BlockState1 = world.getBlockState(pos))
{
pos = pos.down();
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> generator, Random rand, BlockPos pos, NoFeatureConfig config)
{
BlockState BlockState = this.chooseGrassState(rand);
int i = 0;
for (BlockState BlockState1 = world.getBlockState(pos); (BlockState1.isAir(world, pos) || BlockState1.isIn(BlockTags.LEAVES)) && pos.getY() > 0; BlockState1 = world.getBlockState(pos))
{
pos = pos.down();
}
for (int j = 0; j < 128; ++j)
{
BlockPos blockpos = pos.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
if (world.isAirBlock(blockpos) && BlockState.isValidPosition(world, blockpos))
{
world.setBlockState(blockpos, BlockState, 2);
++i;
}
}
int i = 0;
return i > 0;
}
}
for (int j = 0; j < 128; ++j)
{
BlockPos blockpos = pos.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
if (world.isAirBlock(blockpos) && BlockState.isValidPosition(world, blockpos))
{
world.setBlockState(blockpos, BlockState, 2);
++i;
}
}
return i > 0;
}
}

View File

@ -7,24 +7,33 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import java.util.Random;
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.AbstractFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
public class WetlandFlowersFeature extends AbstractFlowersFeature
import java.util.Random;
import java.util.function.Function;
public class WetlandFlowersFeature extends FlowersFeature
{
private static final Block[] FLOWERS = new Block[]{Blocks.BLUE_ORCHID, Blocks.DANDELION, Blocks.POPPY};
private static final Block[] FLOWERS = new Block[]{Blocks.BLUE_ORCHID, Blocks.DANDELION, Blocks.POPPY};
public BlockState getRandomFlower(Random p_202355_1_, BlockPos p_202355_2_)
{
double d0 = MathHelper.clamp((1.0D + Biome.INFO_NOISE.getValue((double)p_202355_2_.getX() / 48.0D, (double)p_202355_2_.getZ() / 48.0D)) / 2.0D, 0.0D, 0.9999D);
Block block = FLOWERS[(int)(d0 * (double)FLOWERS.length)];
return block.getDefaultState();
}
}
public WetlandFlowersFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> deserializer)
{
super(deserializer);
}
@Override
public BlockState getRandomFlower(Random p_202355_1_, BlockPos p_202355_2_)
{
double d0 = MathHelper.clamp((1.0D + Biome.INFO_NOISE.getValue((double)p_202355_2_.getX() / 48.0D, (double)p_202355_2_.getZ() / 48.0D)) / 2.0D, 0.0D, 0.9999D);
Block block = FLOWERS[(int)(d0 * (double)FLOWERS.length)];
return block.getDefaultState();
}
}

View File

@ -7,24 +7,33 @@
******************************************************************************/
package biomesoplenty.common.world.gen.feature;
import java.util.Random;
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.AbstractFlowersFeature;
import net.minecraft.world.gen.feature.FlowersFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
public class XericShrublandFlowersFeature extends AbstractFlowersFeature
import java.util.Random;
import java.util.function.Function;
public class XericShrublandFlowersFeature extends FlowersFeature
{
private static final Block[] FLOWERS = new Block[]{BOPBlocks.wildflower};
private static final Block[] FLOWERS = new Block[]{BOPBlocks.wildflower};
public BlockState getRandomFlower(Random p_202355_1_, BlockPos p_202355_2_)
{
double d0 = MathHelper.clamp((1.0D + Biome.INFO_NOISE.getValue((double)p_202355_2_.getX() / 48.0D, (double)p_202355_2_.getZ() / 48.0D)) / 2.0D, 0.0D, 0.9999D);
Block block = FLOWERS[(int)(d0 * (double)FLOWERS.length)];
return block.getDefaultState();
}
}
public XericShrublandFlowersFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> deserializer)
{
super(deserializer);
}
@Override
public BlockState getRandomFlower(Random p_202355_1_, BlockPos p_202355_2_)
{
double d0 = MathHelper.clamp((1.0D + Biome.INFO_NOISE.getValue((double)p_202355_2_.getX() / 48.0D, (double)p_202355_2_.getZ() / 48.0D)) / 2.0D, 0.0D, 0.9999D);
Block block = FLOWERS[(int)(d0 * (double)FLOWERS.length)];
return block.getDefaultState();
}
}

View File

@ -9,10 +9,9 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.api.enums.BOPClimates;
import biomesoplenty.init.ModBiomes;
import net.minecraft.init.Biomes;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.world.gen.IContext;
import net.minecraft.world.gen.area.AreaDimension;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.area.IArea;
import net.minecraft.world.gen.layer.traits.IAreaTransformer2;
import net.minecraft.world.gen.layer.traits.IDimOffset0Transformer;
@ -22,11 +21,11 @@ public enum GenLayerBiomeBOP implements IAreaTransformer2, IDimOffset0Transforme
{
INSTANCE;
private static final int DEEP_OCEAN = IRegistry.BIOME.getId(Biomes.DEEP_OCEAN);
private static final int MUSHROOM_FIELDS = IRegistry.BIOME.getId(Biomes.MUSHROOM_FIELDS);
private static final int DEEP_OCEAN = Registry.BIOME.getId(Biomes.DEEP_OCEAN);
private static final int MUSHROOM_FIELDS = Registry.BIOME.getId(Biomes.MUSHROOM_FIELDS);
@Override
public int apply(IContext context, AreaDimension dimension, IArea area1, IArea area2, int x, int z)
public int func_215723_a(INoiseRandom context, IArea area1, IArea area2, int x, int z)
{
int landSeaVal = area1.getValue(x, z);
int climateVal = area2.getValue(x, z);
@ -48,7 +47,7 @@ public enum GenLayerBiomeBOP implements IAreaTransformer2, IDimOffset0Transforme
// At this point, oceans and land have been assigned, and so have mushroom islands
if (landSeaVal == DEEP_OCEAN)
{
return IRegistry.BIOME.getId(climate.getRandomOceanBiome(context, true));
return Registry.BIOME.getId(climate.getRandomOceanBiome(context, true));
}
else if ((landSeaVal == MUSHROOM_FIELDS || ModBiomes.islandBiomes.contains(landSeaVal)) && climate.biomeType != BiomeManager.BiomeType.ICY) // TODO
{
@ -57,11 +56,11 @@ public enum GenLayerBiomeBOP implements IAreaTransformer2, IDimOffset0Transforme
}
else if (landSeaVal == 0)
{
return IRegistry.BIOME.getId(climate.getRandomOceanBiome(context, false));
return Registry.BIOME.getId(climate.getRandomOceanBiome(context, false));
}
else
{
return IRegistry.BIOME.getId(climate.getRandomBiome(context, Biomes.PLAINS));
return Registry.BIOME.getId(climate.getRandomBiome(context, Biomes.PLAINS));
}
}
}

View File

@ -8,10 +8,10 @@
package biomesoplenty.common.world.layer;
import biomesoplenty.api.biome.BOPBiomes;
import net.minecraft.init.Biomes;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.IContext;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.layer.LayerUtil;
import net.minecraft.world.gen.layer.traits.ICastleTransformer;
@ -21,24 +21,24 @@ public enum GenLayerBiomeEdgeBOP implements ICastleTransformer
{
INSTANCE;
private static final int DESERT = IRegistry.BIOME.getId(Biomes.DESERT);
private static final int MOUNTAINS = IRegistry.BIOME.getId(Biomes.MOUNTAINS);
private static final int WOODED_MOUNTAINS = IRegistry.BIOME.getId(Biomes.WOODED_MOUNTAINS);
private static final int SNOWY_TUNDRA = IRegistry.BIOME.getId(Biomes.SNOWY_TUNDRA);
private static final int JUNGLE = IRegistry.BIOME.getId(Biomes.JUNGLE);
private static final int JUNGLE_EDGE = IRegistry.BIOME.getId(Biomes.JUNGLE_EDGE);
private static final int BADLANDS = IRegistry.BIOME.getId(Biomes.BADLANDS);
private static final int BADLANDS_PLATEAU = IRegistry.BIOME.getId(Biomes.BADLANDS_PLATEAU);
private static final int WOODED_BADLANDS_PLATEAU = IRegistry.BIOME.getId(Biomes.WOODED_BADLANDS_PLATEAU);
private static final int PLAINS = IRegistry.BIOME.getId(Biomes.PLAINS);
private static final int GIANT_TREE_TAIGA = IRegistry.BIOME.getId(Biomes.GIANT_TREE_TAIGA);
private static final int MOUNTAIN_EDGE = IRegistry.BIOME.getId(Biomes.MOUNTAIN_EDGE);
private static final int SWAMP = IRegistry.BIOME.getId(Biomes.SWAMP);
private static final int TAIGA = IRegistry.BIOME.getId(Biomes.TAIGA);
private static final int SNOWY_TAIGA = IRegistry.BIOME.getId(Biomes.SNOWY_TAIGA);
private static final int DESERT = Registry.BIOME.getId(Biomes.DESERT);
private static final int MOUNTAINS = Registry.BIOME.getId(Biomes.MOUNTAINS);
private static final int WOODED_MOUNTAINS = Registry.BIOME.getId(Biomes.WOODED_MOUNTAINS);
private static final int SNOWY_TUNDRA = Registry.BIOME.getId(Biomes.SNOWY_TUNDRA);
private static final int JUNGLE = Registry.BIOME.getId(Biomes.JUNGLE);
private static final int JUNGLE_EDGE = Registry.BIOME.getId(Biomes.JUNGLE_EDGE);
private static final int BADLANDS = Registry.BIOME.getId(Biomes.BADLANDS);
private static final int BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.BADLANDS_PLATEAU);
private static final int WOODED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.WOODED_BADLANDS_PLATEAU);
private static final int PLAINS = Registry.BIOME.getId(Biomes.PLAINS);
private static final int GIANT_TREE_TAIGA = Registry.BIOME.getId(Biomes.GIANT_TREE_TAIGA);
private static final int MOUNTAIN_EDGE = Registry.BIOME.getId(Biomes.MOUNTAIN_EDGE);
private static final int SWAMP = Registry.BIOME.getId(Biomes.SWAMP);
private static final int TAIGA = Registry.BIOME.getId(Biomes.TAIGA);
private static final int SNOWY_TAIGA = Registry.BIOME.getId(Biomes.SNOWY_TAIGA);
@Override
public int apply(IContext context, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId)
public int apply(INoiseRandom context, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId)
{
int[] outBiomeId = new int[1];
@ -111,12 +111,12 @@ public enum GenLayerBiomeEdgeBOP implements ICastleTransformer
private boolean replaceBiomeEdge(int[] outId, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId, Optional<Biome> fromBiome, Optional<Biome> toBiome)
{
return fromBiome.isPresent() && toBiome.isPresent() && this.replaceBiomeEdge(outId, northBiomeId, eastBiomeId, southBiomeId, westBiomeId, biomeId, IRegistry.BIOME.getId(fromBiome.get()), IRegistry.BIOME.getId(toBiome.get()));
return fromBiome.isPresent() && toBiome.isPresent() && this.replaceBiomeEdge(outId, northBiomeId, eastBiomeId, southBiomeId, westBiomeId, biomeId, Registry.BIOME.getId(fromBiome.get()), Registry.BIOME.getId(toBiome.get()));
}
private boolean replaceBiomeEdge(int[] outId, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId, Optional<Biome> fromBiome, int toBiome)
{
return fromBiome.isPresent() && this.replaceBiomeEdge(outId, northBiomeId, eastBiomeId, southBiomeId, westBiomeId, biomeId, IRegistry.BIOME.getId(fromBiome.get()), toBiome);
return fromBiome.isPresent() && this.replaceBiomeEdge(outId, northBiomeId, eastBiomeId, southBiomeId, westBiomeId, biomeId, Registry.BIOME.getId(fromBiome.get()), toBiome);
}
private boolean replaceBiomeEdge(int[] outId, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId, int fromBiome, int toBiome)
@ -148,8 +148,8 @@ public enum GenLayerBiomeEdgeBOP implements ICastleTransformer
}
else
{
Biome biomeA = IRegistry.BIOME.get(biomeIdA);
Biome biomeB = IRegistry.BIOME.get(biomeIdB);
Biome biomeA = Registry.BIOME.getByValue(biomeIdA);
Biome biomeB = Registry.BIOME.getByValue(biomeIdB);
if (biomeA != null && biomeB != null)
{
Biome.TempCategory catA = biomeA.getTempCategory();

View File

@ -9,8 +9,7 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.api.enums.BOPClimates;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.gen.IContext;
import net.minecraft.world.gen.area.AreaDimension;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.area.IArea;
import net.minecraft.world.gen.layer.traits.IAreaTransformer2;
import net.minecraft.world.gen.layer.traits.IDimOffset0Transformer;
@ -27,7 +26,7 @@ public enum GenLayerClimate implements IAreaTransformer2, IDimOffset0Transformer
}
@Override
public int apply(IContext context, AreaDimension dimension, IArea area1, IArea area2, int x, int z)
public int func_215723_a(INoiseRandom context, IArea area1, IArea area2, int x, int z)
{
int temperature = area1.getValue(x, z);
int rainfall = area2.getValue(x, z);

View File

@ -8,10 +8,9 @@
package biomesoplenty.common.world.layer;
import biomesoplenty.api.enums.BOPClimates;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.IContext;
import net.minecraft.world.gen.area.AreaDimension;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.area.IArea;
import net.minecraft.world.gen.layer.traits.IAreaTransformer2;
import net.minecraft.world.gen.layer.traits.IDimOffset1Transformer;
@ -21,7 +20,7 @@ public enum GenLayerLargeIsland implements IAreaTransformer2, IDimOffset1Transfo
INSTANCE;
@Override
public int apply(IContext context, AreaDimension dimension, IArea landSeaArea, IArea climateArea, int x, int z)
public int func_215723_a(INoiseRandom context, IArea landSeaArea, IArea climateArea, int x, int z)
{
int northVal = landSeaArea.getValue(x + 1, z + 0);
int eastVal = landSeaArea.getValue(x + 2, z + 1);
@ -54,7 +53,7 @@ public enum GenLayerLargeIsland implements IAreaTransformer2, IDimOffset1Transfo
}
else
{
return IRegistry.BIOME.getId(islandBiome);
return Registry.BIOME.getId(islandBiome);
}
}
else return centerVal;

View File

@ -10,8 +10,7 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.api.enums.BOPClimates;
import biomesoplenty.common.world.BOPLayerUtil;
import biomesoplenty.common.world.layer.traits.IAreaTransformer3;
import net.minecraft.world.gen.IContext;
import net.minecraft.world.gen.area.AreaDimension;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.area.IArea;
import net.minecraft.world.gen.layer.traits.IDimOffset0Transformer;
@ -20,7 +19,7 @@ public enum GenLayerMixOceansBOP implements IAreaTransformer3, IDimOffset0Transf
INSTANCE;
@Override
public int apply(IContext context, AreaDimension dimension, IArea biomeArea, IArea oceanArea, IArea climateArea, int x, int z)
public int apply(INoiseRandom context, IArea biomeArea, IArea oceanArea, IArea climateArea, int x, int z)
{
int biomeId = biomeArea.getValue(x, z);
int oceanId = oceanArea.getValue(x, z);

View File

@ -10,7 +10,6 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.common.world.SimplexNoise;
import biomesoplenty.common.world.layer.traits.IBOPAreaTransformer0;
import biomesoplenty.common.world.layer.traits.IBOPContextExtended;
import net.minecraft.world.gen.area.AreaDimension;
public enum GenLayerRainfallNoise implements IBOPAreaTransformer0
{
@ -26,11 +25,11 @@ public enum GenLayerRainfallNoise implements IBOPAreaTransformer0
}
@Override
public int apply(IBOPContextExtended context, AreaDimension areaDimension, int x, int z)
public int apply(IBOPContextExtended context, int x, int z)
{
double xOffset = (double)(context.getWorldSeed() & 0xFFFFFF) * 0.000003D;
double zOffset = (double)(context.getWorldSeed() & 0xFFFFFF) * 0.000004D;
double noiseVal = SimplexNoise.noise((x + areaDimension.getStartX() + xOffset) * this.scale, (z + areaDimension.getStartZ() + zOffset) * this.scale);
double noiseVal = SimplexNoise.noise((x + xOffset) * this.scale, (z + zOffset) * this.scale);
// boundaries were determined empirically by analyzing statistically output from the SimplexNoise function, and splitting into 12 equally likely groups
if (noiseVal < -0.637D) return 0;

View File

@ -9,14 +9,13 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.common.world.layer.traits.IBOPAreaTransformer0;
import biomesoplenty.common.world.layer.traits.IBOPContextExtended;
import net.minecraft.world.gen.area.AreaDimension;
public enum GenLayerRainfallRandom implements IBOPAreaTransformer0
{
INSTANCE;
@Override
public int apply(IBOPContextExtended context, AreaDimension areaDimension, int x, int z)
public int apply(IBOPContextExtended context, int x, int z)
{
// Choose a random heat value
return context.random(12);

View File

@ -9,11 +9,10 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.common.biome.BiomeBOP;
import biomesoplenty.common.world.BOPLayerUtil;
import net.minecraft.init.Biomes;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.IContext;
import net.minecraft.world.gen.area.AreaDimension;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.area.IArea;
import net.minecraft.world.gen.layer.traits.IAreaTransformer2;
import net.minecraft.world.gen.layer.traits.IDimOffset0Transformer;
@ -22,18 +21,18 @@ public enum GenLayerRiverMixBOP implements IAreaTransformer2, IDimOffset0Transfo
{
INSTANCE;
private static final int FROZEN_RIVER = IRegistry.BIOME.getId(Biomes.FROZEN_RIVER);
private static final int SNOWY_TUNDRA = IRegistry.BIOME.getId(Biomes.SNOWY_TUNDRA);
private static final int MUSHROOM_FIELDS = IRegistry.BIOME.getId(Biomes.MUSHROOM_FIELDS);
private static final int MUSHROOM_FIELD_SHORE = IRegistry.BIOME.getId(Biomes.MUSHROOM_FIELD_SHORE);
private static final int RIVER = IRegistry.BIOME.getId(Biomes.RIVER);
private static final int FROZEN_RIVER = Registry.BIOME.getId(Biomes.FROZEN_RIVER);
private static final int SNOWY_TUNDRA = Registry.BIOME.getId(Biomes.SNOWY_TUNDRA);
private static final int MUSHROOM_FIELDS = Registry.BIOME.getId(Biomes.MUSHROOM_FIELDS);
private static final int MUSHROOM_FIELD_SHORE = Registry.BIOME.getId(Biomes.MUSHROOM_FIELD_SHORE);
private static final int RIVER = Registry.BIOME.getId(Biomes.RIVER);
@Override
public int apply(IContext context, AreaDimension dimension, IArea biomeArea, IArea riverArea, int x, int z)
public int func_215723_a(INoiseRandom context, IArea biomeArea, IArea riverArea, int x, int z)
{
int biomeId = biomeArea.getValue(x, z);
int riverId = riverArea.getValue(x, z);
Biome biome = IRegistry.BIOME.get(biomeId);
Biome biome = Registry.BIOME.getByValue(biomeId);
if (BOPLayerUtil.isOcean(biomeId))
{

View File

@ -9,43 +9,43 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.common.biome.BiomeBOP;
import biomesoplenty.common.world.BOPLayerUtil;
import net.minecraft.init.Biomes;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.IContext;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.layer.traits.ICastleTransformer;
public enum GenLayerShoreBOP implements ICastleTransformer
{
INSTANCE;
private static final int BEACH = IRegistry.BIOME.getId(Biomes.BEACH);
private static final int SNOWY_BEACH = IRegistry.BIOME.getId(Biomes.SNOWY_BEACH);
private static final int DESERT = IRegistry.BIOME.getId(Biomes.DESERT);
private static final int MOUNTAINS = IRegistry.BIOME.getId(Biomes.MOUNTAINS);
private static final int WOODED_MOUNTAINS = IRegistry.BIOME.getId(Biomes.WOODED_MOUNTAINS);
private static final int FOREST = IRegistry.BIOME.getId(Biomes.FOREST);
private static final int JUNGLE = IRegistry.BIOME.getId(Biomes.JUNGLE);
private static final int JUNGLE_EDGE = IRegistry.BIOME.getId(Biomes.JUNGLE_EDGE);
private static final int JUNGLE_HILLS = IRegistry.BIOME.getId(Biomes.JUNGLE_HILLS);
private static final int BADLANDS = IRegistry.BIOME.getId(Biomes.BADLANDS);
private static final int WOODED_BADLANDS_PLATEAU = IRegistry.BIOME.getId(Biomes.WOODED_BADLANDS_PLATEAU);
private static final int BADLANDS_PLATEAU = IRegistry.BIOME.getId(Biomes.BADLANDS_PLATEAU);
private static final int ERODED_BADLANDS = IRegistry.BIOME.getId(Biomes.ERODED_BADLANDS);
private static final int MODIFIED_WOODED_BADLANDS_PLATEAU = IRegistry.BIOME.getId(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU);
private static final int MODIFIED_BADLANDS_PLATEAU = IRegistry.BIOME.getId(Biomes.MODIFIED_BADLANDS_PLATEAU);
private static final int MUSHROOM_FIELDS = IRegistry.BIOME.getId(Biomes.MUSHROOM_FIELDS);
private static final int MUSHROOM_FIELD_SHORE = IRegistry.BIOME.getId(Biomes.MUSHROOM_FIELD_SHORE);
private static final int RIVER = IRegistry.BIOME.getId(Biomes.RIVER);
private static final int MOUNTAIN_EDGE = IRegistry.BIOME.getId(Biomes.MOUNTAIN_EDGE);
private static final int STONE_SHORE = IRegistry.BIOME.getId(Biomes.STONE_SHORE);
private static final int SWAMP = IRegistry.BIOME.getId(Biomes.SWAMP);
private static final int TAIGA = IRegistry.BIOME.getId(Biomes.TAIGA);
private static final int BEACH = Registry.BIOME.getId(Biomes.BEACH);
private static final int SNOWY_BEACH = Registry.BIOME.getId(Biomes.SNOWY_BEACH);
private static final int DESERT = Registry.BIOME.getId(Biomes.DESERT);
private static final int MOUNTAINS = Registry.BIOME.getId(Biomes.MOUNTAINS);
private static final int WOODED_MOUNTAINS = Registry.BIOME.getId(Biomes.WOODED_MOUNTAINS);
private static final int FOREST = Registry.BIOME.getId(Biomes.FOREST);
private static final int JUNGLE = Registry.BIOME.getId(Biomes.JUNGLE);
private static final int JUNGLE_EDGE = Registry.BIOME.getId(Biomes.JUNGLE_EDGE);
private static final int JUNGLE_HILLS = Registry.BIOME.getId(Biomes.JUNGLE_HILLS);
private static final int BADLANDS = Registry.BIOME.getId(Biomes.BADLANDS);
private static final int WOODED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.WOODED_BADLANDS_PLATEAU);
private static final int BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.BADLANDS_PLATEAU);
private static final int ERODED_BADLANDS = Registry.BIOME.getId(Biomes.ERODED_BADLANDS);
private static final int MODIFIED_WOODED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU);
private static final int MODIFIED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.MODIFIED_BADLANDS_PLATEAU);
private static final int MUSHROOM_FIELDS = Registry.BIOME.getId(Biomes.MUSHROOM_FIELDS);
private static final int MUSHROOM_FIELD_SHORE = Registry.BIOME.getId(Biomes.MUSHROOM_FIELD_SHORE);
private static final int RIVER = Registry.BIOME.getId(Biomes.RIVER);
private static final int MOUNTAIN_EDGE = Registry.BIOME.getId(Biomes.MOUNTAIN_EDGE);
private static final int STONE_SHORE = Registry.BIOME.getId(Biomes.STONE_SHORE);
private static final int SWAMP = Registry.BIOME.getId(Biomes.SWAMP);
private static final int TAIGA = Registry.BIOME.getId(Biomes.TAIGA);
@Override
public int apply(IContext context, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId)
public int apply(INoiseRandom context, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId)
{
Biome biome = IRegistry.BIOME.get(biomeId);
Biome biome = Registry.BIOME.getByValue(biomeId);
if (biomeId == MUSHROOM_FIELDS)
{
@ -115,7 +115,7 @@ public enum GenLayerShoreBOP implements ICastleTransformer
private static boolean isJungleCompatible(int biomeId)
{
if (IRegistry.BIOME.get(biomeId) != null && (IRegistry.BIOME.get(biomeId)).getCategory() == Biome.Category.JUNGLE)
if (Registry.BIOME.getByValue(biomeId) != null && (Registry.BIOME.getByValue(biomeId)).getCategory() == Biome.Category.JUNGLE)
{
return true;
}

View File

@ -8,55 +8,53 @@
package biomesoplenty.common.world.layer;
import java.util.Iterator;
import java.util.List;
import com.google.common.collect.Lists;
import biomesoplenty.api.enums.BOPClimates;
import biomesoplenty.common.world.BOPLayerUtil;
import biomesoplenty.init.ModBiomes;
import net.minecraft.init.Biomes;
import net.minecraft.util.registry.IRegistry;
import com.google.common.collect.Lists;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.IContext;
import net.minecraft.world.gen.area.AreaDimension;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.area.IArea;
import net.minecraft.world.gen.layer.LayerUtil;
import net.minecraft.world.gen.layer.traits.IAreaTransformer2;
import net.minecraft.world.gen.layer.traits.IDimOffset1Transformer;
import java.util.Iterator;
import java.util.List;
public enum GenLayerSubBiome implements IAreaTransformer2, IDimOffset1Transformer
{
INSTANCE;
private static final int BIRCH_FOREST = IRegistry.BIOME.getId(Biomes.BIRCH_FOREST);
private static final int BIRCH_FOREST_HILLS = IRegistry.BIOME.getId(Biomes.BIRCH_FOREST_HILLS);
private static final int DESERT = IRegistry.BIOME.getId(Biomes.DESERT);
private static final int DESERT_HILLS = IRegistry.BIOME.getId(Biomes.DESERT_HILLS);
private static final int MOUNTAINS = IRegistry.BIOME.getId(Biomes.MOUNTAINS);
private static final int WOODED_MOUNTAINS = IRegistry.BIOME.getId(Biomes.WOODED_MOUNTAINS);
private static final int FOREST = IRegistry.BIOME.getId(Biomes.FOREST);
private static final int WOODED_HILLS = IRegistry.BIOME.getId(Biomes.WOODED_HILLS);
private static final int SNOWY_TUNDRA = IRegistry.BIOME.getId(Biomes.SNOWY_TUNDRA);
private static final int SNOWY_MOUNTAINS = IRegistry.BIOME.getId(Biomes.SNOWY_MOUNTAINS);
private static final int JUNGLE = IRegistry.BIOME.getId(Biomes.JUNGLE);
private static final int JUNGLE_HILLS = IRegistry.BIOME.getId(Biomes.JUNGLE_HILLS);
private static final int BADLANDS = IRegistry.BIOME.getId(Biomes.BADLANDS);
private static final int WOODED_BADLANDS_PLATEAU = IRegistry.BIOME.getId(Biomes.WOODED_BADLANDS_PLATEAU);
private static final int PLAINS = IRegistry.BIOME.getId(Biomes.PLAINS);
private static final int GIANT_TREE_TAIGA = IRegistry.BIOME.getId(Biomes.GIANT_TREE_TAIGA);
private static final int GIANT_TREE_TAIGA_HILLS = IRegistry.BIOME.getId(Biomes.GIANT_TREE_TAIGA_HILLS);
private static final int DARK_FOREST = IRegistry.BIOME.getId(Biomes.DARK_FOREST);
private static final int SAVANNA = IRegistry.BIOME.getId(Biomes.SAVANNA);
private static final int SAVANA_PLATEAU = IRegistry.BIOME.getId(Biomes.SAVANNA_PLATEAU);
private static final int TAIGA = IRegistry.BIOME.getId(Biomes.TAIGA);
private static final int SNOWY_TAIGA = IRegistry.BIOME.getId(Biomes.SNOWY_TAIGA);
private static final int SNOWY_TAIGA_HILLS = IRegistry.BIOME.getId(Biomes.SNOWY_TAIGA_HILLS);
private static final int TAIGA_HILLS = IRegistry.BIOME.getId(Biomes.TAIGA_HILLS);
private static final int BIRCH_FOREST = Registry.BIOME.getId(Biomes.BIRCH_FOREST);
private static final int BIRCH_FOREST_HILLS = Registry.BIOME.getId(Biomes.BIRCH_FOREST_HILLS);
private static final int DESERT = Registry.BIOME.getId(Biomes.DESERT);
private static final int DESERT_HILLS = Registry.BIOME.getId(Biomes.DESERT_HILLS);
private static final int MOUNTAINS = Registry.BIOME.getId(Biomes.MOUNTAINS);
private static final int WOODED_MOUNTAINS = Registry.BIOME.getId(Biomes.WOODED_MOUNTAINS);
private static final int FOREST = Registry.BIOME.getId(Biomes.FOREST);
private static final int WOODED_HILLS = Registry.BIOME.getId(Biomes.WOODED_HILLS);
private static final int SNOWY_TUNDRA = Registry.BIOME.getId(Biomes.SNOWY_TUNDRA);
private static final int SNOWY_MOUNTAINS = Registry.BIOME.getId(Biomes.SNOWY_MOUNTAINS);
private static final int JUNGLE = Registry.BIOME.getId(Biomes.JUNGLE);
private static final int JUNGLE_HILLS = Registry.BIOME.getId(Biomes.JUNGLE_HILLS);
private static final int BADLANDS = Registry.BIOME.getId(Biomes.BADLANDS);
private static final int WOODED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.WOODED_BADLANDS_PLATEAU);
private static final int PLAINS = Registry.BIOME.getId(Biomes.PLAINS);
private static final int GIANT_TREE_TAIGA = Registry.BIOME.getId(Biomes.GIANT_TREE_TAIGA);
private static final int GIANT_TREE_TAIGA_HILLS = Registry.BIOME.getId(Biomes.GIANT_TREE_TAIGA_HILLS);
private static final int DARK_FOREST = Registry.BIOME.getId(Biomes.DARK_FOREST);
private static final int SAVANNA = Registry.BIOME.getId(Biomes.SAVANNA);
private static final int SAVANA_PLATEAU = Registry.BIOME.getId(Biomes.SAVANNA_PLATEAU);
private static final int TAIGA = Registry.BIOME.getId(Biomes.TAIGA);
private static final int SNOWY_TAIGA = Registry.BIOME.getId(Biomes.SNOWY_TAIGA);
private static final int SNOWY_TAIGA_HILLS = Registry.BIOME.getId(Biomes.SNOWY_TAIGA_HILLS);
private static final int TAIGA_HILLS = Registry.BIOME.getId(Biomes.TAIGA_HILLS);
@Override
public int apply(IContext context, AreaDimension dimension, IArea biomeArea, IArea riverAndSubBiomesInitArea, int x, int z)
public int func_215723_a(INoiseRandom context, IArea biomeArea, IArea riverAndSubBiomesInitArea, int x, int z)
{
int biomeId = biomeArea.getValue(x + 1, z + 1);
int initVal = riverAndSubBiomesInitArea.getValue(x + 1, z + 1);
@ -68,10 +66,10 @@ public enum GenLayerSubBiome implements IAreaTransformer2, IDimOffset1Transforme
Biome mutatedBiome;
if (!BOPLayerUtil.isShallowOcean(biomeId) && initVal >= 2 && tryRareBiome)
{
Biome biome = IRegistry.BIOME.get(biomeId);
Biome biome = Registry.BIOME.getByValue(biomeId);
if (biome == null || !biome.isMutation()) {
mutatedBiome = Biome.getMutationForBiome(biome);
return mutatedBiome == null ? biomeId : IRegistry.BIOME.getId(mutatedBiome);
return mutatedBiome == null ? biomeId : Registry.BIOME.getId(mutatedBiome);
}
}
@ -86,8 +84,8 @@ public enum GenLayerSubBiome implements IAreaTransformer2, IDimOffset1Transforme
if (subBiomeType == 0 && mutatedBiomeId != biomeId)
{
mutatedBiome = Biome.getMutationForBiome(IRegistry.BIOME.get(mutatedBiomeId));
mutatedBiomeId = mutatedBiome == null ? biomeId : IRegistry.BIOME.getId(mutatedBiome);
mutatedBiome = Biome.getMutationForBiome(Registry.BIOME.getByValue(mutatedBiomeId));
mutatedBiomeId = mutatedBiome == null ? biomeId : Registry.BIOME.getId(mutatedBiome);
}
if (mutatedBiomeId != biomeId)
@ -110,7 +108,7 @@ public enum GenLayerSubBiome implements IAreaTransformer2, IDimOffset1Transforme
return biomeId;
}
public int getCommonSubBiomeId(IContext context, int originalBiomeId)
public int getCommonSubBiomeId(INoiseRandom context, int originalBiomeId)
{
float rarity = (float)context.random(100) / 100.0f;
List<BOPClimates.WeightedBiomeEntry> weightedBiomeEntryList = Lists.newArrayList();
@ -140,11 +138,11 @@ public enum GenLayerSubBiome implements IAreaTransformer2, IDimOffset1Transforme
}
while (weight >= 0);
selectedBiomeId = IRegistry.BIOME.getId(item.biome);
selectedBiomeId = Registry.BIOME.getId(item.biome);
return selectedBiomeId;
}
public int getRareSubBiomeId(IContext context, int originalBiomeId)
public int getRareSubBiomeId(INoiseRandom context, int originalBiomeId)
{
int mutatedBiomeId = originalBiomeId;
if (originalBiomeId == DESERT) mutatedBiomeId = DESERT_HILLS;

View File

@ -10,7 +10,6 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.common.world.layer.traits.IBOPAreaTransformer0;
import biomesoplenty.common.world.layer.traits.IBOPContextExtended;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.gen.area.AreaDimension;
public enum GenLayerTemperatureLatitude implements IBOPAreaTransformer0
{
@ -22,11 +21,11 @@ public enum GenLayerTemperatureLatitude implements IBOPAreaTransformer0
private static final double AMPLITUDE = 8.9999D / HALF_PERIOD;
@Override
public int apply(IBOPContextExtended context, AreaDimension areaDimension, int x, int z)
public int apply(IBOPContextExtended context, int x, int z)
{
int offset = (int) (context.getWorldSeed() % ((int) (PERIOD * 2)));
double yOffset = z + areaDimension.getStartZ() + offset + ((context.random(1001) - 500) * OFFSET_VARIATION / 500.0D);
double yOffset = z + offset + ((context.random(1001) - 500) * OFFSET_VARIATION / 500.0D);
return MathHelper.floor(AMPLITUDE * Math.abs((Math.abs(yOffset % PERIOD) - HALF_PERIOD)));
}
}

View File

@ -10,7 +10,6 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.common.world.SimplexNoise;
import biomesoplenty.common.world.layer.traits.IBOPAreaTransformer0;
import biomesoplenty.common.world.layer.traits.IBOPContextExtended;
import net.minecraft.world.gen.area.AreaDimension;
public enum GenLayerTemperatureNoise implements IBOPAreaTransformer0
{
@ -26,11 +25,11 @@ public enum GenLayerTemperatureNoise implements IBOPAreaTransformer0
}
@Override
public int apply(IBOPContextExtended context, AreaDimension areaDimension, int x, int z)
public int apply(IBOPContextExtended context, int x, int z)
{
double xOffset = (double)(context.getWorldSeed() & 0xFFFFFF) * 0.000001D;
double zOffset = (double)(context.getWorldSeed() & 0xFFFFFF) * 0.000002D;
double noiseVal = SimplexNoise.noise((x + areaDimension.getStartX() + xOffset) * this.scale, (z + areaDimension.getStartZ() + zOffset) * this.scale);
double noiseVal = SimplexNoise.noise((x + xOffset) * this.scale, (z + zOffset) * this.scale);
// boundaries were determined empirically by analyzing statistically output from the SimplexNoise function, and splitting into 9 equally likely groups
if (noiseVal < -0.619D) return 0;

View File

@ -9,14 +9,13 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.common.world.layer.traits.IBOPAreaTransformer0;
import biomesoplenty.common.world.layer.traits.IBOPContextExtended;
import net.minecraft.world.gen.area.AreaDimension;
public enum GenLayerTemperatureRandom implements IBOPAreaTransformer0
{
INSTANCE;
@Override
public int apply(IBOPContextExtended context, AreaDimension areaDimension, int x, int z)
public int apply(IBOPContextExtended context, int x, int z)
{
return context.random(9);
}

View File

@ -7,29 +7,28 @@
******************************************************************************/
package biomesoplenty.common.world.layer.traits;
import net.minecraft.world.gen.IContext;
import net.minecraft.world.gen.IContextExtended;
import net.minecraft.world.gen.area.AreaDimension;
import net.minecraft.world.gen.IExtendedNoiseRandom;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.area.IArea;
import net.minecraft.world.gen.area.IAreaFactory;
import net.minecraft.world.gen.layer.traits.IDimTransformer;
public interface IAreaTransformer3 extends IDimTransformer
{
default <R extends IArea> IAreaFactory<R> apply(IContextExtended<R> context, IAreaFactory<R> areaFactory1, IAreaFactory<R> areaFactory2, IAreaFactory<R> areaFactory3)
default <R extends IArea> IAreaFactory<R> apply(IExtendedNoiseRandom<R> context, IAreaFactory<R> areaFactory1, IAreaFactory<R> areaFactory2, IAreaFactory<R> areaFactory3)
{
return (areaDimension) ->
return () ->
{
R area1 = areaFactory1.make(this.apply(areaDimension));
R area2 = areaFactory2.make(this.apply(areaDimension));
R area3 = areaFactory3.make(this.apply(areaDimension));
return context.makeArea(areaDimension, (x, z) ->
{
context.setPosition((long)(x + areaDimension.getStartX()), (long)(z + areaDimension.getStartZ()));
return this.apply(context, areaDimension, area1, area2, area3, x, z);
R area1 = areaFactory1.make();
R area2 = areaFactory2.make();
R area3 = areaFactory3.make();
return context.func_212861_a_((x, z) -> {
context.setPosition((long)x, (long)z);
return this.apply(context, area1, area2, area3, x, z);
});
};
}
int apply(IContext context, AreaDimension dimension, IArea area1, IArea area2, IArea area3, int x, int z);
int apply(INoiseRandom context, IArea area1, IArea area2, IArea area3, int x, int z);
}

View File

@ -7,8 +7,7 @@
******************************************************************************/
package biomesoplenty.common.world.layer.traits;
import net.minecraft.world.gen.IContextExtended;
import net.minecraft.world.gen.area.AreaDimension;
import net.minecraft.world.gen.IExtendedNoiseRandom;
import net.minecraft.world.gen.area.IArea;
import net.minecraft.world.gen.area.IAreaFactory;
@ -18,7 +17,7 @@ import net.minecraft.world.gen.area.IAreaFactory;
*/
public interface IBOPAreaTransformer0
{
default <R extends IArea> IAreaFactory<R> apply(IContextExtended<R> context)
default <R extends IArea> IAreaFactory<R> apply(IExtendedNoiseRandom<R> context)
{
if (!(context instanceof IBOPContextExtended))
throw new IllegalArgumentException("Context must be an IBOPContextExtended");
@ -26,14 +25,14 @@ public interface IBOPAreaTransformer0
IBOPContextExtended<R> bopContext = (IBOPContextExtended<R>)context;
// Create a new IAreaFactory
return (areaDimension) ->
return () ->
// Return a new IArea, with the below IPixelTransformer
context.makeArea(areaDimension, (x, z) ->
context.func_212861_a_((x, z) ->
{
context.setPosition((long)(x + areaDimension.getStartX()), (long)(z + areaDimension.getStartZ()));
return this.apply(bopContext, areaDimension, x, z);
context.setPosition((long)(x), (long)(z));
return this.apply(bopContext, x, z);
});
}
int apply(IBOPContextExtended context, AreaDimension areaDimension, int x, int z);
int apply(IBOPContextExtended context, int x, int z);
}

View File

@ -7,13 +7,13 @@
******************************************************************************/
package biomesoplenty.common.world.layer.traits;
import net.minecraft.world.gen.IContextExtended;
import net.minecraft.world.gen.IExtendedNoiseRandom;
import net.minecraft.world.gen.area.IArea;
/***
* Provides extra information beyond that used by Mojang.
*/
public interface IBOPContextExtended<R extends IArea> extends IContextExtended<R>
public interface IBOPContextExtended<R extends IArea> extends IExtendedNoiseRandom<R>
{
long getWorldSeed();
}

View File

@ -14,9 +14,9 @@ public class LazyAreaLayerContextBOP extends LazyAreaLayerContext implements IBO
{
private long worldSeed;
public LazyAreaLayerContextBOP(int maxCacheSize, int layerCount, long seed, long seedModifier)
public LazyAreaLayerContextBOP(int maxCacheSize, long seed, long seedModifier)
{
super(maxCacheSize, layerCount, seed, seedModifier);
super(maxCacheSize, seed, seedModifier);
this.worldSeed = seed;
}

View File

@ -82,8 +82,8 @@ import biomesoplenty.common.biome.overworld.WhiteBeachBiome;
import biomesoplenty.common.biome.overworld.WoodlandBiome;
import biomesoplenty.common.biome.overworld.XericShrublandBiome;
import biomesoplenty.common.world.WorldTypeBOP;
import net.minecraft.init.Biomes;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.world.biome.Biomes;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeDictionary.Type;
@ -300,7 +300,7 @@ public class ModBiomes
if (!child.isPresent())
return;
subBiomes.put(IRegistry.BIOME.getId(parent), new WeightedSubBiome(child.get(), rarity, weight));
subBiomes.put(Registry.BIOME.getId(parent), new WeightedSubBiome(child.get(), rarity, weight));
}
public static void registerSubBiome(Optional<Biome> parent, Optional<Biome> child, float rarity, int weight)
@ -311,12 +311,12 @@ public class ModBiomes
if (!child.isPresent())
return;
subBiomes.put(IRegistry.BIOME.getId(parent.get()), new WeightedSubBiome(child.get(), rarity, weight));
subBiomes.put(Registry.BIOME.getId(parent.get()), new WeightedSubBiome(child.get(), rarity, weight));
}
public static void registerIslandBiome(Biome biome, BOPClimates climate, int weight)
{
islandBiomes.add(IRegistry.BIOME.getId(biome));
islandBiomes.add(Registry.BIOME.getId(biome));
climate.addIslandBiome(weight, biome);
}