mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-22 00:09:20 +00:00
This is only intended for plot worlds, and disabled by default. Only use if you know what you're doing.
31 lines
1.7 KiB
Diff
31 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <kfian294ma4@gmail.com>
|
|
Date: Mon, 22 Jan 2024 15:52:33 +0000
|
|
Subject: [PATCH] Calculate biome noise once per chunk section
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
|
index f0de72afad4bb571153436399386a6a8a70582a6..0e38415230f4c59727cd8414ed3ff19b3b32f183 100644
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
|
@@ -227,12 +227,18 @@ public class LevelChunkSection {
|
|
|
|
public void fillBiomesFromNoise(BiomeResolver biomeSupplier, Climate.Sampler sampler, int x, int y, int z) {
|
|
PalettedContainer<Holder<Biome>> datapaletteblock = this.biomes.recreate();
|
|
+ Holder<Biome> biome = null; // Sakura
|
|
boolean flag = true;
|
|
|
|
for (int l = 0; l < 4; ++l) {
|
|
for (int i1 = 0; i1 < 4; ++i1) {
|
|
for (int j1 = 0; j1 < 4; ++j1) {
|
|
- datapaletteblock.getAndSetUnchecked(l, i1, j1, biomeSupplier.getNoiseBiome(x + l, y + i1, z + j1, sampler));
|
|
+ // Sakura start - calculate biome noise once per chunk section
|
|
+ if (biome == null || !me.samsuik.sakura.configuration.GlobalConfiguration.get().environment.calculateBiomeNoiseOncePerChunkSection) {
|
|
+ biome = biomeSupplier.getNoiseBiome(x + l, y + i1, z + j1, sampler);
|
|
+ }
|
|
+ datapaletteblock.getAndSetUnchecked(l, i1, j1, biome);
|
|
+ // Sakura end
|
|
}
|
|
}
|
|
}
|