Fix Optimize VarInts

Thank you, Martijn!
This commit is contained in:
IPECTER
2023-09-07 00:54:10 +09:00
parent 8441c27926
commit b8bd312430
5 changed files with 37 additions and 20 deletions

View File

@@ -12,9 +12,9 @@ LinearCongruentialGenerator#next(long, long) which is pretty heavy on performanc
We are able to do this by skipping around 370 of 512 possible calls to getBiome() by predicting the outcome
before doing the seed mixing. This seems to be around 25% - 75% faster depending on the use case.
We can predict much faster than the seed mixing.
diff --git a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
index 5695c5116c8a338b2e41aafcb2dc9f2146856970..7fdf087a9cd77732a1f90e33bbdca2837d3482d4 100644
index 5695c5116c8a338b2e41aafcb2dc9f2146856970..b2291854b9803fe01d40e8a1d76d6ff358cea114 100644
--- a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
+++ b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
@@ -12,6 +12,7 @@ public class BiomeManager {
@@ -162,10 +162,10 @@ index 5695c5116c8a338b2e41aafcb2dc9f2146856970..7fdf087a9cd77732a1f90e33bbdca283
public Holder<Biome> getNoiseBiomeAtPosition(double x, double y, double z) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index b552cb547fef8b4d87cb68e410d1b8fd669a9d4a..a21d691d9510efe960d36eb70fec97a3bb53048b 100644
index 7040b1c97292bd58ce531065078fb2df2533e562..bf323df50bc07e19ec6e3a4a11f3b7db466064c9 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -76,6 +76,11 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -81,6 +81,11 @@ public class GlobalConfiguration extends ConfigurationPart {
public class CarpetFixes extends ConfigurationPart {
public boolean enabled = DO_OPTIMIZE;