aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/makamys/lodmod/LODMod.java3
-rw-r--r--src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java4
-rw-r--r--src/main/java/makamys/lodmod/util/MCUtil.java20
-rw-r--r--src/main/resources/META-INF/LODMod_at.cfg3
4 files changed, 28 insertions, 2 deletions
diff --git a/src/main/java/makamys/lodmod/LODMod.java b/src/main/java/makamys/lodmod/LODMod.java
index c700f77..1490a0a 100644
--- a/src/main/java/makamys/lodmod/LODMod.java
+++ b/src/main/java/makamys/lodmod/LODMod.java
@@ -51,6 +51,7 @@ public class LODMod
public static double fogStart;
public static double fogEnd;
public static float maxSimpleMeshHeight;
+ public static boolean forceVanillaBiomeTemperature;
private File configFile;
@@ -83,6 +84,8 @@ public class LODMod
fogEnd = config.get("Fog", "fogEnd", "0.8").getDouble();
debugEnabled = config.get("Debug", "enabled", false).getBoolean();
maxSimpleMeshHeight = (float)config.get("Debug", "maxSimpleMeshHeight", 1000.0).getDouble();
+
+ forceVanillaBiomeTemperature = config.get("Simple mesh generation", "forceVanillaBiomeTemperature", true).getBoolean();
if(config.hasChanged()) {
config.save();
diff --git a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java
index 07bb084..4065b6c 100644
--- a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java
+++ b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java
@@ -17,6 +17,7 @@ import java.util.List;
import org.lwjgl.BufferUtils;
import makamys.lodmod.LODMod;
+import makamys.lodmod.util.MCUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockGrass;
import net.minecraft.block.BlockLeaves;
@@ -125,7 +126,8 @@ public class SimpleChunkMesh extends Mesh {
}
color = (0xFF << 24) | ((color >> 16 & 0xFF) << 0) | ((color >> 8 & 0xFF) << 8) | ((color >> 0 & 0xFF) << 16);
- if(biome.getFloatTemperature(worldX, y, worldZ) < 0.15f) {
+ if((LODMod.forceVanillaBiomeTemperature ? MCUtil.getBiomeTemperatureVanilla(biome, worldX, y, worldZ)
+ : biome.getFloatTemperature(worldX, y, worldZ)) < 0.15f) {
builder.addCube(divX, divZ, worldY + 0.2f, 1f, Blocks.snow_layer.getIcon(1, 0), 0xFFFFFFFF, brightnessMult);
builder.addCube(divX, divZ, worldY - 0.8f, -1, icon, color, brightnessMult);
diff --git a/src/main/java/makamys/lodmod/util/MCUtil.java b/src/main/java/makamys/lodmod/util/MCUtil.java
new file mode 100644
index 0000000..7f81d74
--- /dev/null
+++ b/src/main/java/makamys/lodmod/util/MCUtil.java
@@ -0,0 +1,20 @@
+package makamys.lodmod.util;
+
+import net.minecraft.world.biome.BiomeGenBase;
+
+public class MCUtil {
+
+ public static float getBiomeTemperatureVanilla(BiomeGenBase biome, int p_150564_1_, int p_150564_2_, int p_150564_3_){
+ if (p_150564_2_ > 64)
+ {
+ float f = (float)BiomeGenBase.temperatureNoise
+ .func_151601_a((double)p_150564_1_ * 1.0D / 8.0D, (double)p_150564_3_ * 1.0D / 8.0D) * 4.0F;
+ return biome.temperature - (f + (float)p_150564_2_ - 64.0F) * 0.05F / 30.0F;
+ }
+ else
+ {
+ return biome.temperature;
+ }
+ }
+
+}
diff --git a/src/main/resources/META-INF/LODMod_at.cfg b/src/main/resources/META-INF/LODMod_at.cfg
index ff15140..e28c810 100644
--- a/src/main/resources/META-INF/LODMod_at.cfg
+++ b/src/main/resources/META-INF/LODMod_at.cfg
@@ -1,2 +1,3 @@
public net.minecraft.client.renderer.texture.TextureMap field_94252_e #mapUploadedSprites
-public net.minecraft.client.renderer.Tessellator func_78379_d()V #reset \ No newline at end of file
+public net.minecraft.client.renderer.Tessellator func_78379_d()V #reset
+public net.minecraft.world.biome.BiomeGenBase field_150605_ac #temperatureNoise \ No newline at end of file