Compare commits
2 Commits
dev-1.20.2
...
release-96
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbce78374d | ||
|
|
23bc7620d2 |
@@ -1,10 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: IPECTER <ipectert@gmail.com>
|
From: IPECTER <ipectert@gmail.com>
|
||||||
Date: Tue, 28 Mar 2023 12:42:17 +0900
|
Date: Tue, 28 Mar 2023 12:42:17 +0900
|
||||||
Subject: [PATCH] Implement MemoryLeakFix
|
Subject: [PATCH] Improve BiomeTemperatureCache
|
||||||
|
|
||||||
Original: fxmorin/MemoryLeakFix
|
|
||||||
Copyright (C) 2023 fxmorin
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||||
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bfad12d127 100644
|
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bfad12d127 100644
|
||||||
@@ -15,7 +12,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
|
|||||||
private final BiomeSpecialEffects specialEffects;
|
private final BiomeSpecialEffects specialEffects;
|
||||||
// Pufferfish start - use our cache
|
// Pufferfish start - use our cache
|
||||||
- private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> {
|
- private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> {
|
||||||
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - MemoryLeakFix
|
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - Improve BiomeTemperatureCache
|
||||||
return Util.make(() -> {
|
return Util.make(() -> {
|
||||||
/*
|
/*
|
||||||
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
|
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
|
||||||
@@ -24,7 +21,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
|
|||||||
long l = blockPos.asLong();
|
long l = blockPos.asLong();
|
||||||
// Pufferfish start
|
// Pufferfish start
|
||||||
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get();
|
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get();
|
||||||
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - MemoryLeakFix
|
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve BiomeTemperatureCache
|
||||||
float f = cache.getValue(l);
|
float f = cache.getValue(l);
|
||||||
if (!Float.isNaN(f)) {
|
if (!Float.isNaN(f)) {
|
||||||
return f;
|
return f;
|
||||||
Reference in New Issue
Block a user