Skip to content

Commit

Permalink
Removed remap-based-on-color option
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Apr 1, 2024
1 parent d980812 commit c00850b
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 39 deletions.
7 changes: 0 additions & 7 deletions src/main/java/net/raphimc/vialegacy/ViaLegacyConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class ViaLegacyConfig extends Config implements net.raphimc.vialegacy.pla
private boolean legacySkinLoading;
private boolean soundEmulation;
private boolean oldBiomes;
private boolean remapBasedOnColor;
private boolean enableB1_7_3Sprinting;
private int classicChunkRange;
private boolean enableClassicFly;
Expand All @@ -55,7 +54,6 @@ private void loadFields() {
this.legacySkinLoading = this.getBoolean("legacy-skin-loading", false);
this.soundEmulation = this.getBoolean("sound-emulation", true);
this.oldBiomes = this.getBoolean("old-biomes", true);
this.remapBasedOnColor = this.getBoolean("remap-based-on-color", true);
this.enableB1_7_3Sprinting = this.getBoolean("enable-b1_7_3-sprinting", false);
this.classicChunkRange = this.getInt("classic-chunk-range", 10);
this.enableClassicFly = this.getBoolean("enable-classic-fly", false);
Expand Down Expand Up @@ -105,11 +103,6 @@ public boolean isOldBiomes() {
return this.oldBiomes;
}

@Override
public boolean isRemapBasedOnColor() {
return this.remapBasedOnColor;
}

@Override
public boolean enableB1_7_3Sprinting() {
return this.enableB1_7_3Sprinting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public interface ViaLegacyConfig extends Config {

boolean isOldBiomes();

boolean isRemapBasedOnColor();

boolean enableB1_7_3Sprinting();

int getClassicChunkRange();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package net.raphimc.vialegacy.protocols.release.protocol1_2_1_3to1_1.biome.beta;

import net.raphimc.vialegacy.ViaLegacy;
import net.raphimc.vialegacy.api.model.ChunkCoord;
import net.raphimc.vialegacy.protocols.release.protocol1_2_1_3to1_1.biome.IWorldChunkManager;
import net.raphimc.vialegacy.protocols.release.protocol1_2_1_3to1_1.biome.release.NewBiomeGenBase;
Expand All @@ -34,25 +33,18 @@ public class WorldChunkManager_b1_7 implements IWorldChunkManager {
public double[] field_4196_c;
public OldBiomeGenBase[] field_4195_d;

private final boolean remapBasedOnColor;

public WorldChunkManager_b1_7(final long seed) {
field_4194_e = new NoiseGeneratorOctaves2(new Random(seed * 9871L), 4);
field_4193_f = new NoiseGeneratorOctaves2(new Random(seed * 39811L), 4);
field_4192_g = new NoiseGeneratorOctaves2(new Random(seed * 0x84a59L), 2);
this.remapBasedOnColor = ViaLegacy.getConfig().isRemapBasedOnColor();
}

@Override
public byte[] getBiomeDataAt(int chunkX, int chunkZ) {
final byte[] biomeData = new byte[256];
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
if (this.remapBasedOnColor) {
biomeData[z << 4 | x] = (byte) this.getBiomeGenAt((chunkX * 16) + x, (chunkZ * 16) + z).colorBiomeID;
} else {
biomeData[z << 4 | x] = (byte) this.getBiomeGenAt((chunkX * 16) + x, (chunkZ * 16) + z).biomeID;
}
biomeData[z << 4 | x] = (byte) this.getBiomeGenAt((chunkX * 16) + x, (chunkZ * 16) + z).biomeID;
}
}
return biomeData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class NewBiomeGenBase {
public static final NewBiomeGenBase desert = new NewBiomeGenBase(2).setTemperatureRainfall(2.0F, 0.0F);
public static final NewBiomeGenBase extremeHills = new NewBiomeGenBase(3).setTemperatureRainfall(0.2F, 0.3F);
public static final NewBiomeGenBase forest = new NewBiomeGenBase(4).setTemperatureRainfall(0.7F, 0.8F);
public static final NewBiomeGenBase taiga = new NewBiomeGenBase(5, 30).setTemperatureRainfall(0.05F, 0.8F);
public static final NewBiomeGenBase swampland = new NewBiomeGenBase(6, 1).setTemperatureRainfall(0.8F, 0.9F);
public static final NewBiomeGenBase taiga = new NewBiomeGenBase(5).setTemperatureRainfall(0.05F, 0.8F);
public static final NewBiomeGenBase swampland = new NewBiomeGenBase(6).setTemperatureRainfall(0.8F, 0.9F);
public static final NewBiomeGenBase river = new NewBiomeGenBase(7);
public static final NewBiomeGenBase hell = new NewBiomeGenBase(8).setTemperatureRainfall(2.0F, 0.0F);
public static final NewBiomeGenBase sky = new NewBiomeGenBase(9);
Expand All @@ -49,23 +49,16 @@ public class NewBiomeGenBase {
public static final NewBiomeGenBase mutatedJungleEdge = new NewBiomeGenBase(151); //This is here for the OldWorldChunkManager

public final int biomeID;
public int colorBiomeID;
public float temperature;
public float rainfall;

protected NewBiomeGenBase(int i) {
biomeID = i;
colorBiomeID = i;
if (i <= 20) {
BIOME_LIST[i] = this;
}
}

public NewBiomeGenBase(int i, int colorBiomeID) {
this(i);
this.colorBiomeID = colorBiomeID;
}

private NewBiomeGenBase setTemperatureRainfall(float f, float f1) {
if (f > 0.1F && f < 0.2F) {
throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package net.raphimc.vialegacy.protocols.release.protocol1_2_1_3to1_1.biome.release;

import com.viaversion.viaversion.api.connection.UserConnection;
import net.raphimc.vialegacy.ViaLegacy;
import net.raphimc.vialegacy.protocols.release.protocol1_2_1_3to1_1.biome.IWorldChunkManager;
import net.raphimc.vialegacy.protocols.release.protocol1_2_1_3to1_1.biome.release.genlayer.GenLayer;

Expand All @@ -29,12 +28,9 @@ public class WorldChunkManager_r1_1 implements IWorldChunkManager {
private GenLayer rainfallLayer;
private final BiomeCache biomeCache;

private final boolean remapBasedOnColor;

protected WorldChunkManager_r1_1() {
IntCache.resetEverything();
biomeCache = new BiomeCache(this);
this.remapBasedOnColor = ViaLegacy.getConfig().isRemapBasedOnColor();
}

public WorldChunkManager_r1_1(final UserConnection user, final long seed) {
Expand All @@ -50,11 +46,7 @@ public byte[] getBiomeDataAt(int chunkX, int chunkZ) {
final byte[] biomeData = new byte[256];
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
if (this.remapBasedOnColor) {
biomeData[z << 4 | x] = (byte) this.getBiomeGenAt((chunkX * 16) + x, (chunkZ * 16) + z).colorBiomeID;
} else {
biomeData[z << 4 | x] = (byte) this.getBiomeGenAt((chunkX * 16) + x, (chunkZ * 16) + z).biomeID;
}
biomeData[z << 4 | x] = (byte) this.getBiomeGenAt((chunkX * 16) + x, (chunkZ * 16) + z).biomeID;
}
}
return biomeData;
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/assets/vialegacy/vialegacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ sound-emulation: true
# Calculate <= 1.1 biomes. Requires a lot of extra calculations
old-biomes: true
#
# Remap <= 1.1 biomes based on color
remap-based-on-color: true
#
# Enables sprinting for versions below beta 1.8. !THIS CAN CAUSE ISSUES WITH ANTI-CHEAT PLUGINS!
enable-b1_7_3-sprinting: false
#
Expand Down

0 comments on commit c00850b

Please sign in to comment.