9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-27 10:39:12 +00:00
This commit is contained in:
Dreeam
2024-11-03 04:49:12 -05:00
parent eb399bb84f
commit b8310d5f89
32 changed files with 1193 additions and 1413 deletions

View File

@@ -6,7 +6,7 @@ import kotlin.io.path.deleteRecursively
plugins {
java
`maven-publish`
id("io.papermc.paperweight.patcher") version "1.7.3"
id("io.papermc.paperweight.patcher") version "1.7.4"
}
allprojects {

View File

@@ -1,8 +1,8 @@
group=org.galemc.gale
version=1.21.1-R0.1-SNAPSHOT
version=1.21.3-R0.1-SNAPSHOT
mcVersion=1.21.1
paperRef=84281ceeefb9d294758a9a292ba6c01da40e8409
mcVersion=1.21.3
paperRef=ce0a0419476d1072ca739a0e8f22d8a358c1c1a2
org.gradle.caching=false
org.gradle.parallel=true

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/build.gradle.kts b/build.gradle.kts
index ab84a1405acc1f0d5f267892243b82b8dab03e21..7d5f68599e680bd6ce21ff32c902a994e8fc6538 100644
index 254fd96d3950b4494c7e43547b00b5175ee53c93..855a5eb171ce94444de1313eafacf3558c4cf728 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -131,6 +131,15 @@ val generateApiVersioningFile by tasks.registering {
@@ -135,6 +135,15 @@ val generateApiVersioningFile by tasks.registering {
}
}
@@ -26,7 +26,7 @@ index ab84a1405acc1f0d5f267892243b82b8dab03e21..7d5f68599e680bd6ce21ff32c902a994
tasks.jar {
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
into("META-INF/maven/${project.group}/${project.name}")
@@ -190,6 +199,8 @@ tasks.withType<Javadoc> {
@@ -194,6 +203,8 @@ tasks.withType<Javadoc> {
into("build/docs/javadoc")
}
}

View File

@@ -46,10 +46,10 @@ index 94a9ed024d3859793618152ea559a168bbcbb5e2..e60008693e017bec1b4eb49c84be3898
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+<https://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/build.gradle.kts b/build.gradle.kts
index 7d5f68599e680bd6ce21ff32c902a994e8fc6538..a4c827331900d292febae384701bcd51add111d9 100644
index 855a5eb171ce94444de1313eafacf3558c4cf728..40fed07c4f1d6205dd79021641fc1395816e7354 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -149,6 +149,12 @@ tasks.jar {
@@ -153,6 +153,12 @@ tasks.jar {
"Automatic-Module-Name" to "org.bukkit"
)
}

View File

@@ -13,10 +13,10 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/build.gradle.kts b/build.gradle.kts
index a4c827331900d292febae384701bcd51add111d9..1a4598388a101795237cba9789b89f0511aca77c 100644
index 40fed07c4f1d6205dd79021641fc1395816e7354..180c44678973f690c05cab9e5aabcd3715aeb021 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -137,6 +137,7 @@ tasks.withType<JavaCompile> {
@@ -141,6 +141,7 @@ tasks.withType<JavaCompile> {
compilerArgs.add("-Xlint:-module")
compilerArgs.add("-Xlint:-removal")
compilerArgs.add("-Xlint:-dep-ann")
@@ -24,7 +24,7 @@ index a4c827331900d292febae384701bcd51add111d9..1a4598388a101795237cba9789b89f05
}
// Gale end - hide irrelevant compilation warnings
@@ -207,6 +208,7 @@ tasks.withType<Javadoc> {
@@ -211,6 +212,7 @@ tasks.withType<Javadoc> {
}
options.addStringOption("Xdoclint:none", "-quiet") // Gale - hide irrelevant compilation warnings

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 7c56182acaf827f4b1a986a61cea8e9960604c98..328c34dee07311193d41f36c0976ed09135ab448 100644
index 95f0b3186e313c7fbd5c8531d52b82a69e525f94..b9ccc3dda46ab0e759faff9a299798dd75a310eb 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2113,6 +2113,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2153,6 +2153,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
boolean listPlayer(@NotNull Player other);
// Paper end

View File

@@ -34,10 +34,10 @@ index b0d26b0eadb2a43924629424a6c13198aace8f69..e8b8c453a7ff7af0a60ae915cfd85aba
for (T executionCommandSource2 : list) {
diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java
index 68dda6a3257ca18c1e6c7659d62455da46d187e2..f8fa36b7c3763fed2392d62188bd210241e8f313 100644
index eaa47e644926d6ec32e1c70523a0e713bc4c4906..4e7ed7fa08fabb4c253c75db41f7f24947aefff0 100644
--- a/src/main/java/net/minecraft/util/ExtraCodecs.java
+++ b/src/main/java/net/minecraft/util/ExtraCodecs.java
@@ -223,7 +223,7 @@ public class ExtraCodecs {
@@ -226,7 +226,7 @@ public class ExtraCodecs {
P object2 = listx.get(1);
return combineFunction.apply(object, object2);
}), pair -> ImmutableList.of(leftFunction.apply((I)pair), rightFunction.apply((I)pair)));
@@ -46,7 +46,7 @@ index 68dda6a3257ca18c1e6c7659d62455da46d187e2..f8fa36b7c3763fed2392d62188bd2102
instance -> instance.group(codec.fieldOf(leftFieldName).forGetter(Pair::getFirst), codec.fieldOf(rightFieldName).forGetter(Pair::getSecond))
.apply(instance, Pair::of)
)
@@ -240,14 +240,14 @@ public class ExtraCodecs {
@@ -243,14 +243,14 @@ public class ExtraCodecs {
});
}
@@ -63,7 +63,7 @@ index 68dda6a3257ca18c1e6c7659d62455da46d187e2..f8fa36b7c3763fed2392d62188bd2102
}
public <T> DataResult<T> coApply(DynamicOps<T> dynamicOps, A object, DataResult<T> dataResult) {
@@ -256,7 +256,7 @@ public class ExtraCodecs {
@@ -259,7 +259,7 @@ public class ExtraCodecs {
@Override
public String toString() {
@@ -86,7 +86,7 @@ index 2942534d265416a3693848d76538c04735bc14fa..3f48037d5d6a4965b895fde69825d3b2
.put(levelDynamic.createString("x"), levelDynamic.createInt(sectionX * 16 + i))
.put(levelDynamic.createString("y"), levelDynamic.createInt(sectionY * 16 + j))
diff --git a/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java b/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java
index 9167bad12e1be3f4163f85987862b044a630b2eb..7ba3a3ca57b55f796a90b700b930f365c3508484 100644
index 7174613ef2cac0f27c72dcfa2f822199ffbc79e5..38428ba2c522108f4f9f7986bc3535d1232ac1f8 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java
@@ -177,10 +177,10 @@ public class SurfaceRules {
@@ -102,7 +102,7 @@ index 9167bad12e1be3f4163f85987862b044a630b2eb..7ba3a3ca57b55f796a90b700b930f365
}
@Override
@@ -514,12 +514,14 @@ public class SurfaceRules {
@@ -522,12 +522,14 @@ public class SurfaceRules {
}
@Override
@@ -120,7 +120,7 @@ index 9167bad12e1be3f4163f85987862b044a630b2eb..7ba3a3ca57b55f796a90b700b930f365
}
@Override
@@ -655,12 +657,12 @@ public class SurfaceRules {
@@ -663,12 +665,12 @@ public class SurfaceRules {
}
@Override
@@ -135,7 +135,7 @@ index 9167bad12e1be3f4163f85987862b044a630b2eb..7ba3a3ca57b55f796a90b700b930f365
}
@Override
@@ -748,26 +750,32 @@ public class SurfaceRules {
@@ -756,26 +758,32 @@ public class SurfaceRules {
}
@Override
@@ -178,7 +178,7 @@ index 9167bad12e1be3f4163f85987862b044a630b2eb..7ba3a3ca57b55f796a90b700b930f365
return (double)randomSource.nextFloat() < d;
}
}
@@ -795,10 +803,10 @@ public class SurfaceRules {
@@ -803,10 +811,10 @@ public class SurfaceRules {
}
@Override
@@ -191,7 +191,7 @@ index 9167bad12e1be3f4163f85987862b044a630b2eb..7ba3a3ca57b55f796a90b700b930f365
}
@Override
@@ -833,10 +841,10 @@ public class SurfaceRules {
@@ -841,10 +849,10 @@ public class SurfaceRules {
}
@Override

View File

@@ -7,11 +7,11 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/build.gradle.kts b/build.gradle.kts
index ee1b8fbab56ff0a85a4f2bd071a0de5111aa1d4f..381b4b5d2cc54497c7db46218acc58313552ad78 100644
index d600158c16341591ec7cd08d7c2894fb34fdab4b..5cc16e573241106d2a8b67c2f6e1a9338cfe6708 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -72,6 +72,15 @@ paperweight {
craftBukkitPackageVersion.set("v1_21_R1") // also needs to be updated in MappingEnvironment
craftBukkitPackageVersion.set("v1_21_R2") // also needs to be updated in MappingEnvironment
}
+// Gale start - hide irrelevant compilation warnings

View File

@@ -221,7 +221,7 @@ index 94a9ed024d3859793618152ea559a168bbcbb5e2..e60008693e017bec1b4eb49c84be3898
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+<https://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/build.gradle.kts b/build.gradle.kts
index adb8c4f3ed3cb22b62a4b4eb867b197b10cfac54..badd1433e27e2e95b165618de280cba1ff10a69d 100644
index c8c3599a780bbc02a1ead1fe66498733ea4075c2..ead700089f8867e38699db409c13162f1014f58a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -94,14 +94,14 @@ tasks.jar {
@@ -477,10 +477,10 @@ index bb1a60180e58c1333e7bb33e8acf1b0225eda8a8..4d037e899e0b5548be406ad55acd2062
DamageSource damageSource = this.cloneInstance();
damageSource.customEventDamager = entity;
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index 40689256711cc94a806ca1da346f4f62eda31526..11cf6a20550e252501a92be5bdffafcff007cbf9 100644
index 78922c3e9a69db1774dd846047b79e9523d7cf41..84bc6585702f8d7a801530b09f18912ac083404d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -177,7 +177,13 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
@@ -274,7 +274,13 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
// Paper start
private static void printOversizedLog(String msg, Path file, int x, int z) {
@@ -496,24 +496,24 @@ index 40689256711cc94a806ca1da346f4f62eda31526..11cf6a20550e252501a92be5bdffafcf
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 2f4d6b56301195f8d39ed50dffe842464065bfe1..bdfb969f88e68d89a5cad4b145bbc1441a110bac 100644
index 6fef86e47e37eab6721cfd67d494afb25a2ded68..29aa7549e0082f0061a94b5b2f59aeec39b17c6c 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -492,7 +492,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -491,7 +491,7 @@ public class CraftScheduler implements BukkitScheduler {
this.parsePending();
} else {
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(this.currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
- task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Paper"); // Paper
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Gale"); // Paper // Gale - branding changes
// We don't need to parse pending
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index d06aab9bd5cd901c8367f9680f5d27ddb17b3dc4..4d0de69b730599d7a89903dd862b89d51ba79e1b 100644
index 83020837e29ee627b1081daddb4bdee147b95af3..71d526cf165ff63a7344e19864eed409f3952fbb 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -489,7 +489,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -505,7 +505,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
// Paper start
@Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
- return new com.destroystokyo.paper.PaperVersionFetcher();

View File

@@ -6,21 +6,35 @@ Subject: [PATCH] Gale metrics
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
index b1456c1ddf24b625c6caf41a9379d8c011e1c36c..be7a4e2fd8823925847949d33358d64d464ec79f 100644
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
@@ -65,7 +65,7 @@ public final class ChunkTaskScheduler {
diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java
index c125c70a68130be373acc989053a6c0e487be924..bd43c483c2f0837d3d4db9e0a9bc624c8c7b65ba 100644
--- a/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java
+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java
@@ -11,6 +11,10 @@ import java.util.function.Consumer;
public final class MoonriseCommon {
private static final Logger LOGGER = LogUtils.getClassLogger();
private static final Logger LOGGER = LoggerFactory.getLogger(MoonriseCommon.class);
+ // Gale start - metrics - chunk system IO threads
+ public static int chunkSystemIOThreads;
+ public static int chunkSystemWorkerThreads;
+ // Gale end - metrics - chunk system IO threads
public static final PrioritisedThreadPool WORKER_POOL = new PrioritisedThreadPool(
new Consumer<>() {
@@ -54,6 +58,11 @@ public final class MoonriseCommon {
final int ioThreads = Math.max(1, configIoThreads);
+ // Gale start - metrics - chunk system IO threads
+ chunkSystemIOThreads = ioThreads;
+ chunkSystemWorkerThreads = workerThreads;
+ // Gale end - metrics - chunk system IO threads
+
WORKER_POOL.adjustThreadCount(workerThreads);
IO_POOL.adjustThreadCount(ioThreads);
- static int newChunkSystemIOThreads;
+ public static int newChunkSystemIOThreads; // Gale - metrics - chunk system IO threads - package-private -> public
static int newChunkSystemGenParallelism;
static int newChunkSystemGenPopulationParallelism;
static int newChunkSystemLoadParallelism;
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 4b002e8b75d117b726b0de274a76d3596fce015b..7e1405d5e2b847b28b07cb94fcbf5dec78706e34 100644
index 4b002e8b75d117b726b0de274a76d3596fce015b..e848529892c07cad638090a39ef738b4a068db3e 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -593,7 +593,7 @@ public class Metrics {
@@ -77,7 +91,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..7e1405d5e2b847b28b07cb94fcbf5dec
entry.put(String.valueOf(legacy), 1);
// create buckets as higher dimension
@@ -676,6 +676,253 @@ public class Metrics {
@@ -676,6 +676,256 @@ public class Metrics {
return map;
}));
@@ -216,7 +230,10 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..7e1405d5e2b847b28b07cb94fcbf5dec
+ }));
+ // Gale end - metrics - netty threads
+
+ metrics.addCustomChart(new Metrics.SimplePie("chunk_system_io_thread_count", () -> String.valueOf(ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.newChunkSystemIOThreads))); // Gale - metrics - chunk system IO threads
+ // Gale start - metrics - chunk system threads
+ metrics.addCustomChart(new Metrics.SimplePie("chunk_system_io_thread_count", () -> String.valueOf(ca.spottedleaf.moonrise.common.util.MoonriseCommon.chunkSystemIOThreads)));
+ metrics.addCustomChart(new Metrics.SimplePie("chunk_system_worker_thread_count", () -> String.valueOf(ca.spottedleaf.moonrise.common.util.MoonriseCommon.chunkSystemWorkerThreads)));
+ // Gale end - metrics - chunk system threads
+
+ // Gale start - metrics - physical cores
+ metrics.addCustomChart(new Metrics.SimplePie("physical_core_count", () -> {

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 7e1405d5e2b847b28b07cb94fcbf5dec78706e34..66477f772ffb9271cf647dfb7567d75c3d5145fb 100644
index e848529892c07cad638090a39ef738b4a068db3e..cb9e42fea57856f9ab649e33df26071db1b7790f 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -923,6 +923,16 @@ public class Metrics {
@@ -926,6 +926,16 @@ public class Metrics {
}));
// Gale end - metrics - runtime max memory

View File

@@ -12,31 +12,6 @@ By: Jake Potrebic <jake.m.potrebic@gmail.com>
As part of: Paper (https://github.com/PaperMC/Paper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index 7620c72a4c243cbeea245203ce03a97cbfa7d922..29796a404e210f7864f4b33b3367e02531bca2a0 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -240,7 +240,10 @@ public class TimingsExport extends Thread {
parent.put("config", createObject(
pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null))
+ // Gale start - Gale configuration - include in timings
+ pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)),
+ pair("gale", mapAsJSON(Bukkit.spigot().getGaleConfig(), null))
+ // Gale end - Gale configuration - include in timings
));
new TimingsExport(listeners, parent, history).start();
@@ -281,7 +284,7 @@ public class TimingsExport extends Thread {
return timingsCost;
}
- private static JSONObject mapAsJSON(ConfigurationSection config, String parentKey) {
+ public static JSONObject mapAsJSON(ConfigurationSection config, String parentKey) { // Gale - Gale configuration
JSONObject object = new JSONObject();
for (String key : config.getKeys(false)) {
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
index 87e5f614ba988547a827486740db217e28585773..38d99d73a33911afa71d02a456bb4df62ce75166 100644
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
@@ -189,7 +164,7 @@ index 8f23276796037d048eb114952891a01a40971b3e..ac9ceb54b894119cb30a22d37e035e2c
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 696d075ca2883f3c37e35f983c4d020e5db89d16..1840332f79c5cfc2a913d80d9885939be92f87d6 100644
index 64b56abf8900d0424100da460fc68ac964394793..072e0188280d4d49fd5a96dbfa95344eec250e8b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -3,9 +3,6 @@ package net.minecraft.server;
@@ -202,7 +177,7 @@ index 696d075ca2883f3c37e35f983c4d020e5db89d16..1840332f79c5cfc2a913d80d9885939b
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -149,6 +146,9 @@ import net.minecraft.world.level.levelgen.WorldOptions;
@@ -156,6 +153,9 @@ import net.minecraft.world.level.levelgen.WorldOptions;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
import net.minecraft.world.level.storage.WorldData;
@@ -212,7 +187,7 @@ index 696d075ca2883f3c37e35f983c4d020e5db89d16..1840332f79c5cfc2a913d80d9885939b
import org.slf4j.Logger;
// CraftBukkit start
@@ -317,6 +317,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -327,6 +327,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final double[] recentTps = new double[ 3 ];
// Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
@@ -220,7 +195,7 @@ index 696d075ca2883f3c37e35f983c4d020e5db89d16..1840332f79c5cfc2a913d80d9885939b
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
public volatile Thread shutdownThread; // Paper
@@ -496,6 +497,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -510,6 +511,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
// CraftBukkit end
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
@@ -274,10 +249,10 @@ index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..67d4a82f371a4772128cc2218fd0a18c
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index dd56c8e041116ef3602a9f89c998c8208ab89b51..86c615518e315dd4425d17df163e88a150a4ef7c 100644
index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..9ce281e220089ea2a9218c25879f42aafa0a4011 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -226,6 +226,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -223,6 +223,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
// Paper end - initialize global and world-defaults configuration
@@ -289,23 +264,23 @@ index dd56c8e041116ef3602a9f89c998c8208ab89b51..86c615518e315dd4425d17df163e88a1
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index f9abf63e12ea930275121b470e4e4906cff0fc12..e20b7a1ad141834a10c5f23f9b27cc41fa25ac0d 100644
index 5964d601c05176f48167cc92057a59e52a4da92b..d406eebb7efb00b79128bdceb71d51be4efbce4c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -503,7 +503,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
@@ -590,7 +590,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), spigotConfig -> minecraftserver.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor // Gale - Gale configuration
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), spigotConfig -> minecraftserver.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor // Gale - Gale configuration
this.pvpMode = minecraftserver.isPvpAllowed();
this.convertable = convertable_conversionsession;
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 507671476c3d2d92a2fdb05be24443af27d26dcf..32cd737206dd9f2bcfdacfe17dc0621ee34b589a 100644
index 022de445bbbb869c38be4972c98dcf1c665539ec..c0e4b996715dec16dd181b7dac87c361a16a1f7f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -12,7 +12,6 @@ import java.util.function.Supplier;
@@ -11,7 +11,6 @@ import java.util.function.Predicate;
import javax.annotation.Nullable;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
@@ -322,15 +297,15 @@ index 507671476c3d2d92a2fdb05be24443af27d26dcf..32cd737206dd9f2bcfdacfe17dc0621e
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
@@ -101,6 +98,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
@@ -103,6 +100,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
import org.bukkit.entity.SpawnCategory;
import org.bukkit.event.block.BlockPhysicsEvent;
+import org.galemc.gale.configuration.GaleWorldConfiguration;
// CraftBukkit end
public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel, ca.spottedleaf.moonrise.patches.chunk_system.world.ChunkSystemEntityGetter, ca.spottedleaf.moonrise.patches.collisions.world.CollisionLevel { // Paper - rewrite chunk system // Paper - optimise collisions
@@ -171,6 +169,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel, ca.spottedleaf.moonrise.patches.chunk_system.world.ChunkSystemEntityGetter { // Paper - rewrite chunk system // Paper - optimise collisions
@@ -172,6 +170,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
return this.paperConfig;
}
// Paper end - add paper world config
@@ -342,13 +317,18 @@ index 507671476c3d2d92a2fdb05be24443af27d26dcf..32cd737206dd9f2bcfdacfe17dc0621e
+ // Gale end - Gale configuration
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
@@ -684,9 +688,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
public static BlockPos lastPhysicsProblem; // Spigot
@@ -830,7 +834,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
// Paper end - optimise random ticking
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration
// Paper start - getblock optimisations - cache world height/sections
final DimensionType dimType = holder.value();
this.minY = dimType.minY();
@@ -842,6 +846,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
// Paper end - getblock optimisations - cache world height/sections
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
+ this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration
@@ -356,18 +336,18 @@ index 507671476c3d2d92a2fdb05be24443af27d26dcf..32cd737206dd9f2bcfdacfe17dc0621e
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c7df339aeb62ee627edaf1bb4c8474b61e357ba6..b1c1e600100ac31ecb20473b8ad2853676dff84a 100644
index b185a9b474121b8a4067816b3c3c39270c2a202e..9009da78ba2d7751b974123ce76a37af98189b6a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1072,6 +1072,7 @@ public final class CraftServer implements Server {
@@ -1074,6 +1074,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console);
+ this.console.galeConfigurations.reloadConfigs(this.console); // Gale - Gale configuration
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -2990,6 +2991,14 @@ public final class CraftServer implements Server {
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -3009,6 +3010,14 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}
@@ -793,28 +773,3 @@ index 0000000000000000000000000000000000000000..b82bb95b524c95cdefb81abef906eded
+ }
+
+}
diff --git a/src/main/java/org/galemc/gale/configuration/timingsexport/GaleConfigurationTimingsExport.java b/src/main/java/org/galemc/gale/configuration/timingsexport/GaleConfigurationTimingsExport.java
new file mode 100644
index 0000000000000000000000000000000000000000..579c2e69d8f6ce8398eb1297d1d1ead98c9068a5
--- /dev/null
+++ b/src/main/java/org/galemc/gale/configuration/timingsexport/GaleConfigurationTimingsExport.java
@@ -0,0 +1,19 @@
+// Gale - Gale configuration
+
+package org.galemc.gale.configuration.timingsexport;
+
+import co.aikar.timings.TimingsExport;
+import org.bukkit.Bukkit;
+import org.jetbrains.annotations.NotNull;
+import org.json.simple.JSONObject;
+
+public final class GaleConfigurationTimingsExport {
+
+ private GaleConfigurationTimingsExport() {}
+
+ public static @NotNull JSONObject get() {
+ var json = TimingsExport.mapAsJSON(Bukkit.spigot().getGaleConfig(), null);
+ return json;
+ }
+
+}

View File

@@ -13,10 +13,10 @@ As part of: Paper (https://github.com/PaperMC/Paper)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 86c615518e315dd4425d17df163e88a150a4ef7c..8306edb6fb28e90ba4b432a07131e063daa70507 100644
index 9ce281e220089ea2a9218c25879f42aafa0a4011..43e2ffd275e4ea74edf5eb4065ce2ccb415740f3 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -57,6 +57,7 @@ import net.minecraft.world.level.GameRules;
@@ -56,6 +56,7 @@ import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.entity.SkullBlockEntity;
import net.minecraft.world.level.storage.LevelStorageSource;
@@ -24,7 +24,7 @@ index 86c615518e315dd4425d17df163e88a150a4ef7c..8306edb6fb28e90ba4b432a07131e063
import org.slf4j.Logger;
// CraftBukkit start
@@ -240,6 +241,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -237,6 +238,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/util/Mth.java b/src/main/java/net/minecraft/util/Mth.java
index 3468b7fbc7440f220fce8039f237658a593df296..cb8cde3c1b65329f92b7c78e529e128f5a408fd6 100644
index 6b21782ad18cd5dbd1b9a59e5dc12c670c2a42fb..34bfbbabe3dfbf033f4a4e22a049323213fb23f3 100644
--- a/src/main/java/net/minecraft/util/Mth.java
+++ b/src/main/java/net/minecraft/util/Mth.java
@@ -149,14 +149,26 @@ public class Mth {
@@ -40,10 +40,10 @@ index 3468b7fbc7440f220fce8039f237658a593df296..cb8cde3c1b65329f92b7c78e529e128f
return a % b == 0;
}
diff --git a/src/main/java/net/minecraft/world/level/levelgen/blending/Blender.java b/src/main/java/net/minecraft/world/level/levelgen/blending/Blender.java
index ef73772bd3f9484efbcd521a86a34c6ec3fd0d14..45f6f74bcae3e3f27809d2ff3973b98edb169f0f 100644
index d058e71d6047bbd9256f6c71bb21966cfc056a7d..079edef073e751f38063b42515df893cecd2fcc4 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/blending/Blender.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/blending/Blender.java
@@ -148,7 +148,7 @@ public class Blender {
@@ -146,7 +146,7 @@ public class Blender {
private static double heightToOffset(double height) {
double d = 1.0;
double e = height + 0.5;

View File

@@ -37,26 +37,26 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
index 213ee4aa988dd4c2a5a7be99b1d13f67338e5209..a51f21995b66e08b33e8645297c25e1f979d0e73 100644
index 6ec7b234b468755835107be40d0080222c0b9263..4e09c158a3e767754abc0df9410c736016ef0704 100644
--- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
@@ -25,8 +25,15 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
final CraftingBookCategory category;
final ItemStack result;
final NonNullList<Ingredient> ingredients;
@@ -31,8 +31,15 @@ public class ShapelessRecipe implements CraftingRecipe {
final List<Ingredient> ingredients;
@Nullable
private PlacementInfo placementInfo;
+ private final boolean isBukkit; // Gale - Airplane - simpler ShapelessRecipe comparison for vanilla
public ShapelessRecipe(String group, CraftingBookCategory category, ItemStack result, NonNullList<Ingredient> ingredients) {
public ShapelessRecipe(String group, CraftingBookCategory category, ItemStack result, List<Ingredient> ingredients) {
+ // Gale start - Airplane - simpler ShapelessRecipe comparison for vanilla
+ this(group, category, result, ingredients, false);
+ }
+ public ShapelessRecipe(String group, CraftingBookCategory category, ItemStack result, NonNullList<Ingredient> ingredients, boolean isBukkit) {
+ public ShapelessRecipe(String group, CraftingBookCategory category, ItemStack result, List<Ingredient> ingredients, boolean isBukkit) {
+ this.isBukkit = isBukkit;
+ // Gale end - Airplane - simpler ShapelessRecipe comparison for vanilla
this.group = group;
this.category = category;
this.result = result;
@@ -76,6 +83,29 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
@@ -80,6 +87,29 @@ public class ShapelessRecipe implements CraftingRecipe {
}
public boolean matches(CraftingInput input, Level world) {
@@ -83,18 +83,18 @@ index 213ee4aa988dd4c2a5a7be99b1d13f67338e5209..a51f21995b66e08b33e8645297c25e1f
+ }
+ // Gale end - Airplane - simpler ShapelessRecipe comparison for vanilla
+
// Paper start - unwrap ternary & better exact choice recipes
if (input.ingredientCount() != this.ingredients.size()) {
return false;
return input.ingredientCount() != this.ingredients.size() ? false : (input.size() == 1 && this.ingredients.size() == 1 ? ((Ingredient) this.ingredients.getFirst()).test(input.getItem(0)) : input.stackedContents().canCraft((Recipe) this, (StackedContents.Output) null));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
index 96d772eb02f79f8c478f5e6f065e387aa7665b18..0d27792dcc3deb4cc7835512f4156b490223358d 100644
index 7c989318dc7ad89bb0d9143fcaac1e4bba6f5907..a90b294a99072ab576e61ddacb60a036cb7f0f5a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
@@ -45,6 +45,6 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe
data.set(i, this.toNMS(ingred.get(i), true));
@@ -44,6 +44,6 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe
data.add(this.toNMS(i, true));
}
- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.ShapelessRecipe(this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data)));
+ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.ShapelessRecipe(this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data, true))); // Gale - Airplane - simpler ShapelessRecipe comparison for vanilla
- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftRecipe.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.ShapelessRecipe(this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data)));
+ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftRecipe.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.ShapelessRecipe(this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data, true))); // Gale - Airplane - simpler ShapelessRecipe comparison for vanilla
}
}

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index 5f7d152f41eb85f17bcded4bc8099b998e5a338b..bf1e1e7561b674ace6bfd601a5c1ddfcd203ac04 100644
index 6c2d4d6f3a36ab452dfd3c33f66e54f152906639..507a7f2116b020a5af4b8fff15b73dba9904874f 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -52,6 +52,45 @@ public abstract class Projectile extends Entity implements TraceableEntity {
@@ -58,6 +58,45 @@ public abstract class Projectile extends Entity implements TraceableEntity {
super(type, world);
}

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
index dc27ddf5131e7398a5390a5187261d4c7fb6ccaa..c888ca771efa7a570b8302d48e69fbb69bf98bd9 100644
index 60c2868f255d372226e0c1389caaa5477bbef41e..46ec05c0ec7c794481e996dd9f51c396a5f75f97 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -239,12 +239,60 @@ public class Bat extends AmbientCreature {
@@ -242,12 +242,60 @@ public class Bat extends AmbientCreature {
}
}

View File

@@ -52,54 +52,55 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 3b3684d202e460a80b3e6e97afbaa4c84c4e3b3b..39b187dc90f79dbfff55be697b8cb4d404b290fc 100644
index ebed376154ce30bf75fcdc2bd23c4dab251e1719..01a6e1fd4d7271f5a223765dab7976efcdf1fd92 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -441,6 +441,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
// Paper - chunk tick iteration optimisations
@@ -471,6 +471,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
this.lastInhabitedUpdate = i;
if (!this.level.isDebug()) {
+ this.level.resetIceAndSnowTick(); // Gale - Airplane - optimize random calls in chunk ticking - reset ice & snow tick random
if (this.level.tickRateManager().runsNormally()) {
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
int k = this.distanceManager.getNaturalSpawnChunkCount();
List<LevelChunk> list = this.tickingChunks;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 7aa13de4b3778e6708ed46ddcedde100f585a40f..bad5725292cf549d2cd4f62bc3c77c321df24294 100644
index 3401602c57337e96012c2768b38f523ca7dd6798..e54fa5dc8587cad486e1e509d803ee5e2fd27712 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -834,13 +834,15 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -887,6 +887,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
// Paper end - optimise random ticking
+ private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.random.nextInt(16); } // Gale - Airplane - optimize random calls in chunk ticking
+
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
final ca.spottedleaf.moonrise.common.util.SimpleRandom simpleRandom = this.simpleRandom; // Paper - optimise random ticking
ChunkPos chunkcoordintpair = chunk.getPos();
boolean flag = this.isRaining();
@@ -894,7 +896,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
int j = chunkcoordintpair.getMinBlockX();
int k = chunkcoordintpair.getMinBlockZ();
- if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder
+ if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 /*&& this.random.nextInt(this.spigotConfig.thunderChance) == 0*/ && chunk.shouldDoLightning(this.random)) { // Spigot // Paper - Option to disable thunder // Gale - Airplane - optimize random calls in chunk ticking - replace random with shouldDoLightning
- if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking
+ if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 /*&& simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0*/ && chunk.shouldDoLightning(this.simpleRandom)) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking // Gale - Airplane - optimize random calls in chunk ticking - replace random with shouldDoLightning
BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
if (this.isRainingAt(blockposition)) {
@@ -868,7 +870,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -922,7 +924,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
}
- if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
+ if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Option to disable ice and snow // Gale - Airplane - optimize random calls in chunk ticking - optimize further random ticking
for (int l = 0; l < randomTickSpeed; ++l) {
if (this.random.nextInt(48) == 0) {
if (simpleRandom.nextInt(48) == 0) { // Paper - optimise random ticking
this.tickPrecipitation(this.getBlockRandomPos(j, 0, k, 15));
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 36540053590c30a902b9986dcf2e74375157822d..f23ed06a943646f45e1291f35ab3025e1dfa6b49 100644
index 09a6d7410bc029889ce4b89ab149a52f31468b9b..e7c9fc8b7f15cd299b32ad9bf2cdeb0d04f1a3ee 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -85,6 +85,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
private final LevelChunkTicks<Block> blockTicks;
@@ -86,6 +86,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
private final LevelChunkTicks<Fluid> fluidTicks;
private LevelChunk.UnsavedListener unsavedListener;
+ // Gale start - Airplane - optimize random calls in chunk ticking - instead of using a random every time the chunk is ticked, define when lightning strikes preemptively
+ private int lightningTick;
@@ -116,7 +117,7 @@ index 36540053590c30a902b9986dcf2e74375157822d..f23ed06a943646f45e1291f35ab3025e
public LevelChunk(Level world, ChunkPos pos) {
this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null);
}
@@ -116,6 +128,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -119,6 +131,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
this.debug = !empty && this.level.isDebug();
this.defaultBlockState = empty ? VOID_AIR_BLOCKSTATE : AIR_BLOCKSTATE;
// Paper end - get block chunk optimisation

View File

@@ -31,21 +31,20 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
index 828c51477cd8f35d591367b30bf4feef6a250292..7b05ef99702af0e8a7d2a652984c4f8c15eefed8 100644
index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..b14935c32409ccc4e65e7d642342e113142443f8 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -320,11 +320,17 @@ public class EnderMan extends Monster implements NeutralMob {
@@ -307,11 +307,17 @@ public class EnderMan extends Monster implements NeutralMob {
private boolean teleport(double x, double y, double z) {
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z);
- while (blockposition_mutableblockposition.getY() > this.level().getMinBuildHeight() && !this.level().getBlockState(blockposition_mutableblockposition).blocksMotion()) {
+ // Gale start - Airplane - single chunk lookup
+ net.minecraft.world.level.chunk.LevelChunk chunk = this.level().getChunkIfLoaded(blockposition_mutableblockposition);
+ if (chunk == null) {
+ return false;
+ }
+ while (blockposition_mutableblockposition.getY() > this.level().getMinBuildHeight() && !chunk.getBlockState(blockposition_mutableblockposition).blocksMotion()) {
+ // Gale end - Airplane - single chunk lookup
+
while (blockposition_mutableblockposition.getY() > this.level().getMinY() && !this.level().getBlockState(blockposition_mutableblockposition).blocksMotion()) {
blockposition_mutableblockposition.move(Direction.DOWN);
}

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
index 6e66141dca61f777b354854b5d0bac2570b8bf3b..06104744bb778a922adaaee2d91252cd37080f8f 100644
index ad82e5aeb565b23c3ec565fa60e1f31d1710bd4e..5bf4164f0b9a3d4e6b8e9de87d80683c98a21298 100644
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
@@ -643,6 +643,8 @@ public class Inventory implements Container, Nameable {
@@ -649,6 +649,8 @@ public class Inventory implements Container, Nameable {
}
public boolean contains(ItemStack stack) {
@@ -43,7 +43,7 @@ index 6e66141dca61f777b354854b5d0bac2570b8bf3b..06104744bb778a922adaaee2d91252cd
Iterator iterator = this.compartments.iterator();
while (iterator.hasNext()) {
@@ -679,25 +681,34 @@ public class Inventory implements Container, Nameable {
@@ -685,25 +687,34 @@ public class Inventory implements Container, Nameable {
return false;
}
@@ -89,24 +89,24 @@ index 6e66141dca61f777b354854b5d0bac2570b8bf3b..06104744bb778a922adaaee2d91252cd
public void replaceWith(Inventory other) {
for (int i = 0; i < this.getContainerSize(); ++i) {
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
index 17f33c83c6033564d6bf4fbd388b0b847c68adb3..73e546cc828850365dae0131bf8d997f58473823 100644
index ae321b3b8d98e42ef07fd1f0f738c1a2b428f6db..b15b0c8057e61c6aef05c0865e2c3e06adcf938b 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -295,7 +295,7 @@ public class MapItemSavedData extends SavedData {
@@ -294,7 +294,7 @@ public class MapItemSavedData extends SavedData {
Predicate<ItemStack> predicate = MapItemSavedData.mapMatcher(stack);
- if (!player.getInventory().contains(predicate)) {
+ if (!player.getInventory().containsMatchedMap(predicate)) {
+ if (!player.getInventory().containsMatchedMap(predicate)) { // Gale - Airplane - remove iterators from Inventory#contains
this.removeDecoration(player.getName().getString());
}
@@ -303,7 +303,7 @@ public class MapItemSavedData extends SavedData {
MapItemSavedData.HoldingPlayer worldmap_worldmaphumantracker1 = (MapItemSavedData.HoldingPlayer) this.carriedBy.get(i);
String s = worldmap_worldmaphumantracker1.player.getName().getString();
Player entityhuman1 = worldmap_worldmaphumantracker1.player;
String s = entityhuman1.getName().getString();
- if (!worldmap_worldmaphumantracker1.player.isRemoved() && (worldmap_worldmaphumantracker1.player.getInventory().contains(predicate) || stack.isFramed())) {
+ if (!worldmap_worldmaphumantracker1.player.isRemoved() && (worldmap_worldmaphumantracker1.player.getInventory().containsMatchedMap(predicate) || stack.isFramed())) {
if (!stack.isFramed() && worldmap_worldmaphumantracker1.player.level().dimension() == this.dimension && this.trackingPosition) {
this.addDecoration(MapDecorationTypes.PLAYER, worldmap_worldmaphumantracker1.player.level(), s, worldmap_worldmaphumantracker1.player.getX(), worldmap_worldmaphumantracker1.player.getZ(), (double) worldmap_worldmaphumantracker1.player.getYRot(), (Component) null);
- if (!entityhuman1.isRemoved() && (entityhuman1.getInventory().contains(predicate) || stack.isFramed())) {
+ if (!entityhuman1.isRemoved() && (entityhuman1.getInventory().containsMatchedMap(predicate) || stack.isFramed())) { // Gale - Airplane - remove iterators from Inventory#contains
if (!stack.isFramed() && entityhuman1.level().dimension() == this.dimension && this.trackingPosition) {
this.addDecoration(MapDecorationTypes.PLAYER, entityhuman1.level(), s, entityhuman1.getX(), entityhuman1.getZ(), (double) entityhuman1.getYRot(), (Component) null);
}

View File

@@ -31,26 +31,26 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
index aecb0ad814586bfc5e56755ee14379a69388b38c..4addcfe248dd4705be7e67551b258ce86c57e194 100644
index 52982c1e6a4da36392569c791853279f5f9ac31a..b51a04d3e006bc770006cff790791bc0f6bee77d 100644
--- a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
+++ b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
@@ -76,9 +76,18 @@ public class TargetingConditions {
@@ -75,9 +75,18 @@ public class TargetingConditions {
}
if (this.range > 0.0) {
- double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0;
- double e = Math.max((this.useFollowRange ? this.getFollowRange(baseEntity) : this.range) * d, 2.0); // Paper - Fix MC-145656
- double d = this.testInvisible ? target.getVisibilityPercent(tester) : 1.0;
- double e = Math.max(this.range * d, 2.0);
+ // Gale start - Airplane - check targeting range before getting visibility
+ // d = invisibility percent, e = follow range adjusted for invisibility, f = distance
double f = baseEntity.distanceToSqr(targetEntity.getX(), targetEntity.getY(), targetEntity.getZ());
+ double followRangeRaw = this.useFollowRange ? this.getFollowRange(baseEntity) : this.range;
double f = tester.distanceToSqr(target.getX(), target.getY(), target.getZ());
+ double followRangeRaw = this.range;
+
+ if (f > followRangeRaw * followRangeRaw) { // the actual follow range will always be this value or smaller, so if the distance is larger then it never will return true after getting invis
+ return false;
+ }
+
+ double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0D;
+ double e = Math.max((followRangeRaw) * d, 2.0D); // Paper - Fix MC-145656
+ double d = this.testInvisible ? target.getVisibilityPercent(tester) : 1.0;
+ double e = Math.max(followRangeRaw * d, 2.0);
+ // Gale end - Airplane - check targeting range before getting visibility
if (f > e * e) {
return false;

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b1c1e600100ac31ecb20473b8ad2853676dff84a..84b8de571361f2087ac5106726c9e69377183089 100644
index 9009da78ba2d7751b974123ce76a37af98189b6a..b7342208b5d72f82c6d095cac379356d57f97486 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1166,6 +1166,13 @@ public final class CraftServer implements Server {
@@ -1168,6 +1168,13 @@ public final class CraftServer implements Server {
plugin.getPluginMeta().getDisplayName(),
"This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies."
));

View File

@@ -31,18 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 2463746163a8e08527fc55beb467aedf4ed5cd68..ec25ae1dbbf623025c3e7e14143b9b6b60a68ff6 100644
index 74ee200081f372e66e1d2a5a291fff42758ba965..4c299ce47caafaa233355cb71aab8d622008f346 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -157,7 +157,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
// CraftBukkit end
-import co.aikar.timings.MinecraftTimings; // Paper
public abstract class LivingEntity extends Entity implements Attackable {
@@ -2063,6 +2062,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -2109,6 +2109,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
return this.lastClimbablePos;
}
@@ -64,10 +56,10 @@ index 2463746163a8e08527fc55beb467aedf4ed5cd68..ec25ae1dbbf623025c3e7e14143b9b6b
if (this.isSpectator()) {
return false;
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index bf2d18f74b0f0da7c3c30310c74224a1c0853564..f83c2b35cc279666686be3af558473b5d93bf7cd 100644
index 133bcf639a45bd7fa1a2d02410ea3e8568265007..f8a57248da47cf8cfb47dc92b36c191338c8d598 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -298,7 +298,7 @@ public class ActivationRange
@@ -294,7 +294,7 @@ public class ActivationRange
if ( entity instanceof LivingEntity )
{
LivingEntity living = (LivingEntity) entity;

View File

@@ -1,276 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 23 Nov 2022 20:35:40 +0100
Subject: [PATCH] Improve fluid direction caching
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Improve fluid direction caching"
By: Paul Sauve <paul@technove.co>
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
* Airplane description *
Implements a custom cache that better fits the needs of fluids
calculating whether a direction can be moved in or something. There's a
big javadoc on the FluidDirectionCache with some more information.
* Airplane copyright *
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/gg/airplane/structs/FluidDirectionCache.java b/src/main/java/gg/airplane/structs/FluidDirectionCache.java
new file mode 100644
index 0000000000000000000000000000000000000000..bf6a36c933b686f0e34591dff3d43b3797c29b2b
--- /dev/null
+++ b/src/main/java/gg/airplane/structs/FluidDirectionCache.java
@@ -0,0 +1,143 @@
+// Gale - Airplane - improve fluid direction caching
+
+package gg.airplane.structs;
+
+import it.unimi.dsi.fastutil.HashCommon;
+
+/**
+ * This is a replacement for the cache used in FluidTypeFlowing.
+ * The requirements for the previous cache were:
+ * <ul>
+ * <li>Store 200 entries</li>
+ * <li>Look for the flag in the cache</li>
+ * <li>If it exists, move to front of cache</li>
+ * <li>If it doesn't exist, remove last entry in cache and insert in front</li>
+ * </ul>
+ * This class accomplishes something similar, however has a few different
+ * requirements put into place to make this more optimize:
+ * <ul>
+ * <li>
+ * maxDistance is the most amount of entries to be checked, instead
+ * of having to check the entire list.
+ * </li>
+ * <li>
+ * In combination with that, entries are all tracked by age and how
+ * frequently they're used. This enables us to remove old entries,
+ * without constantly shifting any around.
+ * </li>
+ * </ul>
+ * Usage of the previous map would have to reset the head every single usage,
+ * shifting the entire map. Here, nothing happens except an increment when
+ * the cache is hit, and when it needs to replace an old element only a single
+ * element is modified.
+ */
+public class FluidDirectionCache<T> {
+
+ private static class FluidDirectionEntry<T> {
+ private final T data;
+ private final boolean flag;
+ private int uses = 0;
+ private int age = 0;
+
+ private FluidDirectionEntry(T data, boolean flag) {
+ this.data = data;
+ this.flag = flag;
+ }
+
+ public int getValue() {
+ return this.uses - (this.age >> 1); // age isn't as important as uses
+ }
+
+ public void incrementUses() {
+ this.uses = this.uses + 1 & Integer.MAX_VALUE;
+ }
+
+ public void incrementAge() {
+ this.age = this.age + 1 & Integer.MAX_VALUE;
+ }
+ }
+
+ private final FluidDirectionEntry[] entries;
+ private final int mask;
+ private final int maxDistance; // the most amount of entries to check for a value
+
+ public FluidDirectionCache(int size) {
+ int arraySize = HashCommon.nextPowerOfTwo(size);
+ this.entries = new FluidDirectionEntry[arraySize];
+ this.mask = arraySize - 1;
+ this.maxDistance = Math.min(arraySize, 4);
+ }
+
+ public Boolean getValue(T data) {
+ FluidDirectionEntry curr;
+ int pos;
+
+ if ((curr = this.entries[pos = HashCommon.mix(data.hashCode()) & this.mask]) == null) {
+ return null;
+ } else if (data.equals(curr.data)) {
+ curr.incrementUses();
+ return curr.flag;
+ }
+
+ int checked = 1; // start at 1 because we already checked the first spot above
+
+ while ((curr = this.entries[pos = (pos + 1) & this.mask]) != null) {
+ if (data.equals(curr.data)) {
+ curr.incrementUses();
+ return curr.flag;
+ } else if (++checked >= this.maxDistance) {
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ public void putValue(T data, boolean flag) {
+ FluidDirectionEntry<T> curr;
+ int pos;
+
+ if ((curr = this.entries[pos = HashCommon.mix(data.hashCode()) & this.mask]) == null) {
+ this.entries[pos] = new FluidDirectionEntry<>(data, flag); // add
+ return;
+ } else if (data.equals(curr.data)) {
+ curr.incrementUses();
+ return;
+ }
+
+ int checked = 1; // start at 1 because we already checked the first spot above
+
+ while ((curr = this.entries[pos = (pos + 1) & this.mask]) != null) {
+ if (data.equals(curr.data)) {
+ curr.incrementUses();
+ return;
+ } else if (++checked >= this.maxDistance) {
+ this.forceAdd(data, flag);
+ return;
+ }
+ }
+
+ this.entries[pos] = new FluidDirectionEntry<>(data, flag); // add
+ }
+
+ private void forceAdd(T data, boolean flag) {
+ int expectedPos = HashCommon.mix(data.hashCode()) & this.mask;
+
+ int toRemovePos = expectedPos;
+ FluidDirectionEntry entryToRemove = this.entries[toRemovePos];
+
+ for (int i = expectedPos + 1; i < expectedPos + this.maxDistance; i++) {
+ int pos = i & this.mask;
+ FluidDirectionEntry entry = this.entries[pos];
+ if (entry.getValue() < entryToRemove.getValue()) {
+ toRemovePos = pos;
+ entryToRemove = entry;
+ }
+
+ entry.incrementAge(); // use this as a mechanism to age the other entries
+ }
+
+ // remove the least used/oldest entry
+ this.entries[toRemovePos] = new FluidDirectionEntry(data, flag);
+ }
+}
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
index 1c0712295695727ee9c4d430d4157b8e17cbd71f..0eac7bc0c56ac17c900737271a965cfc1ccd03d2 100644
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
@@ -45,6 +45,8 @@ public abstract class FlowingFluid extends Fluid {
public static final BooleanProperty FALLING = BlockStateProperties.FALLING;
public static final IntegerProperty LEVEL = BlockStateProperties.LEVEL_FLOWING;
private static final int CACHE_SIZE = 200;
+ // Gale start - Airplane - improve fluid direction caching - use our own cache
+ /*
private static final ThreadLocal<Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey>> OCCLUSION_CACHE = ThreadLocal.withInitial(() -> {
Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey> object2bytelinkedopenhashmap = new Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey>(200) {
protected void rehash(int i) {}
@@ -53,6 +55,14 @@ public abstract class FlowingFluid extends Fluid {
object2bytelinkedopenhashmap.defaultReturnValue((byte) 127);
return object2bytelinkedopenhashmap;
});
+ */
+
+ private static final ThreadLocal<gg.airplane.structs.FluidDirectionCache<Block.BlockStatePairKey>> localFluidDirectionCache = ThreadLocal.withInitial(() -> {
+ // Gale - Airplane - TODO - mess with this number for performance
+ // with 2048 it seems very infrequent on a small world that it has to remove old entries
+ return new gg.airplane.structs.FluidDirectionCache<>(2048);
+ });
+ // Gale end - Airplane - improve fluid direction caching - use our own cache
private final Map<FluidState, VoxelShape> shapes = Maps.newIdentityHashMap();
public FlowingFluid() {}
@@ -240,6 +250,8 @@ public abstract class FlowingFluid extends Fluid {
}
private boolean canPassThroughWall(Direction face, BlockGetter world, BlockPos pos, BlockState state, BlockPos fromPos, BlockState fromState) {
+ // Gale start - Airplane - improve fluid direction caching - modify to use our cache
+ /*
Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap;
if (!state.getBlock().hasDynamicShape() && !fromState.getBlock().hasDynamicShape()) {
@@ -247,9 +259,16 @@ public abstract class FlowingFluid extends Fluid {
} else {
object2bytelinkedopenhashmap = null;
}
+ */
+ gg.airplane.structs.FluidDirectionCache<Block.BlockStatePairKey> cache = null;
+
+ if (!state.getBlock().hasDynamicShape() && !fromState.getBlock().hasDynamicShape()) {
+ cache = localFluidDirectionCache.get();
+ }
Block.BlockStatePairKey block_a;
+ /*
if (object2bytelinkedopenhashmap != null) {
block_a = new Block.BlockStatePairKey(state, fromState, face);
byte b0 = object2bytelinkedopenhashmap.getAndMoveToFirst(block_a);
@@ -260,11 +279,22 @@ public abstract class FlowingFluid extends Fluid {
} else {
block_a = null;
}
+ */
+ if (cache != null) {
+ block_a = new Block.BlockStatePairKey(state, fromState, face);
+ Boolean flag = cache.getValue(block_a);
+ if (flag != null) {
+ return flag;
+ }
+ } else {
+ block_a = null;
+ }
VoxelShape voxelshape = state.getCollisionShape(world, pos);
VoxelShape voxelshape1 = fromState.getCollisionShape(world, fromPos);
boolean flag = !Shapes.mergedFaceOccludes(voxelshape, voxelshape1, face);
+ /*
if (object2bytelinkedopenhashmap != null) {
if (object2bytelinkedopenhashmap.size() == 200) {
object2bytelinkedopenhashmap.removeLastByte();
@@ -272,6 +302,11 @@ public abstract class FlowingFluid extends Fluid {
object2bytelinkedopenhashmap.putAndMoveToFirst(block_a, (byte) (flag ? 1 : 0));
}
+ */
+ if (cache != null) {
+ cache.putValue(block_a, flag);
+ }
+ // Gale end - Airplane - improve fluid direction caching - modify to use our cache
return flag;
}

View File

@@ -40,10 +40,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java b/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java
index 88a4a72bb390947dc17e5da09a99b2d1b3ac4621..9343195e5e7444a1926db656707df961a5b8ea55 100644
index a94fbedaf0297c006c561a145913bb91f2d0a817..121d155be5213cb4d9a4258b4b9a27ca3f335209 100644
--- a/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java
+++ b/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java
@@ -17,23 +17,33 @@ public class EntityCollisionContext implements CollisionContext {
@@ -19,23 +19,33 @@ public class EntityCollisionContext implements CollisionContext {
return defaultValue;
}
};
@@ -71,14 +71,14 @@ index 88a4a72bb390947dc17e5da09a99b2d1b3ac4621..9343195e5e7444a1926db656707df961
}
@Deprecated
protected EntityCollisionContext(Entity entity) {
protected EntityCollisionContext(Entity entity, boolean collidesWithFluid) {
+ // Gale start - Airplane - make EntityCollisionContext a live representation - remove unneeded things
+ /*
this(
entity.isDescending(),
entity.getY(),
@@ -41,26 +51,41 @@ public class EntityCollisionContext implements CollisionContext {
entity instanceof LivingEntity ? ((LivingEntity)entity)::canStandOnFluid : fluidState -> false,
@@ -43,16 +53,31 @@ public class EntityCollisionContext implements CollisionContext {
collidesWithFluid ? state -> true : (entity instanceof LivingEntity ? ((LivingEntity)entity)::canStandOnFluid : state -> false),
entity
);
+ */
@@ -110,6 +110,9 @@ index 88a4a72bb390947dc17e5da09a99b2d1b3ac4621..9343195e5e7444a1926db656707df961
+ // Gale end - Airplane - make EntityCollisionContext a live representation
}
@Override
@@ -62,12 +87,12 @@ public class EntityCollisionContext implements CollisionContext {
@Override
public boolean isDescending() {
- return this.descending;

View File

@@ -31,22 +31,22 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 8ea2f24695f5dad55e21f238b69442513e7a90c6..20b5a81d50397438b3200322f31b62db44ebdb3b 100644
index 90eb4927fa51ce3df86aa7b6c71f49150a03e337..bf813380d5767ce05cdeca7084e6f19aa106803a 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -193,6 +193,7 @@ public class ServerEntity {
boolean flag6 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
@@ -207,6 +207,7 @@ public class ServerEntity {
boolean flag5 = i < -32768L || i > 32767L || j < -32768L || j > 32767L || k < -32768L || k > 32767L;
if (!this.forceStateResync && !flag6 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.onGround()) { // Paper - fix desync when a player is added to the tracker
+ if (flag2 || flag3 || this.entity instanceof AbstractArrow) { // Gale - Airplane - better checking for useless move packets
if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) {
if (flag2) {
packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.onGround());
@@ -206,6 +207,7 @@ public class ServerEntity {
flag4 = true;
flag5 = true;
}
+ } // Gale - Airplane - better checking for useless move packets
} else {
this.wasOnGround = this.entity.onGround();
this.teleportDelay = 0;
if (!this.forceStateResync && !flag5 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.onGround()) { // Paper - fix desync when a player is added to the tracker
+ if (flag2 || flag || this.entity instanceof AbstractArrow) { // Gale - Airplane - better checking for useless move packets
if ((!flag2 || !flag) && !(this.entity instanceof AbstractArrow)) {
if (flag2) {
packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) i), (short) ((int) j), (short) ((int) k), this.entity.onGround());
@@ -220,6 +221,7 @@ public class ServerEntity {
flag3 = true;
flag4 = true;
}
+ } // Gale - Airplane - better checking for useless move packets
} else {
this.wasOnGround = this.entity.onGround();
this.teleportDelay = 0;

View File

@@ -1,66 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 23 Nov 2022 22:41:54 +0100
Subject: [PATCH] Inline level height
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Ensure level height is inlined"
By: Paul Sauve <paul@technove.co>
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
* Airplane copyright *
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index abebc41e69a41cbf940ffd10dae4815202b525dc..a48b1639ffa83ae2d1e614d32a339f08366da57c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -685,6 +685,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
// Paper end - optimise random ticking
+ // Gale start - Airplane - inline level height
+ private final int minBuildHeight, levelHeightAccessorMinSection, height, maxBuildHeight, levelHeightAccessorMaxSection;
+ @Override public final int getMaxBuildHeight() { return this.maxBuildHeight; }
+ @Override public final int getMinSection() { return this.levelHeightAccessorMinSection; }
+ @Override public final int getMaxSection() { return this.levelHeightAccessorMaxSection; }
+ @Override public final int getMinBuildHeight() { return this.minBuildHeight; }
+ @Override public final int getHeight() { return this.height; }
+ // Gale end - Airplane - inline level height
+
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
@@ -704,6 +713,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
this.dimensionTypeRegistration = holder;
final DimensionType dimensionmanager = (DimensionType) holder.value();
+ // Gale start - Airplane - inline level height
+ this.minBuildHeight = LevelAccessor.super.getMinBuildHeight();
+ this.levelHeightAccessorMinSection = LevelAccessor.super.getMinSection();
+ this.height = LevelAccessor.super.getHeight();
+ this.maxBuildHeight = LevelAccessor.super.getMaxBuildHeight();
+ this.levelHeightAccessorMaxSection = LevelAccessor.super.getMaxSection();
+ // Gale end - Airplane - inline level height
this.dimension = resourcekey;
this.isClientSide = flag;
if (dimensionmanager.coordinateScale() != 1.0D) {

View File

@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3a5f832578abbf3ead4d5bd99eee1438a2e74b35..e26d98cb34e9fd2c599ce72d8c83f1431f4bf991 100644
index ca4ce69ecad2291d196c4126e4cbde69554dd50c..5e939e377c35fe69d66ecb79266dcfc429e34f5c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -445,6 +445,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -43,7 +43,7 @@ index 3a5f832578abbf3ead4d5bd99eee1438a2e74b35..e26d98cb34e9fd2c599ce72d8c83f143
return this.yRot;
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 69992ebc999ea3ff9e47e4e049bcc514c01150ca..f9f6745d45aaba4a7106f80d403dcf9ae40e1d6c 100644
index 94d04a20f97405e02d7cccaabadc7a7e86e336f7..edd791da70fd7e18c42133dcd771f212cb25abab 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -23,9 +23,11 @@ public class AttributeMap {

View File

@@ -1,77 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 23 Nov 2022 22:53:39 +0100
Subject: [PATCH] Remove streams and iterators from range check
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Remove streams and iterators from range check"
By: Paul Sauve <paul@technove.co>
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
* Airplane copyright *
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 62bd7523e0d7d2dfdce1ee9edb2249c755f1ade3..a9b6f3ceb45ecd6bcc6d6acc097a5d12aeaae620 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1275,8 +1275,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
}
+ // Gale start - Airplane - remove streams and iterators from range check
+ private static int getHighestRange(Entity parent, int highest) {
+ List<Entity> passengers = parent.getPassengers();
+
+ for (int i = 0, size = passengers.size(); i < size; i++) {
+ Entity entity = passengers.get(i);
+ int range = entity.getType().clientTrackingRange() * 16;
+ range = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, range); // Paper
+
+ if (range > highest) { // Paper - we need the lowest range thanks to the fact that our tracker doesn't account for passenger logic // Tuinity - not anymore!
+ highest = range;
+ }
+
+ highest = getHighestRange(entity, highest);
+ }
+
+ return highest;
+ }
+ // Gale end - Airplane - remove streams and iterators from range check
+
private int getEffectiveRange() {
int i = this.range;
+ // Gale start - Airplane - remove streams and iterators from range check
+ /*
Iterator iterator = this.entity.getIndirectPassengers().iterator();
while (iterator.hasNext()) {
@@ -1288,6 +1310,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
i = j;
}
}
+ */
+ i = getHighestRange(this.entity, i);
+ // Gale end - Airplane - remove streams and iterators from range check
return this.scaledRange(i);
}

4
todos.txt Normal file
View File

@@ -0,0 +1,4 @@
## TODOs
Check chunk sys threads in gale metrics
Check to use simple random by default in tick chunk opt (add back move random patch)
check fluid cache