diff --git a/src/main/java/biomesoplenty/api/enums/BOPClimates.java b/src/main/java/biomesoplenty/api/enums/BOPClimates.java index b3317c8ae..fce2452a2 100644 --- a/src/main/java/biomesoplenty/api/enums/BOPClimates.java +++ b/src/main/java/biomesoplenty/api/enums/BOPClimates.java @@ -178,9 +178,9 @@ public enum BOPClimates public static class WeightedBiomeEntry { public final int weight; - public final RegistryKey biome; + public final Biome biome; - public WeightedBiomeEntry(int weight, RegistryKey biome) + public WeightedBiomeEntry(int weight, Biome biome) { this.weight = weight; this.biome = biome; diff --git a/src/main/java/biomesoplenty/client/util/BiomeMapColours.java b/src/main/java/biomesoplenty/client/util/BiomeMapColours.java deleted file mode 100644 index 1c4a0e5d8..000000000 --- a/src/main/java/biomesoplenty/client/util/BiomeMapColours.java +++ /dev/null @@ -1,280 +0,0 @@ -/******************************************************************************* - * Copyright 2014-2019, the Biomes O' Plenty Team - * - * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. - * - * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. - ******************************************************************************/ -package biomesoplenty.client.util; - -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.BlockModelShapes; -import net.minecraft.client.renderer.BlockRendererDispatcher; -import net.minecraft.client.renderer.color.BlockColors; -import net.minecraft.client.renderer.model.BakedQuad; -import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraft.util.Direction; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.Registry; -import net.minecraft.world.biome.Biome; -import net.minecraftforge.common.BiomeDictionary; - -import java.nio.ByteBuffer; -import java.security.MessageDigest; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; - -// Adapted from TTFTCUTS' work here -// https://github.com/TTFTCUTS/Pioneer/blob/master/src/main/java/ttftcuts/pioneer/map/MapColours.java -public class BiomeMapColours -{ - public static final boolean RANDOM_COLOURS = false; - public static Map biomeColours = new HashMap(); - public static Random rand = new Random(50); - - static - { - // Hardcoded colours - - // Temperature layer colours. 0 is cold, 8 is hot - /*biomeColours.put(0, 0x91CDFF); - biomeColours.put(1, 0x93DBFD); - biomeColours.put(2, 0x9CE3E9); - biomeColours.put(3, 0xA5EBD5); - biomeColours.put(4, 0xAEF3C1); - biomeColours.put(5, 0xCCF4A2); - biomeColours.put(6, 0xE8E9A0); - biomeColours.put(7, 0xF3D09D); - biomeColours.put(8, 0xFDB69B); - - // Rainfall layer colours. 0 is wet, 11 is dry. - biomeColours.put(0, 0x82FFE3); - biomeColours.put(1, 0x99FFD9); - biomeColours.put(2, 0xB1FFCE); - biomeColours.put(3, 0xC8FFC4); - biomeColours.put(4, 0xD7FDBE); - biomeColours.put(5, 0xDDF6BB); - biomeColours.put(6, 0xE3EEB8); - biomeColours.put(7, 0xE8E7B5); - biomeColours.put(8, 0xEEE0B2); - biomeColours.put(9, 0xF4D9AF); - biomeColours.put(10, 0xFAD1AC); - biomeColours.put(11, 0xFFCCAA);*/ - - // Climate colours. See the values in BOPClimates - /*biomeColours.put(0, 0xF3F3F3); - biomeColours.put(1, 0xCFE2F3); - biomeColours.put(2, 0xA2C4C9); - biomeColours.put(3, 0x45818E); - biomeColours.put(4, 0xD9EAD3); - biomeColours.put(5, 0xE6B8AF); - biomeColours.put(6, 0xD2EA98); - biomeColours.put(7, 0xA8EAB6); - biomeColours.put(8, 0x6AA84F); - biomeColours.put(9, 0x69EE79); - biomeColours.put(10, 0xEDFFB7); - biomeColours.put(11, 0xFCE39D); - biomeColours.put(12, 0xFFFBE0); - biomeColours.put(13, 0xA6947F);*/ - } - - public static int getBiomeMapColour(int biomeId) - { - if (RANDOM_COLOURS) - { - // Who can be bothered coming up with colours manually? - try - { - MessageDigest digest = MessageDigest.getInstance("SHA-256"); - return ByteBuffer.wrap(digest.digest(ByteBuffer.allocate(4).putInt(biomeId).array())).getInt() & 0xFFFFFF; - } - catch (Exception e) - { - return 0; - } - } - - if (biomeColours.containsKey(biomeId)) { - return biomeColours.get(biomeId); - } - - int colour = getBiomeMapColourRaw(Registry.BIOME.byId(biomeId)); - biomeColours.put(biomeId, colour); - return colour; - } - - public static int getBiomeMapColourRaw(Biome biome) - { - boolean treebased = false; - int colour = getTopColour(biome); - - if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.FOREST)) - { - colour = blend(biome.getFoliageColor(), 0xff0b7000, 0.35); - treebased = true; - } - - if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.LUSH) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.CONIFEROUS) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.JUNGLE)) - { - colour = blend(colour, 0xff0b7000, Math.min(0.25, 0.25f * 0.025)); - colour = brightness(colour, 1.0 - Math.min(0.1, 0.25f * 0.015)); - - if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.CONIFEROUS) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.JUNGLE)) - treebased = true; - } - - if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.RIVER) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN)) - { - colour = blend(colour, 0xff4582ff, 0.7); // sea blue - } - - if (biome.getDepth() > 0.0) - { - double mod = Math.min(biome.getDepth() * 0.2 + 1.0, 1.35); - colour = brightness(colour, mod); - } else if (biome.getDepth() <= -1.2) { - colour = brightness(colour, 0.9); - } - - if (treebased) - { - colour = temptint(colour, biome.getTemperature(new BlockPos(0, 64, 0))); - } - - if (biome.getTemperature() < 0.15F) - { - colour = blend(colour, 0xffffffff, 0.5); // icy pale cyan - //colour = blend(colour, 0xffc9e4ff, 0.25); - colour = brightness(colour, 1.2); - } - - return colour | 0xFF000000; - } - - public static int getTopColour(Biome biome) - { - BlockPos.Mutable pos = new BlockPos.Mutable(0,64,0); - return getBiomeBlockColourForCoords(biome, pos); - } - - public static int getBiomeBlockColourForCoords(Biome biome, BlockPos pos) - { - BlockState topBlock = biome.getSurfaceBuilder().getSurfaceBuilderConfiguration().getTopMaterial(); - int colour; - - if (topBlock == Blocks.GRASS.defaultBlockState()) - { // uuuugh - colour = topBlock.getMapColor(null, pos).col | 0xFF000000; - int tint = biome.getGrassColor(pos.getX(), pos.getZ()) | 0xFF000000; - colour = blend(colour, tint, 0.75); - } - else - { - colour = getBlockColourRaw(topBlock); - } - - return colour; - } - - public static int getBlockColourRaw(BlockState block) - { - Minecraft mc = Minecraft.getInstance(); - BlockRendererDispatcher brd = mc.getBlockRenderer(); - BlockModelShapes shapes = brd.getBlockModelShaper(); - BlockColors colours = mc.getBlockColors(); - - int colour = block.getMapColor(null, null).col | 0xFF000000; - int fallback = colour; - - if (block == Blocks.GRASS.defaultBlockState()) { - } - else - { - try - { - IBakedModel topmodel = shapes.getBlockModel(block); - List topquads = topmodel.getQuads(block, Direction.UP, rand); - - for (BakedQuad quad : topquads) - { - colour = block.getMapColor(null, null).col | 0xFF000000; - - if (quad.isTinted()) - { - int tint = colours.getColor(block, null, null, quad.getTintIndex()) | 0xFF000000; - colour = blend(colour, tint, 0.75); - } - } - - } catch (Exception e) { - e.printStackTrace(); - colour = fallback; - } - } - - return block.getMapColor(null, null).col | 0xFF000000; - } - - public static int intAverage(int a, int b) - { - return (int)( ((((a) ^ (b)) & 0xfffefefeL) >> 1) + ((a) & (b)) ); - } - - public static int blend(int a, int b, double mix) - { - if (mix == 0) { - return a; - } else if (mix == 1) { - return b; - } else if (mix == 0.5) { - return intAverage(a,b); - } - - int ar = (a & 0x00FF0000) >> 16; - int ag = (a & 0x0000FF00) >> 8; - int ab = (a & 0x000000FF); - - int br = (b & 0x00FF0000) >> 16; - int bg = (b & 0x0000FF00) >> 8; - int bb = (b & 0x000000FF); - - int mr = (int)Math.min(255,Math.max(0,Math.floor(ar * (1.0-mix) + br * mix))); - int mg = (int)Math.min(255,Math.max(0,Math.floor(ag * (1.0-mix) + bg * mix))); - int mb = (int)Math.min(255,Math.max(0,Math.floor(ab * (1.0-mix) + bb * mix))); - - return (mr << 16) | (mg << 8) | (mb) | 0xFF000000; - } - - public static int brightness(int col, double light) - { - int r = (col & 0x00FF0000) >> 16; - int g = (col & 0x0000FF00) >> 8; - int b = (col & 0x000000FF); - - r = (int)Math.min(255,Math.floor(r * light)); - g = (int)Math.min(255,Math.floor(g * light)); - b = (int)Math.min(255,Math.floor(b * light)); - - return (r << 16) | (g << 8) | (b) | 0xFF000000; - } - - public static int temptint(int col, double temp) - { - int r = (col & 0x00FF0000) >> 16; - int g = (col & 0x0000FF00) >> 8; - int b = (col & 0x000000FF); - - double limit = 0.25; - double factor = Math.max(-limit, Math.min(limit, (temp - 0.4) * 0.75)); - - r = (int)Math.min(255,Math.floor(r * (1+factor))); - g = (int)Math.min(255,Math.floor(g * (1+factor * 0.5))); - b = (int)Math.min(255,Math.floor(b * (1-factor * 2.5))); - - return (r << 16) | (g << 8) | (b) | 0xFF000000; - } -} diff --git a/src/main/java/biomesoplenty/client/util/GenLayerVisualizer.java b/src/main/java/biomesoplenty/client/util/GenLayerVisualizer.java deleted file mode 100644 index 5fa269a33..000000000 --- a/src/main/java/biomesoplenty/client/util/GenLayerVisualizer.java +++ /dev/null @@ -1,278 +0,0 @@ -/******************************************************************************* - * Copyright 2014-2019, the Biomes O' Plenty Team - * - * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. - * - * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. - ******************************************************************************/ -package biomesoplenty.client.util; - -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.biome.Biome; -import net.minecraft.world.biome.Biomes; -import org.lwjgl.glfw.GLFW; -import org.lwjgl.glfw.GLFWVidMode; -import org.lwjgl.opengl.GL; -import org.lwjgl.opengl.GL11; -import org.lwjgl.system.MemoryStack; - -import java.nio.IntBuffer; - -import static org.lwjgl.opengl.GL11.*; -import static org.lwjgl.opengl.GL13.GL_TEXTURE0; -import static org.lwjgl.opengl.GL13.glActiveTexture; -import static org.lwjgl.opengl.GL15.*; -import static org.lwjgl.opengl.GL20.*; -import static org.lwjgl.opengl.GL30.glBindVertexArray; -import static org.lwjgl.opengl.GL30.glGenVertexArrays; -import static org.lwjgl.system.MemoryStack.stackPush; - -public class GenLayerVisualizer -{ - private static VisualizerThread visualizerThread; - - public static void run() - { - visualizerThread = new VisualizerThread(); - visualizerThread.start(); - } - - private static class VisualizerThread extends Thread - { - private static final int WINDOW_WIDTH = 1000; - private static final int WINDOW_HEIGHT = 1000; - private static final int CANVAS_WIDTH = 100; - private static final int CANVAS_HEIGHT = 100; - - private static final String VERTEX_SHADER_SRC = - "#version 330\n" + - "layout(location = 0) in vec3 position;\n" + - "layout(location = 1) in vec2 vertexUV;\n" + - "out vec2 uv;\n" + - "void main()\n" + - "{\n" + - " gl_Position.xyz = position;\n" + - " gl_Position.w = 1.0;\n" + - " uv = vertexUV;\n" + - "}"; - - private static final String FRAGMENT_SHADER_SRC = - "#version 330\n" + - "in vec2 uv;\n" + - "out vec3 color;\n" + - "uniform sampler2D sampler;\n" + - "void main()\n" + - "{\n" + - " color = texture(sampler, uv).rgb;\n" + - "}"; - - int[] biomeIds = new int[CANVAS_WIDTH * CANVAS_HEIGHT]; - private int vertexBuffer = 0; - private int textureId = 0; - - private void setupOpenGL() - { - GL.createCapabilities(); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - int vertexArray = glGenVertexArrays(); - int programId = glCreateProgram(); - - glBindVertexArray(vertexArray); - int vertexShader = makeShader(GL_VERTEX_SHADER, VERTEX_SHADER_SRC); - int fragmentShader = makeShader(GL_FRAGMENT_SHADER, FRAGMENT_SHADER_SRC); - - glAttachShader(programId, vertexShader); - glAttachShader(programId, fragmentShader); - glLinkProgram(programId); - glUseProgram(programId); - - int[] linked = new int[1]; - glGetProgramiv(programId, GL_LINK_STATUS, linked); - - if (linked[0] == 0) - { - throw new RuntimeException("Failed to link shaders! " + glGetProgramInfoLog(programId)); - } - - glDetachShader(programId, vertexShader); - glDetachShader(programId, fragmentShader); - glDeleteShader(vertexShader); - glDeleteShader(fragmentShader); - - float VERTICES[] = - { - // Vertex 1 data - -1.0F, -1.0F, 0.0F, - -1.0F, 1.0F, 0.0F, - 1.0F, -1.0F, 0.0F, - - // Vertex 2 data - -1.0F, 1.0F, 0.0F, - 1.0F, 1.0F, 0.0F, - 1.0F, -1.0F, 0.0F, - - // UV 1 data - 0.0F, 0.0F, - 0.0F, 1.0F, - 1.0F, 0.0F, - - // UV 2 data - 0.0F, 1.0F, - 1.0F, 1.0F, - 1.0F, 0.0F - }; - - this.vertexBuffer = glGenBuffers(); - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); - glBufferData(GL_ARRAY_BUFFER, VERTICES, GL_STATIC_DRAW); - - // Specify the format and the offset of the vertex data (the pointer) - glVertexAttribPointer(0, 3, GL_FLOAT, false, 0, 0); - glVertexAttribPointer(1, 2, GL_FLOAT, false, 0, 72); - - // Enable the vertex attribute specified by the index - // This is stored in the currently bound VAO - glEnableVertexAttribArray(0); - glEnableVertexAttribArray(1); - - // Create a texture for the screen to be rendered to - this.textureId = glGenTextures(); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, textureId); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - } - - private void populateBiomeIds() - { - // FIXME -// OverworldBiomeProviderSettings settingsProvider = BiomeProviderType.VANILLA_LAYERED.createSettings(new WorldInfo(new WorldSettings(0, GameType.NOT_SET, true, false, ModBiomes.worldType), "MpServer")); -// OverworldGenSettings settings = settingsProvider.getGeneratorSettings(); -// -// LongFunction> contextFactory = (seedModifier) -> { -// return new LazyAreaLayerContextBOP(1, 0, seedModifier); -// }; -// -// IAreaFactory landAreaFactory = BOPLayerUtil.createInitialLandAndSeaFactory(contextFactory); -// IAreaFactory climateFactory = BOPLayerUtil.createClimateFactory(contextFactory, new BOPOverworldGenSettings()); -// IAreaFactory biomeAreaFactory = BOPLayerUtil.createBiomeFactory(landAreaFactory, climateFactory, contextFactory); -// -// //IAreaFactory biomeAreaFactory = BOPLayerUtil.createAreaFactories(WorldType.DEFAULT, settings, contextFactory).get(0); -// -// LazyArea area = biomeAreaFactory.make(); -// -// int startX = 5000; -// int startZ = 10000; -// -// for (int i = 0; i < CANVAS_HEIGHT ; ++i) -// { -// for (int j = 0; j < CANVAS_WIDTH ; ++j) -// { -// this.biomeIds[j + i * CANVAS_WIDTH] = area.get(startX + j, startZ + i); -// } -// } - } - - private int getColourForBiomeId(int biomeId, BlockPos pos) - { - return BiomeMapColours.getBiomeMapColour(biomeId); - /*BlockState topBlock = biome.getSurfaceBuilder().getConfig().getTop(); - - if (topBlock.getBlock() == Blocks.GRASS) - return biome.getGrassColor(pos); - else if (topBlock.getBlock() == Blocks.WATER || isOcean(biome) || biome == Biomes.RIVER || biome == Biomes.SWAMP) - return biome.getWaterColor(); - - return topBlock.getMaterialColor(null, pos).colorValue;*/ - } - - private void genTexture() - { - int[] textureColours = new int[CANVAS_WIDTH * CANVAS_HEIGHT]; - - // Translate colours into texture colours - for (int x = 0; x < CANVAS_WIDTH; x++) - { - for (int y = 0; y < CANVAS_HEIGHT; y++) - { - int color = getColourForBiomeId(this.biomeIds[x + y * CANVAS_WIDTH], new BlockPos(x, 0, y)); - - color = ((color >> 16) & 0xFF | color & 0xFF00 | (color << 16) & 0xFF0000); - - textureColours[x + ((CANVAS_WIDTH - 1) - y) * CANVAS_HEIGHT] = color; - } - } - - glBindTexture(GL_TEXTURE_2D, textureId); - glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA, CANVAS_WIDTH, CANVAS_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureColours); - } - - public void run() - { - // Create the window and setup glfw - long window = GLFW.glfwCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, "Gen Layer Visualizer", 0,0 ); - - if (window == 0) - throw new RuntimeException("Failed to create the GLFW window"); - - try ( MemoryStack stack = stackPush()) - { - IntBuffer pWidth = stack.mallocInt(1); // int* - IntBuffer pHeight = stack.mallocInt(1); // int* - - // Get the window size passed to glfwCreateWindow - GLFW.glfwGetWindowSize(window, pWidth, pHeight); - - // Get the resolution of the primary monitor - GLFWVidMode vidmode = GLFW.glfwGetVideoMode(GLFW.glfwGetPrimaryMonitor()); - - // Center the window - GLFW.glfwSetWindowPos(window, - (vidmode.width() - pWidth.get(0)) / 2, - (vidmode.height() - pHeight.get(0)) / 2 - ); - } - - GLFW.glfwMakeContextCurrent(window); - GLFW.glfwSwapInterval(1); // Enable V-Sync - GLFW.glfwShowWindow(window); - - this.setupOpenGL(); - this.populateBiomeIds(); - - while (!GLFW.glfwWindowShouldClose(window)) - { - GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); - - this.genTexture(); - glDrawArrays(GL_TRIANGLES, 0, 6); - - GLFW.glfwSwapBuffers(window); // swap the color buffers - GLFW.glfwPollEvents(); - } - } - - private static int makeShader(int type, String source) - { - int shader = glCreateShader(type); - glShaderSource(shader, source); - glCompileShader(shader); - - int[] compiled = new int[1]; - glGetShaderiv(shader, GL_COMPILE_STATUS, compiled); - - if (compiled[0] == 0) - { - throw new RuntimeException("Failed to compile shader! " + glGetShaderInfoLog(shader)); - } - - return shader; - } - - private static boolean isOcean(Biome biome) - { - return biome == Biomes.WARM_OCEAN || biome == Biomes.LUKEWARM_OCEAN || biome == Biomes.OCEAN || biome == Biomes.COLD_OCEAN || biome == Biomes.FROZEN_OCEAN || biome == Biomes.DEEP_WARM_OCEAN || biome == Biomes.DEEP_LUKEWARM_OCEAN || biome == Biomes.DEEP_OCEAN || biome == Biomes.DEEP_COLD_OCEAN || biome == Biomes.DEEP_FROZEN_OCEAN; - } - } -} diff --git a/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java b/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java index 8de51ccf8..b2f449a0e 100644 --- a/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java +++ b/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java @@ -9,6 +9,7 @@ package biomesoplenty.common.biome; import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.enums.BOPClimates; +import biomesoplenty.common.util.biome.BiomeUtil; import biomesoplenty.common.util.config.JsonUtil; import biomesoplenty.core.BiomesOPlenty; import biomesoplenty.init.ModBiomes; @@ -437,7 +438,7 @@ public class BiomeRegistry String childName = data.getChild().delegate.name().toString(); BiomesOPlenty.logger.debug(String.format("Sub biome %s weight set to %d", childName, data.getWeight())); - ModBiomes.subBiomes.put(Registry.BIOME.getId(data.getParent()), new ModBiomes.WeightedSubBiome(data.getChild(), data.getRarity(), data.getWeight())); + ModBiomes.subBiomes.put(BiomeUtil.getBiomeId(data.getParent()), new ModBiomes.WeightedSubBiome(data.getChild(), data.getRarity(), data.getWeight())); }), ISLAND_BIOME((SingleClimateRegistrationData data) -> { if (data.getWeight() == 0) @@ -448,7 +449,7 @@ public class BiomeRegistry String biomeName = data.getBiome().delegate.name().toString(); BiomesOPlenty.logger.debug(String.format("Island biome %s weight set to %d for climate %s", biomeName, data.getWeight(), data.getClimate().name())); - ModBiomes.islandBiomeIds.add(Registry.BIOME.getId(data.getBiome())); + ModBiomes.islandBiomeIds.add(BiomeUtil.getBiomeId(data.getBiome())); data.getClimate().addIslandBiome(data.getWeight(), data.getBiome()); }), VANILLA_BIOME((SingleClimateRegistrationData data) -> { diff --git a/src/main/java/biomesoplenty/common/block/FoliageBlockBOP.java b/src/main/java/biomesoplenty/common/block/FoliageBlockBOP.java index 449365f39..7bd337835 100644 --- a/src/main/java/biomesoplenty/common/block/FoliageBlockBOP.java +++ b/src/main/java/biomesoplenty/common/block/FoliageBlockBOP.java @@ -81,7 +81,7 @@ public class FoliageBlockBOP extends BushBlock implements IPlantable if (this == BOPBlocks.sprout) { - return ground.isFaceSturdy(groundState, worldIn, pos.below(), Direction.UP) || super.canSurvive(state, worldIn, pos); + return groundState.isFaceSturdy(worldIn, pos.below(), Direction.UP) || super.canSurvive(state, worldIn, pos); } if (this == BOPBlocks.dune_grass) { diff --git a/src/main/java/biomesoplenty/common/block/MushroomBlockBOP.java b/src/main/java/biomesoplenty/common/block/MushroomBlockBOP.java index e376d54b9..293a4dc3b 100644 --- a/src/main/java/biomesoplenty/common/block/MushroomBlockBOP.java +++ b/src/main/java/biomesoplenty/common/block/MushroomBlockBOP.java @@ -62,7 +62,7 @@ public class MushroomBlockBOP extends MushroomBlock implements IGrowable configuredfeature = BOPBiomeFeatures.HUGE_TOADSTOOL.configured(IFeatureConfig.NONE); } - if (configuredfeature.place(world, world.structureFeatureManager(), world.getChunkSource().getGenerator(), p_226940_4_, p_226940_2_)) + if (configuredfeature.place(world, world.getChunkSource().getGenerator(), p_226940_4_, p_226940_2_)) { return true; } diff --git a/src/main/java/biomesoplenty/common/block/trees/BigTreeDefaultConfig.java b/src/main/java/biomesoplenty/common/block/trees/BigTreeDefaultConfig.java index ebd8b6dbb..86a2dfe6a 100644 --- a/src/main/java/biomesoplenty/common/block/trees/BigTreeDefaultConfig.java +++ b/src/main/java/biomesoplenty/common/block/trees/BigTreeDefaultConfig.java @@ -62,7 +62,7 @@ public abstract class BigTreeDefaultConfig extends BigTree else { world.setBlock(pos, Blocks.AIR.defaultBlockState(), 4); - if (feature.place(world, world.structureFeatureManager(), generator, random, pos, Features.OAK.config())) + if (feature.place(world, generator, random, pos, Features.OAK.config())) { return true; } @@ -89,7 +89,7 @@ public abstract class BigTreeDefaultConfig extends BigTree world.setBlock(pos.offset(x + 1, 0, z), blockstate, 4); world.setBlock(pos.offset(x, 0, z + 1), blockstate, 4); world.setBlock(pos.offset(x + 1, 0, z + 1), blockstate, 4); - if (feature.place(world, world.structureFeatureManager(), generator, random, pos.offset(x, 0, z), Features.OAK.config())) + if (feature.place(world, generator, random, pos.offset(x, 0, z), Features.OAK.config())) { return true; } diff --git a/src/main/java/biomesoplenty/common/block/trees/TreeDefaultConfig.java b/src/main/java/biomesoplenty/common/block/trees/TreeDefaultConfig.java index 78e730a92..5308d2bfe 100644 --- a/src/main/java/biomesoplenty/common/block/trees/TreeDefaultConfig.java +++ b/src/main/java/biomesoplenty/common/block/trees/TreeDefaultConfig.java @@ -42,7 +42,7 @@ public abstract class TreeDefaultConfig extends Tree else { world.setBlock(pos, Blocks.AIR.defaultBlockState(), 4); - if (feature.place(world, world.structureFeatureManager(), generator, random, pos, Features.OAK.config())) + if (feature.place(world, generator, random, pos, Features.OAK.config())) { return true; } diff --git a/src/main/java/biomesoplenty/common/world/BOPLayerUtil.java b/src/main/java/biomesoplenty/common/world/BOPLayerUtil.java index 4ecdb78fd..114981bbe 100644 --- a/src/main/java/biomesoplenty/common/world/BOPLayerUtil.java +++ b/src/main/java/biomesoplenty/common/world/BOPLayerUtil.java @@ -7,6 +7,7 @@ ******************************************************************************/ package biomesoplenty.common.world; +import biomesoplenty.common.util.biome.BiomeUtil; import biomesoplenty.common.world.layer.*; import biomesoplenty.common.world.layer.traits.LazyAreaLayerContextBOP; import net.minecraft.util.registry.Registry; @@ -21,16 +22,16 @@ import java.util.function.LongFunction; public class BOPLayerUtil { - 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 final int WARM_OCEAN = BiomeUtil.getBiomeId(Biomes.WARM_OCEAN); + public static final int LUKEWARM_OCEAN = BiomeUtil.getBiomeId(Biomes.LUKEWARM_OCEAN); + public static final int OCEAN = BiomeUtil.getBiomeId(Biomes.OCEAN); + public static final int COLD_OCEAN = BiomeUtil.getBiomeId(Biomes.COLD_OCEAN); + public static final int FROZEN_OCEAN = BiomeUtil.getBiomeId(Biomes.FROZEN_OCEAN); + public static final int DEEP_WARM_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_WARM_OCEAN); + public static final int DEEP_LUKEWARM_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_LUKEWARM_OCEAN); + public static final int DEEP_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_OCEAN); + public static final int DEEP_COLD_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_COLD_OCEAN); + public static final int DEEP_FROZEN_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_FROZEN_OCEAN); public static > IAreaFactory createInitialLandAndSeaFactory(LongFunction contextFactory) { diff --git a/src/main/java/biomesoplenty/common/world/BOPNetherBiomeProvider.java b/src/main/java/biomesoplenty/common/world/BOPNetherBiomeProvider.java index 1e4265de7..de7699ad9 100644 --- a/src/main/java/biomesoplenty/common/world/BOPNetherBiomeProvider.java +++ b/src/main/java/biomesoplenty/common/world/BOPNetherBiomeProvider.java @@ -11,6 +11,7 @@ import biomesoplenty.api.enums.BOPClimates; import com.google.common.collect.ImmutableList; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.util.RegistryKey; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; import net.minecraft.world.biome.provider.BiomeProvider; @@ -24,7 +25,7 @@ public class BOPNetherBiomeProvider extends BiomeProvider { public static final Codec CODEC = RecordCodecBuilder.create((builder) -> builder.group(Codec.LONG.fieldOf("seed").stable().forGetter((biomeProvider) -> biomeProvider.seed)).apply(builder, builder.stable(BOPNetherBiomeProvider::new))); - private static final List VANILLA_POSSIBLE_BIOMES = ImmutableList.of(Biomes.NETHER_WASTES, Biomes.SOUL_SAND_VALLEY, Biomes.CRIMSON_FOREST, Biomes.WARPED_FOREST, Biomes.BASALT_DELTAS); + private static final List> VANILLA_POSSIBLE_BIOMES = ImmutableList.of(Biomes.NETHER_WASTES, Biomes.SOUL_SAND_VALLEY, Biomes.CRIMSON_FOREST, Biomes.WARPED_FOREST, Biomes.BASALT_DELTAS); private final long seed; private final Layer noiseBiomeLayer; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/BigPumpkinFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/BigPumpkinFeature.java index 9e0f5104e..06b0b790e 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/BigPumpkinFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/BigPumpkinFeature.java @@ -27,7 +27,7 @@ public class BigPumpkinFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.below();} diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/BlackSandstoneColumnFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/BlackSandstoneColumnFeature.java index 75a354652..8e17a55cd 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/BlackSandstoneColumnFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/BlackSandstoneColumnFeature.java @@ -31,22 +31,24 @@ public class BlackSandstoneColumnFeature extends Feature { super(p_i231925_1_); } - public boolean place(ISeedReader p_230362_1_, StructureManager p_230362_2_, ChunkGenerator p_230362_3_, Random p_230362_4_, BlockPos p_230362_5_, ColumnConfig p_230362_6_) { + @Override + public boolean place(ISeedReader p_230362_1_, ChunkGenerator p_230362_3_, Random rand, BlockPos p_230362_5_, ColumnConfig config) + { int i = p_230362_3_.getSeaLevel(); BlockPos blockpos = findSurface(p_230362_1_, i, p_230362_5_.mutable().clamp(Direction.Axis.Y, 1, p_230362_1_.getMaxBuildHeight() - 1), Integer.MAX_VALUE); if (blockpos == null) { return false; } else { - int j = calculateHeight(p_230362_4_, p_230362_6_); - boolean flag = p_230362_4_.nextFloat() < 0.9F; + int j = config.height().sample(rand); + boolean flag = rand.nextFloat() < 0.9F; int k = Math.min(j, flag ? 5 : 8); int l = flag ? 50 : 15; boolean flag1 = false; - for(BlockPos blockpos1 : BlockPos.randomBetweenClosed(p_230362_4_, l, blockpos.getX() - k, blockpos.getY(), blockpos.getZ() - k, blockpos.getX() + k, blockpos.getY(), blockpos.getZ() + k)) { + for(BlockPos blockpos1 : BlockPos.randomBetweenClosed(rand, l, blockpos.getX() - k, blockpos.getY(), blockpos.getZ() - k, blockpos.getX() + k, blockpos.getY(), blockpos.getZ() + k)) { int i1 = j - blockpos1.distManhattan(blockpos); if (i1 >= 0) { - flag1 |= this.placeColumn(p_230362_1_, i, blockpos1, i1, calculateReach(p_230362_4_, p_230362_6_)); + flag1 |= this.placeColumn(p_230362_1_, i, blockpos1, i1, config.reach().sample(rand)); } } @@ -117,16 +119,8 @@ public class BlackSandstoneColumnFeature extends Feature { return null; } - private static int calculateHeight(Random p_236250_0_, ColumnConfig p_236250_1_) { - return p_236250_1_.minimumHeight + p_236250_0_.nextInt(p_236250_1_.maximumHeight - p_236250_1_.minimumHeight + 1); - } - - private static int calculateReach(Random p_236251_0_, ColumnConfig p_236251_1_) { - return p_236251_1_.minimumReach + p_236251_0_.nextInt(p_236251_1_.maximumReach - p_236251_1_.minimumReach + 1); - } - private static boolean isAirOrLavaOcean(IWorld p_236247_0_, int p_236247_1_, BlockPos p_236247_2_) { BlockState blockstate = p_236247_0_.getBlockState(p_236247_2_); - return blockstate.isAir() || blockstate.getBlock() instanceof BushBlock || blockstate.is(Blocks.LAVA) && p_236247_2_.getY() <= p_236247_1_; + return blockstate.isAir() || blockstate.is(Blocks.LAVA) && p_236247_2_.getY() <= p_236247_1_; } } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/BoneSpineFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/BoneSpineFeature.java index e75fb7207..91ed9b271 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/BoneSpineFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/BoneSpineFeature.java @@ -27,7 +27,7 @@ public class BoneSpineFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager p_230362_2_, ChunkGenerator p_230362_3_, Random rand, BlockPos startPos, NoFeatureConfig p_230362_6_) + public boolean place(ISeedReader world, ChunkGenerator p_230362_3_, Random rand, BlockPos startPos, NoFeatureConfig p_230362_6_) { while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.below();} diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/BrambleFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/BrambleFeature.java index cd73f02e2..90eeb1cc3 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/BrambleFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/BrambleFeature.java @@ -43,7 +43,7 @@ public class BrambleFeature extends Feature protected IBlockPosQuery replace = (world, pos) -> world.getBlockState(pos).getMaterial() == Material.AIR; @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { for (int i = 0; i < 128; ++i) { diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/FernGrassFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/FernGrassFeature.java index bfa41566e..2b1d6ae6a 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/FernGrassFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/FernGrassFeature.java @@ -33,7 +33,7 @@ public class FernGrassFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { BlockState BlockState = this.chooseGrassState(rand); diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/FleshTendonFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/FleshTendonFeature.java index 7b0fe8130..99005f323 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/FleshTendonFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/FleshTendonFeature.java @@ -43,7 +43,7 @@ public class FleshTendonFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator generator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator generator, Random rand, BlockPos pos, NoFeatureConfig config) { BlockState below = world.getBlockState(pos.below()); if (!below.is(BOPBlocks.flesh)) diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/GrassSplatterFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/GrassSplatterFeature.java index 7fd8865f9..80f863d33 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/GrassSplatterFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/GrassSplatterFeature.java @@ -21,7 +21,7 @@ public class GrassSplatterFeature extends Feature } @Override - public boolean place(ISeedReader worldIn, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader worldIn, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; int j = rand.nextInt(8 - 2) + 2; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/HeathFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/HeathFeature.java index 014fb7d5e..fad45d6ef 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/HeathFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/HeathFeature.java @@ -21,7 +21,7 @@ public class HeathFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/HugeGlowshroomFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/HugeGlowshroomFeature.java index 8aee06768..60701c5a2 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/HugeGlowshroomFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/HugeGlowshroomFeature.java @@ -28,7 +28,7 @@ public class HugeGlowshroomFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { while (startPos.getY() > 1 && this.replace.matches(world, startPos)) { startPos = startPos.below(); } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/HugeToadstoolFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/HugeToadstoolFeature.java index 4b12136b4..21751ee3a 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/HugeToadstoolFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/HugeToadstoolFeature.java @@ -28,7 +28,7 @@ public class HugeToadstoolFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { while (startPos.getY() > 1 && this.replace.matches(world, startPos)) { startPos = startPos.below(); } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/LargeCrystalFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/LargeCrystalFeature.java index 22070fa83..d1119b5f9 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/LargeCrystalFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/LargeCrystalFeature.java @@ -35,7 +35,7 @@ public class LargeCrystalFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager p_230362_2_, ChunkGenerator p_230362_3_, Random rand, BlockPos pos, NoFeatureConfig p_230362_6_) + public boolean place(ISeedReader world, ChunkGenerator p_230362_3_, Random rand, BlockPos pos, NoFeatureConfig p_230362_6_) { if (!world.isEmptyBlock(pos)) { diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/MangroveFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/MangroveFeature.java index 32f63b7d6..a14eb0159 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/MangroveFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/MangroveFeature.java @@ -24,7 +24,7 @@ public class MangroveFeature extends Feature { } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; BlockState blockstate = BOPBlocks.mangrove_root.defaultBlockState(); diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/MyceliumSplatterFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/MyceliumSplatterFeature.java index ce2b71739..65b6bcd35 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/MyceliumSplatterFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/MyceliumSplatterFeature.java @@ -20,7 +20,7 @@ public class MyceliumSplatterFeature extends Feature } @Override - public boolean place(ISeedReader worldIn, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader worldIn, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; int j = rand.nextInt(8 - 2) + 2; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/NetherVinesFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/NetherVinesFeature.java index 4fc8be758..e6cac8074 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/NetherVinesFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/NetherVinesFeature.java @@ -32,7 +32,7 @@ public class NetherVinesFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.below();} diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/NetherWartFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/NetherWartFeature.java index 0785c32bd..fb80a065f 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/NetherWartFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/NetherWartFeature.java @@ -20,7 +20,7 @@ public class NetherWartFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/ObsidianSplatterFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/ObsidianSplatterFeature.java index 75adb288f..9d6837b1a 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/ObsidianSplatterFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/ObsidianSplatterFeature.java @@ -20,7 +20,7 @@ public class ObsidianSplatterFeature extends Feature } @Override - public boolean place(ISeedReader worldIn, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader worldIn, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; int j = rand.nextInt(8 - 2) + 2; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/PodzolSplatterFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/PodzolSplatterFeature.java index d13a47bbb..6966c41d5 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/PodzolSplatterFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/PodzolSplatterFeature.java @@ -20,7 +20,7 @@ public class PodzolSplatterFeature extends Feature } @Override - public boolean place(ISeedReader worldIn, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader worldIn, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; int j = rand.nextInt(8 - 2) + 2; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/PumpkinPatchFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/PumpkinPatchFeature.java index 21bbdb5f9..1e5be7025 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/PumpkinPatchFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/PumpkinPatchFeature.java @@ -22,7 +22,7 @@ public class PumpkinPatchFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/ScatteredRocksFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/ScatteredRocksFeature.java index 87b36cb7b..7940930f0 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/ScatteredRocksFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/ScatteredRocksFeature.java @@ -19,7 +19,7 @@ public class ScatteredRocksFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/ScrubFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/ScrubFeature.java index e3709eca1..b3fab741e 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/ScrubFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/ScrubFeature.java @@ -20,7 +20,7 @@ public class ScrubFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/ShortBambooFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/ShortBambooFeature.java index a4154d61d..40db7cf75 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/ShortBambooFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/ShortBambooFeature.java @@ -31,7 +31,7 @@ public class ShortBambooFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { while (pos.getY() > 1 && this.replace.matches(world, pos)) {pos = pos.below();} diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/SmallBrownMushroomFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/SmallBrownMushroomFeature.java index 735afe61f..54461ace0 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/SmallBrownMushroomFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/SmallBrownMushroomFeature.java @@ -27,7 +27,7 @@ public class SmallBrownMushroomFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { while (startPos.getY() > 1 && this.replace.matches(world, startPos)) { startPos = startPos.below(); } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/SmallCrystalFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/SmallCrystalFeature.java index 4aba9a1a5..b1e50ed45 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/SmallCrystalFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/SmallCrystalFeature.java @@ -24,7 +24,7 @@ public class SmallCrystalFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { int i = 0; diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/SmallGlowshroomFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/SmallGlowshroomFeature.java index 0dbf602ec..f78dc71eb 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/SmallGlowshroomFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/SmallGlowshroomFeature.java @@ -28,7 +28,7 @@ public class SmallGlowshroomFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { while (startPos.getY() > 1 && this.replace.matches(world, startPos)) { startPos = startPos.below(); } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/SmallRedMushroomFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/SmallRedMushroomFeature.java index 9c4f16a00..deb5dfb0b 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/SmallRedMushroomFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/SmallRedMushroomFeature.java @@ -27,7 +27,7 @@ public class SmallRedMushroomFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { while (startPos.getY() > 1 && this.replace.matches(world, startPos)) { startPos = startPos.below(); } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/SmallToadstoolFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/SmallToadstoolFeature.java index 6a7476fd4..14f9f8eef 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/SmallToadstoolFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/SmallToadstoolFeature.java @@ -28,7 +28,7 @@ public class SmallToadstoolFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos startPos, NoFeatureConfig config) { while (startPos.getY() > 1 && this.replace.matches(world, startPos)) { startPos = startPos.below(); } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/StandardGrassFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/StandardGrassFeature.java index d4886c4d6..f2b22a998 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/StandardGrassFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/StandardGrassFeature.java @@ -33,7 +33,7 @@ public class StandardGrassFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { BlockState BlockState = this.chooseGrassState(rand); diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/WastelandGrassFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/WastelandGrassFeature.java index d227c47a2..5e37d1d6f 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/WastelandGrassFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/WastelandGrassFeature.java @@ -33,7 +33,7 @@ public class WastelandGrassFeature extends Feature } @Override - public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) + public boolean place(ISeedReader world, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config) { BlockState BlockState = this.chooseGrassState(rand); diff --git a/src/main/java/biomesoplenty/common/world/layer/BOPBiomeEdgeLayer.java b/src/main/java/biomesoplenty/common/world/layer/BOPBiomeEdgeLayer.java index d62c57c35..d82f18b30 100644 --- a/src/main/java/biomesoplenty/common/world/layer/BOPBiomeEdgeLayer.java +++ b/src/main/java/biomesoplenty/common/world/layer/BOPBiomeEdgeLayer.java @@ -8,6 +8,7 @@ package biomesoplenty.common.world.layer; import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.common.util.biome.BiomeUtil; import net.minecraft.util.registry.Registry; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; @@ -21,22 +22,22 @@ public enum BOPBiomeEdgeLayer implements ICastleTransformer { INSTANCE; - 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_HILLS = Registry.BIOME.getId(Biomes.JUNGLE_HILLS); - 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); + private static final int DESERT = BiomeUtil.getBiomeId(Biomes.DESERT); + private static final int MOUNTAINS = BiomeUtil.getBiomeId(Biomes.MOUNTAINS); + private static final int WOODED_MOUNTAINS = BiomeUtil.getBiomeId(Biomes.WOODED_MOUNTAINS); + private static final int SNOWY_TUNDRA = BiomeUtil.getBiomeId(Biomes.SNOWY_TUNDRA); + private static final int JUNGLE = BiomeUtil.getBiomeId(Biomes.JUNGLE); + private static final int JUNGLE_HILLS = BiomeUtil.getBiomeId(Biomes.JUNGLE_HILLS); + private static final int JUNGLE_EDGE = BiomeUtil.getBiomeId(Biomes.JUNGLE_EDGE); + private static final int BADLANDS = BiomeUtil.getBiomeId(Biomes.BADLANDS); + private static final int BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.BADLANDS_PLATEAU); + private static final int WOODED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.WOODED_BADLANDS_PLATEAU); + private static final int PLAINS = BiomeUtil.getBiomeId(Biomes.PLAINS); + private static final int GIANT_TREE_TAIGA = BiomeUtil.getBiomeId(Biomes.GIANT_TREE_TAIGA); + private static final int MOUNTAIN_EDGE = BiomeUtil.getBiomeId(Biomes.MOUNTAIN_EDGE); + private static final int SWAMP = BiomeUtil.getBiomeId(Biomes.SWAMP); + private static final int TAIGA = BiomeUtil.getBiomeId(Biomes.TAIGA); + private static final int SNOWY_TAIGA = BiomeUtil.getBiomeId(Biomes.SNOWY_TAIGA); @Override public int apply(INoiseRandom context, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId) @@ -108,12 +109,12 @@ public enum BOPBiomeEdgeLayer implements ICastleTransformer private boolean replaceBiomeEdge(int[] outId, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId, Optional fromBiome, Optional toBiome) { - return fromBiome.isPresent() && toBiome.isPresent() && this.replaceBiomeEdge(outId, northBiomeId, eastBiomeId, southBiomeId, westBiomeId, biomeId, Registry.BIOME.getId(fromBiome.get()), Registry.BIOME.getId(toBiome.get())); + return fromBiome.isPresent() && toBiome.isPresent() && this.replaceBiomeEdge(outId, northBiomeId, eastBiomeId, southBiomeId, westBiomeId, biomeId, BiomeUtil.getBiomeId(fromBiome.get()), BiomeUtil.getBiomeId(toBiome.get())); } private boolean replaceBiomeEdge(int[] outId, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId, Optional fromBiome, int toBiome) { - return fromBiome.isPresent() && this.replaceBiomeEdge(outId, northBiomeId, eastBiomeId, southBiomeId, westBiomeId, biomeId, Registry.BIOME.getId(fromBiome.get()), toBiome); + return fromBiome.isPresent() && this.replaceBiomeEdge(outId, northBiomeId, eastBiomeId, southBiomeId, westBiomeId, biomeId, BiomeUtil.getBiomeId(fromBiome.get()), toBiome); } private boolean replaceBiomeEdge(int[] outId, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId, int fromBiome, int toBiome) diff --git a/src/main/java/biomesoplenty/common/world/layer/BOPBiomeLayer.java b/src/main/java/biomesoplenty/common/world/layer/BOPBiomeLayer.java index 2135bdd91..f50394553 100644 --- a/src/main/java/biomesoplenty/common/world/layer/BOPBiomeLayer.java +++ b/src/main/java/biomesoplenty/common/world/layer/BOPBiomeLayer.java @@ -8,6 +8,7 @@ package biomesoplenty.common.world.layer; import biomesoplenty.api.enums.BOPClimates; +import biomesoplenty.common.util.biome.BiomeUtil; import biomesoplenty.init.ModBiomes; import net.minecraft.util.registry.Registry; import net.minecraft.world.biome.Biomes; @@ -21,8 +22,8 @@ public enum BOPBiomeLayer implements IAreaTransformer2, IDimOffset0Transformer { INSTANCE; - private static final int DEEP_OCEAN = Registry.BIOME.getId(Biomes.DEEP_OCEAN); - private static final int MUSHROOM_FIELDS = Registry.BIOME.getId(Biomes.MUSHROOM_FIELDS); + private static final int DEEP_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_OCEAN); + private static final int MUSHROOM_FIELDS = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELDS); @Override public int applyPixel(INoiseRandom context, IArea area1, IArea area2, int x, int z) @@ -47,7 +48,7 @@ public enum BOPBiomeLayer implements IAreaTransformer2, IDimOffset0Transformer // At this point, oceans and land have been assigned, and so have mushroom islands if (landSeaVal == DEEP_OCEAN) { - return Registry.BIOME.getId(climate.getRandomOceanBiome(context, true)); + return BiomeUtil.getBiomeId(climate.getRandomOceanBiome(context, true)); } else if ((landSeaVal == MUSHROOM_FIELDS || ModBiomes.islandBiomeIds.contains(landSeaVal)) && climate.biomeType != BiomeManager.BiomeType.ICY) // TODO { @@ -56,11 +57,11 @@ public enum BOPBiomeLayer implements IAreaTransformer2, IDimOffset0Transformer } else if (landSeaVal == 0) { - return Registry.BIOME.getId(climate.getRandomOceanBiome(context, false)); + return BiomeUtil.getBiomeId(climate.getRandomOceanBiome(context, false)); } else { - return Registry.BIOME.getId(climate.getRandomBiome(context, Biomes.OCEAN)); + return BiomeUtil.getBiomeId(climate.getRandomBiome(context, Biomes.OCEAN)); } } } diff --git a/src/main/java/biomesoplenty/common/world/layer/BOPMixOceansLayer.java b/src/main/java/biomesoplenty/common/world/layer/BOPMixOceansLayer.java index eaf03ffc8..e88743b5e 100644 --- a/src/main/java/biomesoplenty/common/world/layer/BOPMixOceansLayer.java +++ b/src/main/java/biomesoplenty/common/world/layer/BOPMixOceansLayer.java @@ -62,7 +62,7 @@ public enum BOPMixOceansLayer implements IAreaTransformer3, IDimOffset0Transform case WASTELAND: if (BOPBiomes.wasteland.isPresent()) { - oceanId = Registry.BIOME.getId(BOPBiomes.wasteland.get()); + oceanId = BiomeUtil.getBiomeId(BOPBiomes.wasteland.get()); } // Fallthrough @@ -120,9 +120,9 @@ public enum BOPMixOceansLayer implements IAreaTransformer3, IDimOffset0Transform return BOPLayerUtil.DEEP_FROZEN_OCEAN; } - if (BOPBiomes.wasteland.isPresent() && oceanId == Registry.BIOME.getId(BOPBiomes.wasteland.get())) + if (BOPBiomes.wasteland.isPresent() && oceanId == BiomeUtil.getBiomeId(BOPBiomes.wasteland.get())) { - return Registry.BIOME.getId(BOPBiomes.wasteland.get()); + return BiomeUtil.getBiomeId(BOPBiomes.wasteland.get()); } } diff --git a/src/main/java/biomesoplenty/common/world/layer/BOPRiverMixLayer.java b/src/main/java/biomesoplenty/common/world/layer/BOPRiverMixLayer.java index 2711efcd9..4d7288ae6 100644 --- a/src/main/java/biomesoplenty/common/world/layer/BOPRiverMixLayer.java +++ b/src/main/java/biomesoplenty/common/world/layer/BOPRiverMixLayer.java @@ -21,11 +21,11 @@ public enum BOPRiverMixLayer implements IAreaTransformer2, IDimOffset0Transforme { INSTANCE; - 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); + private static final int FROZEN_RIVER = BiomeUtil.getBiomeId(Biomes.FROZEN_RIVER); + private static final int SNOWY_TUNDRA = BiomeUtil.getBiomeId(Biomes.SNOWY_TUNDRA); + private static final int MUSHROOM_FIELDS = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELDS); + private static final int MUSHROOM_FIELD_SHORE = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELD_SHORE); + private static final int RIVER = BiomeUtil.getBiomeId(Biomes.RIVER); @Override public int applyPixel(INoiseRandom context, IArea biomeArea, IArea riverArea, int x, int z) diff --git a/src/main/java/biomesoplenty/common/world/layer/BOPShoreLayer.java b/src/main/java/biomesoplenty/common/world/layer/BOPShoreLayer.java index ba63d794c..f2682d676 100644 --- a/src/main/java/biomesoplenty/common/world/layer/BOPShoreLayer.java +++ b/src/main/java/biomesoplenty/common/world/layer/BOPShoreLayer.java @@ -22,28 +22,28 @@ public enum BOPShoreLayer implements ICastleTransformer { INSTANCE; - 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); + private static final int BEACH = BiomeUtil.getBiomeId(Biomes.BEACH); + private static final int SNOWY_BEACH = BiomeUtil.getBiomeId(Biomes.SNOWY_BEACH); + private static final int DESERT = BiomeUtil.getBiomeId(Biomes.DESERT); + private static final int MOUNTAINS = BiomeUtil.getBiomeId(Biomes.MOUNTAINS); + private static final int WOODED_MOUNTAINS = BiomeUtil.getBiomeId(Biomes.WOODED_MOUNTAINS); + private static final int FOREST = BiomeUtil.getBiomeId(Biomes.FOREST); + private static final int JUNGLE = BiomeUtil.getBiomeId(Biomes.JUNGLE); + private static final int JUNGLE_EDGE = BiomeUtil.getBiomeId(Biomes.JUNGLE_EDGE); + private static final int JUNGLE_HILLS = BiomeUtil.getBiomeId(Biomes.JUNGLE_HILLS); + private static final int BADLANDS = BiomeUtil.getBiomeId(Biomes.BADLANDS); + private static final int WOODED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.WOODED_BADLANDS_PLATEAU); + private static final int BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.BADLANDS_PLATEAU); + private static final int ERODED_BADLANDS = BiomeUtil.getBiomeId(Biomes.ERODED_BADLANDS); + private static final int MODIFIED_WOODED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU); + private static final int MODIFIED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.MODIFIED_BADLANDS_PLATEAU); + private static final int MUSHROOM_FIELDS = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELDS); + private static final int MUSHROOM_FIELD_SHORE = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELD_SHORE); + private static final int RIVER = BiomeUtil.getBiomeId(Biomes.RIVER); + private static final int MOUNTAIN_EDGE = BiomeUtil.getBiomeId(Biomes.MOUNTAIN_EDGE); + private static final int STONE_SHORE = BiomeUtil.getBiomeId(Biomes.STONE_SHORE); + private static final int SWAMP = BiomeUtil.getBiomeId(Biomes.SWAMP); + private static final int TAIGA = BiomeUtil.getBiomeId(Biomes.TAIGA); @Override public int apply(INoiseRandom context, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId) @@ -133,7 +133,7 @@ public enum BOPShoreLayer implements ICastleTransformer private static int getBiomeIdIfPresent(Optional biome, int fallbackId) { - return biome.isPresent() ? Registry.BIOME.getId(biome.get()) : fallbackId; + return biome.isPresent() ? BiomeUtil.getBiomeId(biome.get()) : fallbackId; } private static boolean isJungleCompatible(int biomeId) diff --git a/src/main/java/biomesoplenty/common/world/layer/LargeIslandLayer.java b/src/main/java/biomesoplenty/common/world/layer/LargeIslandLayer.java index 37759ffa1..74575a8e3 100644 --- a/src/main/java/biomesoplenty/common/world/layer/LargeIslandLayer.java +++ b/src/main/java/biomesoplenty/common/world/layer/LargeIslandLayer.java @@ -53,7 +53,7 @@ public enum LargeIslandLayer implements IAreaTransformer2, IDimOffset1Transforme } else { - return Registry.BIOME.getId(islandBiome); + return BiomeUtil.getBiomeId(islandBiome); } } else return centerVal; diff --git a/src/main/java/biomesoplenty/common/world/layer/NetherBiomeLayer.java b/src/main/java/biomesoplenty/common/world/layer/NetherBiomeLayer.java index 19edbf7ec..dbfccb963 100644 --- a/src/main/java/biomesoplenty/common/world/layer/NetherBiomeLayer.java +++ b/src/main/java/biomesoplenty/common/world/layer/NetherBiomeLayer.java @@ -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_WASTES)); + return BiomeUtil.getBiomeId(BOPClimates.NETHER.getRandomBiome(context, Biomes.NETHER_WASTES)); } } diff --git a/src/main/java/biomesoplenty/common/world/layer/SubBiomeLayer.java b/src/main/java/biomesoplenty/common/world/layer/SubBiomeLayer.java index a6ecece11..95c7a2ce5 100644 --- a/src/main/java/biomesoplenty/common/world/layer/SubBiomeLayer.java +++ b/src/main/java/biomesoplenty/common/world/layer/SubBiomeLayer.java @@ -10,6 +10,7 @@ package biomesoplenty.common.world.layer; import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.enums.BOPClimates; +import biomesoplenty.common.util.biome.BiomeUtil; import biomesoplenty.common.world.BOPLayerUtil; import biomesoplenty.init.ModBiomes; import com.google.common.collect.Lists; @@ -29,32 +30,32 @@ public enum SubBiomeLayer implements IAreaTransformer2, IDimOffset1Transformer { INSTANCE; - 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 BAMBOO_JUNGLE = Registry.BIOME.getId(Biomes.BAMBOO_JUNGLE); - private static final int BAMBOO_JUNGLE_HILLS = Registry.BIOME.getId(Biomes.BAMBOO_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); + private static final int BIRCH_FOREST = BiomeUtil.getBiomeId(Biomes.BIRCH_FOREST); + private static final int BIRCH_FOREST_HILLS = BiomeUtil.getBiomeId(Biomes.BIRCH_FOREST_HILLS); + private static final int DESERT = BiomeUtil.getBiomeId(Biomes.DESERT); + private static final int DESERT_HILLS = BiomeUtil.getBiomeId(Biomes.DESERT_HILLS); + private static final int MOUNTAINS = BiomeUtil.getBiomeId(Biomes.MOUNTAINS); + private static final int WOODED_MOUNTAINS = BiomeUtil.getBiomeId(Biomes.WOODED_MOUNTAINS); + private static final int FOREST = BiomeUtil.getBiomeId(Biomes.FOREST); + private static final int WOODED_HILLS = BiomeUtil.getBiomeId(Biomes.WOODED_HILLS); + private static final int SNOWY_TUNDRA = BiomeUtil.getBiomeId(Biomes.SNOWY_TUNDRA); + private static final int SNOWY_MOUNTAINS = BiomeUtil.getBiomeId(Biomes.SNOWY_MOUNTAINS); + private static final int JUNGLE = BiomeUtil.getBiomeId(Biomes.JUNGLE); + private static final int JUNGLE_HILLS = BiomeUtil.getBiomeId(Biomes.JUNGLE_HILLS); + private static final int BAMBOO_JUNGLE = BiomeUtil.getBiomeId(Biomes.BAMBOO_JUNGLE); + private static final int BAMBOO_JUNGLE_HILLS = BiomeUtil.getBiomeId(Biomes.BAMBOO_JUNGLE_HILLS); + private static final int BADLANDS = BiomeUtil.getBiomeId(Biomes.BADLANDS); + private static final int WOODED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.WOODED_BADLANDS_PLATEAU); + private static final int PLAINS = BiomeUtil.getBiomeId(Biomes.PLAINS); + private static final int GIANT_TREE_TAIGA = BiomeUtil.getBiomeId(Biomes.GIANT_TREE_TAIGA); + private static final int GIANT_TREE_TAIGA_HILLS = BiomeUtil.getBiomeId(Biomes.GIANT_TREE_TAIGA_HILLS); + private static final int DARK_FOREST = BiomeUtil.getBiomeId(Biomes.DARK_FOREST); + private static final int SAVANNA = BiomeUtil.getBiomeId(Biomes.SAVANNA); + private static final int SAVANA_PLATEAU = BiomeUtil.getBiomeId(Biomes.SAVANNA_PLATEAU); + private static final int TAIGA = BiomeUtil.getBiomeId(Biomes.TAIGA); + private static final int SNOWY_TAIGA = BiomeUtil.getBiomeId(Biomes.SNOWY_TAIGA); + private static final int SNOWY_TAIGA_HILLS = BiomeUtil.getBiomeId(Biomes.SNOWY_TAIGA_HILLS); + private static final int TAIGA_HILLS = BiomeUtil.getBiomeId(Biomes.TAIGA_HILLS); @Override public int applyPixel(INoiseRandom context, IArea biomeArea, IArea riverAndSubBiomesInitArea, int x, int z) @@ -72,7 +73,7 @@ public enum SubBiomeLayer implements IAreaTransformer2, IDimOffset1Transformer Biome biome = Registry.BIOME.byId(biomeId); if (biome == null || !biome.isMutated()) { mutatedBiome = Biome.getMutatedVariant(biome); - return mutatedBiome == null ? biomeId : Registry.BIOME.getId(mutatedBiome); + return mutatedBiome == null ? biomeId : BiomeUtil.getBiomeId(mutatedBiome); } } @@ -88,7 +89,7 @@ public enum SubBiomeLayer implements IAreaTransformer2, IDimOffset1Transformer if (subBiomeType == 0 && mutatedBiomeId != biomeId) { mutatedBiome = Biome.getMutatedVariant(Registry.BIOME.byId(mutatedBiomeId)); - mutatedBiomeId = mutatedBiome == null ? biomeId : Registry.BIOME.getId(mutatedBiome); + mutatedBiomeId = mutatedBiome == null ? biomeId : BiomeUtil.getBiomeId(mutatedBiome); } if (mutatedBiomeId != biomeId) @@ -141,7 +142,7 @@ public enum SubBiomeLayer implements IAreaTransformer2, IDimOffset1Transformer } while (weight >= 0); - selectedBiomeId = Registry.BIOME.getId(item.biome); + selectedBiomeId = BiomeUtil.getBiomeId(item.biome); return selectedBiomeId; } @@ -157,7 +158,7 @@ public enum SubBiomeLayer implements IAreaTransformer2, IDimOffset1Transformer else if (originalBiomeId == SNOWY_TAIGA) mutatedBiomeId = SNOWY_TAIGA_HILLS; //Use BOP orchard instead of vanilla forest //else if (originalBiomeId == PLAINS) mutatedBiomeId = context.random(3) == 0 ? WOODED_HILLS : FOREST; - else if (originalBiomeId == PLAINS && BOPBiomes.orchard.isPresent()) mutatedBiomeId = Registry.BIOME.getId(BOPBiomes.orchard.get()); + else if (originalBiomeId == PLAINS && BOPBiomes.orchard.isPresent()) mutatedBiomeId = BiomeUtil.getBiomeId(BOPBiomes.orchard.get()); ////////// else if (originalBiomeId == SNOWY_TUNDRA) mutatedBiomeId = SNOWY_MOUNTAINS; else if (originalBiomeId == JUNGLE) mutatedBiomeId = JUNGLE_HILLS; diff --git a/src/main/java/biomesoplenty/core/BiomesOPlenty.java b/src/main/java/biomesoplenty/core/BiomesOPlenty.java index 5646ee1e3..5b68fa3fd 100644 --- a/src/main/java/biomesoplenty/core/BiomesOPlenty.java +++ b/src/main/java/biomesoplenty/core/BiomesOPlenty.java @@ -59,8 +59,6 @@ public class BiomesOPlenty private void loadComplete(final FMLLoadCompleteEvent event) // PostRegistrationEven { proxy.init(); - //GenLayerVisualizer.run(); - ModCompatibility.setup(); } private void serverStarting(final FMLServerAboutToStartEvent event) diff --git a/src/main/java/biomesoplenty/init/ModBiomes.java b/src/main/java/biomesoplenty/init/ModBiomes.java index 19992c872..000e6a9e2 100644 --- a/src/main/java/biomesoplenty/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/init/ModBiomes.java @@ -19,7 +19,8 @@ import com.google.common.collect.HashMultimap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import net.minecraft.client.gui.screen.BiomeGeneratorTypeScreens; -import net.minecraft.entity.villager.IVillagerType; +import net.minecraft.entity.villager.VillagerType; +import net.minecraft.entity.villager.VillagerType; import net.minecraft.util.registry.Registry; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; @@ -207,86 +208,78 @@ public class ModBiomes private static void registerVillagerTypes() { - registerVillagerType(alps, IVillagerType.SNOW); - registerVillagerType(alps_foothills, IVillagerType.SNOW); - registerVillagerType(bayou, IVillagerType.SWAMP); - registerVillagerType(bog, IVillagerType.SWAMP); - registerVillagerType(boreal_forest, IVillagerType.TAIGA); - registerVillagerType(brushland, IVillagerType.SAVANNA); - registerVillagerType(chaparral, IVillagerType.PLAINS); - registerVillagerType(cherry_blossom_grove, IVillagerType.PLAINS); - registerVillagerType(cold_desert, IVillagerType.SNOW); - registerVillagerType(coniferous_forest, IVillagerType.TAIGA); - registerVillagerType(dead_forest, IVillagerType.TAIGA); - registerVillagerType(fir_clearing, IVillagerType.TAIGA); - registerVillagerType(floodplain, IVillagerType.JUNGLE); - registerVillagerType(flower_meadow, IVillagerType.TAIGA); - registerVillagerType(fungal_jungle, IVillagerType.JUNGLE); - registerVillagerType(grassland, IVillagerType.PLAINS); - registerVillagerType(gravel_beach, IVillagerType.PLAINS); - registerVillagerType(grove, IVillagerType.PLAINS); - registerVillagerType(highland, IVillagerType.PLAINS); - registerVillagerType(highland_moor, IVillagerType.PLAINS); - registerVillagerType(lavender_field, IVillagerType.PLAINS); - registerVillagerType(lush_grassland, IVillagerType.JUNGLE); - registerVillagerType(lush_swamp, IVillagerType.JUNGLE); - registerVillagerType(mangrove, IVillagerType.SWAMP); - registerVillagerType(maple_woods, IVillagerType.TAIGA); - registerVillagerType(marsh, IVillagerType.SWAMP); - registerVillagerType(meadow, IVillagerType.TAIGA); - registerVillagerType(mire, IVillagerType.SWAMP); - registerVillagerType(muskeg, IVillagerType.SNOW); - registerVillagerType(mystic_grove, IVillagerType.PLAINS); - registerVillagerType(oasis, IVillagerType.DESERT); - registerVillagerType(ominous_woods, IVillagerType.SWAMP); - registerVillagerType(orchard, IVillagerType.PLAINS); - registerVillagerType(origin_hills, IVillagerType.PLAINS); - registerVillagerType(outback, IVillagerType.SAVANNA); - registerVillagerType(overgrown_cliffs, IVillagerType.JUNGLE); - registerVillagerType(pasture, IVillagerType.PLAINS); - registerVillagerType(poppy_field, IVillagerType.PLAINS); - registerVillagerType(prairie, IVillagerType.PLAINS); - registerVillagerType(pumpkin_patch, IVillagerType.PLAINS); - registerVillagerType(rainbow_valley, IVillagerType.PLAINS); - registerVillagerType(rainforest, IVillagerType.JUNGLE); - registerVillagerType(redwood_forest, IVillagerType.PLAINS); - registerVillagerType(redwood_forest_edge, IVillagerType.PLAINS); - registerVillagerType(scrubland, IVillagerType.SAVANNA); - registerVillagerType(seasonal_forest, IVillagerType.PLAINS); - registerVillagerType(shield, IVillagerType.TAIGA); - registerVillagerType(shrubland, IVillagerType.PLAINS); - registerVillagerType(silkglade, IVillagerType.SWAMP); - registerVillagerType(snowy_coniferous_forest, IVillagerType.SNOW); - registerVillagerType(snowy_fir_clearing, IVillagerType.SNOW); - registerVillagerType(snowy_forest, IVillagerType.SNOW); - registerVillagerType(steppe, IVillagerType.PLAINS); - registerVillagerType(temperate_rainforest, IVillagerType.PLAINS); - registerVillagerType(temperate_rainforest_hills, IVillagerType.PLAINS); - registerVillagerType(tropical_rainforest, IVillagerType.JUNGLE); - registerVillagerType(tropic_beach, IVillagerType.JUNGLE); - registerVillagerType(tropics, IVillagerType.JUNGLE); - registerVillagerType(tundra, IVillagerType.TAIGA); - registerVillagerType(volcanic_plains, IVillagerType.PLAINS); - registerVillagerType(volcano, IVillagerType.PLAINS); - registerVillagerType(wasteland, IVillagerType.DESERT); - registerVillagerType(wetland, IVillagerType.SWAMP); - registerVillagerType(woodland, IVillagerType.PLAINS); - registerVillagerType(xeric_shrubland, IVillagerType.DESERT); - } - - private static void registerBiomeToDictionary(Optional biome, Type...types) - { - if (biome.isPresent()) - { - BiomeDictionary.addTypes(biome.get(), types); - } + registerVillagerType(alps, VillagerType.SNOW); + registerVillagerType(alps_foothills, VillagerType.SNOW); + registerVillagerType(bayou, VillagerType.SWAMP); + registerVillagerType(bog, VillagerType.SWAMP); + registerVillagerType(boreal_forest, VillagerType.TAIGA); + registerVillagerType(brushland, VillagerType.SAVANNA); + registerVillagerType(chaparral, VillagerType.PLAINS); + registerVillagerType(cherry_blossom_grove, VillagerType.PLAINS); + registerVillagerType(cold_desert, VillagerType.SNOW); + registerVillagerType(coniferous_forest, VillagerType.TAIGA); + registerVillagerType(dead_forest, VillagerType.TAIGA); + registerVillagerType(fir_clearing, VillagerType.TAIGA); + registerVillagerType(floodplain, VillagerType.JUNGLE); + registerVillagerType(flower_meadow, VillagerType.TAIGA); + registerVillagerType(fungal_jungle, VillagerType.JUNGLE); + registerVillagerType(grassland, VillagerType.PLAINS); + registerVillagerType(gravel_beach, VillagerType.PLAINS); + registerVillagerType(grove, VillagerType.PLAINS); + registerVillagerType(highland, VillagerType.PLAINS); + registerVillagerType(highland_moor, VillagerType.PLAINS); + registerVillagerType(lavender_field, VillagerType.PLAINS); + registerVillagerType(lush_grassland, VillagerType.JUNGLE); + registerVillagerType(lush_swamp, VillagerType.JUNGLE); + registerVillagerType(mangrove, VillagerType.SWAMP); + registerVillagerType(maple_woods, VillagerType.TAIGA); + registerVillagerType(marsh, VillagerType.SWAMP); + registerVillagerType(meadow, VillagerType.TAIGA); + registerVillagerType(mire, VillagerType.SWAMP); + registerVillagerType(muskeg, VillagerType.SNOW); + registerVillagerType(mystic_grove, VillagerType.PLAINS); + registerVillagerType(oasis, VillagerType.DESERT); + registerVillagerType(ominous_woods, VillagerType.SWAMP); + registerVillagerType(orchard, VillagerType.PLAINS); + registerVillagerType(origin_hills, VillagerType.PLAINS); + registerVillagerType(outback, VillagerType.SAVANNA); + registerVillagerType(overgrown_cliffs, VillagerType.JUNGLE); + registerVillagerType(pasture, VillagerType.PLAINS); + registerVillagerType(poppy_field, VillagerType.PLAINS); + registerVillagerType(prairie, VillagerType.PLAINS); + registerVillagerType(pumpkin_patch, VillagerType.PLAINS); + registerVillagerType(rainbow_valley, VillagerType.PLAINS); + registerVillagerType(rainforest, VillagerType.JUNGLE); + registerVillagerType(redwood_forest, VillagerType.PLAINS); + registerVillagerType(redwood_forest_edge, VillagerType.PLAINS); + registerVillagerType(scrubland, VillagerType.SAVANNA); + registerVillagerType(seasonal_forest, VillagerType.PLAINS); + registerVillagerType(shield, VillagerType.TAIGA); + registerVillagerType(shrubland, VillagerType.PLAINS); + registerVillagerType(silkglade, VillagerType.SWAMP); + registerVillagerType(snowy_coniferous_forest, VillagerType.SNOW); + registerVillagerType(snowy_fir_clearing, VillagerType.SNOW); + registerVillagerType(snowy_forest, VillagerType.SNOW); + registerVillagerType(steppe, VillagerType.PLAINS); + registerVillagerType(temperate_rainforest, VillagerType.PLAINS); + registerVillagerType(temperate_rainforest_hills, VillagerType.PLAINS); + registerVillagerType(tropical_rainforest, VillagerType.JUNGLE); + registerVillagerType(tropic_beach, VillagerType.JUNGLE); + registerVillagerType(tropics, VillagerType.JUNGLE); + registerVillagerType(tundra, VillagerType.TAIGA); + registerVillagerType(volcanic_plains, VillagerType.PLAINS); + registerVillagerType(volcano, VillagerType.PLAINS); + registerVillagerType(wasteland, VillagerType.DESERT); + registerVillagerType(wetland, VillagerType.SWAMP); + registerVillagerType(woodland, VillagerType.PLAINS); + registerVillagerType(xeric_shrubland, VillagerType.DESERT); } - private static void registerVillagerType(Optional biome, IVillagerType type) + private static void registerVillagerType(Optional biome, VillagerType type) { if (biome.isPresent()) { - IVillagerType.BY_BIOME.put(biome.get(), type); + VillagerType.BY_BIOME.put(biome.get(), type); } }