Misc fixes
This commit is contained in:
parent
2bc36c12ff
commit
ad5259af61
48 changed files with 216 additions and 783 deletions
|
@ -178,9 +178,9 @@ public enum BOPClimates
|
||||||
public static class WeightedBiomeEntry
|
public static class WeightedBiomeEntry
|
||||||
{
|
{
|
||||||
public final int weight;
|
public final int weight;
|
||||||
public final RegistryKey<Biome> biome;
|
public final Biome biome;
|
||||||
|
|
||||||
public WeightedBiomeEntry(int weight, RegistryKey<Biome> biome)
|
public WeightedBiomeEntry(int weight, Biome biome)
|
||||||
{
|
{
|
||||||
this.weight = weight;
|
this.weight = weight;
|
||||||
this.biome = biome;
|
this.biome = biome;
|
||||||
|
|
|
@ -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<Integer, Integer> biomeColours = new HashMap<Integer, Integer>();
|
|
||||||
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<BakedQuad> 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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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<IBOPContextExtended<LazyArea>> contextFactory = (seedModifier) -> {
|
|
||||||
// return new LazyAreaLayerContextBOP(1, 0, seedModifier);
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// IAreaFactory<LazyArea> landAreaFactory = BOPLayerUtil.createInitialLandAndSeaFactory(contextFactory);
|
|
||||||
// IAreaFactory<LazyArea> climateFactory = BOPLayerUtil.createClimateFactory(contextFactory, new BOPOverworldGenSettings());
|
|
||||||
// IAreaFactory<LazyArea> biomeAreaFactory = BOPLayerUtil.createBiomeFactory(landAreaFactory, climateFactory, contextFactory);
|
|
||||||
//
|
|
||||||
// //IAreaFactory<LazyArea> 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -9,6 +9,7 @@ package biomesoplenty.common.biome;
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
import biomesoplenty.api.biome.BOPBiomes;
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
import biomesoplenty.api.enums.BOPClimates;
|
||||||
|
import biomesoplenty.common.util.biome.BiomeUtil;
|
||||||
import biomesoplenty.common.util.config.JsonUtil;
|
import biomesoplenty.common.util.config.JsonUtil;
|
||||||
import biomesoplenty.core.BiomesOPlenty;
|
import biomesoplenty.core.BiomesOPlenty;
|
||||||
import biomesoplenty.init.ModBiomes;
|
import biomesoplenty.init.ModBiomes;
|
||||||
|
@ -437,7 +438,7 @@ public class BiomeRegistry
|
||||||
|
|
||||||
String childName = data.getChild().delegate.name().toString();
|
String childName = data.getChild().delegate.name().toString();
|
||||||
BiomesOPlenty.logger.debug(String.format("Sub biome %s weight set to %d", childName, data.getWeight()));
|
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) -> {
|
ISLAND_BIOME((SingleClimateRegistrationData data) -> {
|
||||||
if (data.getWeight() == 0)
|
if (data.getWeight() == 0)
|
||||||
|
@ -448,7 +449,7 @@ public class BiomeRegistry
|
||||||
|
|
||||||
String biomeName = data.getBiome().delegate.name().toString();
|
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()));
|
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());
|
data.getClimate().addIslandBiome(data.getWeight(), data.getBiome());
|
||||||
}),
|
}),
|
||||||
VANILLA_BIOME((SingleClimateRegistrationData data) -> {
|
VANILLA_BIOME((SingleClimateRegistrationData data) -> {
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class FoliageBlockBOP extends BushBlock implements IPlantable
|
||||||
|
|
||||||
if (this == BOPBlocks.sprout)
|
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)
|
if (this == BOPBlocks.dune_grass)
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class MushroomBlockBOP extends MushroomBlock implements IGrowable
|
||||||
configuredfeature = BOPBiomeFeatures.HUGE_TOADSTOOL.configured(IFeatureConfig.NONE);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public abstract class BigTreeDefaultConfig extends BigTree
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 4);
|
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;
|
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 + 1, 0, z), blockstate, 4);
|
||||||
world.setBlock(pos.offset(x, 0, z + 1), blockstate, 4);
|
world.setBlock(pos.offset(x, 0, z + 1), blockstate, 4);
|
||||||
world.setBlock(pos.offset(x + 1, 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ public abstract class TreeDefaultConfig extends Tree
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 4);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package biomesoplenty.common.world;
|
package biomesoplenty.common.world;
|
||||||
|
|
||||||
|
import biomesoplenty.common.util.biome.BiomeUtil;
|
||||||
import biomesoplenty.common.world.layer.*;
|
import biomesoplenty.common.world.layer.*;
|
||||||
import biomesoplenty.common.world.layer.traits.LazyAreaLayerContextBOP;
|
import biomesoplenty.common.world.layer.traits.LazyAreaLayerContextBOP;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
|
@ -21,16 +22,16 @@ import java.util.function.LongFunction;
|
||||||
|
|
||||||
public class BOPLayerUtil
|
public class BOPLayerUtil
|
||||||
{
|
{
|
||||||
public static final int WARM_OCEAN = Registry.BIOME.getId(Biomes.WARM_OCEAN);
|
public static final int WARM_OCEAN = BiomeUtil.getBiomeId(Biomes.WARM_OCEAN);
|
||||||
public static final int LUKEWARM_OCEAN = Registry.BIOME.getId(Biomes.LUKEWARM_OCEAN);
|
public static final int LUKEWARM_OCEAN = BiomeUtil.getBiomeId(Biomes.LUKEWARM_OCEAN);
|
||||||
public static final int OCEAN = Registry.BIOME.getId(Biomes.OCEAN);
|
public static final int OCEAN = BiomeUtil.getBiomeId(Biomes.OCEAN);
|
||||||
public static final int COLD_OCEAN = Registry.BIOME.getId(Biomes.COLD_OCEAN);
|
public static final int COLD_OCEAN = BiomeUtil.getBiomeId(Biomes.COLD_OCEAN);
|
||||||
public static final int FROZEN_OCEAN = Registry.BIOME.getId(Biomes.FROZEN_OCEAN);
|
public static final int FROZEN_OCEAN = BiomeUtil.getBiomeId(Biomes.FROZEN_OCEAN);
|
||||||
public static final int DEEP_WARM_OCEAN = Registry.BIOME.getId(Biomes.DEEP_WARM_OCEAN);
|
public static final int DEEP_WARM_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_WARM_OCEAN);
|
||||||
public static final int DEEP_LUKEWARM_OCEAN = Registry.BIOME.getId(Biomes.DEEP_LUKEWARM_OCEAN);
|
public static final int DEEP_LUKEWARM_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_LUKEWARM_OCEAN);
|
||||||
public static final int DEEP_OCEAN = Registry.BIOME.getId(Biomes.DEEP_OCEAN);
|
public static final int DEEP_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_OCEAN);
|
||||||
public static final int DEEP_COLD_OCEAN = Registry.BIOME.getId(Biomes.DEEP_COLD_OCEAN);
|
public static final int DEEP_COLD_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_COLD_OCEAN);
|
||||||
public static final int DEEP_FROZEN_OCEAN = Registry.BIOME.getId(Biomes.DEEP_FROZEN_OCEAN);
|
public static final int DEEP_FROZEN_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_FROZEN_OCEAN);
|
||||||
|
|
||||||
public static <T extends IArea, C extends IExtendedNoiseRandom<T>> IAreaFactory<T> createInitialLandAndSeaFactory(LongFunction<C> contextFactory)
|
public static <T extends IArea, C extends IExtendedNoiseRandom<T>> IAreaFactory<T> createInitialLandAndSeaFactory(LongFunction<C> contextFactory)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,6 +11,7 @@ import biomesoplenty.api.enums.BOPClimates;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.mojang.serialization.Codec;
|
import com.mojang.serialization.Codec;
|
||||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import net.minecraft.util.RegistryKey;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.Biomes;
|
import net.minecraft.world.biome.Biomes;
|
||||||
import net.minecraft.world.biome.provider.BiomeProvider;
|
import net.minecraft.world.biome.provider.BiomeProvider;
|
||||||
|
@ -24,7 +25,7 @@ public class BOPNetherBiomeProvider extends BiomeProvider
|
||||||
{
|
{
|
||||||
public static final Codec<BOPNetherBiomeProvider> CODEC = RecordCodecBuilder.create((builder) -> builder.group(Codec.LONG.fieldOf("seed").stable().forGetter((biomeProvider) -> biomeProvider.seed)).apply(builder, builder.stable(BOPNetherBiomeProvider::new)));
|
public static final Codec<BOPNetherBiomeProvider> 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<Biome> 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<RegistryKey<Biome>> 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 long seed;
|
||||||
private final Layer noiseBiomeLayer;
|
private final Layer noiseBiomeLayer;
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class BigPumpkinFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();}
|
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.below();}
|
||||||
|
|
||||||
|
|
|
@ -31,22 +31,24 @@ public class BlackSandstoneColumnFeature extends Feature<ColumnConfig> {
|
||||||
super(p_i231925_1_);
|
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();
|
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);
|
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) {
|
if (blockpos == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
int j = calculateHeight(p_230362_4_, p_230362_6_);
|
int j = config.height().sample(rand);
|
||||||
boolean flag = p_230362_4_.nextFloat() < 0.9F;
|
boolean flag = rand.nextFloat() < 0.9F;
|
||||||
int k = Math.min(j, flag ? 5 : 8);
|
int k = Math.min(j, flag ? 5 : 8);
|
||||||
int l = flag ? 50 : 15;
|
int l = flag ? 50 : 15;
|
||||||
boolean flag1 = false;
|
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);
|
int i1 = j - blockpos1.distManhattan(blockpos);
|
||||||
if (i1 >= 0) {
|
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<ColumnConfig> {
|
||||||
return null;
|
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_) {
|
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_);
|
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_;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -27,7 +27,7 @@ public class BoneSpineFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();}
|
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.below();}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class BrambleFeature extends Feature<NoFeatureConfig>
|
||||||
protected IBlockPosQuery replace = (world, pos) -> world.getBlockState(pos).getMaterial() == Material.AIR;
|
protected IBlockPosQuery replace = (world, pos) -> world.getBlockState(pos).getMaterial() == Material.AIR;
|
||||||
|
|
||||||
@Override
|
@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)
|
for (int i = 0; i < 128; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class FernGrassFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
BlockState BlockState = this.chooseGrassState(rand);
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class FleshTendonFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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());
|
BlockState below = world.getBlockState(pos.below());
|
||||||
if (!below.is(BOPBlocks.flesh))
|
if (!below.is(BOPBlocks.flesh))
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class GrassSplatterFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 i = 0;
|
||||||
int j = rand.nextInt(8 - 2) + 2;
|
int j = rand.nextInt(8 - 2) + 2;
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class HeathFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
int i = 0;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class HugeGlowshroomFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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)) {
|
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
|
||||||
startPos = startPos.below();
|
startPos = startPos.below();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class HugeToadstoolFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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)) {
|
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
|
||||||
startPos = startPos.below();
|
startPos = startPos.below();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class LargeCrystalFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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))
|
if (!world.isEmptyBlock(pos))
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class MangroveFeature extends Feature<NoFeatureConfig> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
int i = 0;
|
||||||
BlockState blockstate = BOPBlocks.mangrove_root.defaultBlockState();
|
BlockState blockstate = BOPBlocks.mangrove_root.defaultBlockState();
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class MyceliumSplatterFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 i = 0;
|
||||||
int j = rand.nextInt(8 - 2) + 2;
|
int j = rand.nextInt(8 - 2) + 2;
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class NetherVinesFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();}
|
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.below();}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class NetherWartFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
int i = 0;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class ObsidianSplatterFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 i = 0;
|
||||||
int j = rand.nextInt(8 - 2) + 2;
|
int j = rand.nextInt(8 - 2) + 2;
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class PodzolSplatterFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 i = 0;
|
||||||
int j = rand.nextInt(8 - 2) + 2;
|
int j = rand.nextInt(8 - 2) + 2;
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class PumpkinPatchFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
int i = 0;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class ScatteredRocksFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
int i = 0;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class ScrubFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
int i = 0;
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class ShortBambooFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();}
|
while (pos.getY() > 1 && this.replace.matches(world, pos)) {pos = pos.below();}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class SmallBrownMushroomFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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)) {
|
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
|
||||||
startPos = startPos.below();
|
startPos = startPos.below();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class SmallCrystalFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
int i = 0;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class SmallGlowshroomFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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)) {
|
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
|
||||||
startPos = startPos.below();
|
startPos = startPos.below();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class SmallRedMushroomFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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)) {
|
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
|
||||||
startPos = startPos.below();
|
startPos = startPos.below();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class SmallToadstoolFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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)) {
|
while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {
|
||||||
startPos = startPos.below();
|
startPos = startPos.below();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class StandardGrassFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
BlockState BlockState = this.chooseGrassState(rand);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class WastelandGrassFeature extends Feature<NoFeatureConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
BlockState BlockState = this.chooseGrassState(rand);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
package biomesoplenty.common.world.layer;
|
package biomesoplenty.common.world.layer;
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
import biomesoplenty.api.biome.BOPBiomes;
|
||||||
|
import biomesoplenty.common.util.biome.BiomeUtil;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.Biomes;
|
import net.minecraft.world.biome.Biomes;
|
||||||
|
@ -21,22 +22,22 @@ public enum BOPBiomeEdgeLayer implements ICastleTransformer
|
||||||
{
|
{
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
private static final int DESERT = Registry.BIOME.getId(Biomes.DESERT);
|
private static final int DESERT = BiomeUtil.getBiomeId(Biomes.DESERT);
|
||||||
private static final int MOUNTAINS = Registry.BIOME.getId(Biomes.MOUNTAINS);
|
private static final int MOUNTAINS = BiomeUtil.getBiomeId(Biomes.MOUNTAINS);
|
||||||
private static final int WOODED_MOUNTAINS = Registry.BIOME.getId(Biomes.WOODED_MOUNTAINS);
|
private static final int WOODED_MOUNTAINS = BiomeUtil.getBiomeId(Biomes.WOODED_MOUNTAINS);
|
||||||
private static final int SNOWY_TUNDRA = Registry.BIOME.getId(Biomes.SNOWY_TUNDRA);
|
private static final int SNOWY_TUNDRA = BiomeUtil.getBiomeId(Biomes.SNOWY_TUNDRA);
|
||||||
private static final int JUNGLE = Registry.BIOME.getId(Biomes.JUNGLE);
|
private static final int JUNGLE = BiomeUtil.getBiomeId(Biomes.JUNGLE);
|
||||||
private static final int JUNGLE_HILLS = Registry.BIOME.getId(Biomes.JUNGLE_HILLS);
|
private static final int JUNGLE_HILLS = BiomeUtil.getBiomeId(Biomes.JUNGLE_HILLS);
|
||||||
private static final int JUNGLE_EDGE = Registry.BIOME.getId(Biomes.JUNGLE_EDGE);
|
private static final int JUNGLE_EDGE = BiomeUtil.getBiomeId(Biomes.JUNGLE_EDGE);
|
||||||
private static final int BADLANDS = Registry.BIOME.getId(Biomes.BADLANDS);
|
private static final int BADLANDS = BiomeUtil.getBiomeId(Biomes.BADLANDS);
|
||||||
private static final int BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.BADLANDS_PLATEAU);
|
private static final int BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.BADLANDS_PLATEAU);
|
||||||
private static final int WOODED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.WOODED_BADLANDS_PLATEAU);
|
private static final int WOODED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.WOODED_BADLANDS_PLATEAU);
|
||||||
private static final int PLAINS = Registry.BIOME.getId(Biomes.PLAINS);
|
private static final int PLAINS = BiomeUtil.getBiomeId(Biomes.PLAINS);
|
||||||
private static final int GIANT_TREE_TAIGA = Registry.BIOME.getId(Biomes.GIANT_TREE_TAIGA);
|
private static final int GIANT_TREE_TAIGA = BiomeUtil.getBiomeId(Biomes.GIANT_TREE_TAIGA);
|
||||||
private static final int MOUNTAIN_EDGE = Registry.BIOME.getId(Biomes.MOUNTAIN_EDGE);
|
private static final int MOUNTAIN_EDGE = BiomeUtil.getBiomeId(Biomes.MOUNTAIN_EDGE);
|
||||||
private static final int SWAMP = Registry.BIOME.getId(Biomes.SWAMP);
|
private static final int SWAMP = BiomeUtil.getBiomeId(Biomes.SWAMP);
|
||||||
private static final int TAIGA = Registry.BIOME.getId(Biomes.TAIGA);
|
private static final int TAIGA = BiomeUtil.getBiomeId(Biomes.TAIGA);
|
||||||
private static final int SNOWY_TAIGA = Registry.BIOME.getId(Biomes.SNOWY_TAIGA);
|
private static final int SNOWY_TAIGA = BiomeUtil.getBiomeId(Biomes.SNOWY_TAIGA);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int apply(INoiseRandom 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)
|
||||||
|
@ -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<Biome> fromBiome, Optional<Biome> toBiome)
|
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, 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<Biome> fromBiome, int toBiome)
|
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, 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)
|
private boolean replaceBiomeEdge(int[] outId, int northBiomeId, int eastBiomeId, int southBiomeId, int westBiomeId, int biomeId, int fromBiome, int toBiome)
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
package biomesoplenty.common.world.layer;
|
package biomesoplenty.common.world.layer;
|
||||||
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
import biomesoplenty.api.enums.BOPClimates;
|
||||||
|
import biomesoplenty.common.util.biome.BiomeUtil;
|
||||||
import biomesoplenty.init.ModBiomes;
|
import biomesoplenty.init.ModBiomes;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.world.biome.Biomes;
|
import net.minecraft.world.biome.Biomes;
|
||||||
|
@ -21,8 +22,8 @@ public enum BOPBiomeLayer implements IAreaTransformer2, IDimOffset0Transformer
|
||||||
{
|
{
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
private static final int DEEP_OCEAN = Registry.BIOME.getId(Biomes.DEEP_OCEAN);
|
private static final int DEEP_OCEAN = BiomeUtil.getBiomeId(Biomes.DEEP_OCEAN);
|
||||||
private static final int MUSHROOM_FIELDS = Registry.BIOME.getId(Biomes.MUSHROOM_FIELDS);
|
private static final int MUSHROOM_FIELDS = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELDS);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int applyPixel(INoiseRandom context, IArea area1, IArea area2, int x, int z)
|
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
|
// At this point, oceans and land have been assigned, and so have mushroom islands
|
||||||
if (landSeaVal == DEEP_OCEAN)
|
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
|
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)
|
else if (landSeaVal == 0)
|
||||||
{
|
{
|
||||||
return Registry.BIOME.getId(climate.getRandomOceanBiome(context, false));
|
return BiomeUtil.getBiomeId(climate.getRandomOceanBiome(context, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Registry.BIOME.getId(climate.getRandomBiome(context, Biomes.OCEAN));
|
return BiomeUtil.getBiomeId(climate.getRandomBiome(context, Biomes.OCEAN));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public enum BOPMixOceansLayer implements IAreaTransformer3, IDimOffset0Transform
|
||||||
case WASTELAND:
|
case WASTELAND:
|
||||||
if (BOPBiomes.wasteland.isPresent())
|
if (BOPBiomes.wasteland.isPresent())
|
||||||
{
|
{
|
||||||
oceanId = Registry.BIOME.getId(BOPBiomes.wasteland.get());
|
oceanId = BiomeUtil.getBiomeId(BOPBiomes.wasteland.get());
|
||||||
}
|
}
|
||||||
// Fallthrough
|
// Fallthrough
|
||||||
|
|
||||||
|
@ -120,9 +120,9 @@ public enum BOPMixOceansLayer implements IAreaTransformer3, IDimOffset0Transform
|
||||||
return BOPLayerUtil.DEEP_FROZEN_OCEAN;
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,11 @@ public enum BOPRiverMixLayer implements IAreaTransformer2, IDimOffset0Transforme
|
||||||
{
|
{
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
private static final int FROZEN_RIVER = Registry.BIOME.getId(Biomes.FROZEN_RIVER);
|
private static final int FROZEN_RIVER = BiomeUtil.getBiomeId(Biomes.FROZEN_RIVER);
|
||||||
private static final int SNOWY_TUNDRA = Registry.BIOME.getId(Biomes.SNOWY_TUNDRA);
|
private static final int SNOWY_TUNDRA = BiomeUtil.getBiomeId(Biomes.SNOWY_TUNDRA);
|
||||||
private static final int MUSHROOM_FIELDS = Registry.BIOME.getId(Biomes.MUSHROOM_FIELDS);
|
private static final int MUSHROOM_FIELDS = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELDS);
|
||||||
private static final int MUSHROOM_FIELD_SHORE = Registry.BIOME.getId(Biomes.MUSHROOM_FIELD_SHORE);
|
private static final int MUSHROOM_FIELD_SHORE = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELD_SHORE);
|
||||||
private static final int RIVER = Registry.BIOME.getId(Biomes.RIVER);
|
private static final int RIVER = BiomeUtil.getBiomeId(Biomes.RIVER);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int applyPixel(INoiseRandom context, IArea biomeArea, IArea riverArea, int x, int z)
|
public int applyPixel(INoiseRandom context, IArea biomeArea, IArea riverArea, int x, int z)
|
||||||
|
|
|
@ -22,28 +22,28 @@ public enum BOPShoreLayer implements ICastleTransformer
|
||||||
{
|
{
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
private static final int BEACH = Registry.BIOME.getId(Biomes.BEACH);
|
private static final int BEACH = BiomeUtil.getBiomeId(Biomes.BEACH);
|
||||||
private static final int SNOWY_BEACH = Registry.BIOME.getId(Biomes.SNOWY_BEACH);
|
private static final int SNOWY_BEACH = BiomeUtil.getBiomeId(Biomes.SNOWY_BEACH);
|
||||||
private static final int DESERT = Registry.BIOME.getId(Biomes.DESERT);
|
private static final int DESERT = BiomeUtil.getBiomeId(Biomes.DESERT);
|
||||||
private static final int MOUNTAINS = Registry.BIOME.getId(Biomes.MOUNTAINS);
|
private static final int MOUNTAINS = BiomeUtil.getBiomeId(Biomes.MOUNTAINS);
|
||||||
private static final int WOODED_MOUNTAINS = Registry.BIOME.getId(Biomes.WOODED_MOUNTAINS);
|
private static final int WOODED_MOUNTAINS = BiomeUtil.getBiomeId(Biomes.WOODED_MOUNTAINS);
|
||||||
private static final int FOREST = Registry.BIOME.getId(Biomes.FOREST);
|
private static final int FOREST = BiomeUtil.getBiomeId(Biomes.FOREST);
|
||||||
private static final int JUNGLE = Registry.BIOME.getId(Biomes.JUNGLE);
|
private static final int JUNGLE = BiomeUtil.getBiomeId(Biomes.JUNGLE);
|
||||||
private static final int JUNGLE_EDGE = Registry.BIOME.getId(Biomes.JUNGLE_EDGE);
|
private static final int JUNGLE_EDGE = BiomeUtil.getBiomeId(Biomes.JUNGLE_EDGE);
|
||||||
private static final int JUNGLE_HILLS = Registry.BIOME.getId(Biomes.JUNGLE_HILLS);
|
private static final int JUNGLE_HILLS = BiomeUtil.getBiomeId(Biomes.JUNGLE_HILLS);
|
||||||
private static final int BADLANDS = Registry.BIOME.getId(Biomes.BADLANDS);
|
private static final int BADLANDS = BiomeUtil.getBiomeId(Biomes.BADLANDS);
|
||||||
private static final int WOODED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.WOODED_BADLANDS_PLATEAU);
|
private static final int WOODED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.WOODED_BADLANDS_PLATEAU);
|
||||||
private static final int BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.BADLANDS_PLATEAU);
|
private static final int BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.BADLANDS_PLATEAU);
|
||||||
private static final int ERODED_BADLANDS = Registry.BIOME.getId(Biomes.ERODED_BADLANDS);
|
private static final int ERODED_BADLANDS = BiomeUtil.getBiomeId(Biomes.ERODED_BADLANDS);
|
||||||
private static final int MODIFIED_WOODED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU);
|
private static final int MODIFIED_WOODED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU);
|
||||||
private static final int MODIFIED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.MODIFIED_BADLANDS_PLATEAU);
|
private static final int MODIFIED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.MODIFIED_BADLANDS_PLATEAU);
|
||||||
private static final int MUSHROOM_FIELDS = Registry.BIOME.getId(Biomes.MUSHROOM_FIELDS);
|
private static final int MUSHROOM_FIELDS = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELDS);
|
||||||
private static final int MUSHROOM_FIELD_SHORE = Registry.BIOME.getId(Biomes.MUSHROOM_FIELD_SHORE);
|
private static final int MUSHROOM_FIELD_SHORE = BiomeUtil.getBiomeId(Biomes.MUSHROOM_FIELD_SHORE);
|
||||||
private static final int RIVER = Registry.BIOME.getId(Biomes.RIVER);
|
private static final int RIVER = BiomeUtil.getBiomeId(Biomes.RIVER);
|
||||||
private static final int MOUNTAIN_EDGE = Registry.BIOME.getId(Biomes.MOUNTAIN_EDGE);
|
private static final int MOUNTAIN_EDGE = BiomeUtil.getBiomeId(Biomes.MOUNTAIN_EDGE);
|
||||||
private static final int STONE_SHORE = Registry.BIOME.getId(Biomes.STONE_SHORE);
|
private static final int STONE_SHORE = BiomeUtil.getBiomeId(Biomes.STONE_SHORE);
|
||||||
private static final int SWAMP = Registry.BIOME.getId(Biomes.SWAMP);
|
private static final int SWAMP = BiomeUtil.getBiomeId(Biomes.SWAMP);
|
||||||
private static final int TAIGA = Registry.BIOME.getId(Biomes.TAIGA);
|
private static final int TAIGA = BiomeUtil.getBiomeId(Biomes.TAIGA);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int apply(INoiseRandom 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)
|
||||||
|
@ -133,7 +133,7 @@ public enum BOPShoreLayer implements ICastleTransformer
|
||||||
|
|
||||||
private static int getBiomeIdIfPresent(Optional<Biome> biome, int fallbackId)
|
private static int getBiomeIdIfPresent(Optional<Biome> 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)
|
private static boolean isJungleCompatible(int biomeId)
|
||||||
|
|
|
@ -53,7 +53,7 @@ public enum LargeIslandLayer implements IAreaTransformer2, IDimOffset1Transforme
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Registry.BIOME.getId(islandBiome);
|
return BiomeUtil.getBiomeId(islandBiome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else return centerVal;
|
else return centerVal;
|
||||||
|
|
|
@ -21,6 +21,6 @@ public enum NetherBiomeLayer implements IAreaTransformer0, IDimOffset0Transforme
|
||||||
@Override
|
@Override
|
||||||
public int applyPixel(INoiseRandom context, int x, int z)
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ package biomesoplenty.common.world.layer;
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
import biomesoplenty.api.biome.BOPBiomes;
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
import biomesoplenty.api.enums.BOPClimates;
|
||||||
|
import biomesoplenty.common.util.biome.BiomeUtil;
|
||||||
import biomesoplenty.common.world.BOPLayerUtil;
|
import biomesoplenty.common.world.BOPLayerUtil;
|
||||||
import biomesoplenty.init.ModBiomes;
|
import biomesoplenty.init.ModBiomes;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
@ -29,32 +30,32 @@ public enum SubBiomeLayer implements IAreaTransformer2, IDimOffset1Transformer
|
||||||
{
|
{
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
private static final int BIRCH_FOREST = Registry.BIOME.getId(Biomes.BIRCH_FOREST);
|
private static final int BIRCH_FOREST = BiomeUtil.getBiomeId(Biomes.BIRCH_FOREST);
|
||||||
private static final int BIRCH_FOREST_HILLS = Registry.BIOME.getId(Biomes.BIRCH_FOREST_HILLS);
|
private static final int BIRCH_FOREST_HILLS = BiomeUtil.getBiomeId(Biomes.BIRCH_FOREST_HILLS);
|
||||||
private static final int DESERT = Registry.BIOME.getId(Biomes.DESERT);
|
private static final int DESERT = BiomeUtil.getBiomeId(Biomes.DESERT);
|
||||||
private static final int DESERT_HILLS = Registry.BIOME.getId(Biomes.DESERT_HILLS);
|
private static final int DESERT_HILLS = BiomeUtil.getBiomeId(Biomes.DESERT_HILLS);
|
||||||
private static final int MOUNTAINS = Registry.BIOME.getId(Biomes.MOUNTAINS);
|
private static final int MOUNTAINS = BiomeUtil.getBiomeId(Biomes.MOUNTAINS);
|
||||||
private static final int WOODED_MOUNTAINS = Registry.BIOME.getId(Biomes.WOODED_MOUNTAINS);
|
private static final int WOODED_MOUNTAINS = BiomeUtil.getBiomeId(Biomes.WOODED_MOUNTAINS);
|
||||||
private static final int FOREST = Registry.BIOME.getId(Biomes.FOREST);
|
private static final int FOREST = BiomeUtil.getBiomeId(Biomes.FOREST);
|
||||||
private static final int WOODED_HILLS = Registry.BIOME.getId(Biomes.WOODED_HILLS);
|
private static final int WOODED_HILLS = BiomeUtil.getBiomeId(Biomes.WOODED_HILLS);
|
||||||
private static final int SNOWY_TUNDRA = Registry.BIOME.getId(Biomes.SNOWY_TUNDRA);
|
private static final int SNOWY_TUNDRA = BiomeUtil.getBiomeId(Biomes.SNOWY_TUNDRA);
|
||||||
private static final int SNOWY_MOUNTAINS = Registry.BIOME.getId(Biomes.SNOWY_MOUNTAINS);
|
private static final int SNOWY_MOUNTAINS = BiomeUtil.getBiomeId(Biomes.SNOWY_MOUNTAINS);
|
||||||
private static final int JUNGLE = Registry.BIOME.getId(Biomes.JUNGLE);
|
private static final int JUNGLE = BiomeUtil.getBiomeId(Biomes.JUNGLE);
|
||||||
private static final int JUNGLE_HILLS = Registry.BIOME.getId(Biomes.JUNGLE_HILLS);
|
private static final int JUNGLE_HILLS = BiomeUtil.getBiomeId(Biomes.JUNGLE_HILLS);
|
||||||
private static final int BAMBOO_JUNGLE = Registry.BIOME.getId(Biomes.BAMBOO_JUNGLE);
|
private static final int BAMBOO_JUNGLE = BiomeUtil.getBiomeId(Biomes.BAMBOO_JUNGLE);
|
||||||
private static final int BAMBOO_JUNGLE_HILLS = Registry.BIOME.getId(Biomes.BAMBOO_JUNGLE_HILLS);
|
private static final int BAMBOO_JUNGLE_HILLS = BiomeUtil.getBiomeId(Biomes.BAMBOO_JUNGLE_HILLS);
|
||||||
private static final int BADLANDS = Registry.BIOME.getId(Biomes.BADLANDS);
|
private static final int BADLANDS = BiomeUtil.getBiomeId(Biomes.BADLANDS);
|
||||||
private static final int WOODED_BADLANDS_PLATEAU = Registry.BIOME.getId(Biomes.WOODED_BADLANDS_PLATEAU);
|
private static final int WOODED_BADLANDS_PLATEAU = BiomeUtil.getBiomeId(Biomes.WOODED_BADLANDS_PLATEAU);
|
||||||
private static final int PLAINS = Registry.BIOME.getId(Biomes.PLAINS);
|
private static final int PLAINS = BiomeUtil.getBiomeId(Biomes.PLAINS);
|
||||||
private static final int GIANT_TREE_TAIGA = Registry.BIOME.getId(Biomes.GIANT_TREE_TAIGA);
|
private static final int GIANT_TREE_TAIGA = BiomeUtil.getBiomeId(Biomes.GIANT_TREE_TAIGA);
|
||||||
private static final int GIANT_TREE_TAIGA_HILLS = Registry.BIOME.getId(Biomes.GIANT_TREE_TAIGA_HILLS);
|
private static final int GIANT_TREE_TAIGA_HILLS = BiomeUtil.getBiomeId(Biomes.GIANT_TREE_TAIGA_HILLS);
|
||||||
private static final int DARK_FOREST = Registry.BIOME.getId(Biomes.DARK_FOREST);
|
private static final int DARK_FOREST = BiomeUtil.getBiomeId(Biomes.DARK_FOREST);
|
||||||
private static final int SAVANNA = Registry.BIOME.getId(Biomes.SAVANNA);
|
private static final int SAVANNA = BiomeUtil.getBiomeId(Biomes.SAVANNA);
|
||||||
private static final int SAVANA_PLATEAU = Registry.BIOME.getId(Biomes.SAVANNA_PLATEAU);
|
private static final int SAVANA_PLATEAU = BiomeUtil.getBiomeId(Biomes.SAVANNA_PLATEAU);
|
||||||
private static final int TAIGA = Registry.BIOME.getId(Biomes.TAIGA);
|
private static final int TAIGA = BiomeUtil.getBiomeId(Biomes.TAIGA);
|
||||||
private static final int SNOWY_TAIGA = Registry.BIOME.getId(Biomes.SNOWY_TAIGA);
|
private static final int SNOWY_TAIGA = BiomeUtil.getBiomeId(Biomes.SNOWY_TAIGA);
|
||||||
private static final int SNOWY_TAIGA_HILLS = Registry.BIOME.getId(Biomes.SNOWY_TAIGA_HILLS);
|
private static final int SNOWY_TAIGA_HILLS = BiomeUtil.getBiomeId(Biomes.SNOWY_TAIGA_HILLS);
|
||||||
private static final int TAIGA_HILLS = Registry.BIOME.getId(Biomes.TAIGA_HILLS);
|
private static final int TAIGA_HILLS = BiomeUtil.getBiomeId(Biomes.TAIGA_HILLS);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int applyPixel(INoiseRandom context, IArea biomeArea, IArea riverAndSubBiomesInitArea, int x, int z)
|
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);
|
Biome biome = Registry.BIOME.byId(biomeId);
|
||||||
if (biome == null || !biome.isMutated()) {
|
if (biome == null || !biome.isMutated()) {
|
||||||
mutatedBiome = Biome.getMutatedVariant(biome);
|
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)
|
if (subBiomeType == 0 && mutatedBiomeId != biomeId)
|
||||||
{
|
{
|
||||||
mutatedBiome = Biome.getMutatedVariant(Registry.BIOME.byId(mutatedBiomeId));
|
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)
|
if (mutatedBiomeId != biomeId)
|
||||||
|
@ -141,7 +142,7 @@ public enum SubBiomeLayer implements IAreaTransformer2, IDimOffset1Transformer
|
||||||
}
|
}
|
||||||
while (weight >= 0);
|
while (weight >= 0);
|
||||||
|
|
||||||
selectedBiomeId = Registry.BIOME.getId(item.biome);
|
selectedBiomeId = BiomeUtil.getBiomeId(item.biome);
|
||||||
return selectedBiomeId;
|
return selectedBiomeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +158,7 @@ public enum SubBiomeLayer implements IAreaTransformer2, IDimOffset1Transformer
|
||||||
else if (originalBiomeId == SNOWY_TAIGA) mutatedBiomeId = SNOWY_TAIGA_HILLS;
|
else if (originalBiomeId == SNOWY_TAIGA) mutatedBiomeId = SNOWY_TAIGA_HILLS;
|
||||||
//Use BOP orchard instead of vanilla forest
|
//Use BOP orchard instead of vanilla forest
|
||||||
//else if (originalBiomeId == PLAINS) mutatedBiomeId = context.random(3) == 0 ? WOODED_HILLS : 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 == SNOWY_TUNDRA) mutatedBiomeId = SNOWY_MOUNTAINS;
|
||||||
else if (originalBiomeId == JUNGLE) mutatedBiomeId = JUNGLE_HILLS;
|
else if (originalBiomeId == JUNGLE) mutatedBiomeId = JUNGLE_HILLS;
|
||||||
|
|
|
@ -59,8 +59,6 @@ public class BiomesOPlenty
|
||||||
private void loadComplete(final FMLLoadCompleteEvent event) // PostRegistrationEven
|
private void loadComplete(final FMLLoadCompleteEvent event) // PostRegistrationEven
|
||||||
{
|
{
|
||||||
proxy.init();
|
proxy.init();
|
||||||
//GenLayerVisualizer.run();
|
|
||||||
ModCompatibility.setup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void serverStarting(final FMLServerAboutToStartEvent event)
|
private void serverStarting(final FMLServerAboutToStartEvent event)
|
||||||
|
|
|
@ -19,7 +19,8 @@ import com.google.common.collect.HashMultimap;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import net.minecraft.client.gui.screen.BiomeGeneratorTypeScreens;
|
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.util.registry.Registry;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.Biomes;
|
import net.minecraft.world.biome.Biomes;
|
||||||
|
@ -207,86 +208,78 @@ public class ModBiomes
|
||||||
|
|
||||||
private static void registerVillagerTypes()
|
private static void registerVillagerTypes()
|
||||||
{
|
{
|
||||||
registerVillagerType(alps, IVillagerType.SNOW);
|
registerVillagerType(alps, VillagerType.SNOW);
|
||||||
registerVillagerType(alps_foothills, IVillagerType.SNOW);
|
registerVillagerType(alps_foothills, VillagerType.SNOW);
|
||||||
registerVillagerType(bayou, IVillagerType.SWAMP);
|
registerVillagerType(bayou, VillagerType.SWAMP);
|
||||||
registerVillagerType(bog, IVillagerType.SWAMP);
|
registerVillagerType(bog, VillagerType.SWAMP);
|
||||||
registerVillagerType(boreal_forest, IVillagerType.TAIGA);
|
registerVillagerType(boreal_forest, VillagerType.TAIGA);
|
||||||
registerVillagerType(brushland, IVillagerType.SAVANNA);
|
registerVillagerType(brushland, VillagerType.SAVANNA);
|
||||||
registerVillagerType(chaparral, IVillagerType.PLAINS);
|
registerVillagerType(chaparral, VillagerType.PLAINS);
|
||||||
registerVillagerType(cherry_blossom_grove, IVillagerType.PLAINS);
|
registerVillagerType(cherry_blossom_grove, VillagerType.PLAINS);
|
||||||
registerVillagerType(cold_desert, IVillagerType.SNOW);
|
registerVillagerType(cold_desert, VillagerType.SNOW);
|
||||||
registerVillagerType(coniferous_forest, IVillagerType.TAIGA);
|
registerVillagerType(coniferous_forest, VillagerType.TAIGA);
|
||||||
registerVillagerType(dead_forest, IVillagerType.TAIGA);
|
registerVillagerType(dead_forest, VillagerType.TAIGA);
|
||||||
registerVillagerType(fir_clearing, IVillagerType.TAIGA);
|
registerVillagerType(fir_clearing, VillagerType.TAIGA);
|
||||||
registerVillagerType(floodplain, IVillagerType.JUNGLE);
|
registerVillagerType(floodplain, VillagerType.JUNGLE);
|
||||||
registerVillagerType(flower_meadow, IVillagerType.TAIGA);
|
registerVillagerType(flower_meadow, VillagerType.TAIGA);
|
||||||
registerVillagerType(fungal_jungle, IVillagerType.JUNGLE);
|
registerVillagerType(fungal_jungle, VillagerType.JUNGLE);
|
||||||
registerVillagerType(grassland, IVillagerType.PLAINS);
|
registerVillagerType(grassland, VillagerType.PLAINS);
|
||||||
registerVillagerType(gravel_beach, IVillagerType.PLAINS);
|
registerVillagerType(gravel_beach, VillagerType.PLAINS);
|
||||||
registerVillagerType(grove, IVillagerType.PLAINS);
|
registerVillagerType(grove, VillagerType.PLAINS);
|
||||||
registerVillagerType(highland, IVillagerType.PLAINS);
|
registerVillagerType(highland, VillagerType.PLAINS);
|
||||||
registerVillagerType(highland_moor, IVillagerType.PLAINS);
|
registerVillagerType(highland_moor, VillagerType.PLAINS);
|
||||||
registerVillagerType(lavender_field, IVillagerType.PLAINS);
|
registerVillagerType(lavender_field, VillagerType.PLAINS);
|
||||||
registerVillagerType(lush_grassland, IVillagerType.JUNGLE);
|
registerVillagerType(lush_grassland, VillagerType.JUNGLE);
|
||||||
registerVillagerType(lush_swamp, IVillagerType.JUNGLE);
|
registerVillagerType(lush_swamp, VillagerType.JUNGLE);
|
||||||
registerVillagerType(mangrove, IVillagerType.SWAMP);
|
registerVillagerType(mangrove, VillagerType.SWAMP);
|
||||||
registerVillagerType(maple_woods, IVillagerType.TAIGA);
|
registerVillagerType(maple_woods, VillagerType.TAIGA);
|
||||||
registerVillagerType(marsh, IVillagerType.SWAMP);
|
registerVillagerType(marsh, VillagerType.SWAMP);
|
||||||
registerVillagerType(meadow, IVillagerType.TAIGA);
|
registerVillagerType(meadow, VillagerType.TAIGA);
|
||||||
registerVillagerType(mire, IVillagerType.SWAMP);
|
registerVillagerType(mire, VillagerType.SWAMP);
|
||||||
registerVillagerType(muskeg, IVillagerType.SNOW);
|
registerVillagerType(muskeg, VillagerType.SNOW);
|
||||||
registerVillagerType(mystic_grove, IVillagerType.PLAINS);
|
registerVillagerType(mystic_grove, VillagerType.PLAINS);
|
||||||
registerVillagerType(oasis, IVillagerType.DESERT);
|
registerVillagerType(oasis, VillagerType.DESERT);
|
||||||
registerVillagerType(ominous_woods, IVillagerType.SWAMP);
|
registerVillagerType(ominous_woods, VillagerType.SWAMP);
|
||||||
registerVillagerType(orchard, IVillagerType.PLAINS);
|
registerVillagerType(orchard, VillagerType.PLAINS);
|
||||||
registerVillagerType(origin_hills, IVillagerType.PLAINS);
|
registerVillagerType(origin_hills, VillagerType.PLAINS);
|
||||||
registerVillagerType(outback, IVillagerType.SAVANNA);
|
registerVillagerType(outback, VillagerType.SAVANNA);
|
||||||
registerVillagerType(overgrown_cliffs, IVillagerType.JUNGLE);
|
registerVillagerType(overgrown_cliffs, VillagerType.JUNGLE);
|
||||||
registerVillagerType(pasture, IVillagerType.PLAINS);
|
registerVillagerType(pasture, VillagerType.PLAINS);
|
||||||
registerVillagerType(poppy_field, IVillagerType.PLAINS);
|
registerVillagerType(poppy_field, VillagerType.PLAINS);
|
||||||
registerVillagerType(prairie, IVillagerType.PLAINS);
|
registerVillagerType(prairie, VillagerType.PLAINS);
|
||||||
registerVillagerType(pumpkin_patch, IVillagerType.PLAINS);
|
registerVillagerType(pumpkin_patch, VillagerType.PLAINS);
|
||||||
registerVillagerType(rainbow_valley, IVillagerType.PLAINS);
|
registerVillagerType(rainbow_valley, VillagerType.PLAINS);
|
||||||
registerVillagerType(rainforest, IVillagerType.JUNGLE);
|
registerVillagerType(rainforest, VillagerType.JUNGLE);
|
||||||
registerVillagerType(redwood_forest, IVillagerType.PLAINS);
|
registerVillagerType(redwood_forest, VillagerType.PLAINS);
|
||||||
registerVillagerType(redwood_forest_edge, IVillagerType.PLAINS);
|
registerVillagerType(redwood_forest_edge, VillagerType.PLAINS);
|
||||||
registerVillagerType(scrubland, IVillagerType.SAVANNA);
|
registerVillagerType(scrubland, VillagerType.SAVANNA);
|
||||||
registerVillagerType(seasonal_forest, IVillagerType.PLAINS);
|
registerVillagerType(seasonal_forest, VillagerType.PLAINS);
|
||||||
registerVillagerType(shield, IVillagerType.TAIGA);
|
registerVillagerType(shield, VillagerType.TAIGA);
|
||||||
registerVillagerType(shrubland, IVillagerType.PLAINS);
|
registerVillagerType(shrubland, VillagerType.PLAINS);
|
||||||
registerVillagerType(silkglade, IVillagerType.SWAMP);
|
registerVillagerType(silkglade, VillagerType.SWAMP);
|
||||||
registerVillagerType(snowy_coniferous_forest, IVillagerType.SNOW);
|
registerVillagerType(snowy_coniferous_forest, VillagerType.SNOW);
|
||||||
registerVillagerType(snowy_fir_clearing, IVillagerType.SNOW);
|
registerVillagerType(snowy_fir_clearing, VillagerType.SNOW);
|
||||||
registerVillagerType(snowy_forest, IVillagerType.SNOW);
|
registerVillagerType(snowy_forest, VillagerType.SNOW);
|
||||||
registerVillagerType(steppe, IVillagerType.PLAINS);
|
registerVillagerType(steppe, VillagerType.PLAINS);
|
||||||
registerVillagerType(temperate_rainforest, IVillagerType.PLAINS);
|
registerVillagerType(temperate_rainforest, VillagerType.PLAINS);
|
||||||
registerVillagerType(temperate_rainforest_hills, IVillagerType.PLAINS);
|
registerVillagerType(temperate_rainforest_hills, VillagerType.PLAINS);
|
||||||
registerVillagerType(tropical_rainforest, IVillagerType.JUNGLE);
|
registerVillagerType(tropical_rainforest, VillagerType.JUNGLE);
|
||||||
registerVillagerType(tropic_beach, IVillagerType.JUNGLE);
|
registerVillagerType(tropic_beach, VillagerType.JUNGLE);
|
||||||
registerVillagerType(tropics, IVillagerType.JUNGLE);
|
registerVillagerType(tropics, VillagerType.JUNGLE);
|
||||||
registerVillagerType(tundra, IVillagerType.TAIGA);
|
registerVillagerType(tundra, VillagerType.TAIGA);
|
||||||
registerVillagerType(volcanic_plains, IVillagerType.PLAINS);
|
registerVillagerType(volcanic_plains, VillagerType.PLAINS);
|
||||||
registerVillagerType(volcano, IVillagerType.PLAINS);
|
registerVillagerType(volcano, VillagerType.PLAINS);
|
||||||
registerVillagerType(wasteland, IVillagerType.DESERT);
|
registerVillagerType(wasteland, VillagerType.DESERT);
|
||||||
registerVillagerType(wetland, IVillagerType.SWAMP);
|
registerVillagerType(wetland, VillagerType.SWAMP);
|
||||||
registerVillagerType(woodland, IVillagerType.PLAINS);
|
registerVillagerType(woodland, VillagerType.PLAINS);
|
||||||
registerVillagerType(xeric_shrubland, IVillagerType.DESERT);
|
registerVillagerType(xeric_shrubland, VillagerType.DESERT);
|
||||||
}
|
|
||||||
|
|
||||||
private static void registerBiomeToDictionary(Optional<Biome> biome, Type...types)
|
|
||||||
{
|
|
||||||
if (biome.isPresent())
|
|
||||||
{
|
|
||||||
BiomeDictionary.addTypes(biome.get(), types);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerVillagerType(Optional<Biome> biome, IVillagerType type)
|
private static void registerVillagerType(Optional<Biome> biome, VillagerType type)
|
||||||
{
|
{
|
||||||
if (biome.isPresent())
|
if (biome.isPresent())
|
||||||
{
|
{
|
||||||
IVillagerType.BY_BIOME.put(biome.get(), type);
|
VillagerType.BY_BIOME.put(biome.get(), type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue