diff --git a/.github/workflows/build.yml b/.github/workflows/build-1215.yml
similarity index 98%
rename from .github/workflows/build.yml
rename to .github/workflows/build-1215.yml
index 81c67ec..a6ba67e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build-1215.yml
@@ -1,4 +1,4 @@
-name: DivineMC CI
+name: Build DivineMC 1.21.5
on:
push:
diff --git a/.github/workflows/test.yml b/.github/workflows/pr.yml
similarity index 88%
rename from .github/workflows/test.yml
rename to .github/workflows/pr.yml
index f6ecade..3e31183 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/pr.yml
@@ -1,15 +1,13 @@
-name: DivineMC Test CI
+name: DivineMC Test Build
on:
- push:
- branches-ignore: [ master ]
pull_request:
+ branches: [ "master" ]
workflow_dispatch:
jobs:
build:
runs-on: blacksmith-8vcpu-ubuntu-2204
- if: "!contains(github.event.commits[0].message, '[ci-skip]')"
steps:
- name: Setup Action
uses: actions/checkout@v4
diff --git a/README.md b/README.md
index 3ad69fb..01bbfb4 100644
--- a/README.md
+++ b/README.md
@@ -57,7 +57,7 @@ For anything else you can refer to our [contribution guide](https://bxteam.org/d
org.bxteam.divinemc
divinemc-api
- 1.21.4-R0.1-SNAPSHOT
+ 1.21.5-R0.1-SNAPSHOT
provided
```
@@ -70,11 +70,11 @@ repositories {
```
```kotlin
dependencies {
- compileOnly("org.bxteam.divinemc:divinemc-api:1.21.4-R0.1-SNAPSHOT")
+ compileOnly("org.bxteam.divinemc:divinemc-api:1.21.5-R0.1-SNAPSHOT")
}
```
-We also have a [Javadoc](https://repo.bxteam.org/javadoc/snapshots/org/bxteam/divinemc/divinemc-api/1.21.4-R0.1-SNAPSHOT/raw/index.html) for the API.
+We also have a [Javadoc](https://repo.bxteam.org/javadoc/snapshots/org/bxteam/divinemc/divinemc-api/1.21.5-R0.1-SNAPSHOT/raw/index.html) for the API.
## ⚖️ License
DivineMC is licensed under the GNU General Public License v3.0. You can find the license [here](LICENSE).
diff --git a/divinemc-api/build.gradle.kts.patch b/divinemc-api/build.gradle.kts.patch
index 5f14405..44b2f40 100644
--- a/divinemc-api/build.gradle.kts.patch
+++ b/divinemc-api/build.gradle.kts.patch
@@ -1,8 +1,19 @@
--- a/purpur-api/build.gradle.kts
+++ b/purpur-api/build.gradle.kts
-@@ -41,9 +_,9 @@
- dependencies {
+@@ -14,8 +_,8 @@
+ val adventureVersion = "4.21.0-mc1215-SNAPSHOT" // FIXME move to release asap
+ val adventureJavadocVersion = "4.20.0" // Fixme remove me
+ val bungeeCordChatVersion = "1.21-R0.2-deprecated+build.21"
+-val slf4jVersion = "2.0.16"
+-val log4jVersion = "2.24.1"
++val slf4jVersion = "2.0.17" // DivineMC - Bump dependencies
++val log4jVersion = "2.24.3" // DivineMC - Bump dependencies
+ val apiAndDocs: Configuration by configurations.creating {
+ attributes {
+@@ -42,9 +_,9 @@
+
+ dependencies {
// api dependencies are listed transitively to API consumers
- api("com.google.guava:guava:33.3.1-jre")
- api("com.google.code.gson:gson:2.11.0")
@@ -13,61 +24,65 @@
api("org.joml:joml:1.10.8") {
isTransitive = false // https://github.com/JOML-CI/JOML/issues/352
}
-@@ -54,6 +_,7 @@
+@@ -52,6 +_,7 @@
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
api("org.slf4j:slf4j-api:$slf4jVersion")
api("com.mojang:brigadier:1.3.10")
+ api("io.sentry:sentry:8.4.0") // DivineMC - Pufferfish: Sentry
// Deprecate bungeecord-chat in favor of adventure
- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.19") {
-@@ -77,19 +_,21 @@
- compileOnly(annotations)
- testCompileOnly(annotations)
+ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion") {
+@@ -68,9 +_,11 @@
+ apiAndDocs("$adventureGroup:adventure-text-serializer-plain")
+ apiAndDocs("$adventureGroup:adventure-text-logger-slf4j")
-- val checkerQual = "org.checkerframework:checker-qual:3.33.0"
-+ val checkerQual = "org.checkerframework:checker-qual:3.49.1" // DivineMC - Bump dependencies
- compileOnlyApi(checkerQual)
- testCompileOnly(checkerQual)
-
- api("org.jspecify:jspecify:1.0.0")
+- api("org.apache.maven:maven-resolver-provider:3.9.6") // make API dependency for Paper Plugins
+- compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
+- compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
++ // DivineMC start - Bump dependencies
++ api("org.apache.maven:maven-resolver-provider:3.9.9") // make API dependency for Paper Plugins
++ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.22")
++ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.22")
++ // DivineMC end - Bump dependencies
+ // Annotations - Slowly migrate to jspecify
+ val annotations = "org.jetbrains:annotations:$annotationsVersion"
+@@ -86,11 +_,13 @@
// Test dependencies
-- testImplementation("org.apache.commons:commons-lang3:3.12.0")
-- testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
+ testImplementation("org.apache.commons:commons-lang3:3.17.0")
+ testImplementation("org.junit.jupiter:junit-jupiter:5.12.2")
- testImplementation("org.hamcrest:hamcrest:2.2")
- testImplementation("org.mockito:mockito-core:5.14.1")
-+ // DivineMC start - Bump dependencies
-+ testImplementation("org.apache.commons:commons-lang3:3.17.0")
-+ testImplementation("org.junit.jupiter:junit-jupiter:5.12.1")
-+ testImplementation("org.hamcrest:hamcrest:3.0")
-+ testImplementation("org.mockito:mockito-core:5.16.1")
-+ // DivineMC end - Bump dependencies
- testImplementation("org.ow2.asm:asm-tree:9.7.1")
++ testImplementation("org.hamcrest:hamcrest:3.0") // DivineMC - Bump dependencies
++ testImplementation("org.mockito:mockito-core:5.16.1") // DivineMC - Bump dependencies
+ testImplementation("org.ow2.asm:asm-tree:9.8")
- mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // configure mockito agent that is needed in newer java versions
+ mockitoAgent("org.mockito:mockito-core:5.16.1") { isTransitive = false } // configure mockito agent that is needed in newer java versions // DivineMC - Bump dependencies
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
++
++ compileOnly("org.apache.commons:commons-lang3:3.17.0") // DivineMC - Required for Bukkit
}
+ val generatedDir: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath()
@@ -104,17 +_,21 @@
java {
- srcDir(generatedApiPath)
+ srcDir(generatedDir)
srcDir(file("../paper-api/src/main/java"))
-+ srcDir(file("../purpur-api/src/main/java"))
++ srcDir(file("../purpur-api/src/main/java")) // DivineMC - Rebrand
}
resources {
srcDir(file("../paper-api/src/main/resources"))
-+ srcDir(file("../purpur-api/src/main/resources"))
++ srcDir(file("../purpur-api/src/main/resources")) // DivineMC - Rebrand
}
}
test {
java {
srcDir(file("../paper-api/src/test/java"))
-+ srcDir(file("../purpur-api/src/test/java"))
++ srcDir(file("../purpur-api/src/test/java")) // DivineMC - Rebrand
}
resources {
srcDir(file("../paper-api/src/test/resources"))
-+ srcDir(file("../purpur-api/src/test/resources"))
++ srcDir(file("../purpur-api/src/test/resources")) // DivineMC - Rebrand
}
}
}
@@ -99,14 +114,21 @@
"https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/",
"https://javadoc.io/doc/org.joml/joml/1.10.8/",
"https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.0",
-@@ -201,8 +_,8 @@
- "https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
- "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
+@@ -202,7 +_,7 @@
+ "https://jd.advntr.dev/text-logger-slf4j/$adventureJavadocVersion/",
"https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
-- "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
+ "https://logging.apache.org/log4j/2.x/javadoc/log4j-api/",
- "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3",
-+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/2.20.0/", // DivineMC - Bump dependencies
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.9.22", // DivineMC - Bump dependencies
)
options.tags("apiNote:a:API Note:")
+@@ -226,6 +_,8 @@
+ into("build/docs/javadoc")
+ }
+ }
++
++ options.addStringOption("Xdoclint:none", "-quiet") // DivineMC - Hide unnecessary javadoc warnings
+ }
+
+ tasks.test {
diff --git a/divinemc-api/paper-patches/features/0001-Rebrand.patch b/divinemc-api/paper-patches/features/0001-Rebrand.patch
index 4ea15a9..d2d7e42 100644
--- a/divinemc-api/paper-patches/features/0001-Rebrand.patch
+++ b/divinemc-api/paper-patches/features/0001-Rebrand.patch
@@ -24,10 +24,10 @@ index fb1fe2651e53a9bf46b3632c638e13eea9dcda93..81e92d1053efd15c079e318a4ae08794
* Gets the {@code ServerBuildInfo}.
*
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
-index c880d0010849ab733ad13bbd18fab3c864d0cf61..a76439e59eefa4b6dbd0e100d72c21055d0ca008 100644
+index ec2b71cc2023b8ec7b9567a9ab1875cafc14f40d..354bf634b45ae510bdbddb81f7b1689bd2f4dc04 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
-@@ -259,7 +259,7 @@ public class VersionCommand extends BukkitCommand {
+@@ -257,7 +257,7 @@ public class VersionCommand extends BukkitCommand {
// Purpur start
int distance = getVersionFetcher().distance();
final Component message = Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()),
diff --git a/divinemc-api/paper-patches/features/0002-Delete-Timings.patch b/divinemc-api/paper-patches/features/0002-Delete-Timings.patch
index f907ba1..d8b9985 100644
--- a/divinemc-api/paper-patches/features/0002-Delete-Timings.patch
+++ b/divinemc-api/paper-patches/features/0002-Delete-Timings.patch
@@ -736,7 +736,7 @@ index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
deleted file mode 100644
-index 6f6eb1a2e6c8d49014a7ae44540ee282bae5200e..0000000000000000000000000000000000000000
+index c8287776ad585d04fb4fa3290cd73d7097035ea0..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/TimingHistory.java
+++ /dev/null
@@ -1,357 +0,0 @@
@@ -1031,7 +1031,7 @@ index 6f6eb1a2e6c8d49014a7ae44540ee282bae5200e..00000000000000000000000000000000
- final TicksRecord ticksRecord = new TicksRecord();
- final PingRecord pingRecord = new PingRecord();
- final TimingData fst = TimingsManager.FULL_SERVER_TICK.minuteData.clone();
-- final double tps = 1E9 / ( System.nanoTime() - lastMinuteTime ) * ticksRecord.timed;
+- final double tps = 1E9 / (System.nanoTime() - lastMinuteTime) * ticksRecord.timed;
- final double usedMemory = TimingsManager.FULL_SERVER_TICK.avgUsedMemory;
- final double freeMemory = TimingsManager.FULL_SERVER_TICK.avgFreeMemory;
- final double loadAvg = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
@@ -1753,7 +1753,7 @@ index 04d0dc27406e9f96224f88edb1c535176e84d395..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java
deleted file mode 100644
-index e72ad05abada04426e32a73d02b21cb69079d268..0000000000000000000000000000000000000000
+index 83a70358e9b7d3d9ae76cf130915b3c33d09a793..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/TimingsManager.java
+++ /dev/null
@@ -1,192 +0,0 @@
@@ -1912,9 +1912,9 @@ index e72ad05abada04426e32a73d02b21cb69079d268..00000000000000000000000000000000
- public static Timing getCommandTiming(@Nullable String pluginName, @NotNull Command command) {
- Plugin plugin = null;
- final Server server = Bukkit.getServer();
-- if (!( server == null || pluginName == null ||
-- "minecraft".equals(pluginName) || "bukkit".equals(pluginName) ||
-- "spigot".equalsIgnoreCase(pluginName) || "paper".equals(pluginName)
+- if (!(server == null || pluginName == null ||
+- "minecraft".equals(pluginName) || "bukkit".equals(pluginName) ||
+- "spigot".equalsIgnoreCase(pluginName) || "paper".equals(pluginName)
- )) {
- plugin = server.getPluginManager().getPlugin(pluginName);
- }
@@ -2104,6 +2104,771 @@ index 632c4961515f5052551f841cfa840e60bba7a257..00000000000000000000000000000000
- super.stopTiming();
- }
-}
+diff --git a/src/main/java/co/aikar/util/Counter.java b/src/main/java/co/aikar/util/Counter.java
+deleted file mode 100644
+index dae84243804b4b076cafb3e1b29bdcf614efc93f..0000000000000000000000000000000000000000
+--- a/src/main/java/co/aikar/util/Counter.java
++++ /dev/null
+@@ -1,39 +0,0 @@
+-package co.aikar.util;
+-
+-import com.google.common.collect.ForwardingMap;
+-
+-import java.util.HashMap;
+-import java.util.Map;
+-import org.jetbrains.annotations.NotNull;
+-import org.jetbrains.annotations.Nullable;
+-
+-@Deprecated(forRemoval = true)
+-public class Counter extends ForwardingMap {
+- private final Map counts = new HashMap<>();
+-
+- public long decrement(@Nullable T key) {
+- return increment(key, -1);
+- }
+- public long increment(@Nullable T key) {
+- return increment(key, 1);
+- }
+- public long decrement(@Nullable T key, long amount) {
+- return increment(key, -amount);
+- }
+- public long increment(@Nullable T key, long amount) {
+- Long count = this.getCount(key);
+- count += amount;
+- this.counts.put(key, count);
+- return count;
+- }
+-
+- public long getCount(@Nullable T key) {
+- return this.counts.getOrDefault(key, 0L);
+- }
+-
+- @NotNull
+- @Override
+- protected Map delegate() {
+- return this.counts;
+- }
+-}
+diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java
+deleted file mode 100644
+index 232bf09e1a7bc176bfd34b1acb5326a06a92fe79..0000000000000000000000000000000000000000
+--- a/src/main/java/co/aikar/util/JSONUtil.java
++++ /dev/null
+@@ -1,138 +0,0 @@
+-package co.aikar.util;
+-
+-import com.google.common.base.Function;
+-import com.google.common.collect.Lists;
+-import com.google.common.collect.Maps;
+-import org.jetbrains.annotations.NotNull;
+-import org.jetbrains.annotations.Nullable;
+-
+-import java.util.LinkedHashMap;
+-import java.util.List;
+-import java.util.Map;
+-
+-/**
+- * Provides Utility methods that assist with generating JSON Objects
+- */
+-@SuppressWarnings({"rawtypes", "SuppressionAnnotation"})
+-@Deprecated(forRemoval = true)
+-public final class JSONUtil {
+- private JSONUtil() {}
+-
+- /**
+- * Creates a key/value "JSONPair" object
+- *
+- * @param key Key to use
+- * @param obj Value to use
+- * @return JSONPair
+- */
+- @NotNull
+- public static JSONPair pair(@NotNull String key, @Nullable Object obj) {
+- return new JSONPair(key, obj);
+- }
+-
+- @NotNull
+- public static JSONPair pair(long key, @Nullable Object obj) {
+- return new JSONPair(String.valueOf(key), obj);
+- }
+-
+- /**
+- * Creates a new JSON object from multiple JSONPair key/value pairs
+- *
+- * @param data JSONPairs
+- * @return Map
+- */
+- @NotNull
+- public static Map createObject(@NotNull JSONPair... data) {
+- return appendObjectData(new LinkedHashMap(), data);
+- }
+-
+- /**
+- * This appends multiple key/value Obj pairs into a JSON Object
+- *
+- * @param parent Map to be appended to
+- * @param data Data to append
+- * @return Map
+- */
+- @NotNull
+- public static Map appendObjectData(@NotNull Map parent, @NotNull JSONPair... data) {
+- for (JSONPair JSONPair : data) {
+- parent.put(JSONPair.key, JSONPair.val);
+- }
+- return parent;
+- }
+-
+- /**
+- * This builds a JSON array from a set of data
+- *
+- * @param data Data to build JSON array from
+- * @return List
+- */
+- @NotNull
+- public static List toArray(@NotNull Object... data) {
+- return Lists.newArrayList(data);
+- }
+-
+- /**
+- * These help build a single JSON array using a mapper function
+- *
+- * @param collection Collection to apply to
+- * @param mapper Mapper to apply
+- * @param Element Type
+- * @return List
+- */
+- @NotNull
+- public static List toArrayMapper(@NotNull E[] collection, @NotNull Function mapper) {
+- return toArrayMapper(Lists.newArrayList(collection), mapper);
+- }
+-
+- @NotNull
+- public static List toArrayMapper(@NotNull Iterable collection, @NotNull Function mapper) {
+- List array = Lists.newArrayList();
+- for (E e : collection) {
+- Object object = mapper.apply(e);
+- if (object != null) {
+- array.add(object);
+- }
+- }
+- return array;
+- }
+-
+- /**
+- * These help build a single JSON Object from a collection, using a mapper function
+- *
+- * @param collection Collection to apply to
+- * @param mapper Mapper to apply
+- * @param Element Type
+- * @return Map
+- */
+- @NotNull
+- public static Map toObjectMapper(@NotNull E[] collection, @NotNull Function mapper) {
+- return toObjectMapper(Lists.newArrayList(collection), mapper);
+- }
+-
+- @NotNull
+- public static Map toObjectMapper(@NotNull Iterable collection, @NotNull Function mapper) {
+- Map object = Maps.newLinkedHashMap();
+- for (E e : collection) {
+- JSONPair JSONPair = mapper.apply(e);
+- if (JSONPair != null) {
+- object.put(JSONPair.key, JSONPair.val);
+- }
+- }
+- return object;
+- }
+-
+- /**
+- * Simply stores a key and a value, used internally by many methods below.
+- */
+- @SuppressWarnings("PublicInnerClass")
+- public static class JSONPair {
+- final String key;
+- final Object val;
+-
+- JSONPair(@NotNull String key, @NotNull Object val) {
+- this.key = key;
+- this.val = val;
+- }
+- }
+-}
+diff --git a/src/main/java/co/aikar/util/LoadingIntMap.java b/src/main/java/co/aikar/util/LoadingIntMap.java
+deleted file mode 100644
+index 5753b9bce89db2ac378ec41f1b61907cc2e23335..0000000000000000000000000000000000000000
+--- a/src/main/java/co/aikar/util/LoadingIntMap.java
++++ /dev/null
+@@ -1,77 +0,0 @@
+-/*
+- * Copyright (c) 2015. Starlis LLC / dba Empire Minecraft
+- *
+- * This source code is proprietary software and must not be redistributed without Starlis LLC's approval
+- *
+- */
+-package co.aikar.util;
+-
+-
+-import com.google.common.base.Function;
+-import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
+-import org.jetbrains.annotations.NotNull;
+-import org.jetbrains.annotations.Nullable;
+-
+-/**
+- * Allows you to pass a Loader function that when a key is accessed that doesn't exist,
+- * automatically loads the entry into the map by calling the loader Function.
+- *
+- * .get() Will only return null if the Loader can return null.
+- *
+- * You may pass any backing Map to use.
+- *
+- * This class is not thread safe and should be wrapped with Collections.synchronizedMap on the OUTSIDE of the LoadingMap if needed.
+- *
+- * Do not wrap the backing map with Collections.synchronizedMap.
+- *
+- * @param Value
+- */
+-@Deprecated(forRemoval = true)
+-public class LoadingIntMap extends Int2ObjectOpenHashMap {
+- private final Function loader;
+-
+- public LoadingIntMap(@NotNull Function loader) {
+- super();
+- this.loader = loader;
+- }
+-
+- public LoadingIntMap(int expectedSize, @NotNull Function loader) {
+- super(expectedSize);
+- this.loader = loader;
+- }
+-
+- public LoadingIntMap(int expectedSize, float loadFactor, @NotNull Function loader) {
+- super(expectedSize, loadFactor);
+- this.loader = loader;
+- }
+-
+-
+- @Nullable
+- @Override
+- public V get(int key) {
+- V res = super.get(key);
+- if (res == null) {
+- res = loader.apply(key);
+- if (res != null) {
+- put(key, res);
+- }
+- }
+- return res;
+- }
+-
+- /**
+- * Due to java stuff, you will need to cast it to (Function) for some cases
+- *
+- * @param Type
+- */
+- public abstract static class Feeder implements Function {
+- @Nullable
+- @Override
+- public T apply(@Nullable Object input) {
+- return apply();
+- }
+-
+- @Nullable
+- public abstract T apply();
+- }
+-}
+diff --git a/src/main/java/co/aikar/util/LoadingMap.java b/src/main/java/co/aikar/util/LoadingMap.java
+deleted file mode 100644
+index 1786eeb5cbeaad75602c9c5649bbcd9b2af5cf81..0000000000000000000000000000000000000000
+--- a/src/main/java/co/aikar/util/LoadingMap.java
++++ /dev/null
+@@ -1,369 +0,0 @@
+-/*
+- * This file is licensed under the MIT License (MIT).
+- *
+- * Copyright (c) 2014 Daniel Ennis
+- *
+- * Permission is hereby granted, free of charge, to any person obtaining a copy
+- * of this software and associated documentation files (the "Software"), to deal
+- * in the Software without restriction, including without limitation the rights
+- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+- * copies of the Software, and to permit persons to whom the Software is
+- * furnished to do so, subject to the following conditions:
+- *
+- * The above copyright notice and this permission notice shall be included in
+- * all copies or substantial portions of the Software.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+- * THE SOFTWARE.
+- */
+-package co.aikar.util;
+-
+-import com.google.common.base.Preconditions;
+-import java.lang.reflect.Constructor;
+-import java.util.AbstractMap;
+-import java.util.Collection;
+-import java.util.HashMap;
+-import java.util.IdentityHashMap;
+-import java.util.Map;
+-import java.util.Set;
+-import java.util.function.Function;
+-import org.jetbrains.annotations.NotNull;
+-import org.jetbrains.annotations.Nullable;
+-
+-/**
+- * Allows you to pass a Loader function that when a key is accessed that doesn't exists,
+- * automatically loads the entry into the map by calling the loader Function.
+- *
+- * .get() Will only return null if the Loader can return null.
+- *
+- * You may pass any backing Map to use.
+- *
+- * This class is not thread safe and should be wrapped with Collections.synchronizedMap on the OUTSIDE of the LoadingMap if needed.
+- *
+- * Do not wrap the backing map with Collections.synchronizedMap.
+- *
+- * @param Key
+- * @param Value
+- */
+-@Deprecated(forRemoval = true)
+-public class LoadingMap extends AbstractMap {
+- private final Map backingMap;
+- private final java.util.function.Function loader;
+-
+- /**
+- * Initializes an auto loading map using specified loader and backing map
+- * @param backingMap Map to wrap
+- * @param loader Loader
+- */
+- public LoadingMap(@NotNull Map backingMap, @NotNull java.util.function.Function loader) {
+- this.backingMap = backingMap;
+- this.loader = loader;
+- }
+-
+- /**
+- * Creates a new LoadingMap with the specified map and loader
+- *
+- * @param backingMap Actual map being used.
+- * @param loader Loader to use
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map
+- */
+- @NotNull
+- public static Map of(@NotNull Map backingMap, @NotNull Function loader) {
+- return new LoadingMap<>(backingMap, loader);
+- }
+-
+- /**
+- * Creates a LoadingMap with an auto instantiating loader.
+- *
+- * Will auto construct class of of Value when not found
+- *
+- * Since this uses Reflection, It is more effecient to define your own static loader
+- * than using this helper, but if performance is not critical, this is easier.
+- *
+- * @param backingMap Actual map being used.
+- * @param keyClass Class used for the K generic
+- * @param valueClass Class used for the V generic
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map that auto instantiates on .get()
+- */
+- @NotNull
+- public static Map newAutoMap(@NotNull Map backingMap, @Nullable final Class extends K> keyClass,
+- @NotNull final Class extends V> valueClass) {
+- return new LoadingMap<>(backingMap, new AutoInstantiatingLoader<>(keyClass, valueClass));
+- }
+- /**
+- * Creates a LoadingMap with an auto instantiating loader.
+- *
+- * Will auto construct class of of Value when not found
+- *
+- * Since this uses Reflection, It is more effecient to define your own static loader
+- * than using this helper, but if performance is not critical, this is easier.
+- *
+- * @param backingMap Actual map being used.
+- * @param valueClass Class used for the V generic
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map that auto instantiates on .get()
+- */
+- @NotNull
+- public static Map newAutoMap(@NotNull Map backingMap,
+- @NotNull final Class extends V> valueClass) {
+- return newAutoMap(backingMap, null, valueClass);
+- }
+-
+- /**
+- * @see #newAutoMap
+- *
+- * new Auto initializing map using a HashMap.
+- *
+- * @param keyClass Class used for the K generic
+- * @param valueClass Class used for the V generic
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map that auto instantiates on .get()
+- */
+- @NotNull
+- public static Map newHashAutoMap(@Nullable final Class extends K> keyClass, @NotNull final Class extends V> valueClass) {
+- return newAutoMap(new HashMap<>(), keyClass, valueClass);
+- }
+-
+- /**
+- * @see #newAutoMap
+- *
+- * new Auto initializing map using a HashMap.
+- *
+- * @param valueClass Class used for the V generic
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map that auto instantiates on .get()
+- */
+- @NotNull
+- public static Map newHashAutoMap(@NotNull final Class extends V> valueClass) {
+- return newHashAutoMap(null, valueClass);
+- }
+-
+- /**
+- * @see #newAutoMap
+- *
+- * new Auto initializing map using a HashMap.
+- *
+- * @param keyClass Class used for the K generic
+- * @param valueClass Class used for the V generic
+- * @param initialCapacity Initial capacity to use
+- * @param loadFactor Load factor to use
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map that auto instantiates on .get()
+- */
+- @NotNull
+- public static Map newHashAutoMap(@Nullable final Class extends K> keyClass, @NotNull final Class extends V> valueClass, int initialCapacity, float loadFactor) {
+- return newAutoMap(new HashMap<>(initialCapacity, loadFactor), keyClass, valueClass);
+- }
+-
+- /**
+- * @see #newAutoMap
+- *
+- * new Auto initializing map using a HashMap.
+- *
+- * @param valueClass Class used for the V generic
+- * @param initialCapacity Initial capacity to use
+- * @param loadFactor Load factor to use
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map that auto instantiates on .get()
+- */
+- @NotNull
+- public static Map newHashAutoMap(@NotNull final Class extends V> valueClass, int initialCapacity, float loadFactor) {
+- return newHashAutoMap(null, valueClass, initialCapacity, loadFactor);
+- }
+-
+- /**
+- * Initializes an auto loading map using a HashMap
+- *
+- * @param loader Loader to use
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map
+- */
+- @NotNull
+- public static Map newHashMap(@NotNull Function loader) {
+- return new LoadingMap<>(new HashMap<>(), loader);
+- }
+-
+- /**
+- * Initializes an auto loading map using a HashMap
+- *
+- * @param loader Loader to use
+- * @param initialCapacity Initial capacity to use
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map
+- */
+- @NotNull
+- public static Map newHashMap(@NotNull Function loader, int initialCapacity) {
+- return new LoadingMap<>(new HashMap<>(initialCapacity), loader);
+- }
+- /**
+- * Initializes an auto loading map using a HashMap
+- *
+- * @param loader Loader to use
+- * @param initialCapacity Initial capacity to use
+- * @param loadFactor Load factor to use
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map
+- */
+- @NotNull
+- public static Map newHashMap(@NotNull Function loader, int initialCapacity, float loadFactor) {
+- return new LoadingMap<>(new HashMap<>(initialCapacity, loadFactor), loader);
+- }
+-
+- /**
+- * Initializes an auto loading map using an Identity HashMap
+- *
+- * @param loader Loader to use
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map
+- */
+- @NotNull
+- public static Map newIdentityHashMap(@NotNull Function loader) {
+- return new LoadingMap<>(new IdentityHashMap<>(), loader);
+- }
+-
+- /**
+- * Initializes an auto loading map using an Identity HashMap
+- *
+- * @param loader Loader to use
+- * @param initialCapacity Initial capacity to use
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map
+- */
+- @NotNull
+- public static Map newIdentityHashMap(@NotNull Function loader, int initialCapacity) {
+- return new LoadingMap<>(new IdentityHashMap<>(initialCapacity), loader);
+- }
+-
+- @Override
+- public int size() {return backingMap.size();}
+-
+- @Override
+- public boolean isEmpty() {return backingMap.isEmpty();}
+-
+- @Override
+- public boolean containsKey(@Nullable Object key) {return backingMap.containsKey(key);}
+-
+- @Override
+- public boolean containsValue(@Nullable Object value) {return backingMap.containsValue(value);}
+-
+- @Nullable
+- @Override
+- public V get(@Nullable Object key) {
+- V v = backingMap.get(key);
+- if (v != null) {
+- return v;
+- }
+- return backingMap.computeIfAbsent((K) key, loader);
+- }
+-
+- @Nullable
+- public V put(@Nullable K key, @Nullable V value) {return backingMap.put(key, value);}
+-
+- @Nullable
+- @Override
+- public V remove(@Nullable Object key) {return backingMap.remove(key);}
+-
+- public void putAll(@NotNull Map extends K, ? extends V> m) {backingMap.putAll(m);}
+-
+- @Override
+- public void clear() {backingMap.clear();}
+-
+- @NotNull
+- @Override
+- public Set keySet() {return backingMap.keySet();}
+-
+- @NotNull
+- @Override
+- public Collection values() {return backingMap.values();}
+-
+- @Override
+- public boolean equals(@Nullable Object o) {return backingMap.equals(o);}
+-
+- @Override
+- public int hashCode() {return backingMap.hashCode();}
+-
+- @NotNull
+- @Override
+- public Set> entrySet() {
+- return backingMap.entrySet();
+- }
+-
+- @NotNull
+- public LoadingMap clone() {
+- return new LoadingMap<>(backingMap, loader);
+- }
+-
+- private static class AutoInstantiatingLoader implements Function {
+- final Constructor extends V> constructor;
+- private final Class extends V> valueClass;
+-
+- AutoInstantiatingLoader(@Nullable Class extends K> keyClass, @NotNull Class extends V> valueClass) {
+- try {
+- this.valueClass = valueClass;
+- if (keyClass != null) {
+- constructor = valueClass.getConstructor(keyClass);
+- } else {
+- constructor = null;
+- }
+- } catch (NoSuchMethodException e) {
+- throw new IllegalStateException(
+- valueClass.getName() + " does not have a constructor for " + (keyClass != null ? keyClass.getName() : null));
+- }
+- }
+-
+- @NotNull
+- @Override
+- public V apply(@Nullable K input) {
+- try {
+- return (constructor != null ? constructor.newInstance(input) : valueClass.newInstance());
+- } catch (Exception e) {
+- throw new ExceptionInInitializerError(e);
+- }
+- }
+-
+- @Override
+- public int hashCode() {
+- return super.hashCode();
+- }
+-
+- @Override
+- public boolean equals(Object object) {
+- return false;
+- }
+- }
+-
+- /**
+- * Due to java stuff, you will need to cast it to (Function) for some cases
+- *
+- * @param Type
+- */
+- public abstract static class Feeder implements Function {
+- @Nullable
+- @Override
+- public T apply(@Nullable Object input) {
+- return apply();
+- }
+-
+- @Nullable
+- public abstract T apply();
+- }
+-}
+diff --git a/src/main/java/co/aikar/util/MRUMapCache.java b/src/main/java/co/aikar/util/MRUMapCache.java
+deleted file mode 100644
+index 3e61a926620a67daec3af54b72a1b911eaef2ed4..0000000000000000000000000000000000000000
+--- a/src/main/java/co/aikar/util/MRUMapCache.java
++++ /dev/null
+@@ -1,112 +0,0 @@
+-/*
+- * This file is licensed under the MIT License (MIT).
+- *
+- * Copyright (c) 2014 Daniel Ennis
+- *
+- * Permission is hereby granted, free of charge, to any person obtaining a copy
+- * of this software and associated documentation files (the "Software"), to deal
+- * in the Software without restriction, including without limitation the rights
+- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+- * copies of the Software, and to permit persons to whom the Software is
+- * furnished to do so, subject to the following conditions:
+- *
+- * The above copyright notice and this permission notice shall be included in
+- * all copies or substantial portions of the Software.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+- * THE SOFTWARE.
+- */
+-package co.aikar.util;
+-
+-import java.util.AbstractMap;
+-import java.util.Collection;
+-import java.util.Map;
+-import java.util.Set;
+-import org.jetbrains.annotations.NotNull;
+-import org.jetbrains.annotations.Nullable;
+-
+-/**
+- * Implements a Most Recently Used cache in front of a backing map, to quickly access the last accessed result.
+- *
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- */
+-@Deprecated(forRemoval = true)
+-public class MRUMapCache extends AbstractMap {
+- final Map backingMap;
+- Object cacheKey;
+- V cacheValue;
+- public MRUMapCache(@NotNull final Map backingMap) {
+- this.backingMap = backingMap;
+- }
+-
+- public int size() {return backingMap.size();}
+-
+- public boolean isEmpty() {return backingMap.isEmpty();}
+-
+- public boolean containsKey(@Nullable Object key) {
+- return key != null && key.equals(cacheKey) || backingMap.containsKey(key);
+- }
+-
+- public boolean containsValue(@Nullable Object value) {
+- return value != null && value == cacheValue || backingMap.containsValue(value);
+- }
+-
+- @Nullable
+- public V get(@Nullable Object key) {
+- if (cacheKey != null && cacheKey.equals(key)) {
+- return cacheValue;
+- }
+- cacheKey = key;
+- return cacheValue = backingMap.get(key);
+- }
+-
+- @Nullable
+- public V put(@Nullable K key, @Nullable V value) {
+- cacheKey = key;
+- return cacheValue = backingMap.put(key, value);
+- }
+-
+- @Nullable
+- public V remove(@Nullable Object key) {
+- if (key != null && key.equals(cacheKey)) {
+- cacheKey = null;
+- }
+- return backingMap.remove(key);
+- }
+-
+- public void putAll(@NotNull Map extends K, ? extends V> m) {backingMap.putAll(m);}
+-
+- public void clear() {
+- cacheKey = null;
+- cacheValue = null;
+- backingMap.clear();
+- }
+-
+- @NotNull
+- public Set keySet() {return backingMap.keySet();}
+-
+- @NotNull
+- public Collection values() {return backingMap.values();}
+-
+- @NotNull
+- public Set> entrySet() {return backingMap.entrySet();}
+-
+- /**
+- * Wraps the specified map with a most recently used cache
+- *
+- * @param map Map to be wrapped
+- * @param Key Type of the Map
+- * @param Value Type of the Map
+- * @return Map
+- */
+- @NotNull
+- public static Map of(@NotNull Map map) {
+- return new MRUMapCache(map);
+- }
+-}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 71eb845a4d3b8b6ec3b816a0f20ec807e0f9a86d..a43419c23aa0f6fd809caf5a841cb138f350b7ba 100644
--- a/src/main/java/org/bukkit/command/Command.java
@@ -2219,18 +2984,10 @@ index 001465eedafa51ac027a4db51cba6223edfe1171..9cb0f09b821a4020d17771a5b64ddd53
// Paper start
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
-index 065f182fbfe4541d602f57d548f286ee3c2fab19..40350504b5f7a92d834e95bb2e4e4268195ec9e7 100644
+index b23774f34a39426c7eeba9da05a75de44e603658..1ad24e0107499e4dcaad647feeb54887675d9e51 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
-@@ -43,7 +43,6 @@ import org.bukkit.plugin.TimedRegisteredListener;
- import org.bukkit.plugin.UnknownDependencyException;
- import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
--import org.spigotmc.CustomTimingsHandler; // Spigot
- import org.yaml.snakeyaml.error.YAMLException;
-
- /**
-@@ -294,7 +293,7 @@ public final class JavaPluginLoader implements PluginLoader {
+@@ -291,7 +291,7 @@ public final class JavaPluginLoader implements PluginLoader {
}
}
@@ -2239,15 +2996,15 @@ index 065f182fbfe4541d602f57d548f286ee3c2fab19..40350504b5f7a92d834e95bb2e4e4268
@Override
public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { // Paper
try {
-@@ -308,7 +307,7 @@ public final class JavaPluginLoader implements PluginLoader {
+@@ -305,7 +305,7 @@ public final class JavaPluginLoader implements PluginLoader {
throw new EventException(t);
}
}
- }, plugin, method, eventClass); // Paper
+ }; // Paper // DivineMC - Delete Timings
- if (false) { // Spigot - RL handles useTimings check now
- eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
- } else {
+ eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
+ }
+ return ret;
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
deleted file mode 100644
index b4249da3eb26eae26ec000cc4d56cd21ac2fc6d5..0000000000000000000000000000000000000000
diff --git a/divinemc-api/paper-patches/features/0006-Extend-Sound-API.patch b/divinemc-api/paper-patches/features/0006-Extend-Sound-API.patch
index e367f42..6decfda 100644
--- a/divinemc-api/paper-patches/features/0006-Extend-Sound-API.patch
+++ b/divinemc-api/paper-patches/features/0006-Extend-Sound-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Extend Sound API
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
-index b703ad820ff873097dadff9e55b53fcc6b1b8698..b35c3852a3b8e62c7d2f67fc3ff651c8e0a4d5f2 100644
+index d309e28d7e6756afed82390fd2a99a6131e29140..468e2fa5e059e19c14d095c840723f10a6aa9287 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -817,4 +817,29 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
@@ -39,10 +39,10 @@ index b703ad820ff873097dadff9e55b53fcc6b1b8698..b35c3852a3b8e62c7d2f67fc3ff651c8
+ // DivineMC end - Extend Sound API
}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
-index be56f0f42d4ec23397f9974e158b49fcc7ed44f3..82117a1b258d43f68ff803c4c1af0a33c99065a8 100644
+index bee034fd48b567a64a152196a0b80f2f1a9661e4..1eaae9a9e2d73535ddfea355878c61db0f9aa342 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
-@@ -1251,4 +1251,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
+@@ -1279,4 +1279,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
void setImmuneToFire(@Nullable Boolean fireImmune);
// Purpur end - Fire Immunity API
diff --git a/divinemc-api/paper-patches/features/0007-Pufferfish-Sentry.patch b/divinemc-api/paper-patches/features/0007-Pufferfish-Sentry.patch
index 0c33e29..72341e2 100644
--- a/divinemc-api/paper-patches/features/0007-Pufferfish-Sentry.patch
+++ b/divinemc-api/paper-patches/features/0007-Pufferfish-Sentry.patch
@@ -31,10 +31,10 @@ index 9cb0f09b821a4020d17771a5b64ddd53e7d78478..1638548b766460be65c0c008f7f19df1
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerEventException(msg, ex, registration.getPlugin(), registration.getListener(), event)));
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
-index 40350504b5f7a92d834e95bb2e4e4268195ec9e7..1450ce1ce1ecad79dd9514081190df94ceae9d52 100644
+index 1ad24e0107499e4dcaad647feeb54887675d9e51..9342ea35fb963379039ae020f9317bb02147f9c1 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
-@@ -336,7 +336,13 @@ public final class JavaPluginLoader implements PluginLoader {
+@@ -330,7 +330,13 @@ public final class JavaPluginLoader implements PluginLoader {
try {
jPlugin.setEnabled(true);
} catch (Throwable ex) {
@@ -48,7 +48,7 @@ index 40350504b5f7a92d834e95bb2e4e4268195ec9e7..1450ce1ce1ecad79dd9514081190df94
}
// Perhaps abort here, rather than continue going, but as it stands,
-@@ -361,7 +367,9 @@ public final class JavaPluginLoader implements PluginLoader {
+@@ -355,7 +361,9 @@ public final class JavaPluginLoader implements PluginLoader {
try {
jPlugin.setEnabled(false);
} catch (Throwable ex) {
diff --git a/divinemc-api/paper-patches/features/0008-Paper-PR-Player-standing-on-position-API.patch b/divinemc-api/paper-patches/features/0008-Paper-PR-Player-standing-on-position-API.patch
index e4ca07b..58cafd0 100644
--- a/divinemc-api/paper-patches/features/0008-Paper-PR-Player-standing-on-position-API.patch
+++ b/divinemc-api/paper-patches/features/0008-Paper-PR-Player-standing-on-position-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Paper PR: Player standing on position API
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
-index 82117a1b258d43f68ff803c4c1af0a33c99065a8..cb8232faed9423dd570e3a6b0ea664182074a1ac 100644
+index 1eaae9a9e2d73535ddfea355878c61db0f9aa342..0cb9d99f628a9a8b6bd53b5603bd80b176fbc4f4 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
-@@ -1197,6 +1197,33 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
+@@ -1225,6 +1225,33 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
void broadcastHurtAnimation(@NotNull java.util.Collection players);
// Paper end - broadcast hurt animation
diff --git a/divinemc-api/paper-patches/files/src/main/java/org/bukkit/map/MapPalette.java.patch b/divinemc-api/paper-patches/files/src/main/java/org/bukkit/map/MapPalette.java.patch
index efa8efa..fe3a0f4 100644
--- a/divinemc-api/paper-patches/files/src/main/java/org/bukkit/map/MapPalette.java.patch
+++ b/divinemc-api/paper-patches/files/src/main/java/org/bukkit/map/MapPalette.java.patch
@@ -1,15 +1,15 @@
--- a/src/main/java/org/bukkit/map/MapPalette.java
+++ b/src/main/java/org/bukkit/map/MapPalette.java
-@@ -45,7 +_,7 @@
+@@ -35,7 +_,7 @@
}
@NotNull
- static final Color[] colors = {
+ public static final Color[] colors = { // DivineMC - Pufferfish SIMD - make public
- c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0),
- c(89, 125, 39), c(109, 153, 48), c(127, 178, 56), c(67, 94, 29),
- c(174, 164, 115), c(213, 201, 140), c(247, 233, 163), c(130, 123, 86),
-@@ -216,9 +_,15 @@
+ // Start generate - MapPalette#colors
+ // @GeneratedFrom 1.21.5
+ new Color(0x00000000, true),
+@@ -395,9 +_,15 @@
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
byte[] result = new byte[temp.getWidth() * temp.getHeight()];
diff --git a/divinemc-server/build.gradle.kts.patch b/divinemc-server/build.gradle.kts.patch
index 86da54e..8524bef 100644
--- a/divinemc-server/build.gradle.kts.patch
+++ b/divinemc-server/build.gradle.kts.patch
@@ -1,19 +1,13 @@
--- a/purpur-server/build.gradle.kts
+++ b/purpur-server/build.gradle.kts
-@@ -22,6 +_,7 @@
- // gitFilePatches = true
-
- val purpur = forks.register("purpur") {
-+ rootDirectory = upstreamsDirectory().map { it.dir("purpur") }
- upstream.patchDir("paperServer") {
- upstreamPath = "paper-server"
- excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
-@@ -29,7 +_,23 @@
+@@ -37,9 +_,27 @@
outputDir = rootDirectory.dir("paper-server")
}
}
- activeFork = purpur
-+
+ // Purpur end - Rebrand
+
++ // DivineMC start - Rebrand
+ val divinemc = forks.register("divinemc") {
+ forks = purpur
+ upstream.patchRepo("paperServer") {
@@ -30,32 +24,38 @@
+ }
+
+ activeFork = divinemc
-
++ // DivineMC end - Rebrand
++
spigot {
- buildDataRef = "3edaf46ec1eed4115ce1b18d2846cded42577e42"
-@@ -115,10 +_,14 @@
+ buildDataRef = "702e1a0a5072b2c4082371d5228cb30525687efc"
+ packageVersion = "v1_21_R4" // also needs to be updated in MappingEnvironment
+@@ -125,10 +_,18 @@
main {
java { srcDir("../paper-server/src/main/java") }
resources { srcDir("../paper-server/src/main/resources") }
++ // DivineMC start - Rebrand
+ java { srcDir("../purpur-server/src/main/java") }
+ resources { srcDir("../purpur-server/src/main/resources") }
++ // DivineMC end - Rebrand
}
test {
java { srcDir("../paper-server/src/test/java") }
resources { srcDir("../paper-server/src/test/resources") }
++ // DivineMC start - Rebrand
+ java { srcDir("../purpur-server/src/test/java") }
+ resources { srcDir("../purpur-server/src/test/resources") }
++ // DivineMC end - Rebrand
}
}
-
-@@ -142,10 +_,23 @@
+ val log4jPlugins = sourceSets.create("log4jPlugins") {
+@@ -156,10 +_,23 @@
}
dependencies {
-- implementation(project(":purpur-api"))
-+ implementation(project(":divinemc-api")) // DivineMC
+- implementation(project(":purpur-api")) // Purpur
++ implementation(project(":divinemc-api")) // DivineMC - Rebrand
+
-+ // DivineMC start
++ // DivineMC start - Dependencies
+ implementation("org.yaml:snakeyaml:2.3")
+ implementation ("me.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
+ exclude(group="org.yaml", module="snakeyaml")
@@ -65,7 +65,7 @@
+ implementation("net.openhft:zero-allocation-hashing:0.16")
+ implementation("com.github.luben:zstd-jni:1.5.6-9")
+ implementation("org.lz4:lz4-java:1.8.0")
-+ // DivineMC end
++ // DivineMC end - Dependencies
+
implementation("ca.spottedleaf:concurrentutil:0.0.3")
- implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
@@ -73,14 +73,14 @@
+ implementation("org.jline:jline-terminal-ffm:3.29.0") // use ffm on java 22+ // DivineMC - Bump dependencies
+ implementation("org.jline:jline-terminal-jni:3.29.0") // fall back to jni on java 21 // DivineMC - Bump dependencies
implementation("net.minecrell:terminalconsoleappender:1.3.0")
- implementation("net.kyori:adventure-text-serializer-ansi:4.18.0") // Keep in sync with adventureVersion from Paper-API build file
-
-@@ -155,16 +_,16 @@
+ implementation("io.papermc.adventure:adventure-text-serializer-ansi:4.21.0-mc1215-SNAPSHOT") // Keep in sync with adventureVersion from Paper-API build file // FIXME back to release
+ runtimeConfiguration(sourceSets.main.map { it.runtimeClasspath })
+@@ -170,16 +_,16 @@
all its classes to check if they are plugins.
Scanning takes about 1-2 seconds so adding this speeds up the server start.
*/
-- implementation("org.apache.logging.log4j:log4j-core:2.19.0")
-- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Needed to generate meta for our Log4j plugins
+- implementation("org.apache.logging.log4j:log4j-core:2.24.1")
+- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.24.1") // Needed to generate meta for our Log4j plugins
+ implementation("org.apache.logging.log4j:log4j-core:2.24.3") // DivineMC - Bump dependencies
+ log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.24.3") // Needed to generate meta for our Log4j plugins // DivineMC - Bump dependencies
runtimeOnly(log4jPlugins.output)
@@ -89,52 +89,58 @@
implementation("com.velocitypowered:velocity-native:3.4.0-SNAPSHOT") {
isTransitive = false
}
-- implementation("io.netty:netty-codec-haproxy:4.1.115.Final") // Add support for proxy protocol
+- implementation("io.netty:netty-codec-haproxy:4.1.118.Final") // Add support for proxy protocol
- implementation("org.apache.logging.log4j:log4j-iostreams:2.24.1")
+ implementation("io.netty:netty-codec-haproxy:4.1.119.Final") // Add support for proxy protocol // DivineMC - Bump dependencies
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.24.3") // DivineMC - Bump dependencies
- implementation("org.ow2.asm:asm-commons:9.7.1")
+ implementation("org.ow2.asm:asm-commons:9.8")
implementation("org.spongepowered:configurate-yaml:4.2.0-20250225.064233-199")
implementation("org.spongepowered:configurate-core:4.2.0-20250225.064233-204") // Pinned dependency of above pinned yaml snapshot.
-@@ -173,22 +_,24 @@
- runtimeOnly("com.mysql:mysql-connector-j:9.1.0")
+@@ -191,24 +_,31 @@
+ // Deps that were previously in the API but have now been moved here for backwards compat, eventually to be removed
+ runtimeOnly("commons-lang:commons-lang:2.6")
+ runtimeOnly("org.xerial:sqlite-jdbc:3.49.1.0")
+- runtimeOnly("com.mysql:mysql-connector-j:9.2.0")
++ // DivineMC start - Bump dependencies
++ runtimeOnly("com.mysql:mysql-connector-j:9.2.0") {
++ exclude("com.google.protobuf", "protobuf-java") // exclude outdated version
++ }
++ runtimeOnly("com.google.protobuf:protobuf-java:4.30.1")
++ // DivineMC end - Bump dependencies
runtimeOnly("com.lmax:disruptor:3.4.4")
+ implementation("com.googlecode.json-simple:json-simple:1.1.1") { // change to runtimeOnly once Timings is removed
+ isTransitive = false // includes junit
+ }
-- implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
-- implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
-+ implementation("org.mozilla:rhino-runtime:1.7.15") // Purpur // DivineMC - Bump dependencies
-+ implementation("org.mozilla:rhino-engine:1.7.15") // Purpur // DivineMC - Bump dependencies
- implementation("dev.omega24:upnp4j:1.0") // Purpur
+- runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
+- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
+- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
++ // DivineMC start - Bump dependencies
++ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.9")
++ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.22")
++ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.22")
++ // DivineMC end - Bump dependencies
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
-
-- testImplementation("io.github.classgraph:classgraph:4.8.47") // For mob goal test
-- testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
-- testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0")
+ testImplementation("io.github.classgraph:classgraph:4.8.179") // For mob goal test
+ testImplementation("org.junit.jupiter:junit-jupiter:5.12.2")
+ testImplementation("org.junit.platform:junit-platform-suite-engine:1.12.2")
- testImplementation("org.hamcrest:hamcrest:2.2")
- testImplementation("org.mockito:mockito-core:5.14.1")
- mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Configure mockito agent that is needed in newer java versions
-+ // DivineMC start - Bump dependencies
-+ testImplementation("io.github.classgraph:classgraph:4.8.179") // For mob goal test
-+ testImplementation("org.junit.jupiter:junit-jupiter:5.12.1")
-+ testImplementation("org.junit.platform:junit-platform-suite-engine:1.12.1")
-+ testImplementation("org.hamcrest:hamcrest:3.0")
-+ testImplementation("org.mockito:mockito-core:5.16.1")
-+ mockitoAgent("org.mockito:mockito-core:5.16.1") { isTransitive = false } // Configure mockito agent that is needed in newer java versions
-+ // DivineMC end - Bump dependencies
- testImplementation("org.ow2.asm:asm-tree:9.7.1")
++ testImplementation("org.hamcrest:hamcrest:3.0") // DivineMC - Bump dependencies
++ testImplementation("org.mockito:mockito-core:5.16.1") // DivineMC - Bump dependencies
++ mockitoAgent("org.mockito:mockito-core:5.16.1") { isTransitive = false } // Configure mockito agent that is needed in newer java versions // DivineMC - Bump dependencies
+ testImplementation("org.ow2.asm:asm-tree:9.8")
- testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // CartesianTest
+ testImplementation("org.junit-pioneer:junit-pioneer:2.3.0") // CartesianTest // DivineMC - Bump dependencies
implementation("net.neoforged:srgutils:1.0.9") // Mappings handling
implementation("net.neoforged:AutoRenamingTool:2.0.3") // Remap plugins
-@@ -204,30 +_,42 @@
- implementation("me.lucko:spark-paper:1.10.119-20241121.092015-1")
+@@ -224,30 +_,42 @@
+ implementation("me.lucko:spark-paper:1.10.133-20250413.112336-1")
}
-+// DivineMC start - hide irrelevant compilation warnings
++// DivineMC start - Hide irrelevant compilation warnings
+tasks.withType {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("-Xlint:-module")
@@ -142,7 +148,7 @@
+ compilerArgs.add("-Xlint:-dep-ann")
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
+}
-+// DivineMC end - hide irrelevant compilation warnings
++// DivineMC end - Hide irrelevant compilation warnings
+
tasks.jar {
manifest {
@@ -155,22 +161,22 @@
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim()
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
-+ val experimental = rootProject.providers.gradleProperty("experimental").get()
++ val experimental = rootProject.providers.gradleProperty("experimental").get() // DivineMC - Experimental flag
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
- "Implementation-Title" to "Purpur", // Purpur
-+ "Implementation-Title" to "DivineMC", // DivineMC
++ "Implementation-Title" to "DivineMC", // DivineMC - Rebrand
"Implementation-Version" to implementationVersion,
"Implementation-Vendor" to date,
- "Specification-Title" to "Purpur", // Purpur
-+ "Specification-Title" to "DivineMC", // DivineMC
++ "Specification-Title" to "DivineMC", // DivineMC - Rebrand
"Specification-Version" to project.version,
- "Specification-Vendor" to "Purpur Team", // Purpur
- "Brand-Id" to "purpurmc:purpur", // Purpur
- "Brand-Name" to "Purpur", // Purpur
-+ "Specification-Vendor" to "BX Team", // DivineMC
-+ "Brand-Id" to "bxteam:divinemc", // DivineMC
-+ "Brand-Name" to "DivineMC", // DivineMC
++ "Specification-Vendor" to "BX Team", // DivineMC - Rebrand
++ "Brand-Id" to "bxteam:divinemc", // DivineMC - Rebrand
++ "Brand-Name" to "DivineMC", // DivineMC - Rebrand
"Build-Number" to (build ?: ""),
"Build-Time" to buildTime.toString(),
"Git-Branch" to gitBranch,
diff --git a/divinemc-server/minecraft-patches/features/0001-Rebrand.patch b/divinemc-server/minecraft-patches/features/0001-Rebrand.patch
index d36e881..1cfd6de 100644
--- a/divinemc-server/minecraft-patches/features/0001-Rebrand.patch
+++ b/divinemc-server/minecraft-patches/features/0001-Rebrand.patch
@@ -18,10 +18,10 @@ index 394443d00e661715439be1e56dddc129947699a4..480ad57a6b7b74e6b83e9c6ceb69ea1f
public CrashReport(String title, Throwable exception) {
io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(exception); // Paper
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index 781030cb2e0316151c20351f04347c8db63f43e1..6bb8afb3b0e92c374474c92fa44dc7b80af0bd73 100644
+index 71d28092e0c3fe6e3ab284263f657eb12ba9dc60..4e347f56c98283485f7e279322c19f899e6fd569 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -1182,6 +1182,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, AutoCl
+ // Paper end - add paper world config
- public final io.papermc.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files
+ public final org.bxteam.divinemc.DivineWorldConfig divineConfig; // DivineMC - Configuration
- public static BlockPos lastPhysicsProblem; // Spigot
- private org.spigotmc.TickLimiter entityLimiter;
- private org.spigotmc.TickLimiter tileLimiter;
-@@ -898,6 +899,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+ public static @Nullable BlockPos lastPhysicsProblem; // Spigot
+ private int tileTickPosition;
+ public final Map explosionDensityCache = new java.util.HashMap<>(); // Paper - Optimize explosions
+@@ -885,6 +886,14 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), env); // Purpur - Purpur config files
diff --git a/divinemc-server/minecraft-patches/features/0003-Completely-remove-Mojang-profiler.patch b/divinemc-server/minecraft-patches/features/0003-Completely-remove-Mojang-profiler.patch
index 58707ba..f4fd526 100644
--- a/divinemc-server/minecraft-patches/features/0003-Completely-remove-Mojang-profiler.patch
+++ b/divinemc-server/minecraft-patches/features/0003-Completely-remove-Mojang-profiler.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Completely remove Mojang profiler
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
-index d7922847bd398d809e8b8a31bf136c804305a32b..212d2bcfd34f7cb14e18a8af2cd296fc01d371f6 100644
+index 5e39795860916e8e88e1fde45f71693adee3df58..07e228b620962e507b7db70e5a743daf2e5c82ca 100644
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
@@ -55,7 +55,6 @@ import net.minecraft.server.commands.CloneCommands;
@@ -40,7 +40,7 @@ index d7922847bd398d809e8b8a31bf136c804305a32b..212d2bcfd34f7cb14e18a8af2cd296fc
ContextChain contextChain = this.finishParsing(parseResults, command, commandSourceStack, label); // CraftBukkit // Paper - Add UnknownCommandEvent
try {
-@@ -394,8 +390,6 @@ public class Commands {
+@@ -393,8 +389,6 @@ public class Commands {
commandSourceStack.sendFailure(Component.literal(Util.describeError(var12)));
LOGGER.error("'/{}' threw an exception", command, var12);
}
@@ -49,7 +49,7 @@ index d7922847bd398d809e8b8a31bf136c804305a32b..212d2bcfd34f7cb14e18a8af2cd296fc
}
}
-@@ -452,7 +446,7 @@ public class Commands {
+@@ -451,7 +445,7 @@ public class Commands {
int max = Math.max(1, server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_CHAIN_LENGTH));
int _int = server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT);
@@ -213,10 +213,10 @@ index 18071dcc69cc28471dddb7de94e803ec1e5fc2e4..aa25f5ebaf7d1b22825b962b02dcae02
}
}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index 6bb8afb3b0e92c374474c92fa44dc7b80af0bd73..4cb26cb312802ffc00426293014ed3994793a391 100644
+index 467f9af4446168134abd8d9ee1c4e6cc3479d73c..9956405d7f9d14af7278837adeede76dea8d4bd9 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -114,19 +114,8 @@ import net.minecraft.util.TimeUtil;
+@@ -113,19 +113,8 @@ import net.minecraft.util.TimeUtil;
import net.minecraft.util.debugchart.RemoteDebugSampleType;
import net.minecraft.util.debugchart.SampleLogger;
import net.minecraft.util.debugchart.TpsDebugDimensions;
@@ -236,7 +236,7 @@ index 6bb8afb3b0e92c374474c92fa44dc7b80af0bd73..4cb26cb312802ffc00426293014ed399
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
import net.minecraft.world.Difficulty;
import net.minecraft.world.RandomSequences;
-@@ -199,13 +188,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop tickables = Lists.newArrayList();
@@ -250,7 +250,7 @@ index 6bb8afb3b0e92c374474c92fa44dc7b80af0bd73..4cb26cb312802ffc00426293014ed399
private ServerConnectionListener connection;
public final ChunkProgressListenerFactory progressListenerFactory;
@Nullable
-@@ -1005,9 +987,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0;
try {
this.isSaving = true;
-@@ -1608,10 +1574,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop serverPlayer1.connection.suspendFlushing());
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
// Paper start - Folia scheduler API
-@@ -1726,9 +1684,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Purpur - Ridables
@@ -431,7 +431,7 @@ index 6bb8afb3b0e92c374474c92fa44dc7b80af0bd73..4cb26cb312802ffc00426293014ed399
try {
serverLevel.tick(hasTimeLeft);
} catch (Throwable var7) {
-@@ -1783,34 +1734,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop true);
+ this.chunkMap.tick(() -> true);
- gameprofilerfiller.pop();
-- this.clearCache();
-- }
-- // CraftBukkit end
--
+ this.clearCache();
+ }
+ // CraftBukkit end
+
@Override
public void tick(BooleanSupplier hasTimeLeft, boolean tickChunks) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("purge");
if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot
- this.distanceManager.purgeStaleTickets();
+ this.ticketStorage.purgeStaleTickets();
}
this.runDistanceManagerUpdates();
@@ -1212,29 +1209,17 @@ index 6540b2d6a1062d883811ce240c49d30d1925b291..8055b8552b40160732953b15876dda79
this.clearCache();
}
-@@ -506,34 +484,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -511,22 +500,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
long l = gameTime - this.lastInhabitedUpdate;
this.lastInhabitedUpdate = gameTime;
if (!this.level.isDebug()) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("pollingChunks");
if (this.level.tickRateManager().runsNormally()) {
- List list = this.tickingChunks;
-
- try {
-- profilerFiller.push("filteringTickingChunks");
- this.collectTickingChunks(list);
-- profilerFiller.popPush("shuffleChunks");
- // Paper start - chunk tick iteration optimisation
- this.shuffleRandom.setSeed(this.level.random.nextLong());
- if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.shuffleRandom); // Paper - Optional per player mob spawns; do not need this when per-player is enabled
- // Paper end - chunk tick iteration optimisation
-- this.tickChunks(profilerFiller, l, list);
-- profilerFiller.pop();
-+ this.tickChunks(l, list);
- } finally {
- list.clear();
- }
+- profilerFiller.push("tickingChunks");
+- this.tickChunks(profilerFiller, l);
+- profilerFiller.pop();
++ this.tickChunks(l);
}
- this.broadcastChangedChunks(profilerFiller);
@@ -1250,25 +1235,20 @@ index 6540b2d6a1062d883811ce240c49d30d1925b291..8055b8552b40160732953b15876dda79
for (ChunkHolder chunkHolder : this.chunkHoldersToBroadcast) {
LevelChunk tickingChunk = chunkHolder.getChunkToSend(); // Paper - rewrite chunk system
if (tickingChunk != null) {
-@@ -542,7 +512,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -535,11 +517,9 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
this.chunkHoldersToBroadcast.clear();
- profiler.pop();
}
- private void collectTickingChunks(List output) {
-@@ -568,8 +537,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
- // Paper end - chunk tick iteration optimisation
- }
-
-- private void tickChunks(ProfilerFiller profiler, long timeInhabited, List chunks) {
+- private void tickChunks(ProfilerFiller profiler, long timeInhabited) {
- profiler.popPush("naturalSpawnCount");
-+ private void tickChunks(long timeInhabited, List chunks) {
++ private void tickChunks(long timeInhabited) {
int naturalSpawnChunkCount = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - Optional per player mob spawns
NaturalSpawner.SpawnState spawnState;
-@@ -594,7 +562,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -564,7 +544,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
// Paper end - Optional per player mob spawns
this.lastSpawnState = spawnState;
@@ -1276,15 +1256,33 @@ index 6540b2d6a1062d883811ce240c49d30d1925b291..8055b8552b40160732953b15876dda79
boolean _boolean = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
int _int = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
List filteredSpawningCategories;
-@@ -625,7 +592,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
- }
+@@ -586,14 +565,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+ List list = this.spawningChunks;
+
+ try {
+- profiler.push("filteringSpawningChunks");
+ this.chunkMap.collectSpawningChunks(list);
+- profiler.popPush("shuffleSpawningChunks");
+ // Paper start - chunk tick iteration optimisation
+ this.shuffleRandom.setSeed(this.level.random.nextLong());
+ if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.shuffleRandom); // Paper - Optional per player mob spawns; do not need this when per-player is enabled
+ // Paper end - chunk tick iteration optimisation
+- profiler.popPush("tickSpawningChunks");
+
+ for (LevelChunk levelChunk : list) {
+ this.tickSpawningChunk(levelChunk, timeInhabited, filteredSpawningCategories, spawnState);
+@@ -602,10 +578,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+ list.clear();
}
+- profiler.popPush("tickTickingChunks");
+ this.iterateTickingChunksFaster(); // Paper - chunk tick iteration optimisations
+- profiler.pop();
- profiler.popPush("customSpawners");
if (_boolean) {
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
}
-@@ -814,7 +780,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -814,7 +787,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@Override
protected void doRunTask(Runnable task) {
@@ -1293,19 +1291,19 @@ index 6540b2d6a1062d883811ce240c49d30d1925b291..8055b8552b40160732953b15876dda79
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da78ecc6020 100644
+index d8a8e6d006d18de5ec148a0d9d6f08a6a40a65bb..2bb5055f2fb1e8b95b2a5d8dba5f1fa0bb5fdec7 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -77,8 +77,6 @@ import net.minecraft.util.ProgressListener;
+@@ -74,8 +74,6 @@ import net.minecraft.util.Mth;
+ import net.minecraft.util.ProgressListener;
import net.minecraft.util.RandomSource;
- import net.minecraft.util.Unit;
import net.minecraft.util.datafix.DataFixTypes;
-import net.minecraft.util.profiling.Profiler;
-import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.util.valueproviders.IntProvider;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.DifficultyInstance;
-@@ -735,16 +733,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -725,16 +723,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
public void tick(BooleanSupplier hasTimeLeft) {
@@ -1322,7 +1320,7 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
}
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
-@@ -778,41 +772,30 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -768,41 +762,30 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.tickTime();
}
@@ -1338,7 +1336,7 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
- profilerFiller.popPush("raid");
if (runsNormally) {
- this.raids.tick();
+ this.raids.tick(this);
}
- profilerFiller.popPush("chunkSource");
@@ -1350,7 +1348,7 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
this.handlingTick = false;
- profilerFiller.pop();
- boolean flag = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this
+ boolean flag = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || !this.players.isEmpty() || !this.getForceLoadedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this
if (flag) {
this.resetEmptyTime();
}
@@ -1364,7 +1362,7 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
}
io.papermc.paper.entity.activation.ActivationRange.activateEntities(this); // Paper - EAR
-@@ -821,9 +804,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -811,9 +794,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
entity -> {
if (!entity.isRemoved()) {
if (!tickRateManager.isEntityFrozen(entity)) {
@@ -1374,7 +1372,7 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
if (true) { // Paper - rewrite chunk system
Entity vehicle = entity.getVehicle();
if (vehicle != null) {
-@@ -834,21 +815,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -824,21 +805,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
entity.stopRiding();
}
@@ -1396,7 +1394,7 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
}
@Override
-@@ -863,9 +838,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -853,9 +828,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
if (this.tickTime) {
long l = this.levelData.getGameTime() + 1L;
this.serverLevelData.setGameTime(l);
@@ -1405,26 +1403,17 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
- Profiler.get().pop();
if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
// Purpur start - Configurable daylight cycle
- int incrementTicks = isDay() ? this.purpurConfig.daytimeTicks : this.purpurConfig.nighttimeTicks;
-@@ -966,8 +939,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
- boolean isRaining = this.isRaining();
+ int incrementTicks = isBrightOutside() ? this.purpurConfig.daytimeTicks : this.purpurConfig.nighttimeTicks;
+@@ -955,8 +928,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+ ChunkPos pos = chunk.getPos();
int minBlockX = pos.getMinBlockX();
int minBlockZ = pos.getMinBlockZ();
- ProfilerFiller profilerFiller = Profiler.get();
-- profilerFiller.push("thunder");
- if (!this.paperConfig().environment.disableThunder && isRaining && this.isThundering() && this.spigotConfig.thunderChance > 0 && simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking
- BlockPos blockPos = this.findLightningTargetAround(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15));
- if (this.isRainingAt(blockPos)) {
-@@ -1002,8 +973,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
- }
- }
+- profilerFiller.push("iceandsnow");
-- profilerFiller.popPush("iceandsnow");
--
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
for (int i = 0; i < randomTickSpeed; i++) {
- if (simpleRandom.nextInt(48) == 0) { // Paper - optimise random ticking
-@@ -1012,12 +981,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -966,12 +937,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
} // Paper - Option to disable ice and snow
@@ -1436,8 +1425,26 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
- profilerFiller.pop();
}
+ public void tickThunder(LevelChunk chunk) {
+@@ -979,8 +947,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+ boolean isRaining = this.isRaining();
+ int minBlockX = pos.getMinBlockX();
+ int minBlockZ = pos.getMinBlockZ();
+- ProfilerFiller profilerFiller = Profiler.get();
+- profilerFiller.push("thunder");
+ if (!this.paperConfig().environment.disableThunder && isRaining && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder
+ BlockPos blockPos = this.findLightningTargetAround(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15));
+ if (this.isRainingAt(blockPos)) {
+@@ -1014,8 +980,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+ }
+ }
+ }
+-
+- profilerFiller.pop();
+ }
+
@VisibleForTesting
-@@ -1356,17 +1322,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1355,17 +1319,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
// Paper end - log detailed entity tick information
entity.setOldPosAndRot();
@@ -1455,7 +1462,7 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
for (Entity entity1 : entity.getPassengers()) {
this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2
-@@ -1387,9 +1349,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1386,9 +1346,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
passengerEntity.setOldPosAndRot();
passengerEntity.tickCount++;
passengerEntity.totalEntityAge++; // Paper - age-like counter for all entities
@@ -1465,7 +1472,7 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
// Paper start - EAR 2
if (isActive) {
passengerEntity.rideTick();
-@@ -1401,7 +1360,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1400,7 +1357,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
ridingEntity.positionRider(passengerEntity);
}
// Paper end - EAR 2
@@ -1474,10 +1481,10 @@ index eb6286d34a68bf6eb57877a9cfc2be09615c7e83..f4b1f45f1dc86bd077860f088cdd6da7
for (Entity entity : passengerEntity.getPassengers()) {
this.tickPassenger(passengerEntity, entity, isActive); // Paper - EAR 2
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
-index a9f723528dd05cb9583319edcb14143b784a2fd7..21d41b477cc0e8d2476d1e3141bdf23d0c06f3e0 100644
+index 55d02c1d8c4cbea2eecd82b4fdf0f609647273cb..30c6bdbcd2e33e384f4d6b67e03e7a0acad2a464 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
-@@ -96,8 +96,6 @@ import net.minecraft.tags.FluidTags;
+@@ -104,8 +104,6 @@ import net.minecraft.util.HashOps;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Unit;
@@ -1486,7 +1493,7 @@ index a9f723528dd05cb9583319edcb14143b784a2fd7..21d41b477cc0e8d2476d1e3141bdf23d
import net.minecraft.world.Container;
import net.minecraft.world.Difficulty;
import net.minecraft.world.InteractionHand;
-@@ -1466,14 +1464,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -1410,14 +1408,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.unsetRemoved();
*/
// CraftBukkit end
@@ -1501,7 +1508,7 @@ index a9f723528dd05cb9583319edcb14143b784a2fd7..21d41b477cc0e8d2476d1e3141bdf23d
// CraftBukkit start
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
LevelData worlddata = level.getLevelData();
-@@ -1491,7 +1485,6 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -1435,7 +1429,6 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
level.addDuringTeleport(this);
@@ -1510,7 +1517,7 @@ index a9f723528dd05cb9583319edcb14143b784a2fd7..21d41b477cc0e8d2476d1e3141bdf23d
this.stopUsingItem();
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
-index c089a01765945277aafc62cb3566d81162c40c1d..801dd76a2c7f76fc6fdb7167cbf3ab1310be36c9 100644
+index 66d70c330fd70009018d8d0a7441b93fcef96c97..b865c2fd503c3f0368d77d28c2f7a7c7fa7008bb 100644
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -24,7 +24,6 @@ import net.minecraft.network.protocol.cookie.ServerboundCookieResponsePacket;
@@ -1521,7 +1528,7 @@ index c089a01765945277aafc62cb3566d81162c40c1d..801dd76a2c7f76fc6fdb7167cbf3ab13
import org.slf4j.Logger;
public abstract class ServerCommonPacketListenerImpl implements ServerCommonPacketListener, org.bukkit.craftbukkit.entity.CraftPlayer.TransferCookieConnection { // CraftBukkit
-@@ -256,7 +255,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+@@ -255,7 +254,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
protected void keepConnectionAlive() {
@@ -1529,7 +1536,7 @@ index c089a01765945277aafc62cb3566d81162c40c1d..801dd76a2c7f76fc6fdb7167cbf3ab13
long millis = Util.getMillis();
// Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
// This should effectively place the keepalive handling back to "as it was" before 1.12.2
-@@ -290,8 +288,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+@@ -289,8 +287,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
}
}
@@ -1539,7 +1546,7 @@ index c089a01765945277aafc62cb3566d81162c40c1d..801dd76a2c7f76fc6fdb7167cbf3ab13
private boolean checkIfClosed(long time) {
diff --git a/net/minecraft/server/packs/resources/ProfiledReloadInstance.java b/net/minecraft/server/packs/resources/ProfiledReloadInstance.java
-index 71a4a0b8535a21667261fd66d41cca1216fd9933..1e9edae4708e1b2c282a13bd6a74f71ec4116895 100644
+index f0e2bca572c6f1790772980cd3ec651e9077382d..954e4103c9c359bc13c9a07bec885af90df14cb5 100644
--- a/net/minecraft/server/packs/resources/ProfiledReloadInstance.java
+++ b/net/minecraft/server/packs/resources/ProfiledReloadInstance.java
@@ -9,8 +9,6 @@ import java.util.concurrent.TimeUnit;
@@ -1551,15 +1558,16 @@ index 71a4a0b8535a21667261fd66d41cca1216fd9933..1e9edae4708e1b2c282a13bd6a74f71e
import org.slf4j.Logger;
public class ProfiledReloadInstance extends SimpleReloadInstance {
-@@ -51,12 +49,9 @@ public class ProfiledReloadInstance extends SimpleReloadInstance executor.execute(() -> {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push(name);
long nanos = Util.getNanos();
runnable.run();
timeTaken.addAndGet(Util.getNanos() - nanos);
+ timesRun.incrementAndGet();
- profilerFiller.pop();
});
}
@@ -1640,10 +1648,10 @@ index 64b0508ef21952c65b0b967b756b2a4c64d96899..9682d64983d43f3c0142565e0cbb06f9
}
diff --git a/net/minecraft/util/profiling/ActiveProfiler.java b/net/minecraft/util/profiling/ActiveProfiler.java
deleted file mode 100644
-index 595e0fd9bf08bcb8358bce2a46d4322f1394e7cb..0000000000000000000000000000000000000000
+index 365995455c5e076f145063ab9415b89139f76393..0000000000000000000000000000000000000000
--- a/net/minecraft/util/profiling/ActiveProfiler.java
+++ /dev/null
-@@ -1,206 +0,0 @@
+@@ -1,207 +0,0 @@
-package net.minecraft.util.profiling;
-
-import com.google.common.collect.Lists;
@@ -1659,6 +1667,7 @@ index 595e0fd9bf08bcb8358bce2a46d4322f1394e7cb..00000000000000000000000000000000
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+-import java.util.function.BooleanSupplier;
-import java.util.function.IntSupplier;
-import java.util.function.LongSupplier;
-import java.util.function.Supplier;
@@ -1682,15 +1691,15 @@ index 595e0fd9bf08bcb8358bce2a46d4322f1394e7cb..00000000000000000000000000000000
- private boolean started;
- @Nullable
- private ActiveProfiler.PathEntry currentEntry;
-- private final boolean warn;
+- private final BooleanSupplier suppressWarnings;
- private final Set> chartedPaths = new ObjectArraySet<>();
-
-- public ActiveProfiler(LongSupplier startTimeNano, IntSupplier startTimeTicks, boolean warn) {
-- this.startTimeNano = startTimeNano.getAsLong();
-- this.getRealTime = startTimeNano;
-- this.startTimeTicks = startTimeTicks.getAsInt();
-- this.getTickTime = startTimeTicks;
-- this.warn = warn;
+- public ActiveProfiler(LongSupplier getRealTime, IntSupplier getTickTime, BooleanSupplier supressWarnings) {
+- this.startTimeNano = getRealTime.getAsLong();
+- this.getRealTime = getRealTime;
+- this.startTimeTicks = getTickTime.getAsInt();
+- this.getTickTime = getTickTime;
+- this.suppressWarnings = supressWarnings;
- }
-
- @Override
@@ -1763,7 +1772,7 @@ index 595e0fd9bf08bcb8358bce2a46d4322f1394e7cb..00000000000000000000000000000000
- currentEntry.count++;
- currentEntry.maxDuration = Math.max(currentEntry.maxDuration, l1);
- currentEntry.minDuration = Math.min(currentEntry.minDuration, l1);
-- if (this.warn && l1 > WARNING_TIME_NANOS) {
+- if (l1 > WARNING_TIME_NANOS && !this.suppressWarnings.getAsBoolean()) {
- LOGGER.warn(
- "Something's taking too long! '{}' took aprox {} ms",
- LogUtils.defer(() -> ProfileResults.demanglePath(this.path)),
@@ -1852,23 +1861,26 @@ index 595e0fd9bf08bcb8358bce2a46d4322f1394e7cb..00000000000000000000000000000000
-}
diff --git a/net/minecraft/util/profiling/ContinuousProfiler.java b/net/minecraft/util/profiling/ContinuousProfiler.java
deleted file mode 100644
-index e96949cc279aeb4ef670ec07b6ec2407da2f68bd..0000000000000000000000000000000000000000
+index 553638f3140f2e0f2892adbf082b3af415424550..0000000000000000000000000000000000000000
--- a/net/minecraft/util/profiling/ContinuousProfiler.java
+++ /dev/null
-@@ -1,35 +0,0 @@
+@@ -1,38 +0,0 @@
-package net.minecraft.util.profiling;
-
+-import java.util.function.BooleanSupplier;
-import java.util.function.IntSupplier;
-import java.util.function.LongSupplier;
-
-public class ContinuousProfiler {
- private final LongSupplier realTime;
- private final IntSupplier tickCount;
+- private final BooleanSupplier suppressWarnings;
- private ProfileCollector profiler = InactiveProfiler.INSTANCE;
-
-- public ContinuousProfiler(LongSupplier realTime, IntSupplier tickCount) {
+- public ContinuousProfiler(LongSupplier realTime, IntSupplier tickTime, BooleanSupplier supressWarnings) {
- this.realTime = realTime;
-- this.tickCount = tickCount;
+- this.tickCount = tickTime;
+- this.suppressWarnings = supressWarnings;
- }
-
- public boolean isEnabled() {
@@ -1880,7 +1892,7 @@ index e96949cc279aeb4ef670ec07b6ec2407da2f68bd..00000000000000000000000000000000
- }
-
- public void enable() {
-- this.profiler = new ActiveProfiler(this.realTime, this.tickCount, true);
+- this.profiler = new ActiveProfiler(this.realTime, this.tickCount, this.suppressWarnings);
- }
-
- public ProfilerFiller getFiller() {
@@ -2687,7 +2699,7 @@ index 82aef3d962e8ee6bb9c49a5655a5db49c331b022..00000000000000000000000000000000
-}
diff --git a/net/minecraft/util/profiling/SingleTickProfiler.java b/net/minecraft/util/profiling/SingleTickProfiler.java
deleted file mode 100644
-index 6ead9eb534103a001427ee5bec84cebe7ae97162..0000000000000000000000000000000000000000
+index 33b323b78b8210afeac1f592d36d03bf9c907a1d..0000000000000000000000000000000000000000
--- a/net/minecraft/util/profiling/SingleTickProfiler.java
+++ /dev/null
@@ -1,50 +0,0 @@
@@ -2715,7 +2727,7 @@ index 6ead9eb534103a001427ee5bec84cebe7ae97162..00000000000000000000000000000000
- }
-
- public ProfilerFiller startTick() {
-- this.profiler = new ActiveProfiler(this.realTime, () -> this.tick, false);
+- this.profiler = new ActiveProfiler(this.realTime, () -> this.tick, () -> true);
- this.tick++;
- return this.profiler;
- }
@@ -3329,7 +3341,7 @@ index 4cfaf358f9d7d07c8d58dc152a1c85d6c7824d57..00000000000000000000000000000000
-import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java b/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java
deleted file mode 100644
-index 0cb8ee7b629cb3db348d4c050a63a79fbdcc99b2..0000000000000000000000000000000000000000
+index b26c1f0f07b38a3da8d81af915e8043d55d5060f..0000000000000000000000000000000000000000
--- a/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java
+++ /dev/null
@@ -1,168 +0,0 @@
@@ -3390,13 +3402,13 @@ index 0cb8ee7b629cb3db348d4c050a63a79fbdcc99b2..00000000000000000000000000000000
- ) {
- this.metricsSamplerProvider = metricsSamplerProvider;
- this.wallTimeSource = wallTimeSource;
-- this.taskProfiler = new ContinuousProfiler(wallTimeSource, () -> this.currentTick);
+- this.taskProfiler = new ContinuousProfiler(wallTimeSource, () -> this.currentTick, () -> false);
- this.ioExecutor = ioExecutor;
- this.metricsPersister = metricPersister;
- this.onProfilingEnd = onProfilerEnd;
- this.onReportFinished = globalOnReportFinished == null ? onReportFinished : onReportFinished.andThen(globalOnReportFinished);
- this.deadlineNano = wallTimeSource.getAsLong() + TimeUnit.NANOSECONDS.convert(10L, TimeUnit.SECONDS);
-- this.singleTickProfiler = new ActiveProfiler(this.wallTimeSource, () -> this.currentTick, false);
+- this.singleTickProfiler = new ActiveProfiler(this.wallTimeSource, () -> this.currentTick, () -> true);
- this.taskProfiler.enable();
- }
-
@@ -3452,7 +3464,7 @@ index 0cb8ee7b629cb3db348d4c050a63a79fbdcc99b2..00000000000000000000000000000000
- }
-
- if (!this.killSwitch && this.wallTimeSource.getAsLong() <= this.deadlineNano) {
-- this.singleTickProfiler = new ActiveProfiler(this.wallTimeSource, () -> this.currentTick, false);
+- this.singleTickProfiler = new ActiveProfiler(this.wallTimeSource, () -> this.currentTick, () -> true);
- } else {
- this.killSwitch = false;
- ProfileResults results = this.taskProfiler.getResults();
@@ -3996,10 +4008,10 @@ index 39a604c9a53930b53d959b1d2eb504aa964e9a58..0d0380e3955836ce125f777841477503
@Override
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616619e4bd1 100644
+index 5b0a4ef4ae5a762432dbb0def005f7505197445e..d513b82c0681fdc990af082af69278bd773225a9 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -78,8 +78,6 @@ import net.minecraft.tags.FluidTags;
+@@ -82,8 +82,6 @@ import net.minecraft.tags.FluidTags;
import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
@@ -4008,7 +4020,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.Nameable;
-@@ -857,8 +855,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -844,8 +842,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit end
public void baseTick() {
@@ -4017,7 +4029,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups
this.inBlockState = null;
if (this.isPassenger() && this.getVehicle().isRemoved()) {
-@@ -921,8 +917,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -902,8 +898,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (this.level() instanceof ServerLevel serverLevelx && this instanceof Leashable) {
Leashable.tickLeash(serverLevelx, (Entity & Leashable)this);
}
@@ -4026,7 +4038,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
}
public void setSharedFlagOnFire(boolean isOnFire) {
-@@ -1141,8 +1135,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1124,8 +1118,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
@@ -4035,7 +4047,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7) {
movement = movement.multiply(this.stuckSpeedMultiplier);
this.stuckSpeedMultiplier = Vec3.ZERO;
-@@ -1151,7 +1143,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1134,7 +1126,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper start - ignore movement changes while inactive.
if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && type == MoverType.SELF) {
setDeltaMovement(Vec3.ZERO);
@@ -4043,8 +4055,8 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
return;
}
// Paper end
-@@ -1173,8 +1164,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
- this.setPos(this.getX() + vec3.x, this.getY() + vec3.y, this.getZ() + vec3.z);
+@@ -1169,8 +1160,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ this.setPos(vec31);
}
- profilerFiller.pop();
@@ -4052,7 +4064,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
boolean flag = !Mth.equal(movement.x, vec3.x);
boolean flag1 = !Mth.equal(movement.z, vec3.z);
this.horizontalCollision = flag || flag1;
-@@ -1197,7 +1186,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1193,7 +1182,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
if (this.isRemoved()) {
@@ -4061,7 +4073,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
} else {
if (this.horizontalCollision) {
Vec3 deltaMovement = this.getDeltaMovement();
-@@ -1242,7 +1231,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1237,7 +1226,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
float blockSpeedFactor = this.getBlockSpeedFactor();
this.setDeltaMovement(this.getDeltaMovement().multiply(blockSpeedFactor, 1.0, blockSpeedFactor));
@@ -4069,7 +4081,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
}
}
// Paper start - detailed watchdog information
-@@ -3325,8 +3313,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3257,8 +3245,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.processPortalCooldown();
if (this.portalProcess != null) {
if (this.portalProcess.processPortalTeleportation(serverLevel, this, this.canUsePortal(false))) {
@@ -4078,7 +4090,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
this.setPortalCooldown();
TeleportTransition portalDestination = this.portalProcess.getPortalDestination(serverLevel, this);
if (portalDestination != null) {
-@@ -3336,8 +3322,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3268,8 +3254,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.teleport(portalDestination);
}
}
@@ -4087,7 +4099,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
} else if (this.portalProcess.hasExpired()) {
this.portalProcess = null;
}
-@@ -3857,15 +3841,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3824,15 +3808,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
entity.teleport(this.calculatePassengerTransition(teleportTransition, entity));
}
@@ -4103,7 +4115,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
return this;
}
-@@ -3881,11 +3862,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3848,11 +3829,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
@@ -4115,7 +4127,7 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
return null;
} else {
// Paper start - Fix item duplication and teleport issues
-@@ -3908,7 +3886,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3871,7 +3849,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
level.resetEmptyTime();
teleportTransition.postTeleportTransition().onTransition(entityx);
@@ -4124,10 +4136,10 @@ index 3709efe15b30e4140ba677ffdcd4634b06e34d7d..4c4bed85db28d92ca55593a19ac23616
}
}
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index e7f1be39ecc532e83d9099e81a2dfd8ed5f0df7d..04a1c17a34b495b71eb1b0ccd597cef83480464d 100644
+index b427d3283a6c197203ab0ffed902bca33e0e0017..352421829e24284e4832a168c278233b780a58a2 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -72,8 +72,6 @@ import net.minecraft.tags.FluidTags;
+@@ -70,8 +70,6 @@ import net.minecraft.tags.FluidTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
@@ -4136,7 +4148,7 @@ index e7f1be39ecc532e83d9099e81a2dfd8ed5f0df7d..04a1c17a34b495b71eb1b0ccd597cef8
import net.minecraft.world.Difficulty;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.damagesource.CombatRules;
-@@ -448,8 +446,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -420,8 +418,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
super.baseTick();
@@ -4145,45 +4157,46 @@ index e7f1be39ecc532e83d9099e81a2dfd8ed5f0df7d..04a1c17a34b495b71eb1b0ccd597cef8
if (this.fireImmune() || this.level().isClientSide) {
this.clearFire();
}
-@@ -565,7 +561,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
- this.yHeadRotO = this.yHeadRot;
+@@ -512,7 +508,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ this.yBodyRotO = this.yBodyRot;
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
- profilerFiller.pop();
}
@Override
-@@ -3260,11 +3255,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3305,11 +3300,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ f1 = this.getYRot();
}
- this.run = this.run + (f3 - this.run) * 0.3F;
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("headTurn");
- f2 = this.tickHeadTurn(f1, f2);
+ this.tickHeadTurn(f1);
- profilerFiller.pop();
- profilerFiller.push("rangeChecks");
// Paper start - stop large pitch and yaw changes from crashing the server
this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F;
-@@ -3275,7 +3266,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
-
+@@ -3321,7 +3312,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F;
+ // Paper end - stop large pitch and yaw changes from crashing the server
- profilerFiller.pop();
- this.animStep += f2;
if (this.isFallFlying()) {
this.fallFlyTicks++;
-@@ -3487,20 +3477,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ } else {
+@@ -3497,21 +3487,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.setDeltaMovement(d, d1, d2);
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("ai");
+ this.applyInput();
if (this.isImmobile()) {
this.jumping = false;
this.xxa = 0.0F;
this.zza = 0.0F;
- } else if (this.isEffectiveAi()) {
+ } else if (this.isEffectiveAi() && !this.level().isClientSide) {
- profilerFiller.push("newAi");
this.serverAiStep();
- profilerFiller.pop();
@@ -4194,29 +4207,33 @@ index e7f1be39ecc532e83d9099e81a2dfd8ed5f0df7d..04a1c17a34b495b71eb1b0ccd597cef8
if (this.jumping && this.isAffectedByFluids()) {
double fluidHeight;
if (this.isInLava()) {
-@@ -3529,8 +3513,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3540,8 +3524,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.noJumpDelay = 0;
}
- profilerFiller.pop();
- profilerFiller.push("travel");
- this.xxa *= 0.98F;
- this.zza *= 0.98F;
if (this.isFallFlying()) {
-@@ -3554,8 +3536,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ this.updateFallFlying();
}
-
- this.calculateEntityAnimation(this instanceof FlyingAnimal);
-- profilerFiller.pop();
-- profilerFiller.push("freezing");
- if (!this.level().isClientSide && !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API
- int ticksFrozen = this.getTicksFrozen();
- if (this.isInPowderSnow && this.canFreeze()) {
-@@ -3571,15 +3551,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
- this.hurtServer(serverLevel, this.damageSources().freeze(), 1.0F);
+@@ -3566,9 +3548,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ this.calculateEntityAnimation(this instanceof FlyingAnimal);
}
- profilerFiller.pop();
+ if (this.level() instanceof ServerLevel serverLevel) {
+- profilerFiller.push("freezing");
+ if ((!this.isInPowderSnow || !this.canFreeze()) && !this.freezeLocked) { // Paper - Freeze Tick Lock API
+ this.setTicksFrozen(Math.max(0, this.getTicksFrozen() - 2));
+ }
+@@ -3578,18 +3558,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ if (this.tickCount % 40 == 0 && this.isFullyFrozen() && this.canFreeze()) {
+ this.hurtServer(serverLevel, this.damageSources().freeze(), 1.0F);
+ }
+-
+- profilerFiller.pop();
+ }
+
- profilerFiller.push("push");
if (this.autoSpinAttackTicks > 0) {
this.autoSpinAttackTicks--;
@@ -4229,19 +4246,19 @@ index e7f1be39ecc532e83d9099e81a2dfd8ed5f0df7d..04a1c17a34b495b71eb1b0ccd597cef8
// Purpur start - Ridables
if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) {
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
-index bc22d67bba9b1ebb6bef84f5326375100d24461d..66f3565b978f2ed91cb2bc3a816f1701c0873c73 100644
+index e9344f61a943d610dfabe4918c227ddba166f17f..5bcbebf35eb726a43b957aca5b8b7a1dca7648cd 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
-@@ -33,8 +33,6 @@ import net.minecraft.sounds.SoundEvent;
+@@ -30,8 +30,6 @@ import net.minecraft.sounds.SoundEvent;
import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
-import net.minecraft.util.profiling.Profiler;
-import net.minecraft.util.profiling.ProfilerFiller;
+ import net.minecraft.world.Container;
import net.minecraft.world.Difficulty;
import net.minecraft.world.DifficultyInstance;
- import net.minecraft.world.InteractionHand;
-@@ -331,14 +329,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -318,14 +316,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void baseTick() {
super.baseTick();
@@ -4256,7 +4273,7 @@ index bc22d67bba9b1ebb6bef84f5326375100d24461d..66f3565b978f2ed91cb2bc3a816f1701
incrementTicksSinceLastInteraction(); // Purpur - Entity lifespan
}
-@@ -642,8 +637,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -513,8 +508,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void aiStep() {
super.aiStep();
@@ -4265,7 +4282,7 @@ index bc22d67bba9b1ebb6bef84f5326375100d24461d..66f3565b978f2ed91cb2bc3a816f1701
if (this.level() instanceof ServerLevel serverLevel
&& this.canPickUpLoot()
&& this.isAlive()
-@@ -666,8 +659,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -537,8 +530,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
}
}
}
@@ -4274,7 +4291,7 @@ index bc22d67bba9b1ebb6bef84f5326375100d24461d..66f3565b978f2ed91cb2bc3a816f1701
}
protected Vec3i getPickupReach() {
-@@ -882,42 +873,21 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -748,42 +739,21 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
return;
}
// Paper end - Allow nerfed mobs to jump and float
@@ -4372,7 +4389,7 @@ index a927c2790c8ab9ccaa7161b970e10b0b44817dd8..b816b2de8eb327060ca6ea7c4afc1737
public Set getAvailableGoals() {
diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-index b44f2c49509d847817a78e9c4fb1499fb378054b..6c8fb611943aee8cabc471c63166f9b44ef14826 100644
+index 06389019deba08c7c0966affcdc90512c88db3d5..6bbdfc748f1ce66689c63424fadcf261b1e967b3 100644
--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -10,8 +10,6 @@ import net.minecraft.core.Vec3i;
@@ -4423,10 +4440,10 @@ index c569074403b1d8b443aaa98ba9cf9bbd0e98bd2d..b1aa7294f9479f45fcde77c5ea46db9f
this.seen.add(id);
} else {
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
-index 22e0fad86da2e7b932863ef30182355aa41424a1..b2c9da89ae6044536f4996fdbd37e2cabf22ca12 100644
+index 062f2ca0c8f2443cf890dc917b9de46310eb79bc..29c22b464705f1b50ec0e423c5df40d8f21e57b7 100644
--- a/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
-@@ -30,8 +30,6 @@ import net.minecraft.tags.GameEventTags;
+@@ -29,8 +29,6 @@ import net.minecraft.tags.GameEventTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
@@ -4435,7 +4452,7 @@ index 22e0fad86da2e7b932863ef30182355aa41424a1..b2c9da89ae6044536f4996fdbd37e2ca
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.SimpleContainer;
-@@ -288,14 +286,9 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
+@@ -284,14 +282,9 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4451,10 +4468,10 @@ index 22e0fad86da2e7b932863ef30182355aa41424a1..b2c9da89ae6044536f4996fdbd37e2ca
}
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
-index 90bcd8c79cccbcbe7ff3fd2534e0c3450b970bd4..a24ed1747fb8836927ac41b822dc666862701516 100644
+index 0b4d1e6633ecc2e11606024d085bb9e6cca5a86b..aea96e036846c66d411fdea55fbbf0efb60d467d 100644
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
-@@ -23,8 +23,6 @@ import net.minecraft.util.ByIdMap;
+@@ -24,8 +24,6 @@ import net.minecraft.util.ByIdMap;
import net.minecraft.util.RandomSource;
import net.minecraft.util.StringRepresentable;
import net.minecraft.util.TimeUtil;
@@ -4463,7 +4480,7 @@ index 90bcd8c79cccbcbe7ff3fd2534e0c3450b970bd4..a24ed1747fb8836927ac41b822dc6668
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
-@@ -165,13 +163,8 @@ public class Armadillo extends Animal {
+@@ -166,13 +164,8 @@ public class Armadillo extends Animal {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4478,10 +4495,10 @@ index 90bcd8c79cccbcbe7ff3fd2534e0c3450b970bd4..a24ed1747fb8836927ac41b822dc6668
this.forceDrops = true; // CraftBukkit
if (this.dropFromGiftLootTable(level, BuiltInLootTables.ARMADILLO_SHED, this::spawnAtLocation)) {
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
-index eb74d8313fd3cc15a33330fe7bafaca4f0a5a368..bbfe48fd278cda9926793d0d2de743558fefd622 100644
+index c5aac98efa518696381b4018b3504ebb323bb6b4..0b787911c929f1564d859dcba1ee04510b4a9b7f 100644
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
-@@ -26,8 +26,6 @@ import net.minecraft.util.ByIdMap;
+@@ -31,8 +31,6 @@ import net.minecraft.util.ByIdMap;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import net.minecraft.util.StringRepresentable;
@@ -4490,7 +4507,7 @@ index eb74d8313fd3cc15a33330fe7bafaca4f0a5a368..bbfe48fd278cda9926793d0d2de74355
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -348,14 +346,9 @@ public class Axolotl extends Animal implements VariantHolder, B
+@@ -373,14 +371,9 @@ public class Axolotl extends Animal implements Bucketable {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4506,19 +4523,19 @@ index eb74d8313fd3cc15a33330fe7bafaca4f0a5a368..bbfe48fd278cda9926793d0d2de74355
Optional memory = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS);
this.setPlayingDead(memory.isPresent() && memory.get() > 0);
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
-index 1d7ae2a08968860636918e7c66b60139a9d761b4..64ff0d2923f16a567aa753cad028a1b21c20101b 100644
+index 344edef98e13831d1238e5ae155d81b13126a696..101931ff4474ab4445be3fa1a241a731ad3ac1da 100644
--- a/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
-@@ -17,8 +17,6 @@ import net.minecraft.sounds.SoundSource;
- import net.minecraft.tags.BlockTags;
+@@ -19,8 +19,6 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.Mth;
+ import net.minecraft.util.RandomSource;
-import net.minecraft.util.profiling.Profiler;
-import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -159,14 +157,9 @@ public class Camel extends AbstractHorse {
+@@ -171,14 +169,9 @@ public class Camel extends AbstractHorse {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4534,10 +4551,10 @@ index 1d7ae2a08968860636918e7c66b60139a9d761b4..64ff0d2923f16a567aa753cad028a1b2
}
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
-index 143a740ce2e7f9d384b71b4d64e8b8218f60cba7..4aabb98e0b37b652ad4d334b99c48a818c2859b4 100644
+index 71c09b9b8cc66d1a6f557a685539f9f4c93c0b8b..eb3aa96b2a5cb553b016744863818186d1d831c4 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
-@@ -28,8 +28,6 @@ import net.minecraft.tags.ItemTags;
+@@ -29,8 +29,6 @@ import net.minecraft.tags.ItemTags;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Unit;
@@ -4546,7 +4563,7 @@ index 143a740ce2e7f9d384b71b4d64e8b8218f60cba7..4aabb98e0b37b652ad4d334b99c48a81
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.AgeableMob;
-@@ -243,14 +241,9 @@ public class Frog extends Animal implements VariantHolder> {
+@@ -260,14 +258,9 @@ public class Frog extends Animal {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4562,7 +4579,7 @@ index 143a740ce2e7f9d384b71b4d64e8b8218f60cba7..4aabb98e0b37b652ad4d334b99c48a81
}
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
-index e888e606b4b14fa6485de7426bc146b6005962af..78d256f6a95acb367efd690bc368d2106a928b8f 100644
+index 4db2d63fbc021f28b8ad8d20cc1cc1bb257b057f..63645451495dffd87362fd37cf91a90717ae4470 100644
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -12,8 +12,6 @@ import net.minecraft.server.level.ServerLevel;
@@ -4574,7 +4591,7 @@ index e888e606b4b14fa6485de7426bc146b6005962af..78d256f6a95acb367efd690bc368d210
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
-@@ -134,14 +132,9 @@ public class Tadpole extends AbstractFish {
+@@ -135,14 +133,9 @@ public class Tadpole extends AbstractFish {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4590,7 +4607,7 @@ index e888e606b4b14fa6485de7426bc146b6005962af..78d256f6a95acb367efd690bc368d210
}
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
-index 6f106f10466440f8e65e04511f67d48f082d703f..9b8f5d9926d68fd8b9f1f976e0be0975158cafc3 100644
+index 5eb656a33cb6ca8a93125c27cd7db175d35b80c3..6029051a7bade2eb412d7ec4957a4361e7e575b1 100644
--- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
@@ -21,8 +21,6 @@ import net.minecraft.tags.ItemTags;
@@ -4602,7 +4619,7 @@ index 6f106f10466440f8e65e04511f67d48f082d703f..9b8f5d9926d68fd8b9f1f976e0be0975
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -224,14 +222,9 @@ public class Goat extends Animal {
+@@ -227,14 +225,9 @@ public class Goat extends Animal {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4618,7 +4635,7 @@ index 6f106f10466440f8e65e04511f67d48f082d703f..9b8f5d9926d68fd8b9f1f976e0be0975
}
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
-index 11a5da22149a61ca48bbb0a8ed10b71e91a5cc98..68751f7ed123c3e99f56259ccc23121661f89bc1 100644
+index a21604d3ff3377946cbcbd57ddfa1cbb7e84dac6..0565b37dd5320b49efb11cf28f064d6a970048aa 100644
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -29,8 +29,6 @@ import net.minecraft.tags.BlockTags;
@@ -4644,7 +4661,7 @@ index 11a5da22149a61ca48bbb0a8ed10b71e91a5cc98..68751f7ed123c3e99f56259ccc231216
}
diff --git a/net/minecraft/world/entity/monster/Zoglin.java b/net/minecraft/world/entity/monster/Zoglin.java
-index d2a67f3e1c971f737e58567dae23fa70e9d942ea..ee59cf42db965296e6e8d4aa4ec7b33dc5142237 100644
+index bdf52bfe661d4c0ad6c5a28254302f8f0021c09b..743946e69af541f6d5fe626108c70f96fe7fce65 100644
--- a/net/minecraft/world/entity/monster/Zoglin.java
+++ b/net/minecraft/world/entity/monster/Zoglin.java
@@ -15,8 +15,6 @@ import net.minecraft.network.syncher.SynchedEntityData;
@@ -4656,7 +4673,7 @@ index d2a67f3e1c971f737e58567dae23fa70e9d942ea..ee59cf42db965296e6e8d4aa4ec7b33d
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.damagesource.DamageSource;
-@@ -287,11 +285,8 @@ public class Zoglin extends Monster implements HoglinBase {
+@@ -288,11 +286,8 @@ public class Zoglin extends Monster implements HoglinBase {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4669,7 +4686,7 @@ index d2a67f3e1c971f737e58567dae23fa70e9d942ea..ee59cf42db965296e6e8d4aa4ec7b33d
}
diff --git a/net/minecraft/world/entity/monster/breeze/Breeze.java b/net/minecraft/world/entity/monster/breeze/Breeze.java
-index 23dff1d01387ce89b020aa93de99e6ef557c04e3..fb643596bd5fb12e4cd323706f51a479d78a5455 100644
+index c12653070d62c44b97a07676f24caf7ab570cd2a..d91ce14cc39b1b6ccd558f53ed605d4c6a5acae5 100644
--- a/net/minecraft/world/entity/monster/breeze/Breeze.java
+++ b/net/minecraft/world/entity/monster/breeze/Breeze.java
@@ -12,8 +12,6 @@ import net.minecraft.sounds.SoundEvent;
@@ -4695,10 +4712,10 @@ index 23dff1d01387ce89b020aa93de99e6ef557c04e3..fb643596bd5fb12e4cd323706f51a479
}
diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java
-index 887a81ea82b86edceaa46eb2032f53fccb84e158..2c6833753950f1bb0941b0cbe54bebddb84b137d 100644
+index d19f34616942177e736ba507c27ec93ba1e1e903..c9404d72de59e18dc809b8dec107f1f23d50f441 100644
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
-@@ -18,8 +18,6 @@ import net.minecraft.server.level.ServerLevel;
+@@ -17,8 +17,6 @@ import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.tags.DamageTypeTags;
@@ -4707,7 +4724,7 @@ index 887a81ea82b86edceaa46eb2032f53fccb84e158..2c6833753950f1bb0941b0cbe54bebdd
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.AnimationState;
import net.minecraft.world.entity.Entity;
-@@ -234,10 +232,7 @@ public class Creaking extends Monster {
+@@ -235,10 +233,7 @@ public class Creaking extends Monster {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4719,7 +4736,7 @@ index 887a81ea82b86edceaa46eb2032f53fccb84e158..2c6833753950f1bb0941b0cbe54bebdd
}
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
-index 28f3bc31b4c093e426ae141edeee61a12a444ba1..a5ee49e35b0825c03af058347ee189a7962e8027 100644
+index 252a6469cab202bcc612b4d52a5027c615029a21..0644f425cddebe8e5a65e69acae57db867380981 100644
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
@@ -16,8 +16,6 @@ import net.minecraft.sounds.SoundEvents;
@@ -4731,7 +4748,7 @@ index 28f3bc31b4c093e426ae141edeee61a12a444ba1..a5ee49e35b0825c03af058347ee189a7
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -204,11 +202,8 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
+@@ -207,11 +205,8 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4744,7 +4761,7 @@ index 28f3bc31b4c093e426ae141edeee61a12a444ba1..a5ee49e35b0825c03af058347ee189a7
if (this.isConverting()) {
this.timeInOverworld++;
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
-index f0d78cf5fe2c39add9a673471103c352cce72a45..b2e64c0d4c1943f8a50a03ba59318fc2e6b9e26a 100644
+index 54ab9593b39051d47f1dd8bddf210064768382be..73049e486fbf8411819551b43e3ca641ed7a5578 100644
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
@@ -17,8 +17,6 @@ import net.minecraft.tags.ItemTags;
@@ -4756,7 +4773,7 @@ index f0d78cf5fe2c39add9a673471103c352cce72a45..b2e64c0d4c1943f8a50a03ba59318fc2
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -383,11 +381,8 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
+@@ -358,11 +356,8 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4769,7 +4786,7 @@ index f0d78cf5fe2c39add9a673471103c352cce72a45..b2e64c0d4c1943f8a50a03ba59318fc2
super.customServerAiStep(level);
}
diff --git a/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
-index 4984b9864b63f92bc939b530253e871ca94a3277..460dace4818605ecd5409be887013713f06442a5 100644
+index 70ee15527fa6f30783d6a58bb767b18124f25c53..c4eb58d0b0c51e930f9cb72e1de0103902badba7 100644
--- a/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
+++ b/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
@@ -8,8 +8,6 @@ import net.minecraft.server.level.ServerLevel;
@@ -4794,10 +4811,10 @@ index 4984b9864b63f92bc939b530253e871ca94a3277..460dace4818605ecd5409be887013713
PiglinBruteAi.maybePlayActivitySound(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
-index f968e5c99bdb23b268bc34ea1ba5d54ae9ad0ff9..e4b8a74fae6d058a9a75a12d2ff08c7984442538 100644
+index 8d61d5347896481f250a18d04d17fd4d2088f633..60a8d79306755e9483ba9e93a07939b73ad717fe 100644
--- a/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
-@@ -32,8 +32,6 @@ import net.minecraft.tags.TagKey;
+@@ -31,8 +31,6 @@ import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Unit;
@@ -4806,7 +4823,7 @@ index f968e5c99bdb23b268bc34ea1ba5d54ae9ad0ff9..e4b8a74fae6d058a9a75a12d2ff08c79
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffectInstance;
-@@ -308,10 +306,7 @@ public class Warden extends Monster implements VibrationSystem {
+@@ -305,10 +303,7 @@ public class Warden extends Monster implements VibrationSystem {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -4818,10 +4835,10 @@ index f968e5c99bdb23b268bc34ea1ba5d54ae9ad0ff9..e4b8a74fae6d058a9a75a12d2ff08c79
if ((this.tickCount + this.getId()) % 120 == 0) {
applyDarknessAround(level, this.position(), this, 20);
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
-index 16fbe4e6521cd4f6baa8f5dd590da0fc749f6585..fec90e482c8935dfca609bbf90e67f86a1586221 100644
+index 5b52bbac242a7fbb8eaea7e41b7265a1a859ff7c..a08818450ed6fd78bb429743ee044726fc7994e7 100644
--- a/net/minecraft/world/entity/npc/Villager.java
+++ b/net/minecraft/world/entity/npc/Villager.java
-@@ -35,8 +35,6 @@ import net.minecraft.stats.Stats;
+@@ -36,8 +36,6 @@ import net.minecraft.stats.Stats;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.Mth;
import net.minecraft.util.SpawnUtil;
@@ -4830,7 +4847,7 @@ index 16fbe4e6521cd4f6baa8f5dd590da0fc749f6585..fec90e482c8935dfca609bbf90e67f86
import net.minecraft.world.Difficulty;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
-@@ -390,8 +388,6 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -393,8 +391,6 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
protected void customServerAiStep(ServerLevel level, boolean inactive) { // Purpur - Lobotomize stuck villagers - not final
// Paper end - EAR 2
@@ -4839,7 +4856,7 @@ index 16fbe4e6521cd4f6baa8f5dd590da0fc749f6585..fec90e482c8935dfca609bbf90e67f86
// Purpur start - Lobotomize stuck villagers
if (this.level().purpurConfig.villagerLobotomizeEnabled) {
// treat as inactive if lobotomized
-@@ -406,7 +402,6 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -409,7 +405,6 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
else if (this.isLobotomized && shouldRestock()) restock(); // Purpur - Lobotomize stuck villagers
// Pufferfish end
@@ -4848,7 +4865,7 @@ index 16fbe4e6521cd4f6baa8f5dd590da0fc749f6585..fec90e482c8935dfca609bbf90e67f86
this.assignProfessionWhenSpawned = false;
}
diff --git a/net/minecraft/world/item/crafting/RecipeManager.java b/net/minecraft/world/item/crafting/RecipeManager.java
-index 70eb3f84da8f0c962eaa52998ded69fcfae2f197..c7d91a38fc3b5cf2487e09719a1f9bc39ca5d20e 100644
+index b857e811b4b7a25eaec6dceaae5528d2ec0a1c45..bf69cef9b8ade11a1c08199cdd6c723e5a78c078 100644
--- a/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/net/minecraft/world/item/crafting/RecipeManager.java
@@ -28,7 +28,6 @@ import net.minecraft.server.level.ServerLevel;
@@ -4878,7 +4895,7 @@ index 70eb3f84da8f0c962eaa52998ded69fcfae2f197..c7d91a38fc3b5cf2487e09719a1f9bc3
LOGGER.info("Loaded {} recipes", object.values().size());
}
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
-index b4c2602ecf6b943ab022866231f74b850269af8f..0c58919e8242317ba276e103b81d07006c41deca 100644
+index 38ddadf551c039202c68c44d740f23a08b58d003..2e90bb96ed90f3debbe5803856ed41a5c08003f8 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -35,8 +35,6 @@ import net.minecraft.util.AbortableIterationConsumer;
@@ -4890,7 +4907,7 @@ index b4c2602ecf6b943ab022866231f74b850269af8f..0c58919e8242317ba276e103b81d0700
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.TickRateManager;
import net.minecraft.world.damagesource.DamageSource;
-@@ -267,7 +265,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+@@ -254,7 +252,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
@Override
public final List getEntitiesOfClass(final Class entityClass, final AABB boundingBox, final Predicate super T> predicate) {
@@ -4898,7 +4915,7 @@ index b4c2602ecf6b943ab022866231f74b850269af8f..0c58919e8242317ba276e103b81d0700
final List ret = new java.util.ArrayList<>();
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(entityClass, null, boundingBox, ret, predicate);
-@@ -277,7 +274,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+@@ -264,7 +261,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
@Override
public final List moonrise$getHardCollidingEntities(final Entity entity, final AABB box, final Predicate super Entity> predicate) {
@@ -4906,7 +4923,7 @@ index b4c2602ecf6b943ab022866231f74b850269af8f..0c58919e8242317ba276e103b81d0700
final List ret = new java.util.ArrayList<>();
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate);
-@@ -1513,8 +1509,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+@@ -1498,8 +1494,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
}
protected void tickBlockEntities() {
@@ -4915,7 +4932,7 @@ index b4c2602ecf6b943ab022866231f74b850269af8f..0c58919e8242317ba276e103b81d0700
this.tickingBlockEntities = true;
if (!this.pendingBlockEntityTickers.isEmpty()) {
this.blockEntityTickers.addAll(this.pendingBlockEntityTickers);
-@@ -1545,7 +1539,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+@@ -1529,7 +1523,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
this.tickingBlockEntities = false;
@@ -4923,7 +4940,7 @@ index b4c2602ecf6b943ab022866231f74b850269af8f..0c58919e8242317ba276e103b81d0700
this.spigotConfig.currentPrimedTnt = 0; // Spigot
}
-@@ -1804,7 +1797,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+@@ -1788,7 +1781,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
@Override
public List getEntities(@Nullable Entity entity, AABB boundingBox, Predicate super Entity> predicate) {
@@ -4931,7 +4948,7 @@ index b4c2602ecf6b943ab022866231f74b850269af8f..0c58919e8242317ba276e103b81d0700
List list = Lists.newArrayList();
// Paper start - rewrite chunk system
-@@ -1833,8 +1825,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+@@ -1817,8 +1809,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
public void getEntities(final EntityTypeTest entityTypeTest,
final AABB boundingBox, final Predicate super T> predicate,
final List super T> into, final int maxCount) {
@@ -4941,7 +4958,7 @@ index b4c2602ecf6b943ab022866231f74b850269af8f..0c58919e8242317ba276e103b81d0700
if (maxCount != Integer.MAX_VALUE) {
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(byType, boundingBox, into, predicate, maxCount);
diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java
-index 8aeeeffae50b3ec68ab972e793bb5edb4530ca78..d3f5242fc66529bf3137da4d505a6cf55e749e43 100644
+index fa06ecacc27f619853c8db76d909ab4ba75dc529..345d4b80bd4383e0fb66d744d87bc8ef4100fd32 100644
--- a/net/minecraft/world/level/NaturalSpawner.java
+++ b/net/minecraft/world/level/NaturalSpawner.java
@@ -23,8 +23,6 @@ import net.minecraft.tags.BlockTags;
@@ -4950,10 +4967,10 @@ index 8aeeeffae50b3ec68ab972e793bb5edb4530ca78..d3f5242fc66529bf3137da4d505a6cf5
import net.minecraft.util.VisibleForDebug;
-import net.minecraft.util.profiling.Profiler;
-import net.minecraft.util.profiling.ProfilerFiller;
- import net.minecraft.util.random.WeightedRandomList;
+ import net.minecraft.util.random.WeightedList;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntitySpawnReason;
-@@ -158,9 +156,6 @@ public final class NaturalSpawner {
+@@ -152,9 +150,6 @@ public final class NaturalSpawner {
}
public static void spawnForChunk(ServerLevel level, LevelChunk chunk, NaturalSpawner.SpawnState spawnState, List categories) {
@@ -4963,7 +4980,7 @@ index 8aeeeffae50b3ec68ab972e793bb5edb4530ca78..d3f5242fc66529bf3137da4d505a6cf5
for (MobCategory mobCategory : categories) {
// Paper start - Optional per player mob spawns
final boolean canSpawn;
-@@ -195,8 +190,6 @@ public final class NaturalSpawner {
+@@ -189,8 +184,6 @@ public final class NaturalSpawner {
// Paper end - Optional per player mob spawns
}
}
@@ -4973,7 +4990,7 @@ index 8aeeeffae50b3ec68ab972e793bb5edb4530ca78..d3f5242fc66529bf3137da4d505a6cf5
// Paper start - Add mobcaps commands
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
-index 278761647a6095581f8d8ff4f94ccc28b6e9c8a7..6bddf42504039f2be5eb9a5a35a0835e0e3239fe 100644
+index 6cbb5e923d9cc79090ec00bbe173a298ed674dbe..a772f2bd7be00172ad41353c6ad42d9239b9ec88 100644
--- a/net/minecraft/world/level/ServerExplosion.java
+++ b/net/minecraft/world/level/ServerExplosion.java
@@ -13,8 +13,6 @@ import net.minecraft.Util;
@@ -4985,7 +5002,7 @@ index 278761647a6095581f8d8ff4f94ccc28b6e9c8a7..6bddf42504039f2be5eb9a5a35a0835e
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
-@@ -682,10 +680,7 @@ public class ServerExplosion implements Explosion {
+@@ -671,10 +669,7 @@ public class ServerExplosion implements Explosion {
List list = this.calculateExplodedPositions();
this.hurtEntities();
if (this.interactsWithBlocks()) {
@@ -4997,7 +5014,7 @@ index 278761647a6095581f8d8ff4f94ccc28b6e9c8a7..6bddf42504039f2be5eb9a5a35a0835e
if (this.fire) {
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
-index 048ad8e11c6913ef08c977c7fab3200cc610519c..e3d71604c161373ef44164606602290af1bd1cb0 100644
+index 3829e02fcdd7c6b101157d3bc187cd1d2016b770..04942e23dd2bc82e4c60110756beedb5e0f074d7 100644
--- a/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
@@ -23,8 +23,6 @@ import net.minecraft.network.FriendlyByteBuf;
@@ -5009,7 +5026,7 @@ index 048ad8e11c6913ef08c977c7fab3200cc610519c..e3d71604c161373ef44164606602290a
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.Level;
-@@ -393,12 +391,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -390,12 +388,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}
if (LightEngine.hasDifferentLightProperties(blockState, state)) {
@@ -5021,8 +5038,8 @@ index 048ad8e11c6913ef08c977c7fab3200cc610519c..e3d71604c161373ef44164606602290a
- profilerFiller.pop();
}
- boolean hasBlockEntity = blockState.hasBlockEntity();
-@@ -918,8 +912,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+ boolean flag = !blockState.is(block);
+@@ -922,8 +916,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
BlockPos blockPos = this.blockEntity.getBlockPos();
if (LevelChunk.this.isTicking(blockPos)) {
try {
@@ -5031,7 +5048,7 @@ index 048ad8e11c6913ef08c977c7fab3200cc610519c..e3d71604c161373ef44164606602290a
BlockState blockState = LevelChunk.this.getBlockState(blockPos);
if (this.blockEntity.getType().isValid(blockState)) {
this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), blockState, this.blockEntity);
-@@ -933,8 +925,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -937,8 +929,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}
// Paper end - Remove the Block Entity if it's invalid
}
diff --git a/divinemc-server/minecraft-patches/features/0004-Implement-Secure-Seed.patch b/divinemc-server/minecraft-patches/features/0004-Implement-Secure-Seed.patch
index 1001338..fc0d04a 100644
--- a/divinemc-server/minecraft-patches/features/0004-Implement-Secure-Seed.patch
+++ b/divinemc-server/minecraft-patches/features/0004-Implement-Secure-Seed.patch
@@ -52,10 +52,10 @@ index 5748658abf0b90812005ae9d426df92daf5532f0..8b4b91be368b4195326eeb1c714d713a
this.get("generator-settings", property -> GsonHelper.parse(!property.isEmpty() ? property : "{}"), new JsonObject()),
this.get("level-type", property -> property.toLowerCase(Locale.ROOT), WorldPresets.NORMAL.location().toString())
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
-index 8055b8552b40160732953b15876dda7983890d06..ab30af9cd58ff7310e05be87b08f42bacf69e11e 100644
+index f5d4f439c3346cc158043ada02094257ff05a06e..4d4139b5f42a4db6e22bf1d063a23dc7b9914f85 100644
--- a/net/minecraft/server/level/ServerChunkCache.java
+++ b/net/minecraft/server/level/ServerChunkCache.java
-@@ -618,6 +618,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -619,6 +619,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
public ChunkGenerator getGenerator() {
@@ -64,10 +64,10 @@ index 8055b8552b40160732953b15876dda7983890d06..ab30af9cd58ff7310e05be87b08f42ba
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index 3980e0dfb08a357384ea33670fb282a26a598f6e..9afd448ede87c9192dc576f66e08676a68b34d98 100644
+index 2bb5055f2fb1e8b95b2a5d8dba5f1fa0bb5fdec7..c03895b2fc783d748fe52660b9ef30367143d0f5 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -632,6 +632,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -624,6 +624,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
chunkGenerator = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, chunkGenerator, gen);
}
// CraftBukkit end
@@ -76,27 +76,24 @@ index 3980e0dfb08a357384ea33670fb282a26a598f6e..9afd448ede87c9192dc576f66e08676a
DataFixer fixerUpper = server.getFixerUpper();
// Paper - rewrite chunk system
diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java
-index 240a54b210e23d5b79e6bcaf3806aa454668135d..66dffb8a2c6725ea2502b498044b854f043f3c73 100644
+index 7b6db084a483b4a9c2f292c5ed6e4c7550344c50..0a15269413b443f284b4c703b47e5436c22c15a3 100644
--- a/net/minecraft/world/entity/monster/Slime.java
+++ b/net/minecraft/world/entity/monster/Slime.java
-@@ -423,8 +423,13 @@ public class Slime extends Mob implements Enemy {
- return false;
+@@ -412,7 +412,11 @@ public class Slime extends Mob implements Enemy {
}
-- ChunkPos chunkPos = new ChunkPos(pos);
-- boolean flag = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkPos.x, chunkPos.z, ((WorldGenLevel) level).getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
-+ ChunkPos chunkPos = new ChunkPos(pos);
-+ // DivineMC start - Implement Secure Seed
-+ boolean isSlimeChunk = org.bxteam.divinemc.DivineConfig.enableSecureSeed
-+ ? level.getChunk(chunkPos.x, chunkPos.z).isSlimeChunk()
-+ : WorldgenRandom.seedSlimeChunk(chunkPos.x, chunkPos.z, ((WorldGenLevel) level).getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
-+ boolean flag = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || isSlimeChunk;
-+ // DivineMC end - Implement Secure Seed
+ ChunkPos chunkPos = new ChunkPos(pos);
+- boolean flag = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkPos.x, chunkPos.z, ((WorldGenLevel) level).getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
++ // DivineMC start - Implement Secure Seed
++ boolean flag = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || org.bxteam.divinemc.DivineConfig.enableSecureSeed
++ ? level.getChunk(chunkPos.x, chunkPos.z).isSlimeChunk()
++ : WorldgenRandom.seedSlimeChunk(chunkPos.x, chunkPos.z, ((WorldGenLevel) level).getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
++ // DivineMC end - Implement Secure Seed
// Paper start - Replace rules for Height in Slime Chunks
final double maxHeightSlimeChunk = level.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.slimeChunk.maximum;
if (random.nextInt(10) == 0 && flag && pos.getY() < maxHeightSlimeChunk) {
diff --git a/net/minecraft/world/level/chunk/ChunkAccess.java b/net/minecraft/world/level/chunk/ChunkAccess.java
-index 6d565b52552534ce9cacfc35ad1bf4adcb69eac3..80a0f5524e91e55d716e93c29e199d9816b0072a 100644
+index 3b7f0d5fe40bdda65ab859a0c22bf0d369dc0f01..42458418e6217adba28f729f04904814542eaa17 100644
--- a/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/net/minecraft/world/level/chunk/ChunkAccess.java
@@ -82,6 +82,10 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
@@ -126,13 +123,13 @@ index 6d565b52552534ce9cacfc35ad1bf4adcb69eac3..80a0f5524e91e55d716e93c29e199d98
+ // DivineMC end - Implement Secure Seed
+
public abstract BlockState getBlockState(final int x, final int y, final int z); // Paper
+
@Nullable
- public abstract BlockState setBlockState(BlockPos pos, BlockState state, boolean isMoving);
diff --git a/net/minecraft/world/level/chunk/ChunkGenerator.java b/net/minecraft/world/level/chunk/ChunkGenerator.java
-index 6ed51cf42b5864194d671b5b56f5b9bdf0291dc0..7e0b602e9fd9e3b3f60014ab179b3a82e3bf5c2a 100644
+index 857aa6e29b57a0a8eea4d7c14971b9dde59bb0d0..fdf9318b96d7ac7f707777bb63a5d36a5230b066 100644
--- a/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/net/minecraft/world/level/chunk/ChunkGenerator.java
-@@ -343,7 +343,11 @@ public abstract class ChunkGenerator {
+@@ -342,7 +342,11 @@ public abstract class ChunkGenerator {
Registry registry = level.registryAccess().lookupOrThrow(Registries.STRUCTURE);
Map> map = registry.stream().collect(Collectors.groupingBy(structure1 -> structure1.step().ordinal()));
List list = this.featuresPerStep.get();
@@ -145,7 +142,7 @@ index 6ed51cf42b5864194d671b5b56f5b9bdf0291dc0..7e0b602e9fd9e3b3f60014ab179b3a82
long l = worldgenRandom.setDecorationSeed(level.getSeed(), blockPos.getX(), blockPos.getZ());
Set> set = new ObjectArraySet<>();
ChunkPos.rangeClosed(sectionPos.chunk(), 1).forEach(chunkPos -> {
-@@ -556,8 +560,18 @@ public abstract class ChunkGenerator {
+@@ -551,8 +555,18 @@ public abstract class ChunkGenerator {
} else {
ArrayList list1 = new ArrayList<>(list.size());
list1.addAll(list);
@@ -331,7 +328,7 @@ index c92508741439a8d0d833ea02d0104416adb83c92..630f6c409db349819fc5fd19a3d78fad
public static OptionalLong parseSeed(String seed) {
seed = seed.trim();
diff --git a/net/minecraft/world/level/levelgen/feature/GeodeFeature.java b/net/minecraft/world/level/levelgen/feature/GeodeFeature.java
-index 38475f6975533909924c8d54f438cf43cdfe31a3..6759df026a29810021ddb37f3ddb62382b83a94e 100644
+index 4e72eb49dbf4c70ae7556ba6eb210fcd5ef36aaa..44cefaac4806008ce59b43f5b95ce17ee3ad39e5 100644
--- a/net/minecraft/world/level/levelgen/feature/GeodeFeature.java
+++ b/net/minecraft/world/level/levelgen/feature/GeodeFeature.java
@@ -41,7 +41,11 @@ public class GeodeFeature extends Feature {
@@ -391,10 +388,10 @@ index ee0d9dddb36b6879fa113299e24f1aa3b2b151cc..f01d96895ab348971fb31b614026fb3d
int i3 = this.spreadType.evaluate(worldgenRandom, i2);
int i4 = this.spreadType.evaluate(worldgenRandom, i2);
diff --git a/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java b/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java
-index 670335a7bbfbc9da64c389977498c22dfcd03251..7174a9767cbc94544be81c74d6468f3f73386edc 100644
+index 1f939b325ec5291b3c4aabc4735c863f9436a6f8..4ed6a3d6103ce48797950c7363ea0854227e62e8 100644
--- a/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java
+++ b/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java
-@@ -118,8 +118,17 @@ public abstract class StructurePlacement {
+@@ -119,8 +119,17 @@ public abstract class StructurePlacement {
public abstract StructurePlacementType> type();
private static boolean probabilityReducer(long levelSeed, int regionX, int regionZ, int salt, float probability, @org.jetbrains.annotations.Nullable Integer saltOverride) { // Paper - Add missing structure set seed configs; ignore here
@@ -415,7 +412,7 @@ index 670335a7bbfbc9da64c389977498c22dfcd03251..7174a9767cbc94544be81c74d6468f3f
}
diff --git a/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java b/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
-index eb85edaa3b7fab4f11545b0fa8bfea882dedb67d..63143ceec98f7a84ec4064d05e8f88c11200172f 100644
+index 1cfa0fcd28685736fcdce4aef817e4d4cc4061cb..e275dc8395e556e8a9412b121034e91553fbaea4 100644
--- a/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
+++ b/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
@@ -64,7 +64,11 @@ public class JigsawPlacement {
diff --git a/divinemc-server/minecraft-patches/features/0005-Async-Pathfinding.patch b/divinemc-server/minecraft-patches/features/0005-Async-Pathfinding.patch
index a99b3e5..afaebb5 100644
--- a/divinemc-server/minecraft-patches/features/0005-Async-Pathfinding.patch
+++ b/divinemc-server/minecraft-patches/features/0005-Async-Pathfinding.patch
@@ -393,7 +393,7 @@ index 045cfafb3afe8271d60852ae3c7cdcb039b44d4f..f544bf28ac6531061da08c7266846874
}
diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-index 6c8fb611943aee8cabc471c63166f9b44ef14826..02814be0e1ac9b743a4c6b5b75015a5e87fc2aa6 100644
+index 6bbdfc748f1ce66689c63424fadcf261b1e967b3..55d0ed422f25b6469f9d8ee3ecf2ef8eaf77e9cb 100644
--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -167,6 +167,10 @@ public abstract class PathNavigation {
@@ -557,7 +557,7 @@ index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..9494dd144ff1115c9f0862614ef61803
+ // DivineMC end - async pathfinding
}
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
-index d5727999eb67ff30dbf47865d59452483338e170..ddbee0f0f42fae0a26321bb324d22f5e7520ae72 100644
+index e9dfff7e3726cd2229f89bb39fa1ca4815d99a6d..a0294937487bfd13f26a5e7eb2bd21f29aa7c229 100644
--- a/net/minecraft/world/entity/animal/Bee.java
+++ b/net/minecraft/world/entity/animal/Bee.java
@@ -936,7 +936,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@@ -579,10 +579,10 @@ index d5727999eb67ff30dbf47865d59452483338e170..ddbee0f0f42fae0a26321bb324d22f5e
}
}
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
-index 4aabb98e0b37b652ad4d334b99c48a818c2859b4..dfcba5c2c8a489ebe74c2d5c1fa980c401806757 100644
+index eb3aa96b2a5cb553b016744863818186d1d831c4..3ccc48afb7a9eb2290f16c6a3218515bee59c2bd 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
-@@ -473,6 +473,17 @@ public class Frog extends Animal implements VariantHolder> {
+@@ -482,6 +482,17 @@ public class Frog extends Animal {
super(mob, level);
}
@@ -600,7 +600,7 @@ index 4aabb98e0b37b652ad4d334b99c48a818c2859b4..dfcba5c2c8a489ebe74c2d5c1fa980c4
@Override
public boolean canCutCorner(PathType pathType) {
return pathType != PathType.WATER_BORDER && super.canCutCorner(pathType);
-@@ -481,6 +492,11 @@ public class Frog extends Animal implements VariantHolder> {
+@@ -490,6 +501,11 @@ public class Frog extends Animal {
@Override
protected PathFinder createPathFinder(int maxVisitedNodes) {
this.nodeEvaluator = new Frog.FrogNodeEvaluator(true);
@@ -613,7 +613,7 @@ index 4aabb98e0b37b652ad4d334b99c48a818c2859b4..dfcba5c2c8a489ebe74c2d5c1fa980c4
}
}
diff --git a/net/minecraft/world/entity/monster/Drowned.java b/net/minecraft/world/entity/monster/Drowned.java
-index 6c73245b8d04f194e72165aa0000ca79a95db59d..2686df57d9d48db1438278d0d053bdbd3c65c0a7 100644
+index b85d1e196d2bf61ac4896205afb08eba89c4397e..ea90e3d7ad84e301f975ff91fade63c5429972cf 100644
--- a/net/minecraft/world/entity/monster/Drowned.java
+++ b/net/minecraft/world/entity/monster/Drowned.java
@@ -313,7 +313,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
@@ -626,10 +626,10 @@ index 6c73245b8d04f194e72165aa0000ca79a95db59d..2686df57d9d48db1438278d0d053bdbd
if (target != null) {
double d = this.distanceToSqr(target.getX(), target.getY(), target.getZ());
diff --git a/net/minecraft/world/entity/monster/Strider.java b/net/minecraft/world/entity/monster/Strider.java
-index 241526239bdbd5d9276f85e7fca46a7051f46a25..2329973f735e1ae7fbb76798dc113f4261c906b7 100644
+index fe31c4a45afd61be8b74efe9d0858ccd0aced075..5f965f50294d03e7b03c5d7e912b7aec99db635c 100644
--- a/net/minecraft/world/entity/monster/Strider.java
+++ b/net/minecraft/world/entity/monster/Strider.java
-@@ -579,9 +579,25 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
+@@ -560,9 +560,25 @@ public class Strider extends Animal implements ItemSteerable {
super(strider, level);
}
@@ -656,10 +656,10 @@ index 241526239bdbd5d9276f85e7fca46a7051f46a25..2329973f735e1ae7fbb76798dc113f42
}
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
-index e4b8a74fae6d058a9a75a12d2ff08c7984442538..59a12809e5c7f5ee85ca1f587f6b77383a1ff062 100644
+index 60a8d79306755e9483ba9e93a07939b73ad717fe..97ee07ebbba5ad29f766dff5eb4e51fc0e12cfcb 100644
--- a/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
-@@ -597,6 +597,16 @@ public class Warden extends Monster implements VibrationSystem {
+@@ -578,6 +578,16 @@ public class Warden extends Monster implements VibrationSystem {
@Override
protected PathFinder createPathFinder(int maxVisitedNodes) {
this.nodeEvaluator = new WalkNodeEvaluator();
diff --git a/divinemc-server/minecraft-patches/features/0006-Multithreaded-Tracker.patch b/divinemc-server/minecraft-patches/features/0006-Multithreaded-Tracker.patch
index 2f524d7..0521fbd 100644
--- a/divinemc-server/minecraft-patches/features/0006-Multithreaded-Tracker.patch
+++ b/divinemc-server/minecraft-patches/features/0006-Multithreaded-Tracker.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Multithreaded Tracker
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java b/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
-index dd2509996bfd08e8c3f9f2be042229eac6d7692d..8ef5a1aaac9c27873ce746eb281f77bb318a3c69 100644
+index 02a9ef1694c796584c29430d27f0a09047368835..7a52c42845bd74d0bb7649f87764aba12f442f02 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
-@@ -342,7 +342,11 @@ public final class RegionizedPlayerChunkLoader {
+@@ -340,7 +340,11 @@ public final class RegionizedPlayerChunkLoader {
private boolean canGenerateChunks = true;
private final ArrayDeque> delayedTicketOps = new ArrayDeque<>();
@@ -22,10 +22,10 @@ index dd2509996bfd08e8c3f9f2be042229eac6d7692d..8ef5a1aaac9c27873ce746eb281f77bb
private static final byte CHUNK_TICKET_STAGE_NONE = 0;
private static final byte CHUNK_TICKET_STAGE_LOADING = 1;
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
-index d3d9926d504fa6b3384be5ae06b2843ebb7f807c..965899a98223b15bd770378c202873cbf15b714d 100644
+index b28d19b2fcdff9250e95db05f6e428db54a771e6..b5028cc64e2a43c841801114908825102df41765 100644
--- a/net/minecraft/server/level/ChunkMap.java
+++ b/net/minecraft/server/level/ChunkMap.java
-@@ -951,6 +951,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1013,6 +1013,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end - optimise entity tracker
protected void tick() {
@@ -39,7 +39,7 @@ index d3d9926d504fa6b3384be5ae06b2843ebb7f807c..965899a98223b15bd770378c202873cb
// Paper start - optimise entity tracker
if (true) {
this.newTrackerTick();
-@@ -1073,7 +1080,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1135,7 +1142,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity;
private final int range;
SectionPos lastSectionPos;
@@ -52,7 +52,7 @@ index d3d9926d504fa6b3384be5ae06b2843ebb7f807c..965899a98223b15bd770378c202873cb
// Paper start - optimise entity tracker
private long lastChunkUpdate = -1L;
-@@ -1100,21 +1111,55 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1162,21 +1173,55 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lastTrackedChunk = chunk;
final ServerPlayer[] playersRaw = players.getRawDataUnchecked();
@@ -118,7 +118,7 @@ index d3d9926d504fa6b3384be5ae06b2843ebb7f807c..965899a98223b15bd770378c202873cb
}
@Override
-@@ -1176,7 +1221,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1238,7 +1283,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public void broadcast(Packet> packet) {
@@ -127,7 +127,7 @@ index d3d9926d504fa6b3384be5ae06b2843ebb7f807c..965899a98223b15bd770378c202873cb
serverPlayerConnection.send(packet);
}
}
-@@ -1189,21 +1234,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1259,21 +1304,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public void broadcastRemoved() {
@@ -169,29 +169,10 @@ index f106373ef3ac4a8685c2939c9e8361688a285913..3b4dff8867e91884b5720ca8a9cb64af
public boolean visible = true;
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
-index 0fb253aa55a24b56b17f524b3261c5b75c7d7e59..b6053158f5d9b6ad325ea075ab7c60f9966ba496 100644
+index 257ecbcf7d463eefb951867a5426eaf24e356305..7748183dd12434693b89d2dbc8325988381857c9 100644
--- a/net/minecraft/server/level/ServerEntity.java
+++ b/net/minecraft/server/level/ServerEntity.java
-@@ -110,8 +110,16 @@ public class ServerEntity {
- .forEach(
- removedPassenger -> {
- if (removedPassenger instanceof ServerPlayer serverPlayer1) {
-- serverPlayer1.connection
-- .teleport(serverPlayer1.getX(), serverPlayer1.getY(), serverPlayer1.getZ(), serverPlayer1.getYRot(), serverPlayer1.getXRot());
-+ // DivineMC start - Multithreaded tracker
-+ if (org.bxteam.divinemc.DivineConfig.multithreadedEnabled && Thread.currentThread() instanceof org.bxteam.divinemc.entity.tracking.MultithreadedTracker.MultithreadedTrackerThread) {
-+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> serverPlayer1.connection
-+ .teleport(serverPlayer1.getX(), serverPlayer1.getY(), serverPlayer1.getZ(), serverPlayer1.getYRot(), serverPlayer1.getXRot())
-+ );
-+ } else {
-+ serverPlayer1.connection
-+ .teleport(serverPlayer1.getX(), serverPlayer1.getY(), serverPlayer1.getZ(), serverPlayer1.getYRot(), serverPlayer1.getXRot());
-+ }
-+ // DivineMC end - Multithreaded tracker
- }
- }
- );
-@@ -410,12 +418,13 @@ public class ServerEntity {
+@@ -418,12 +418,13 @@ public class ServerEntity {
if (this.entity instanceof LivingEntity) {
Set attributesToSync = ((LivingEntity)this.entity).getAttributes().getAttributesToSync();
if (!attributesToSync.isEmpty()) {
@@ -208,10 +189,10 @@ index 0fb253aa55a24b56b17f524b3261c5b75c7d7e59..b6053158f5d9b6ad325ea075ab7c60f9
attributesToSync.clear();
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index c229d69ce3d007e4cb57e559611b3fca7a03562f..ba5ca5213fafd60b2257409f334a7c6b28fe918a 100644
+index c03895b2fc783d748fe52660b9ef30367143d0f5..8fa3af0ebcb92138d0dae858c131db0a710df693 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -2497,7 +2497,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -2481,7 +2481,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@Override
public LevelEntityGetter getEntities() {
@@ -220,7 +201,7 @@ index c229d69ce3d007e4cb57e559611b3fca7a03562f..ba5ca5213fafd60b2257409f334a7c6b
return this.moonrise$getEntityLookup(); // Paper - rewrite chunk system
}
-@@ -2724,7 +2724,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -2717,7 +2717,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
map.carriedByPlayers.remove(player);
@@ -230,10 +211,10 @@ index c229d69ce3d007e4cb57e559611b3fca7a03562f..ba5ca5213fafd60b2257409f334a7c6b
}
}
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 56a22d19a82a937c08cb4527b0f67f219a6bb8a0..f8c76bb2c9fa625e191036dc58ef3dfb1d4ee930 100644
+index 374d9e1036a1c4b50f80f3121c7ad0793506a280..b05657f763bbdbc9268c83d78c2da62b97d095e2 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1822,7 +1822,7 @@ public class ServerGamePacketListenerImpl
+@@ -1882,7 +1882,7 @@ public class ServerGamePacketListenerImpl
}
public void internalTeleport(PositionMoveRotation posMoveRotation, Set relatives) {
@@ -243,10 +224,10 @@ index 56a22d19a82a937c08cb4527b0f67f219a6bb8a0..f8c76bb2c9fa625e191036dc58ef3dfb
if (this.player.isRemoved()) {
LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName());
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
-index 8013594bb4844e7a8abf28123958e7f632d39341..72593629324ccd4d70b8ed86a90fb69785d57f5f 100644
+index 3ac9f36eae87369354e992a1d9b5c5b2d87d17cb..3a6c481fae0d3cb5ffdd39caf85252f164774323 100644
--- a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
+++ b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
-@@ -24,8 +24,11 @@ public class AttributeInstance {
+@@ -26,8 +26,11 @@ public class AttributeInstance {
private final Map> modifiersByOperation = Maps.newEnumMap(
AttributeModifier.Operation.class
);
@@ -261,13 +242,13 @@ index 8013594bb4844e7a8abf28123958e7f632d39341..72593629324ccd4d70b8ed86a90fb697
private boolean dirty = true;
private double cachedValue;
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
-index a25d74592e89e3d6339479c6dc2b6f45d1932cfc..621b183211b8148bb8db256d2119c82f8a2c626b 100644
+index 23576e631ad4a12ec3ff3630be253738534588f3..b37a49c44ecb456c798d153fddf3cb6090a9a296 100644
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
-@@ -19,9 +19,12 @@ import org.slf4j.Logger;
+@@ -14,9 +14,12 @@ import net.minecraft.nbt.ListTag;
+ import net.minecraft.resources.ResourceLocation;
public class AttributeMap {
- private static final Logger LOGGER = LogUtils.getLogger();
- private final Map, AttributeInstance> attributes = new Object2ObjectOpenHashMap<>();
- private final Set attributesToSync = new ObjectOpenHashSet<>();
- private final Set attributesToUpdate = new ObjectOpenHashSet<>();
@@ -281,10 +262,10 @@ index a25d74592e89e3d6339479c6dc2b6f45d1932cfc..621b183211b8148bb8db256d2119c82f
private final net.minecraft.world.entity.LivingEntity entity; // Purpur - Ridables
diff --git a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
-index 681dec447486138088fe5f705ef4fadab531139f..3d6aad86519be3e1449d3288369a41aebb924c90 100644
+index 3ae69b17fec1cdb2bee2b5a795026a875f197c30..f8620d34137fe13122deb5b761512e09bb8c4aa7 100644
--- a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
-@@ -279,6 +279,7 @@ public class MapItemSavedData extends SavedData {
+@@ -211,6 +211,7 @@ public class MapItemSavedData extends SavedData {
for (int i = 0; i < this.carriedBy.size(); i++) {
MapItemSavedData.HoldingPlayer holdingPlayer1 = this.carriedBy.get(i);
diff --git a/divinemc-server/minecraft-patches/features/0007-Async-locate-command.patch b/divinemc-server/minecraft-patches/features/0007-Async-locate-command.patch
index d8757d2..4d7c0da 100644
--- a/divinemc-server/minecraft-patches/features/0007-Async-locate-command.patch
+++ b/divinemc-server/minecraft-patches/features/0007-Async-locate-command.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Async locate command
diff --git a/net/minecraft/server/commands/LocateCommand.java b/net/minecraft/server/commands/LocateCommand.java
-index 13bcd8653d766cd0b754a22e9aab261fbc62b0a5..0bc2d17e9bad62f62ab171feb2a92b87e1c3ba6a 100644
+index 2723d5377567241921fef61952e474c1c0ee9bbf..ee9f84b33a34b5b9d7c3f8928c958c298f780a03 100644
--- a/net/minecraft/server/commands/LocateCommand.java
+++ b/net/minecraft/server/commands/LocateCommand.java
@@ -103,44 +103,77 @@ public class LocateCommand {
@@ -119,7 +119,7 @@ index 13bcd8653d766cd0b754a22e9aab261fbc62b0a5..0bc2d17e9bad62f62ab171feb2a92b87
public static int showLocateResult(
@@ -195,7 +228,7 @@ public class LocateCommand {
- .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Component.translatable("chat.coordinates.tooltip")))
+ .withHoverEvent(new HoverEvent.ShowText(Component.translatable("chat.coordinates.tooltip")))
);
source.sendSuccess(() -> Component.translatable(translationKey, elementName, component, i), false);
- LOGGER.info("Locating element " + elementName + " took " + duration.toMillis() + " ms");
diff --git a/divinemc-server/minecraft-patches/features/0009-Misc-Optimizations.patch b/divinemc-server/minecraft-patches/features/0008-Misc-Optimizations.patch
similarity index 83%
rename from divinemc-server/minecraft-patches/features/0009-Misc-Optimizations.patch
rename to divinemc-server/minecraft-patches/features/0008-Misc-Optimizations.patch
index 6a665b6..9aa0cfe 100644
--- a/divinemc-server/minecraft-patches/features/0009-Misc-Optimizations.patch
+++ b/divinemc-server/minecraft-patches/features/0008-Misc-Optimizations.patch
@@ -4,23 +4,11 @@ Date: Fri, 31 Jan 2025 21:50:46 +0300
Subject: [PATCH] Misc Optimizations
-diff --git a/com/mojang/math/OctahedralGroup.java b/com/mojang/math/OctahedralGroup.java
-index 11902e7427761746ee098fea3276a34fef0096ba..3ba23fa243f7af712a41316066ca554f1c23b495 100644
---- a/com/mojang/math/OctahedralGroup.java
-+++ b/com/mojang/math/OctahedralGroup.java
-@@ -112,6 +112,7 @@ public enum OctahedralGroup implements StringRepresentable {
- this.transformation = new Matrix3f().scaling(invertX ? -1.0F : 1.0F, invertY ? -1.0F : 1.0F, invertZ ? -1.0F : 1.0F);
- this.transformation.mul(permutation.transformation());
- this.initializeRotationDirections(); // Paper - Avoid Lazy Initialization for Enum Fields
-+ this.rotate(Direction.UP); // DivineMC - Math Optimizations
- }
-
- private BooleanList packInversions() {
diff --git a/com/mojang/math/Transformation.java b/com/mojang/math/Transformation.java
-index aa755b8b7f8bc5910322e0c5b520f603da06a85a..e781dea43279aa77cc40a7afd2281c32cc8347a9 100644
+index 5fb382be4d86328690c49f2a5a0c3ec698a38e21..f333d9028f315e7912dd335c8158abd525c27ecd 100644
--- a/com/mojang/math/Transformation.java
+++ b/com/mojang/math/Transformation.java
-@@ -51,6 +51,7 @@ public final class Transformation {
+@@ -52,6 +52,7 @@ public final class Transformation {
} else {
this.matrix = matrix;
}
@@ -28,7 +16,7 @@ index aa755b8b7f8bc5910322e0c5b520f603da06a85a..e781dea43279aa77cc40a7afd2281c32
}
public Transformation(@Nullable Vector3f translation, @Nullable Quaternionf leftRotation, @Nullable Vector3f scale, @Nullable Quaternionf rightRotation) {
-@@ -60,6 +61,7 @@ public final class Transformation {
+@@ -61,6 +62,7 @@ public final class Transformation {
this.scale = scale != null ? scale : new Vector3f(1.0F, 1.0F, 1.0F);
this.rightRotation = rightRotation != null ? rightRotation : new Quaternionf();
this.decomposed = true;
@@ -37,10 +25,10 @@ index aa755b8b7f8bc5910322e0c5b520f603da06a85a..e781dea43279aa77cc40a7afd2281c32
public static Transformation identity() {
diff --git a/net/minecraft/core/MappedRegistry.java b/net/minecraft/core/MappedRegistry.java
-index 5f752603aa5611ce9d3dd44cc5b70c27ac46a86e..332122c0b700fb743f91f3fed16aade41dceec28 100644
+index 761e583a56b1c4a605b0cbb04b61c4df60b8b9bb..c07155589ef44cbbacafe03b36d2cd4cdcba3fd2 100644
--- a/net/minecraft/core/MappedRegistry.java
+++ b/net/minecraft/core/MappedRegistry.java
-@@ -34,10 +34,12 @@ public class MappedRegistry implements WritableRegistry {
+@@ -33,10 +33,12 @@ public class MappedRegistry implements WritableRegistry {
private final ResourceKey extends Registry> key;
private final ObjectList> byId = new ObjectArrayList<>(256);
private final Reference2IntMap toId = Util.make(new Reference2IntOpenHashMap<>(2048), map -> map.defaultReturnValue(-1)); // Paper - Perf: Use bigger expected size to reduce collisions
@@ -57,6 +45,63 @@ index 5f752603aa5611ce9d3dd44cc5b70c27ac46a86e..332122c0b700fb743f91f3fed16aade4
private Lifecycle registryLifecycle;
private final Map, HolderSet.Named> frozenTags = new IdentityHashMap<>();
MappedRegistry.TagSet allTags = MappedRegistry.TagSet.unbound();
+diff --git a/net/minecraft/network/VarInt.java b/net/minecraft/network/VarInt.java
+index 4897ff4648083ebe737ae5b32bae344af27357e4..0d103821d7220daa5cc0d5d3231e794fca0ca055 100644
+--- a/net/minecraft/network/VarInt.java
++++ b/net/minecraft/network/VarInt.java
+@@ -52,16 +52,43 @@ public class VarInt {
+
+ public static ByteBuf write(ByteBuf buffer, int value) {
+ // Paper start - Optimize VarInts
+- // Peel the one and two byte count cases explicitly as they are the most common VarInt sizes
+- // that the proxy will write, to improve inlining.
+- if ((value & (0xFFFFFFFF << 7)) == 0) {
+- buffer.writeByte(value);
+- } else if ((value & (0xFFFFFFFF << 14)) == 0) {
+- int w = (value & 0x7F | 0x80) << 8 | (value >>> 7);
+- buffer.writeShort(w);
+- } else {
+- writeOld(buffer, value);
++ // DivineMC start - Misc optimizations
++ int bytesNeeded = getByteSize(value);
++
++ switch (bytesNeeded) {
++ case 1:
++ buffer.writeByte(value);
++ break;
++ case 2:
++ int w2 = ((value & 0x7F) << 8) | (value >>> 7) | 0x00008000;
++ buffer.writeShort(w2);
++ break;
++ case 3:
++ int w3 = (value & 0x7F) << 16
++ | (value & 0x3F80) << 1
++ | (value >>> 14)
++ | 0x00808000;
++ buffer.writeMedium(w3);
++ break;
++ case 4:
++ int w4 = (value & 0x7F) << 24
++ | ((value & 0x3F80) << 9)
++ | (value & 0x1FC000) >> 6
++ | (value >>> 21)
++ | 0x80808000;
++ buffer.writeInt(w4);
++ break;
++ case 5:
++ int w5 = (value & 0x7F) << 24
++ | (value & 0x3F80) << 9
++ | (value & 0x1FC000) >> 6
++ | ((value >>> 21) & 0x7F)
++ | 0x80808080;
++ buffer.writeInt(w5);
++ buffer.writeByte(value >>> 28);
++ break;
+ }
++ // DivineMC end - Slightly optimized VarInt#write
+ return buffer;
+ }
+ public static ByteBuf writeOld(ByteBuf buffer, int value) {
diff --git a/net/minecraft/server/level/ChunkTrackingView.java b/net/minecraft/server/level/ChunkTrackingView.java
index bee90335677f7d8b01589ce5cfd81a40fd422886..a5e488d14fd2016ee188b114d0e681562b5b09cc 100644
--- a/net/minecraft/server/level/ChunkTrackingView.java
@@ -386,7 +431,7 @@ index ab3a221c115992d0f4ea921aa92cf0976b815ff4..076a931341da486162f289a5f19d3d67
return number % multiple == 0;
}
diff --git a/net/minecraft/util/RandomSource.java b/net/minecraft/util/RandomSource.java
-index 98a54bc4de251014342cda6d0951b7fea79ce553..663edee4dfa660e3d3a04c728fd764258867916d 100644
+index 8516d47b0ba79d91638837199e7ae0fb6cb44a79..71444431b10582f5917c1795275ccdadd2364c3c 100644
--- a/net/minecraft/util/RandomSource.java
+++ b/net/minecraft/util/RandomSource.java
@@ -12,7 +12,7 @@ public interface RandomSource {
@@ -408,23 +453,23 @@ index 98a54bc4de251014342cda6d0951b7fea79ce553..663edee4dfa660e3d3a04c728fd76425
static RandomSource createNewThreadLocalInstance() {
diff --git a/net/minecraft/util/debugchart/DebugSampleSubscriptionTracker.java b/net/minecraft/util/debugchart/DebugSampleSubscriptionTracker.java
-index 15de39fa82c7aea18298509fe9587d027c30cc15..eb534ed5a7478fc632db096328e3582f4ec410b8 100644
+index a18240418a19a95147341a634527d774f3d5bb92..66f74ad2a194a6676574da2932cf4677f9383ecd 100644
--- a/net/minecraft/util/debugchart/DebugSampleSubscriptionTracker.java
+++ b/net/minecraft/util/debugchart/DebugSampleSubscriptionTracker.java
-@@ -15,7 +15,7 @@ public class DebugSampleSubscriptionTracker {
+@@ -14,7 +14,7 @@ public class DebugSampleSubscriptionTracker {
public static final int STOP_SENDING_AFTER_MS = 10000;
private final PlayerList playerList;
- private final EnumMap> subscriptions;
+ private final Map> subscriptions;
- private final Queue subscriptionRequestQueue = new LinkedList<>();
+ private final java.util.List subscriptionRequestQueue = java.util.Collections.synchronizedList(new LinkedList<>()); // DivineMC - Misc Optimizations
public DebugSampleSubscriptionTracker(PlayerList playerList) {
this.playerList = playerList;
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index 7e29f1f1972f2fb4f9a779653467bc85ce37c7bc..3943789e241f6bb6bc165099b1fb585463cf3d86 100644
+index d513b82c0681fdc990af082af69278bd773225a9..b065accf4ca3e87a4c35506f8cbf4d88759e1128 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -143,7 +143,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -149,7 +149,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
// Paper start - Share random for entities to make them more random
@@ -433,11 +478,35 @@ index 7e29f1f1972f2fb4f9a779653467bc85ce37c7bc..3943789e241f6bb6bc165099b1fb5854
// Paper start - replace random
private static final class RandomRandomSource extends ca.spottedleaf.moonrise.common.util.ThreadUnsafeRandom {
public RandomRandomSource() {
+@@ -4502,10 +4502,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+
+ // Paper start - optimise collisions
+ public boolean updateFluidHeightAndDoFluidPushing(final TagKey fluid, final double flowScale) {
+- if (this.touchingUnloadedChunk()) {
+- return false;
+- }
+-
+ final AABB boundingBox = this.getBoundingBox().deflate(1.0E-3);
+
+ final Level world = this.level;
+@@ -4541,7 +4537,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+
+ for (int currChunkZ = minChunkZ; currChunkZ <= maxChunkZ; ++currChunkZ) {
+ for (int currChunkX = minChunkX; currChunkX <= maxChunkX; ++currChunkX) {
+- final net.minecraft.world.level.chunk.LevelChunkSection[] sections = chunkSource.getChunk(currChunkX, currChunkZ, net.minecraft.world.level.chunk.status.ChunkStatus.FULL, false).getSections();
++ // DivineMC start - Misc optimizations
++ final net.minecraft.world.level.chunk.ChunkAccess chunk = chunkSource.getChunk(currChunkX, currChunkZ, net.minecraft.world.level.chunk.status.ChunkStatus.FULL, false);
++ if (chunk == null) continue;
++ final net.minecraft.world.level.chunk.LevelChunkSection[] sections = chunk.getSections();
++ // DivineMC end - Misc optimizations
+
+ // bound y
+ for (int currChunkY = minChunkY; currChunkY <= maxChunkY; ++currChunkY) {
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
-index 66f3565b978f2ed91cb2bc3a816f1701c0873c73..b4e19cc65701d5ef94e1cc0a7473225c222725c3 100644
+index 5bcbebf35eb726a43b957aca5b8b7a1dca7648cd..d618752727e2f2f5c0c1afa97f455e349cb7e76c 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
-@@ -832,7 +832,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -698,7 +698,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
if (this.level().getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) {
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
} else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) {
@@ -446,7 +515,7 @@ index 66f3565b978f2ed91cb2bc3a816f1701c0873c73..b4e19cc65701d5ef94e1cc0a7473225c
if (nearestPlayer != null) {
// Paper start - Configurable despawn distances
final io.papermc.paper.configuration.WorldConfiguration.Entities.Spawning.DespawnRangePair despawnRangePair = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory());
-@@ -861,6 +861,19 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -727,6 +727,19 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
}
}
@@ -467,10 +536,10 @@ index 66f3565b978f2ed91cb2bc3a816f1701c0873c73..b4e19cc65701d5ef94e1cc0a7473225c
protected final void serverAiStep() {
this.noActionTime++;
diff --git a/net/minecraft/world/level/GameRules.java b/net/minecraft/world/level/GameRules.java
-index 5ded2f808a9fcb26856567de6bc56e206f948a84..02d64a5ea756b2c91a71b7a0fc0f21219983616a 100644
+index 02bc5d83b92a594ec519f0a02b0517fdb4b9e954..86c1f5effde3173c8bc458af21b454c81738935e 100644
--- a/net/minecraft/world/level/GameRules.java
+++ b/net/minecraft/world/level/GameRules.java
-@@ -249,7 +249,7 @@ public class GameRules {
+@@ -277,7 +277,7 @@ public class GameRules {
}
private GameRules(Map, GameRules.Value>> rules, FeatureFlagSet enabledFeatures) {
@@ -542,36 +611,24 @@ index 01e5b29d6e9a5c53c0e23b61ed0c1d7be1a0fe08..d80df05e40f3941ade5ed320e12f8dcf
return 1.0 * (32.0 * (d1 - 128.0) - 3.0 * (d1 - 120.0) * d2 + 3.0 * d2 * d2) / (128.0 * (32.0 - 3.0 * d2));
}
-diff --git a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
-index 3d6aad86519be3e1449d3288369a41aebb924c90..9294ac7bb91f86b631b1f0b4ad0bc1dbca82b3a1 100644
---- a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
-+++ b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
-@@ -198,6 +198,7 @@ public class MapItemSavedData extends SavedData {
- }
- }
-
-+ mapItemSavedData.setDirty(false); // DivineMC - Misc Optimizations
- return mapItemSavedData;
- }
-
diff --git a/net/minecraft/world/level/storage/DimensionDataStorage.java b/net/minecraft/world/level/storage/DimensionDataStorage.java
-index d9a3b5a2e6495b7e22c114506c2bd1e406f58f8f..a6e03345afd6d8a38e06a43c59103209618baa14 100644
+index 05361803a929cbcf651a37cf43009e57acb25f3e..5d21d2520dd33889988d8300060e6a41a8334562 100644
--- a/net/minecraft/world/level/storage/DimensionDataStorage.java
+++ b/net/minecraft/world/level/storage/DimensionDataStorage.java
-@@ -34,7 +34,7 @@ import org.slf4j.Logger;
-
+@@ -39,7 +39,7 @@ import org.slf4j.Logger;
public class DimensionDataStorage implements AutoCloseable {
private static final Logger LOGGER = LogUtils.getLogger();
-- public final Map> cache = new HashMap<>();
-+ public final Map> cache = new java.util.concurrent.ConcurrentHashMap<>(); // DivineMC - Concurrent HashMap
+ private final SavedData.Context context;
+- public final Map, Optional> cache = new HashMap<>();
++ public final Map, Optional> cache = new java.util.concurrent.ConcurrentHashMap<>(); // DivineMC - Misc Optimizations
private final DataFixer fixerUpper;
private final HolderLookup.Provider registries;
private final Path dataFolder;
diff --git a/net/minecraft/world/phys/AABB.java b/net/minecraft/world/phys/AABB.java
-index c9c6e4e460ad8435f12761704bb9b0284d6aa708..54807bb4b4189ceaded1f78a1a9ab85ce40ab2b1 100644
+index 5767fbfd7f33c5276fb4335ce473b2e1baca411c..1866d857cabde481f23e861e0db7994bfa84ac40 100644
--- a/net/minecraft/world/phys/AABB.java
+++ b/net/minecraft/world/phys/AABB.java
-@@ -189,13 +189,15 @@ public class AABB {
+@@ -190,13 +190,15 @@ public class AABB {
}
public AABB intersect(AABB other) {
@@ -594,7 +651,7 @@ index c9c6e4e460ad8435f12761704bb9b0284d6aa708..54807bb4b4189ceaded1f78a1a9ab85c
}
public AABB minmax(AABB other) {
-@@ -227,16 +229,37 @@ public class AABB {
+@@ -228,16 +230,37 @@ public class AABB {
}
public boolean intersects(AABB other) {
diff --git a/divinemc-server/minecraft-patches/features/0010-Chunk-System-Optimizations.patch b/divinemc-server/minecraft-patches/features/0009-Chunk-System-Optimizations.patch
similarity index 93%
rename from divinemc-server/minecraft-patches/features/0010-Chunk-System-Optimizations.patch
rename to divinemc-server/minecraft-patches/features/0009-Chunk-System-Optimizations.patch
index a4b1721..706fbb0 100644
--- a/divinemc-server/minecraft-patches/features/0010-Chunk-System-Optimizations.patch
+++ b/divinemc-server/minecraft-patches/features/0009-Chunk-System-Optimizations.patch
@@ -96,10 +96,10 @@ index 866f38eb0f379ffbe2888023a7d1c290f521a231..08666b4aa1c7663861dc361f60e6f1cc
if (indexer == null) {
return dfl;
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java b/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
-index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f2686feb3 100644
+index 7a52c42845bd74d0bb7649f87764aba12f442f02..78f2d7c698a4f2c21a473627c3017a9751f80cf1 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
-@@ -189,13 +189,13 @@ public final class RegionizedPlayerChunkLoader {
+@@ -187,13 +187,13 @@ public final class RegionizedPlayerChunkLoader {
}
if (((ChunkSystemServerPlayer)player).moonrise$getChunkLoader() != null) {
@@ -115,7 +115,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
}
public void updatePlayer(final ServerPlayer player) {
-@@ -301,7 +301,7 @@ public final class RegionizedPlayerChunkLoader {
+@@ -299,7 +299,7 @@ public final class RegionizedPlayerChunkLoader {
return false;
}
@@ -124,7 +124,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
TickThread.ensureTickThread("Cannot tick player chunk loader async");
long currTime = System.nanoTime();
for (final ServerPlayer player : new java.util.ArrayList<>(this.world.players())) {
-@@ -312,6 +312,7 @@ public final class RegionizedPlayerChunkLoader {
+@@ -310,6 +310,7 @@ public final class RegionizedPlayerChunkLoader {
}
loader.update(); // can't invoke plugin logic
loader.updateQueues(currTime);
@@ -132,7 +132,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
}
}
-@@ -362,7 +363,7 @@ public final class RegionizedPlayerChunkLoader {
+@@ -360,7 +361,7 @@ public final class RegionizedPlayerChunkLoader {
GENERATED_TICKET_LEVEL,
TICK_TICKET_LEVEL
};
@@ -141,7 +141,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
{
this.chunkTicketStage.defaultReturnValue(CHUNK_TICKET_STAGE_NONE);
}
-@@ -384,10 +385,19 @@ public final class RegionizedPlayerChunkLoader {
+@@ -382,10 +383,19 @@ public final class RegionizedPlayerChunkLoader {
final int centerX = PlayerChunkLoaderData.this.lastChunkX;
final int centerZ = PlayerChunkLoaderData.this.lastChunkZ;
@@ -165,7 +165,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
};
private final LongHeapPriorityQueue sendQueue = new LongHeapPriorityQueue(CLOSEST_MANHATTAN_DIST);
private final LongHeapPriorityQueue tickingQueue = new LongHeapPriorityQueue(CLOSEST_MANHATTAN_DIST);
-@@ -490,7 +500,7 @@ public final class RegionizedPlayerChunkLoader {
+@@ -488,7 +498,7 @@ public final class RegionizedPlayerChunkLoader {
}
@Override
@@ -174,7 +174,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
final long chunk = CoordinateUtils.getChunkKey(chunkX, chunkZ);
// note: by the time this is called, the tick cleanup should have ran - so, if the chunk is at
// the tick stage it was deemed in range for loading. Thus, we need to move it to generated
-@@ -624,7 +634,7 @@ public final class RegionizedPlayerChunkLoader {
+@@ -622,7 +632,7 @@ public final class RegionizedPlayerChunkLoader {
return Math.max(Math.abs(dx), Math.abs(dz)) <= this.lastTickDistance;
}
@@ -183,7 +183,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
for (int dz = -radius; dz <= radius; ++dz) {
for (int dx = -radius; dx <= radius; ++dx) {
if ((dx | dz) == 0) {
-@@ -643,10 +653,10 @@ public final class RegionizedPlayerChunkLoader {
+@@ -641,10 +651,10 @@ public final class RegionizedPlayerChunkLoader {
return true;
}
@@ -196,7 +196,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
}
// update rate limits
final double loadRate = this.getMaxChunkLoadRate();
-@@ -910,10 +920,10 @@ public final class RegionizedPlayerChunkLoader {
+@@ -907,10 +917,10 @@ public final class RegionizedPlayerChunkLoader {
);
}
@@ -209,7 +209,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
}
final ViewDistances playerDistances = ((ChunkSystemServerPlayer)this.player).moonrise$getViewDistanceHolder().getViewDistances();
final ViewDistances worldDistances = ((ChunkSystemServerLevel)this.world).moonrise$getViewDistanceHolder().getViewDistances();
-@@ -1062,7 +1072,7 @@ public final class RegionizedPlayerChunkLoader {
+@@ -1059,7 +1069,7 @@ public final class RegionizedPlayerChunkLoader {
this.flushDelayedTicketOps();
}
@@ -218,7 +218,7 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
TickThread.ensureTickThread(this.player, "Cannot add player asynchronously");
if (this.removed) {
throw new IllegalStateException("Removing removed player chunk loader");
-@@ -1090,7 +1100,7 @@ public final class RegionizedPlayerChunkLoader {
+@@ -1087,7 +1097,7 @@ public final class RegionizedPlayerChunkLoader {
}
public LongOpenHashSet getSentChunksRaw() {
@@ -228,17 +228,17 @@ index 8ef5a1aaac9c27873ce746eb281f77bb318a3c69..886825a10bd06b4b656d19a05624c74f
}
}
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java
-index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d56318eb22 100644
+index f473999938840562b1007a789600342e5796a123..60705955e231d47c60f5a0a5e869988aed8774fc 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java
-@@ -71,36 +71,49 @@ public final class ChunkHolderManager {
- private static final long PROBE_MARKER = Long.MIN_VALUE + 1;
+@@ -72,36 +72,49 @@ public final class ChunkHolderManager {
+ private static final long NO_TIMEOUT_MARKER = Long.MIN_VALUE;
public final ReentrantAreaLock ticketLockArea;
-- private final ConcurrentLong2ReferenceChainedHashTable>> tickets = new ConcurrentLong2ReferenceChainedHashTable<>();
+- private final ConcurrentLong2ReferenceChainedHashTable> tickets = new ConcurrentLong2ReferenceChainedHashTable<>();
- private final ConcurrentLong2ReferenceChainedHashTable sectionToChunkToExpireCount = new ConcurrentLong2ReferenceChainedHashTable<>();
+ // DivineMC start - Chunk System optimization
-+ private final ConcurrentLong2ReferenceChainedHashTable>> tickets = ConcurrentLong2ReferenceChainedHashTable.createWithCapacity(20, 0.9F);
++ private final ConcurrentLong2ReferenceChainedHashTable> tickets = ConcurrentLong2ReferenceChainedHashTable.createWithCapacity(20, 0.9F);
+ private final ConcurrentLong2ReferenceChainedHashTable sectionToChunkToExpireCount = ConcurrentLong2ReferenceChainedHashTable.createWithCapacity(20, 0.9F);
+ // DivineMC end - Chunk System optimization
final ChunkUnloadQueue unloadQueue;
@@ -298,9 +298,9 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
+ }
+ // DivineMC end - Chunk System optimization
- public ChunkHolderManager(final ServerLevel world, final ChunkTaskScheduler taskScheduler) {
- this.world = world;
-@@ -222,26 +235,29 @@ public final class ChunkHolderManager {
+ private final ConcurrentLong2ReferenceChainedHashTable ticketCounters = new ConcurrentLong2ReferenceChainedHashTable<>();
+
+@@ -224,26 +237,29 @@ public final class ChunkHolderManager {
this.taskScheduler.setShutdown(true);
}
@@ -337,7 +337,7 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
holder.lastAutoSave = currentTick;
if (holder.save(false) != null) {
-@@ -255,10 +271,11 @@ public final class ChunkHolderManager {
+@@ -257,10 +273,11 @@ public final class ChunkHolderManager {
for (final NewChunkHolder holder : reschedule) {
if (holder.getChunkStatus().isOrAfter(FullChunkStatus.FULL)) {
@@ -350,7 +350,7 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
public void saveAllChunks(final boolean flush, final boolean shutdown, final boolean logProgress) {
final List holders = this.getChunkHolders();
-@@ -317,13 +334,9 @@ public final class ChunkHolderManager {
+@@ -319,13 +336,9 @@ public final class ChunkHolderManager {
}
if (logProgress) {
final long currTime = System.nanoTime();
@@ -366,8 +366,8 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
}
}
}
-@@ -425,8 +438,8 @@ public final class ChunkHolderManager {
- final Long2ObjectOpenHashMap>> ret = new Long2ObjectOpenHashMap<>();
+@@ -459,8 +472,8 @@ public final class ChunkHolderManager {
+ final Long2ObjectOpenHashMap> ret = new Long2ObjectOpenHashMap<>();
final Long2ObjectOpenHashMap sections = new Long2ObjectOpenHashMap<>();
final int sectionShift = this.taskScheduler.getChunkSystemLockShift();
- for (final PrimitiveIterator.OfLong iterator = this.tickets.keyIterator(); iterator.hasNext();) {
@@ -377,7 +377,7 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
sections.computeIfAbsent(
CoordinateUtils.getChunkKey(
CoordinateUtils.getChunkX(coord) >> sectionShift,
-@@ -523,7 +536,7 @@ public final class ChunkHolderManager {
+@@ -557,7 +570,7 @@ public final class ChunkHolderManager {
chunkZ >> sectionShift
);
@@ -386,16 +386,18 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
return new Long2IntOpenHashMap();
}).addTo(chunkKey, 1);
}
-@@ -567,7 +580,7 @@ public final class ChunkHolderManager {
+@@ -601,8 +614,8 @@ public final class ChunkHolderManager {
final ReentrantAreaLock.Node ticketLock = lock ? this.ticketLockArea.lock(chunkX, chunkZ) : null;
try {
-- final SortedArraySet> ticketsAtChunk = this.tickets.computeIfAbsent(chunk, (final long keyInMap) -> {
-+ final SortedArraySet> ticketsAtChunk = this.tickets.computeIfAbsent(chunk, (keyInMap) -> { // DivineMC - Chunk System optimization
- return SortedArraySet.create(4);
+- final SortedArraySet ticketsAtChunk = this.tickets.computeIfAbsent(chunk, (final long keyInMap) -> {
+- return (SortedArraySet)SortedArraySet.create(4);
++ final SortedArraySet ticketsAtChunk = this.tickets.computeIfAbsent(chunk, (keyInMap) -> { // DivineMC - Chunk System optimization
++ return SortedArraySet.create(4);
});
-@@ -697,8 +710,8 @@ public final class ChunkHolderManager {
+ final int levelBefore = getTicketLevelAt(ticketsAtChunk);
+@@ -782,8 +795,8 @@ public final class ChunkHolderManager {
final Long2ObjectOpenHashMap sections = new Long2ObjectOpenHashMap<>();
final int sectionShift = this.taskScheduler.getChunkSystemLockShift();
@@ -406,7 +408,7 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
sections.computeIfAbsent(
CoordinateUtils.getChunkKey(
CoordinateUtils.getChunkX(coord) >> sectionShift,
-@@ -746,8 +759,8 @@ public final class ChunkHolderManager {
+@@ -831,8 +844,8 @@ public final class ChunkHolderManager {
return removeDelay <= 0L;
};
@@ -417,16 +419,16 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
if (!this.sectionToChunkToExpireCount.containsKey(sectionKey)) {
// removed concurrently
-@@ -1033,7 +1046,7 @@ public final class ChunkHolderManager {
+@@ -1118,7 +1131,7 @@ public final class ChunkHolderManager {
}
- if (org.bxteam.divinemc.DivineConfig.enableParallelWorldTicking && !TickThread.isTickThreadFor(world)) { // DivineMC - Parallel world ticking
+ if (!TickThread.isTickThread()) {
this.taskScheduler.scheduleChunkTask(() -> {
- final ArrayDeque pendingFullLoadUpdate = ChunkHolderManager.this.pendingFullLoadUpdate;
+ final java.util.Deque pendingFullLoadUpdate = ChunkHolderManager.this.getData().pendingFullLoadUpdate; // DivineMC - Chunk System optimization
for (int i = 0, len = changedFullStatus.size(); i < len; ++i) {
pendingFullLoadUpdate.add(changedFullStatus.get(i));
}
-@@ -1041,16 +1054,16 @@ public final class ChunkHolderManager {
+@@ -1126,16 +1139,16 @@ public final class ChunkHolderManager {
ChunkHolderManager.this.processPendingFullUpdate();
}, Priority.HIGHEST);
} else {
@@ -446,7 +448,7 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
PlatformHooks.get().onChunkHolderDelete(this.world, holder.vanillaChunkHolder);
this.chunkHolders.remove(CoordinateUtils.getChunkKey(holder.chunkX, holder.chunkZ));
}
-@@ -1214,6 +1227,27 @@ public final class ChunkHolderManager {
+@@ -1293,6 +1306,27 @@ public final class ChunkHolderManager {
}
}
@@ -474,7 +476,7 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
public enum TicketOperationType {
ADD, REMOVE, ADD_IF_REMOVED, ADD_AND_REMOVE
}
-@@ -1387,7 +1421,7 @@ public final class ChunkHolderManager {
+@@ -1466,7 +1500,7 @@ public final class ChunkHolderManager {
// only call on tick thread
private boolean processPendingFullUpdate() {
@@ -483,21 +485,21 @@ index 5683395e09a65b1b39748df5152fffef630ac083..6aea99f071bd1a6a1ea9507bb70739d5
boolean ret = false;
-@@ -1423,8 +1457,7 @@ public final class ChunkHolderManager {
+@@ -1502,8 +1536,7 @@ public final class ChunkHolderManager {
final JsonArray allTicketsJson = new JsonArray();
ret.add("tickets", allTicketsJson);
-- for (final Iterator>>> iterator = this.tickets.entryIterator();
+- for (final Iterator>> iterator = this.tickets.entryIterator();
- iterator.hasNext();) {
-+ for (final Iterator>>> iterator = this.tickets.entryIterator(); iterator.hasNext();) { // DivineMC - Chunk System optimization
- final ConcurrentLong2ReferenceChainedHashTable.TableEntry>> coordinateTickets = iterator.next();
++ for (final Iterator>> iterator = this.tickets.entryIterator(); iterator.hasNext();) { // DivineMC - Chunk System optimization
+ final ConcurrentLong2ReferenceChainedHashTable.TableEntry> coordinateTickets = iterator.next();
final long coordinate = coordinateTickets.getKey();
- final SortedArraySet> tickets = coordinateTickets.getValue();
+ final SortedArraySet tickets = coordinateTickets.getValue();
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
-index 67532b85073b7978254a0b04caadfe822679e61f..4b97b676d4245e7ece956eb4c78bed96ff452b2d 100644
+index 8f8268924ac92fca5df8a11e08031fa8416c6e05..f1bc7a5e80de0293e1837b2f7401b347fc59f831 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
-@@ -65,14 +65,6 @@ public final class ChunkTaskScheduler {
+@@ -66,14 +66,6 @@ public final class ChunkTaskScheduler {
private static final Logger LOGGER = LogUtils.getClassLogger();
@@ -509,10 +511,10 @@ index 67532b85073b7978254a0b04caadfe822679e61f..4b97b676d4245e7ece956eb4c78bed96
- LOGGER.info("Chunk system is using population gen parallelism: " + useParallelGen);
- }
-
- public static final TicketType CHUNK_LOAD = TicketType.create("chunk_system:chunk_load", Long::compareTo);
+ public static final TicketType CHUNK_LOAD = ChunkSystemTicketType.create("chunk_system:chunk_load", Long::compareTo);
private static final AtomicLong CHUNK_LOAD_IDS = new AtomicLong();
-@@ -115,12 +107,12 @@ public final class ChunkTaskScheduler {
+@@ -116,12 +108,12 @@ public final class ChunkTaskScheduler {
public final ServerLevel world;
public final RadiusAwarePrioritisedExecutor radiusAwareScheduler;
@@ -530,7 +532,7 @@ index 67532b85073b7978254a0b04caadfe822679e61f..4b97b676d4245e7ece956eb4c78bed96
private final PrioritisedTaskQueue mainThreadExecutor = new PrioritisedTaskQueue();
-@@ -291,14 +283,14 @@ public final class ChunkTaskScheduler {
+@@ -292,14 +284,14 @@ public final class ChunkTaskScheduler {
this.lockShift = Math.max(((ChunkSystemServerLevel)world).moonrise$getRegionChunkShift(), ThreadedTicketLevelPropagator.SECTION_SHIFT);
this.schedulingLockArea = new ReentrantAreaLock(this.getChunkSystemLockShift());
@@ -784,7 +786,7 @@ index 28ffa653e87a4e8ef7cf614916ef3fe61681fe16..b35b92b204fbefd139c4544f15e32d46
} finally {
this.returnNode();
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/task/ChunkFullTask.java b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/task/ChunkFullTask.java
-index 6ab353b0d2465c3680bb3c8d0852ba0f65c00fd2..70067c12d4d82460d55d8f90d01b0bc1e5368408 100644
+index 96ccb8f657d755b2e58a8dd0cda00ca0df4886b2..89de0fcb3f8142f76399fc00e288e03d7f3742f2 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/task/ChunkFullTask.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/task/ChunkFullTask.java
@@ -35,7 +35,7 @@ public final class ChunkFullTask extends ChunkProgressionTask implements Runnabl
@@ -865,17 +867,18 @@ index 95ed5a0ff3f0588f625ba48a5fee3aafbab9d13f..f2fd6d5eb024f646875868c441eb2da2
protected static final class LoadDataFromDiskTask {
diff --git a/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickConstants.java b/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickConstants.java
-index e97e7d276faf055c89207385d3820debffb06463..4aeb75a2cdcfb4206bab3eee5ad674dd9890e720 100644
+index 6d1fe8028739145b11fce98ad62b2f8044299548..2cd1197fa0d15e19749409cc857a0254de444ba5 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickConstants.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickConstants.java
-@@ -2,6 +2,6 @@ package ca.spottedleaf.moonrise.patches.chunk_tick_iteration;
+@@ -2,7 +2,7 @@ package ca.spottedleaf.moonrise.patches.chunk_tick_iteration;
public final class ChunkTickConstants {
- public static final int PLAYER_SPAWN_TRACK_RANGE = 8;
+ public static final int PLAYER_SPAWN_TRACK_RANGE = (int) Math.round(org.bxteam.divinemc.DivineConfig.playerNearChunkDetectionRange / 16.0); // DivineMC - Chunk System optimization
-
- }
+ // the smallest distance on x/z is at 45 degrees, we need to subtract 0.5 since this is calculated from chunk center and not chunk perimeter
+ // note: vanilla does not subtract 0.5 but the result is (luckily!) the same
+ public static final int NARROW_SPAWN_TRACK_RANGE = (int)Math.floor(((double)PLAYER_SPAWN_TRACK_RANGE / Math.sqrt(2.0)) - 0.5);
diff --git a/ca/spottedleaf/moonrise/patches/starlight/light/SWMRNibbleArray.java b/ca/spottedleaf/moonrise/patches/starlight/light/SWMRNibbleArray.java
index 4ca68a903e67606fc4ef0bfa9862a73797121c8b..f94f443f862611f039454d1dc8ff2a4ba5f081d3 100644
--- a/ca/spottedleaf/moonrise/patches/starlight/light/SWMRNibbleArray.java
@@ -890,10 +893,10 @@ index 4ca68a903e67606fc4ef0bfa9862a73797121c8b..f94f443f862611f039454d1dc8ff2a4b
return false;
}
diff --git a/ca/spottedleaf/moonrise/patches/starlight/light/StarLightInterface.java b/ca/spottedleaf/moonrise/patches/starlight/light/StarLightInterface.java
-index 571db5f9bf94745a8afe2cd313e593fb15db5e37..c8e59f6abed384f45314fc995d3822724c9b4001 100644
+index 51f4dd4f583dfbd16cb00f1cb4418d1044cecb1c..2f83deafbb5b50e5ce191b5351ec5ed948262008 100644
--- a/ca/spottedleaf/moonrise/patches/starlight/light/StarLightInterface.java
+++ b/ca/spottedleaf/moonrise/patches/starlight/light/StarLightInterface.java
-@@ -888,7 +888,7 @@ public final class StarLightInterface {
+@@ -887,7 +887,7 @@ public final class StarLightInterface {
super(chunkCoordinate, lightEngine, queue);
this.task = ((ChunkSystemServerLevel)(ServerLevel)lightEngine.getWorld()).moonrise$getChunkTaskScheduler().radiusAwareScheduler.createTask(
CoordinateUtils.getChunkX(chunkCoordinate), CoordinateUtils.getChunkZ(chunkCoordinate),
@@ -903,7 +906,7 @@ index 571db5f9bf94745a8afe2cd313e593fb15db5e37..c8e59f6abed384f45314fc995d382272
}
diff --git a/io/papermc/paper/FeatureHooks.java b/io/papermc/paper/FeatureHooks.java
-index 460bb584db04b582f3297ae419183f430aff1ec0..72c4e1876115745fbeec12fe8a1ad6f4803e9d7f 100644
+index 52b981a05ad5aabb7c85dc1e0f1d2b835163bb87..f4af8e131c2badbe0e57ccec5be8710e12d7c38d 100644
--- a/io/papermc/paper/FeatureHooks.java
+++ b/io/papermc/paper/FeatureHooks.java
@@ -32,11 +32,6 @@ import org.bukkit.Chunk;
@@ -919,10 +922,10 @@ index 460bb584db04b582f3297ae419183f430aff1ec0..72c4e1876115745fbeec12fe8a1ad6f4
commands.put(Set.of("fixlight"), new FixLightCommand()); // Paper - rewrite chunk system
commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); // Paper - rewrite chunk system
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
-index 965899a98223b15bd770378c202873cbf15b714d..dccf4d4b1067e1b09e38cabeae82185929494b62 100644
+index b5028cc64e2a43c841801114908825102df41765..fb6e0beb35d1d6bb9a159debeb06e861051821b9 100644
--- a/net/minecraft/server/level/ChunkMap.java
+++ b/net/minecraft/server/level/ChunkMap.java
-@@ -127,8 +127,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -132,8 +132,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public final AtomicInteger tickingGenerated = new AtomicInteger(); // Paper - public
private final String storageName;
private final PlayerMap playerMap = new PlayerMap();
@@ -933,7 +936,7 @@ index 965899a98223b15bd770378c202873cbf15b714d..dccf4d4b1067e1b09e38cabeae821859
// Paper - rewrite chunk system
public int serverViewDistance;
public final WorldGenContext worldGenContext; // Paper - public
-@@ -249,7 +249,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -256,7 +256,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final ServerPlayer[] backingSet = inRange.getRawDataUnchecked();
for (int i = 0, len = inRange.size(); i < len; i++) {
@@ -946,7 +949,7 @@ index 965899a98223b15bd770378c202873cbf15b714d..dccf4d4b1067e1b09e38cabeae821859
}
}
-@@ -266,7 +270,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -273,7 +277,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
final ServerPlayer[] backingSet = inRange.getRawDataUnchecked();
for (int i = 0, len = inRange.size(); i < len; i++) {
@@ -959,7 +962,7 @@ index 965899a98223b15bd770378c202873cbf15b714d..dccf4d4b1067e1b09e38cabeae821859
}
}
// Paper end - per player mob count backoff
-@@ -720,27 +728,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -774,27 +782,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return false;
}
@@ -977,8 +980,8 @@ index 965899a98223b15bd770378c202873cbf15b714d..dccf4d4b1067e1b09e38cabeae821859
- if (event == null || event.isCancelled()) continue;
- blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4));
- }
-- // Paper end - PlayerNaturallySpawnCreaturesEvent
- if (this.playerIsCloseEnoughForSpawning(serverPlayer, chunkPos, blockRange)) {
+- // Paper end - PlayerNaturallySpawnCreaturesEvent
- return true;
- }
- }
@@ -988,7 +991,7 @@ index 965899a98223b15bd770378c202873cbf15b714d..dccf4d4b1067e1b09e38cabeae821859
// Paper end - chunk tick iteration optimisation
}
-@@ -758,10 +746,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -812,10 +800,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final ServerPlayer[] raw = players.getRawDataUnchecked();
final int len = players.size();
@@ -1002,7 +1005,7 @@ index 965899a98223b15bd770378c202873cbf15b714d..dccf4d4b1067e1b09e38cabeae821859
if (ret == null) {
ret = new ArrayList<>(len - i);
ret.add(player);
-@@ -1146,6 +1134,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1208,6 +1196,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
for (int i = 0, len = players.size(); i < len; ++i) {
final ServerPlayer player = playersRaw[i];
@@ -1011,10 +1014,10 @@ index 965899a98223b15bd770378c202873cbf15b714d..dccf4d4b1067e1b09e38cabeae821859
}
diff --git a/net/minecraft/server/level/DistanceManager.java b/net/minecraft/server/level/DistanceManager.java
-index 5eab6179ce3913cb4e4d424f910ba423faf21c85..4b1efd53e423bdfe90d5efd472823869fc87e73b 100644
+index fd3d0f6cb53bc8b6186f0d86575f21007b2c20ed..7f3c41b59e288364d67534511fc038e6dbb268fa 100644
--- a/net/minecraft/server/level/DistanceManager.java
+++ b/net/minecraft/server/level/DistanceManager.java
-@@ -178,15 +178,13 @@ public abstract class DistanceManager implements ca.spottedleaf.moonrise.patches
+@@ -127,15 +127,13 @@ public abstract class DistanceManager implements ca.spottedleaf.moonrise.patches
public boolean inEntityTickingRange(long chunkPos) {
// Paper start - rewrite chunk system
@@ -1033,10 +1036,10 @@ index 5eab6179ce3913cb4e4d424f910ba423faf21c85..4b1efd53e423bdfe90d5efd472823869
}
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
-index ab30af9cd58ff7310e05be87b08f42bacf69e11e..ae0e36d198ad8243920c8e8a55c0be4945542763 100644
+index 4d4139b5f42a4db6e22bf1d063a23dc7b9914f85..9a65321ce62f21b150d29be30dbae7dba0ff40be 100644
--- a/net/minecraft/server/level/ServerChunkCache.java
+++ b/net/minecraft/server/level/ServerChunkCache.java
-@@ -439,8 +439,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -444,8 +444,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
public boolean isPositionTicking(long chunkPos) {
// Paper start - rewrite chunk system
@@ -1047,18 +1050,18 @@ index ab30af9cd58ff7310e05be87b08f42bacf69e11e..ae0e36d198ad8243920c8e8a55c0be49
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index 52ba052fc1ff2a35786570c282a7de4e9dff99f5..9298bdca9a653622f3625190e875e7b6c5e40023 100644
+index 8fa3af0ebcb92138d0dae858c131db0a710df693..e351b75f03b7096dcd0378b49987d27c04474116 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -181,6 +181,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -177,6 +177,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
public final ServerChunkCache chunkSource;
private final MinecraftServer server;
public final net.minecraft.world.level.storage.PrimaryLevelData serverLevelData; // CraftBukkit - type
+ public final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkHolderManager.LevelHolderData chunkHolderData; // DivineMC - Chunk System optimization
private int lastSpawnChunkRadius;
- final EntityTickList entityTickList = new EntityTickList(this); // DivineMC - Parallel world ticking
+ final EntityTickList entityTickList = new EntityTickList();
// Paper - rewrite chunk system
-@@ -291,6 +292,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -287,6 +288,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
// Paper end - optimise getPlayerByUUID
// Paper start - rewrite chunk system
@@ -1066,7 +1069,7 @@ index 52ba052fc1ff2a35786570c282a7de4e9dff99f5..9298bdca9a653622f3625190e875e7b6
private final ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.ViewDistanceHolder viewDistanceHolder = new ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.ViewDistanceHolder();
private final ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader chunkLoader = new ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader((ServerLevel)(Object)this);
private final ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.EntityDataController entityDataController;
-@@ -689,6 +691,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -678,6 +680,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// Paper start - rewrite chunk system
this.moonrise$setEntityLookup(new ca.spottedleaf.moonrise.patches.chunk_system.level.entity.server.ServerEntityLookup((ServerLevel)(Object)this, ((ServerLevel)(Object)this).new EntityCallbacks()));
this.chunkTaskScheduler = new ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler((ServerLevel)(Object)this);
@@ -1074,15 +1077,15 @@ index 52ba052fc1ff2a35786570c282a7de4e9dff99f5..9298bdca9a653622f3625190e875e7b6
this.entityDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.EntityDataController(
new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.EntityDataController.EntityRegionFileStorage(
new RegionStorageInfo(levelStorageAccess.getLevelId(), dimension, "entities"),
-@@ -703,6 +706,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -691,6 +694,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+ // Paper end - rewrite chunk system
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
- this.tickExecutor = java.util.concurrent.Executors.newSingleThreadExecutor(new org.bxteam.divinemc.server.ServerLevelTickExecutorThreadFactory(getWorld().getName())); // DivineMC - Parallel world ticking
this.preciseTime = this.serverLevelData.getDayTime(); // Purpur - Configurable daylight cycle
+ this.chunkSystemPriorities = new org.bxteam.divinemc.server.chunk.PriorityHandler(this); // DivineMC - Chunk System optimizations
}
// Paper start
-@@ -832,8 +836,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -820,8 +824,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@Override
public boolean shouldTickBlocksAt(long chunkPos) {
// Paper start - rewrite chunk system
@@ -1092,7 +1095,7 @@ index 52ba052fc1ff2a35786570c282a7de4e9dff99f5..9298bdca9a653622f3625190e875e7b6
// Paper end - rewrite chunk system
}
-@@ -889,7 +892,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -877,7 +880,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
private void optimiseRandomTick(final LevelChunk chunk, final int tickSpeed) {
final LevelChunkSection[] sections = chunk.getSections();
@@ -1101,7 +1104,7 @@ index 52ba052fc1ff2a35786570c282a7de4e9dff99f5..9298bdca9a653622f3625190e875e7b6
final ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom simpleRandom = this.simpleRandom;
final boolean doubleTickFluids = !ca.spottedleaf.moonrise.common.PlatformHooks.get().configFixMC224294();
-@@ -897,42 +900,41 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -885,42 +888,41 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
final int offsetX = cpos.x << 4;
final int offsetZ = cpos.z << 4;
@@ -1154,9 +1157,9 @@ index 52ba052fc1ff2a35786570c282a7de4e9dff99f5..9298bdca9a653622f3625190e875e7b6
}
// Paper end - optimise random ticking
-@@ -2557,30 +2559,25 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -2532,16 +2534,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
- private boolean isPositionTickingWithEntitiesLoaded(long chunkPos) {
+ public boolean isPositionTickingWithEntitiesLoaded(long chunkPos) {
// Paper start - rewrite chunk system
- final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder chunkHolder = this.moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(chunkPos);
- // isTicking implies the chunk is loaded, and the chunk is loaded now implies the entities are loaded
@@ -1173,24 +1176,8 @@ index 52ba052fc1ff2a35786570c282a7de4e9dff99f5..9298bdca9a653622f3625190e875e7b6
// Paper end - rewrite chunk system
}
- public boolean isNaturalSpawningAllowed(BlockPos pos) {
- // Paper start - rewrite chunk system
-- final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder chunkHolder = this.moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(pos));
-- return chunkHolder != null && chunkHolder.isEntityTickingReady();
-+ return this.moonrise$getChunkTaskScheduler().chunkHolderManager.entityTickingChunkHolders.contains(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(pos)); // DivineMC - Chunk System optimization
- // Paper end - rewrite chunk system
- }
-
- public boolean isNaturalSpawningAllowed(ChunkPos chunkPos) {
- // Paper start - rewrite chunk system
-- final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder chunkHolder = this.moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(chunkPos));
-- return chunkHolder != null && chunkHolder.isEntityTickingReady();
-+ return this.moonrise$getChunkTaskScheduler().chunkHolderManager.entityTickingChunkHolders.contains(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(chunkPos)); // DivineMC - Chunk System optimization
- // Paper end - rewrite chunk system
- }
-
diff --git a/net/minecraft/server/level/ThreadedLevelLightEngine.java b/net/minecraft/server/level/ThreadedLevelLightEngine.java
-index 5c9ac44a3b4bc8e047feaf61a94eb163761498a2..66dc6d77263d6f5de7d0a96b8b6575e7a363f5bf 100644
+index 216c2294f59a9d53613ac249ea63adeaa8a8efa4..b83438852a7b01fef9a736a5b0bc46f15ed1d59b 100644
--- a/net/minecraft/server/level/ThreadedLevelLightEngine.java
+++ b/net/minecraft/server/level/ThreadedLevelLightEngine.java
@@ -138,7 +138,7 @@ public class ThreadedLevelLightEngine extends LevelLightEngine implements AutoCl
@@ -1203,10 +1190,10 @@ index 5c9ac44a3b4bc8e047feaf61a94eb163761498a2..66dc6d77263d6f5de7d0a96b8b6575e7
return chunks.size();
}
diff --git a/net/minecraft/world/level/LevelReader.java b/net/minecraft/world/level/LevelReader.java
-index 26c8c1e5598daf3550aef05b12218c47bda6618b..94c824ab1457939c425e1f99929d3222ee2c18a0 100644
+index 0842fd6488c8b27d98c4344e1244996b4c0e9912..cba72a86d99fb4b3a3f9f5aefe9993ec8e84abfd 100644
--- a/net/minecraft/world/level/LevelReader.java
+++ b/net/minecraft/world/level/LevelReader.java
-@@ -70,10 +70,27 @@ public interface LevelReader extends ca.spottedleaf.moonrise.patches.chunk_syste
+@@ -74,10 +74,27 @@ public interface LevelReader extends ca.spottedleaf.moonrise.patches.chunk_syste
@Override
default Holder getNoiseBiome(int x, int y, int z) {
@@ -1424,7 +1411,7 @@ index cf3172be76fa4c7987ed569138439ff42f92fa7f..ed3c470056855a520a110ac7014f7839
+ // DivineMC end - Chunk System Optimizations
}
diff --git a/net/minecraft/world/level/chunk/LevelChunkSection.java b/net/minecraft/world/level/chunk/LevelChunkSection.java
-index c83d0667b19830304f22319a46a23422a8766790..aa10c5087a0fc9306b734f20ccbad73045a1b6d0 100644
+index 4db7ec2647b9f08536dc5253dac0fa8d3044e38b..e3abc97a1a66988e44b1ed78b76a198b82051da1 100644
--- a/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -23,6 +23,7 @@ public class LevelChunkSection implements ca.spottedleaf.moonrise.patches.block_
@@ -1539,7 +1526,7 @@ index a80b2e9dceea423180a9c390d1970317dff4f1b0..6d9dfc1837dccef2073da180aaaf68b0
void read(FriendlyByteBuf buffer);
diff --git a/net/minecraft/world/level/chunk/PalettedContainer.java b/net/minecraft/world/level/chunk/PalettedContainer.java
-index 230cb433c38f9b6ffb1adeaa8b6040490f13e826..712d3d1669aecd38934957c81835e1f38289539a 100644
+index d7f4d54f73adc0d4d71fb9ba425e45a11c456961..a512609aaa823b940ed269c981fc9beec49a126e 100644
--- a/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -393,6 +393,12 @@ public class PalettedContainer implements PaletteResize, PalettedContainer
@@ -1556,7 +1543,7 @@ index 230cb433c38f9b6ffb1adeaa8b6040490f13e826..712d3d1669aecd38934957c81835e1f3
public PalettedContainer copy() {
return new PalettedContainer<>(this, this.presetValues); // Paper - Anti-Xray - Add preset values
diff --git a/net/minecraft/world/level/chunk/ProtoChunk.java b/net/minecraft/world/level/chunk/ProtoChunk.java
-index e66239e2da91bd3ddf358d239be796719c0da327..35e9d8cfe12252d3419626f1cefb64d30e20069e 100644
+index 13837d5508c34de3ccc49caac0d6c0ba7010d88a..3449d4dbb68353204ec67c46eed1404dd6410e96 100644
--- a/net/minecraft/world/level/chunk/ProtoChunk.java
+++ b/net/minecraft/world/level/chunk/ProtoChunk.java
@@ -41,7 +41,7 @@ public class ProtoChunk extends ChunkAccess {
@@ -1610,7 +1597,7 @@ index 2ffae24b0cb1a20c7d5a8520f1b5197c2cedea11..c3ec5e5645f680a915c95d833b589b68
public T valueFor(int id) {
if (this.value != null && id == 0) {
diff --git a/net/minecraft/world/level/chunk/storage/IOWorker.java b/net/minecraft/world/level/chunk/storage/IOWorker.java
-index 2199a9e2a0141c646d108f2687a27f1d165453c5..c28c2583b257f92207b822a1fdde8f5b7e480992 100644
+index 27e1edbd8d8ffd80c1a3df17bc47f4a6936619f7..fae062a643692369175f58bb1687e766e873d8e3 100644
--- a/net/minecraft/world/level/chunk/storage/IOWorker.java
+++ b/net/minecraft/world/level/chunk/storage/IOWorker.java
@@ -212,7 +212,38 @@ public class IOWorker implements ChunkScanAccess, AutoCloseable {
@@ -1653,10 +1640,10 @@ index 2199a9e2a0141c646d108f2687a27f1d165453c5..c28c2583b257f92207b822a1fdde8f5b
if (entry != null) {
this.runStore(entry.getKey(), entry.getValue());
diff --git a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-index 6ebd1300c2561116b83cb2472ac7939ead36d576..16cd10ab8de69ca3d29c84cf93715645322fd72a 100644
+index 8d1174f25e0e90d0533970f4ddd8448442024936..c98cb390bda4b536f97445f228e06aaebcd84609 100644
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-@@ -244,7 +244,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
+@@ -269,7 +269,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
protected RegionFileStorage(RegionStorageInfo info, Path folder, boolean sync) { // Paper - protected
this.folder = folder;
@@ -2222,7 +2209,7 @@ index c62a15ea4a1bb22e7bcc2fc544acf8a601892029..bc67039f8374ae4e471ca14e0c623e6b
}
}
diff --git a/net/minecraft/world/level/levelgen/Beardifier.java b/net/minecraft/world/level/levelgen/Beardifier.java
-index 131923282c9ecbcb1d7f45a826da907c02bd2716..1af75406ba69c5eec4a41fe7a8dce0d07c259099 100644
+index 74d8202b5c9bb2a3ee832be70f95c0b5cbecb460..4c11b822fa65388c1d8d9aaa7fd70200d0eaa418 100644
--- a/net/minecraft/world/level/levelgen/Beardifier.java
+++ b/net/minecraft/world/level/levelgen/Beardifier.java
@@ -29,6 +29,17 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
@@ -2243,7 +2230,7 @@ index 131923282c9ecbcb1d7f45a826da907c02bd2716..1af75406ba69c5eec4a41fe7a8dce0d0
public static Beardifier forStructuresInChunk(StructureManager structureManager, ChunkPos chunkPos) {
int minBlockX = chunkPos.getMinBlockX();
-@@ -76,50 +87,44 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
+@@ -75,50 +86,44 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
this.junctionIterator = junctionIterator;
}
@@ -2318,7 +2305,7 @@ index 131923282c9ecbcb1d7f45a826da907c02bd2716..1af75406ba69c5eec4a41fe7a8dce0d0
@Override
public double minValue() {
-@@ -132,8 +137,14 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
+@@ -131,8 +136,14 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
}
private static double getBuryContribution(double x, double y, double z) {
@@ -2336,10 +2323,10 @@ index 131923282c9ecbcb1d7f45a826da907c02bd2716..1af75406ba69c5eec4a41fe7a8dce0d0
private static double getBeardContribution(int x, int y, int z, int height) {
diff --git a/net/minecraft/world/level/levelgen/BelowZeroRetrogen.java b/net/minecraft/world/level/levelgen/BelowZeroRetrogen.java
-index 4993ace2b3d615570de3d4b6621aeba3a3e7fe99..1be79332446559c95ae3048a71a6634fd01cf2e2 100644
+index 3379c3893227d42bb54f3a94e697a9851d279605..161aed37d14cd283a3b4341ea15d57a4a0f088b3 100644
--- a/net/minecraft/world/level/levelgen/BelowZeroRetrogen.java
+++ b/net/minecraft/world/level/levelgen/BelowZeroRetrogen.java
-@@ -82,6 +82,7 @@ public final class BelowZeroRetrogen {
+@@ -74,6 +74,7 @@ public final class BelowZeroRetrogen {
}
public void applyBedrockMask(ProtoChunk chunk) {
@@ -2623,20 +2610,19 @@ index 9d3a9ca1e13cd80f468f1352bbb74345f03903dd..d97b9b43686bda0a95fc02f6ca31b2d0
public RandomSource at(int x, int y, int z) {
long seed = Mth.getSeed(x, y, z);
diff --git a/net/minecraft/world/level/levelgen/feature/stateproviders/RandomizedIntStateProvider.java b/net/minecraft/world/level/levelgen/feature/stateproviders/RandomizedIntStateProvider.java
-index f4009671880b00ecec98fe604215e2824e453cdf..7b00301da0b3fb6429d04e4d10cafa30e168aa62 100644
+index 21cbf6c1723feb1813d8cd5106e36594d140d987..29fad81878fe6902328b810e1584650cfb65aba6 100644
--- a/net/minecraft/world/level/levelgen/feature/stateproviders/RandomizedIntStateProvider.java
+++ b/net/minecraft/world/level/levelgen/feature/stateproviders/RandomizedIntStateProvider.java
-@@ -54,18 +54,21 @@ public class RandomizedIntStateProvider extends BlockStateProvider {
- }
+@@ -55,17 +55,21 @@ public class RandomizedIntStateProvider extends BlockStateProvider {
@Override
-+ @SuppressWarnings("DataFlowIssue")
public BlockState getState(RandomSource random, BlockPos pos) {
- BlockState state = this.source.getState(random, pos);
- if (this.property == null || !state.hasProperty(this.property)) {
- IntegerProperty integerProperty = findProperty(state, this.propertyName);
- if (integerProperty == null) {
- return state;
++ // DivineMC start - Chunk System optimization
+ BlockState blockState = this.source.getState(random, pos);
+ IntegerProperty propertyLocal = this.property;
+ if (propertyLocal == null || !blockState.hasProperty(propertyLocal)) {
@@ -2650,13 +2636,14 @@ index f4009671880b00ecec98fe604215e2824e453cdf..7b00301da0b3fb6429d04e4d10cafa30
+ this.property = intProperty;
}
-- return state.setValue(this.property, Integer.valueOf(this.values.sample(random)));
-+ return (BlockState)blockState.setValue(propertyLocal, this.values.sample(random));
+- return state.setValue(this.property, this.values.sample(random));
++ return (BlockState) blockState.setValue(this.property, this.values.sample(random));
++ // DivineMC end - Chunk System optimization
}
@Nullable
diff --git a/net/minecraft/world/level/levelgen/structure/ScatteredFeaturePiece.java b/net/minecraft/world/level/levelgen/structure/ScatteredFeaturePiece.java
-index d122221deefb218db962e97ba2d958c33d903b8a..56311b439ac22700593d2d31da3a4efe3a519d53 100644
+index e2036a80eff3dc1a9ec625880d4aab6ef71d84fa..6c5200a311a6c5a93a49999cc0c3a8b3f3ca8240 100644
--- a/net/minecraft/world/level/levelgen/structure/ScatteredFeaturePiece.java
+++ b/net/minecraft/world/level/levelgen/structure/ScatteredFeaturePiece.java
@@ -12,7 +12,7 @@ public abstract class ScatteredFeaturePiece extends StructurePiece {
@@ -2669,10 +2656,10 @@ index d122221deefb218db962e97ba2d958c33d903b8a..56311b439ac22700593d2d31da3a4efe
protected ScatteredFeaturePiece(StructurePieceType type, int x, int y, int z, int width, int height, int depth, Direction orientation) {
super(type, 0, StructurePiece.makeBoundingBox(x, y, z, orientation, width, height, depth));
diff --git a/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/net/minecraft/world/level/levelgen/structure/StructureCheck.java
-index f7dc4957b38878ddd3bfc7546be8a4e0af65c807..4023115e8120a6ccbc2a5bf7f2d17ffb2f808eb7 100644
+index 48fce0845fb023d6286dac144c285b048d778564..3e8e740f08614143f09c62f07bee7b305dd7929c 100644
--- a/net/minecraft/world/level/levelgen/structure/StructureCheck.java
+++ b/net/minecraft/world/level/levelgen/structure/StructureCheck.java
-@@ -46,6 +46,7 @@ public class StructureCheck {
+@@ -47,6 +47,7 @@ public class StructureCheck {
private final LevelHeightAccessor heightAccessor;
private final BiomeSource biomeSource;
private final long seed;
@@ -2680,7 +2667,7 @@ index f7dc4957b38878ddd3bfc7546be8a4e0af65c807..4023115e8120a6ccbc2a5bf7f2d17ffb
private final DataFixer fixerUpper;
// Paper start - rewrite chunk system
// make sure to purge entries from the maps to prevent memory leaks
-@@ -235,15 +236,13 @@ public class StructureCheck {
+@@ -229,15 +230,13 @@ public class StructureCheck {
}
private void storeFullResults(long chunkPos, Object2IntMap structureChunks) {
@@ -2702,7 +2689,7 @@ index f7dc4957b38878ddd3bfc7546be8a4e0af65c807..4023115e8120a6ccbc2a5bf7f2d17ffb
public void incrementReference(ChunkPos pos, Structure structure) {
diff --git a/net/minecraft/world/level/levelgen/structure/StructureStart.java b/net/minecraft/world/level/levelgen/structure/StructureStart.java
-index 4dafa79dd4ec55a443ba3731a79e7cd6e8052f48..8aeab4d773473ad20b1c64295c93d6fcb4ea02a1 100644
+index f9a15c3769f29af1952ef880f6fcd2612119ecf0..13f6654e06f87e9a9fbeba2217ee0e0eaa95347d 100644
--- a/net/minecraft/world/level/levelgen/structure/StructureStart.java
+++ b/net/minecraft/world/level/levelgen/structure/StructureStart.java
@@ -26,7 +26,7 @@ public final class StructureStart {
@@ -2768,10 +2755,10 @@ index c84d865837e0f009fcde19e14a44fa43aefe660a..64d7adbd4aa398044a1d68d51e463b67
@Nullable
private volatile StructureTemplatePool.Projection projection;
diff --git a/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidPiece.java b/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidPiece.java
-index e8c125ddb335bfe81b8f1dbb91f7f7ccec11d980..4b6b18b3d255f6a72e6be3b85260732b8eab533c 100644
+index 0d2451a9ade43650dbbcbab69ce0f6e8f69b5aee..21b8e738c8823eac5d8fc8241dd8fb0e5ce82364 100644
--- a/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidPiece.java
+++ b/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidPiece.java
-@@ -23,29 +23,44 @@ import net.minecraft.world.level.storage.loot.BuiltInLootTables;
+@@ -23,29 +23,45 @@ import net.minecraft.world.level.storage.loot.BuiltInLootTables;
public class DesertPyramidPiece extends ScatteredFeaturePiece {
public static final int WIDTH = 21;
public static final int DEPTH = 21;
@@ -2798,15 +2785,16 @@ index e8c125ddb335bfe81b8f1dbb91f7f7ccec11d980..4b6b18b3d255f6a72e6be3b85260732b
public DesertPyramidPiece(CompoundTag tag) {
super(StructurePieceType.DESERT_PYRAMID_PIECE, tag);
-- this.hasPlacedChest[0] = tag.getBoolean("hasPlacedChest0");
-- this.hasPlacedChest[1] = tag.getBoolean("hasPlacedChest1");
-- this.hasPlacedChest[2] = tag.getBoolean("hasPlacedChest2");
-- this.hasPlacedChest[3] = tag.getBoolean("hasPlacedChest3");
+- this.hasPlacedChest[0] = tag.getBooleanOr("hasPlacedChest0", false);
+- this.hasPlacedChest[1] = tag.getBooleanOr("hasPlacedChest1", false);
+- this.hasPlacedChest[2] = tag.getBooleanOr("hasPlacedChest2", false);
+- this.hasPlacedChest[3] = tag.getBooleanOr("hasPlacedChest3", false);
+ // DivineMC start - Chunk System Optimizations
-+ this.hasPlacedChestAtomic.set(0, tag.getBoolean("hasPlacedChest0"));
-+ this.hasPlacedChestAtomic.set(1, tag.getBoolean("hasPlacedChest1"));
-+ this.hasPlacedChestAtomic.set(2, tag.getBoolean("hasPlacedChest2"));
-+ this.hasPlacedChestAtomic.set(3, tag.getBoolean("hasPlacedChest3"));
++ this.hasPlacedChestAtomic.set(0, tag.getBooleanOr("hasPlacedChest0", false));
++ this.hasPlacedChestAtomic.set(1, tag.getBooleanOr("hasPlacedChest1", false));
++ this.hasPlacedChestAtomic.set(2, tag.getBooleanOr("hasPlacedChest2", false));
++ this.hasPlacedChestAtomic.set(3, tag.getBooleanOr("hasPlacedChest3", false));
++ init();
+ // DivineMC end - Chunk System Optimizations
}
@@ -2826,7 +2814,7 @@ index e8c125ddb335bfe81b8f1dbb91f7f7ccec11d980..4b6b18b3d255f6a72e6be3b85260732b
}
@Override
-@@ -287,12 +302,12 @@ public class DesertPyramidPiece extends ScatteredFeaturePiece {
+@@ -287,12 +303,12 @@ public class DesertPyramidPiece extends ScatteredFeaturePiece {
this.placeBlock(level, Blocks.CUT_SANDSTONE.defaultBlockState(), 10, -11, 13, box);
for (Direction direction : Direction.Plane.HORIZONTAL) {
@@ -2842,7 +2830,7 @@ index e8c125ddb335bfe81b8f1dbb91f7f7ccec11d980..4b6b18b3d255f6a72e6be3b85260732b
}
}
-@@ -419,7 +434,7 @@ public class DesertPyramidPiece extends ScatteredFeaturePiece {
+@@ -419,7 +435,7 @@ public class DesertPyramidPiece extends ScatteredFeaturePiece {
this.randomCollapsedRoofPos = new BlockPos(this.getWorldX(i1, randomInt), this.getWorldY(y), this.getWorldZ(i1, randomInt));
}
@@ -2852,7 +2840,7 @@ index e8c125ddb335bfe81b8f1dbb91f7f7ccec11d980..4b6b18b3d255f6a72e6be3b85260732b
}
diff --git a/net/minecraft/world/level/levelgen/structure/structures/JungleTemplePiece.java b/net/minecraft/world/level/levelgen/structure/structures/JungleTemplePiece.java
-index 82600a247e13b82fc56273e1fd8483c8102a8d3d..cd9b24f017ebea5df55c7d15ee3d793ad612fbc6 100644
+index d28f1a25e2137955402e41679d1a4220a0136579..d751eac6d7a97b8de44c83c35ff7d3e36ca3b066 100644
--- a/net/minecraft/world/level/levelgen/structure/structures/JungleTemplePiece.java
+++ b/net/minecraft/world/level/levelgen/structure/structures/JungleTemplePiece.java
@@ -30,10 +30,12 @@ import net.minecraft.world.level.storage.loot.BuiltInLootTables;
@@ -2876,15 +2864,15 @@ index 82600a247e13b82fc56273e1fd8483c8102a8d3d..cd9b24f017ebea5df55c7d15ee3d793a
public JungleTemplePiece(CompoundTag tag) {
super(StructurePieceType.JUNGLE_PYRAMID_PIECE, tag);
-- this.placedMainChest = tag.getBoolean("placedMainChest");
-- this.placedHiddenChest = tag.getBoolean("placedHiddenChest");
-- this.placedTrap1 = tag.getBoolean("placedTrap1");
-- this.placedTrap2 = tag.getBoolean("placedTrap2");
+- this.placedMainChest = tag.getBooleanOr("placedMainChest", false);
+- this.placedHiddenChest = tag.getBooleanOr("placedHiddenChest", false);
+- this.placedTrap1 = tag.getBooleanOr("placedTrap1", false);
+- this.placedTrap2 = tag.getBooleanOr("placedTrap2", false);
+ // DivineMC start - Chunk System Optimizations
-+ this.placedMainChest.set(tag.getBoolean("placedMainChest"));
-+ this.placedHiddenChest.set(tag.getBoolean("placedHiddenChest"));
-+ this.placedTrap1.set(tag.getBoolean("placedTrap1"));
-+ this.placedTrap2.set(tag.getBoolean("placedTrap2"));
++ this.placedMainChest.set(tag.getBooleanOr("placedMainChest", false));
++ this.placedHiddenChest.set(tag.getBooleanOr("placedHiddenChest", false));
++ this.placedTrap1.set(tag.getBooleanOr("placedTrap1", false));
++ this.placedTrap2.set(tag.getBooleanOr("placedTrap2", false));
+ // DivineMC end - Chunk System Optimizations
}
@@ -2904,7 +2892,7 @@ index 82600a247e13b82fc56273e1fd8483c8102a8d3d..cd9b24f017ebea5df55c7d15ee3d793a
}
@Override
-@@ -242,8 +248,8 @@ public class JungleTemplePiece extends ScatteredFeaturePiece {
+@@ -236,8 +242,8 @@ public class JungleTemplePiece extends ScatteredFeaturePiece {
box
);
this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 3, -3, 1, box);
@@ -2914,8 +2902,8 @@ index 82600a247e13b82fc56273e1fd8483c8102a8d3d..cd9b24f017ebea5df55c7d15ee3d793a
+ this.placedTrap1.set(this.createDispenser(level, box, random, 3, -2, 1, Direction.NORTH, BuiltInLootTables.JUNGLE_TEMPLE_DISPENSER)); // DivineMC - Chunk System Optimizations
}
- this.placeBlock(level, Blocks.VINE.defaultBlockState().setValue(VineBlock.SOUTH, Boolean.valueOf(true)), 3, -2, 2, box);
-@@ -340,14 +346,14 @@ public class JungleTemplePiece extends ScatteredFeaturePiece {
+ this.placeBlock(level, Blocks.VINE.defaultBlockState().setValue(VineBlock.SOUTH, true), 3, -2, 2, box);
+@@ -328,14 +334,14 @@ public class JungleTemplePiece extends ScatteredFeaturePiece {
);
this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 9, -3, 4, box);
this.placeBlock(level, blockState4, 9, -2, 4, box);
@@ -2925,8 +2913,8 @@ index 82600a247e13b82fc56273e1fd8483c8102a8d3d..cd9b24f017ebea5df55c7d15ee3d793a
+ this.placedTrap2.set(this.createDispenser(level, box, random, 9, -2, 3, Direction.WEST, BuiltInLootTables.JUNGLE_TEMPLE_DISPENSER)); // DivineMC - Chunk System Optimizations
}
- this.placeBlock(level, Blocks.VINE.defaultBlockState().setValue(VineBlock.EAST, Boolean.valueOf(true)), 8, -1, 3, box);
- this.placeBlock(level, Blocks.VINE.defaultBlockState().setValue(VineBlock.EAST, Boolean.valueOf(true)), 8, -2, 3, box);
+ this.placeBlock(level, Blocks.VINE.defaultBlockState().setValue(VineBlock.EAST, true), 8, -1, 3, box);
+ this.placeBlock(level, Blocks.VINE.defaultBlockState().setValue(VineBlock.EAST, true), 8, -2, 3, box);
- if (!this.placedMainChest) {
- this.placedMainChest = this.createChest(level, box, random, 8, -3, 3, BuiltInLootTables.JUNGLE_TEMPLE);
+ if (!this.placedMainChest.get()) { // DivineMC - Chunk System Optimizations
@@ -2934,7 +2922,7 @@ index 82600a247e13b82fc56273e1fd8483c8102a8d3d..cd9b24f017ebea5df55c7d15ee3d793a
}
this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 9, -3, 2, box);
-@@ -390,8 +396,8 @@ public class JungleTemplePiece extends ScatteredFeaturePiece {
+@@ -378,8 +384,8 @@ public class JungleTemplePiece extends ScatteredFeaturePiece {
this.placeBlock(level, Blocks.STICKY_PISTON.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.WEST), 10, -2, 8, box);
this.placeBlock(level, Blocks.STICKY_PISTON.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.WEST), 10, -1, 8, box);
this.placeBlock(level, Blocks.REPEATER.defaultBlockState().setValue(RepeaterBlock.FACING, Direction.NORTH), 10, -2, 10, box);
@@ -2946,10 +2934,10 @@ index 82600a247e13b82fc56273e1fd8483c8102a8d3d..cd9b24f017ebea5df55c7d15ee3d793a
}
}
diff --git a/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java b/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java
-index 1acd506f7c0679fa9f69b6ab221002b28d00c3e5..52237559477e1965cb13a94ee4e6b4ff2ee99b03 100644
+index 53d3bf1d2a1debe46e276b1db25b420be4ad9958..5212e4a4392efa0171c9d709dc2606a4e14df07f 100644
--- a/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java
+++ b/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java
-@@ -95,7 +95,7 @@ public class MineshaftPieces {
+@@ -91,7 +91,7 @@ public class MineshaftPieces {
public static class MineShaftCorridor extends MineshaftPieces.MineShaftPiece {
private final boolean hasRails;
private final boolean spiderCorridor;
@@ -2958,7 +2946,7 @@ index 1acd506f7c0679fa9f69b6ab221002b28d00c3e5..52237559477e1965cb13a94ee4e6b4ff
private final int numSections;
public MineShaftCorridor(CompoundTag tag) {
-@@ -954,7 +954,7 @@ public class MineshaftPieces {
+@@ -950,7 +950,7 @@ public class MineshaftPieces {
}
public static class MineShaftRoom extends MineshaftPieces.MineShaftPiece {
@@ -2968,10 +2956,10 @@ index 1acd506f7c0679fa9f69b6ab221002b28d00c3e5..52237559477e1965cb13a94ee4e6b4ff
public MineShaftRoom(int genDepth, RandomSource random, int x, int z, MineshaftStructure.Type type) {
super(
diff --git a/net/minecraft/world/level/levelgen/structure/structures/NetherFortressPieces.java b/net/minecraft/world/level/levelgen/structure/structures/NetherFortressPieces.java
-index 20ddc6403823f72ef15d10e3d53b5f4d13e82724..081fbe004cac5bca67210a1abcca7fa44642f417 100644
+index ae4ffcf1859e8ff7f8fbc91246e66e20f5c33dd7..b9124999f1aede4450f25e25c55bca96077670e8 100644
--- a/net/minecraft/world/level/levelgen/structure/structures/NetherFortressPieces.java
+++ b/net/minecraft/world/level/levelgen/structure/structures/NetherFortressPieces.java
-@@ -1301,7 +1301,7 @@ public class NetherFortressPieces {
+@@ -1112,7 +1112,7 @@ public class NetherFortressPieces {
int i = 0;
for (NetherFortressPieces.PieceWeight pieceWeight : weights) {
@@ -2980,7 +2968,7 @@ index 20ddc6403823f72ef15d10e3d53b5f4d13e82724..081fbe004cac5bca67210a1abcca7fa4
flag = true;
}
-@@ -1341,7 +1341,7 @@ public class NetherFortressPieces {
+@@ -1152,7 +1152,7 @@ public class NetherFortressPieces {
pieceWeight, pieces, random, x, y, z, orientation, genDepth
);
if (netherBridgePiece != null) {
@@ -2989,7 +2977,7 @@ index 20ddc6403823f72ef15d10e3d53b5f4d13e82724..081fbe004cac5bca67210a1abcca7fa4
startPiece.previousPiece = pieceWeight;
if (!pieceWeight.isValid()) {
weights.remove(pieceWeight);
-@@ -1576,7 +1576,7 @@ public class NetherFortressPieces {
+@@ -1387,7 +1387,7 @@ public class NetherFortressPieces {
static class PieceWeight {
public final Class extends NetherFortressPieces.NetherBridgePiece> pieceClass;
public final int weight;
@@ -2998,7 +2986,7 @@ index 20ddc6403823f72ef15d10e3d53b5f4d13e82724..081fbe004cac5bca67210a1abcca7fa4
public final int maxPlaceCount;
public final boolean allowInRow;
-@@ -1592,11 +1592,11 @@ public class NetherFortressPieces {
+@@ -1403,11 +1403,11 @@ public class NetherFortressPieces {
}
public boolean doPlace(int genDepth) {
@@ -3012,7 +3000,7 @@ index 20ddc6403823f72ef15d10e3d53b5f4d13e82724..081fbe004cac5bca67210a1abcca7fa4
}
}
-@@ -1746,24 +1746,24 @@ public class NetherFortressPieces {
+@@ -1545,24 +1545,24 @@ public class NetherFortressPieces {
}
public static class StartPiece extends NetherFortressPieces.BridgeCrossing {
@@ -3043,10 +3031,10 @@ index 20ddc6403823f72ef15d10e3d53b5f4d13e82724..081fbe004cac5bca67210a1abcca7fa4
}
}
diff --git a/net/minecraft/world/level/levelgen/structure/structures/StrongholdPieces.java b/net/minecraft/world/level/levelgen/structure/structures/StrongholdPieces.java
-index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f19819dfd 100644
+index 1f1ee6e2d020cd06184313d19523ea928cf242c8..ab6d51b60cdbaed7ac7395d2a27eadd6d6b4518f 100644
--- a/net/minecraft/world/level/levelgen/structure/structures/StrongholdPieces.java
+++ b/net/minecraft/world/level/levelgen/structure/structures/StrongholdPieces.java
-@@ -63,32 +63,36 @@ public class StrongholdPieces {
+@@ -65,32 +65,36 @@ public class StrongholdPieces {
}
}
};
@@ -3094,7 +3082,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
}
return flag;
-@@ -138,9 +142,11 @@ public class StrongholdPieces {
+@@ -140,9 +144,11 @@ public class StrongholdPieces {
if (!updatePieceWeight()) {
return null;
} else {
@@ -3109,7 +3097,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
if (strongholdPiece != null) {
return strongholdPiece;
}
-@@ -150,9 +156,9 @@ public class StrongholdPieces {
+@@ -152,9 +158,9 @@ public class StrongholdPieces {
while (i < 5) {
i++;
@@ -3121,7 +3109,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
randomInt -= pieceWeight.weight;
if (randomInt < 0) {
if (!pieceWeight.doPlace(genDepth) || pieceWeight == piece.previousPiece) {
-@@ -163,10 +169,10 @@ public class StrongholdPieces {
+@@ -165,10 +171,10 @@ public class StrongholdPieces {
pieceWeight.pieceClass, pieces, random, x, y, z, direction, genDepth
);
if (strongholdPiece1 != null) {
@@ -3134,7 +3122,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
}
return strongholdPiece1;
-@@ -202,7 +208,7 @@ public class StrongholdPieces {
+@@ -204,7 +210,7 @@ public class StrongholdPieces {
private static final int WIDTH = 5;
private static final int HEIGHT = 5;
private static final int DEPTH = 7;
@@ -3143,7 +3131,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
public ChestCorridor(int genDepth, RandomSource random, BoundingBox box, Direction orientation) {
super(StructurePieceType.STRONGHOLD_CHEST_CORRIDOR, genDepth, box);
-@@ -723,7 +729,7 @@ public class StrongholdPieces {
+@@ -690,7 +696,7 @@ public class StrongholdPieces {
static class PieceWeight {
public final Class extends StrongholdPieces.StrongholdPiece> pieceClass;
public final int weight;
@@ -3152,7 +3140,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
public final int maxPlaceCount;
public PieceWeight(Class extends StrongholdPieces.StrongholdPiece> pieceClass, int weight, int maxPlaceCount) {
-@@ -733,11 +739,11 @@ public class StrongholdPieces {
+@@ -700,11 +706,11 @@ public class StrongholdPieces {
}
public boolean doPlace(int genDepth) {
@@ -3166,7 +3154,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
}
}
-@@ -745,7 +751,7 @@ public class StrongholdPieces {
+@@ -712,7 +718,7 @@ public class StrongholdPieces {
protected static final int WIDTH = 11;
protected static final int HEIGHT = 8;
protected static final int DEPTH = 16;
@@ -3175,7 +3163,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
public PortalRoom(int genDepth, BoundingBox box, Direction orientation) {
super(StructurePieceType.STRONGHOLD_PORTAL_ROOM, genDepth, box);
-@@ -1273,7 +1279,7 @@ public class StrongholdPieces {
+@@ -1174,7 +1180,7 @@ public class StrongholdPieces {
@Override
public void addChildren(StructurePiece piece, StructurePieceAccessor pieces, RandomSource random) {
if (this.isSource) {
@@ -3184,7 +3172,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
}
this.generateSmallDoorChildForward((StrongholdPieces.StartPiece)piece, pieces, random, 1, 1);
-@@ -1322,10 +1328,10 @@ public class StrongholdPieces {
+@@ -1223,10 +1229,10 @@ public class StrongholdPieces {
}
public static class StartPiece extends StrongholdPieces.StairsDown {
@@ -3199,7 +3187,7 @@ index b28829043c558af04511108691a4e9042a5afc62..b9d9fe3affd1f991ea3a742bc48a518f
public StartPiece(RandomSource random, int x, int z) {
super(StructurePieceType.STRONGHOLD_START, 0, x, z, getRandomHorizontalDirection(random));
diff --git a/net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces.java b/net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces.java
-index 6c5b6ba8973c88e959d57fec38abcef5f097e9b3..ad44f4915e7a9609445b62664d2a47581de8c169 100644
+index 081fe9509b777bd1f853b662ca8b01c64f27b5e5..9a3d1ed95d201d24374ff15c7a8daa30bc25f777 100644
--- a/net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces.java
+++ b/net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces.java
@@ -126,7 +126,7 @@ public class WoodlandMansionPieces {
@@ -3261,10 +3249,10 @@ index 05027cc20d174d78bef118cd2ba545ac56e1559c..32bbfe48dee44b0b491aa369dec59cbf
private boolean finalizeEntities;
diff --git a/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java b/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
-index ab1dcbe416e2c3c94cfddf04b7ed053425a71806..a37eb2e29b4577ebc711e8ef7b47fbbc3bc66897 100644
+index bb8b5ca9044ecb33687e7f20cfb0acbf55f887c7..df3a1b9ed4ad836bd3358b6b440964e497213ea3 100644
--- a/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
+++ b/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
-@@ -71,8 +71,8 @@ public class StructureTemplate {
+@@ -69,8 +69,8 @@ public class StructureTemplate {
public static final String ENTITY_TAG_BLOCKPOS = "blockPos";
public static final String ENTITY_TAG_NBT = "nbt";
public static final String SIZE_TAG = "size";
@@ -3276,11 +3264,11 @@ index ab1dcbe416e2c3c94cfddf04b7ed053425a71806..a37eb2e29b4577ebc711e8ef7b47fbbc
private String author = "?";
// CraftBukkit start - data containers
diff --git a/net/minecraft/world/ticks/LevelChunkTicks.java b/net/minecraft/world/ticks/LevelChunkTicks.java
-index faf45ac459f7c25309d6ef6dce371d484a0dae7b..0e862e9c0d9d562e77ce02a35deb761c28fa2f90 100644
+index 66d0a6390febe929ef774b0a7813329015bc8cc2..d1917dee4ca6bba5f2c92475811c724caf2948cb 100644
--- a/net/minecraft/world/ticks/LevelChunkTicks.java
+++ b/net/minecraft/world/ticks/LevelChunkTicks.java
-@@ -18,10 +18,10 @@ import net.minecraft.nbt.ListTag;
- import net.minecraft.world.level.ChunkPos;
+@@ -14,10 +14,10 @@ import javax.annotation.Nullable;
+ import net.minecraft.core.BlockPos;
public class LevelChunkTicks implements SerializableTickContainer, TickContainerAccess, ca.spottedleaf.moonrise.patches.chunk_system.ticks.ChunkSystemLevelChunkTicks { // Paper - rewrite chunk system
- private final Queue> tickQueue = new PriorityQueue<>(ScheduledTick.DRAIN_ORDER);
@@ -3292,7 +3280,7 @@ index faf45ac459f7c25309d6ef6dce371d484a0dae7b..0e862e9c0d9d562e77ce02a35deb761c
@Nullable
private BiConsumer, ScheduledTick> onTickAdded;
-@@ -71,10 +71,18 @@ public class LevelChunkTicks implements SerializableTickContainer, TickCon
+@@ -67,10 +67,18 @@ public class LevelChunkTicks implements SerializableTickContainer, TickCon
@Nullable
public ScheduledTick poll() {
@@ -3314,7 +3302,7 @@ index faf45ac459f7c25309d6ef6dce371d484a0dae7b..0e862e9c0d9d562e77ce02a35deb761c
return scheduledTick;
}
-@@ -87,6 +95,7 @@ public class LevelChunkTicks implements SerializableTickContainer, TickCon
+@@ -83,6 +91,7 @@ public class LevelChunkTicks implements SerializableTickContainer, TickCon
}
private void scheduleUnchecked(ScheduledTick tick) {
@@ -3322,7 +3310,7 @@ index faf45ac459f7c25309d6ef6dce371d484a0dae7b..0e862e9c0d9d562e77ce02a35deb761c
this.tickQueue.add(tick);
if (this.onTickAdded != null) {
this.onTickAdded.accept(this, tick);
-@@ -127,6 +136,7 @@ public class LevelChunkTicks implements SerializableTickContainer, TickCon
+@@ -124,6 +133,7 @@ public class LevelChunkTicks implements SerializableTickContainer, TickCon
}
for (ScheduledTick scheduledTick : this.tickQueue) {
@@ -3331,7 +3319,7 @@ index faf45ac459f7c25309d6ef6dce371d484a0dae7b..0e862e9c0d9d562e77ce02a35deb761c
}
diff --git a/net/minecraft/world/ticks/LevelTicks.java b/net/minecraft/world/ticks/LevelTicks.java
-index 0a9805d42142678ca5213c511235daa6505ddbf3..cd73f1a3ccc80e4ab1766147fccc67d81eeb4cc3 100644
+index 0a9805d42142678ca5213c511235daa6505ddbf3..6e3d4e78a7d92a846e68fe60271cfe5a5cd7b569 100644
--- a/net/minecraft/world/ticks/LevelTicks.java
+++ b/net/minecraft/world/ticks/LevelTicks.java
@@ -30,17 +30,18 @@ public class LevelTicks implements LevelTickAccess {
@@ -3398,10 +3386,11 @@ index 0a9805d42142678ca5213c511235daa6505ddbf3..cd73f1a3ccc80e4ab1766147fccc67d8
if (!this.toRunThisTickSet.isEmpty()) {
this.toRunThisTickSet.remove(scheduledTick);
}
-@@ -183,6 +189,7 @@ public class LevelTicks implements LevelTickAccess