biome rework test 2

This commit is contained in:
Sen 2025-07-23 00:59:37 +02:00
parent b524eeeaa3
commit eec61c9258
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
6 changed files with 10 additions and 7 deletions

View file

@ -1723,7 +1723,7 @@ public class Client implements IThreadListener {
String lline;
if(this.world.isBlockLoaded(blockpos)) {
ChunkClient chunk = this.world.getChunk(blockpos);
bline = String.format("Biom: %.2f K, N: %.2f K, D: %s (%s)", 0.0f, 0.0f,
bline = String.format("Biom: %.2f K, N: %.2f K, D: %s (%s)", chunk.getTemperature(blockpos), chunk.getOffset(blockpos),
TextColor.stripCodes(this.world.dimension.getDisplay()),
this.dimensionName == null ? UniverseRegistry.getName(this.world.dimension) : this.dimensionName);
lline = "Licht: " + chunk.getLightSub(blockpos, 0) + " (" + chunk.getLight(LightType.SKY, blockpos) + " Himmel, "

View file

@ -15,9 +15,10 @@ public class ItemScanner extends ItemWand {
public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec)
{
player.connection.addHotbar(TextColor.NEON + "* Position in %s: %.3f %.3f %.3f, %.2f K, %.2f °C", world.dimension.getDisplay(),
BlockPos pos = new BlockPos(vec);
player.connection.addHotbar(TextColor.NEON + "* Position in %s: %.1f %.1f %.1f, %.1f K, %.1f °C, G: %.1f °C, %.1f %%", world.dimension.getDisplay(),
vec.xCoord, vec.yCoord, vec.zCoord,
world.getTemperatureK(new BlockPos(vec)), world.getTemperatureC(new BlockPos(vec)));
world.getTemperatureK(pos), world.getTemperatureC(pos), world.getGenTemperature(pos.getX(), pos.getZ()), world.getGenHumidity(pos.getX(), pos.getZ()));
}
public int getRange(ItemStack stack, EntityNPC player) {

View file

@ -50,4 +50,6 @@ public abstract class AWorldServer extends World {
public abstract void growGrass(BlockPos pos, State state, Random rand);
public abstract boolean generateBigMushroom(BlockPos pos, State state, Random rand);
public abstract void generateTree(BlockPos pos, State state, Random rand);
public abstract float getGenTemperature(int x, int z);
public abstract float getGenHumidity(int x, int z);
}

View file

@ -2353,7 +2353,7 @@ public final class WorldServer extends AWorldServer {
}
public float getGenTemperature(int x, int z) {
return this.dimension.getTemperature() + (this.biomeGen == null ? 0.0f : this.biomeGen.getBiomeAt(x, z).temperature);
return World.ABSOLUTE_ZERO + this.dimension.getTemperature() + this.dimension.getOrbitOffset() * 0.5f + (this.biomeGen == null ? 0.0f : this.biomeGen.getBiomeAt(x, z).temperature);
}
public float getGenHumidity(int x, int z) {

View file

@ -65,7 +65,7 @@ public class ReplacerAltSimple extends ReplacerBiome
if (by < this.seaLevel && (surface == null || surface.getBlock() == Blocks.air))
{
if (this.freeze && world.getTemperatureC(pos.set(x, by, z)) <= 0.0F)
if (this.freeze && world.getTemperatureC(pos.set((x & ~15) | bz, by, (z & ~15) | bx)) <= 0.0F)
{
surface = Blocks.ice.getState();
}

View file

@ -24,8 +24,8 @@ public class ReplacerTerranian extends ReplacerAltSimple {
public void genTerrainBlocks(WorldServer world, Random rand, ChunkPrimer primer, int x, int z, double noise)
{
float absTemp = world.getGenTemperature(x, z);
float humidity = world.getGenHumidity(x, z);
float absTemp = world.getGenTemperature((x & ~15) | (z & 15), (z & ~15) | (x & 15));
float humidity = world.getGenHumidity((x & ~15) | (z & 15), (z & ~15) | (x & 15));
State topBlock = this.surface;
State fillerBlock = this.top;