9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-22 16:29:26 +00:00

Updated Upstream (Paper)

This commit is contained in:
Martijn Muijsers
2022-12-22 00:58:30 +01:00
parent 7d0ff26770
commit 9e682fdd45
81 changed files with 684 additions and 661 deletions

View File

@@ -16,7 +16,7 @@ repositories {
dependencies { dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.6:fat") remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
decompiler("org.quiltmc:quiltflower:1.8.1") decompiler("net.minecraftforge:forgeflower:2.0.605.1")
paperclip("io.papermc:paperclip:3.0.3-SNAPSHOT") paperclip("io.papermc:paperclip:3.0.3-SNAPSHOT")
} }

View File

@@ -3,6 +3,6 @@ org.gradle.parallel=true
org.gradle.vfs.watch=false org.gradle.vfs.watch=false
group=org.galemc.gale group=org.galemc.gale
version=1.19.2-R0.1-SNAPSHOT version=1.19.3-R0.1-SNAPSHOT
mcVersion=1.19.2 mcVersion=1.19.3
paperRef=476ef25d053c523aea416487a38f72011d72a9cf paperRef=0148283131c900d478a974cfa69085414c0bd424

View File

@@ -13,10 +13,10 @@ As part of: Paper (https://github.com/PaperMC/Paper)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index e43fef0152468944d8a33036344a43e95fe58476..fc0f70f7af8e12347ea67d9985d06c8323b2a3c0 100644 index 2204336d8800311b65e894739ab1b27273e7c6f2..aec6ef7197ed8caec451954727c1f7149491d3f9 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -1967,6 +1967,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -1969,6 +1969,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
{ {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }

View File

@@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 9db611841b73fed8dc8a71f4d7fdef95af3cf89d..7edbcee946bb310bba54720cd47cd21f0a36276d 100644 index b012ce40d82389c29d1b841ff685425ac10a7f9e..7903554958f567c7b566a47fa4b49852a837898e 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -651,6 +651,14 @@ public final class SimplePluginManager implements PluginManager { @@ -653,6 +653,14 @@ public final class SimplePluginManager implements PluginManager {
*/ */
@Override @Override
public void callEvent(@NotNull Event event) { public void callEvent(@NotNull Event event) {
@@ -31,7 +31,7 @@ index 9db611841b73fed8dc8a71f4d7fdef95af3cf89d..7edbcee946bb310bba54720cd47cd21f
// Paper - replace callEvent by merging to below method // Paper - replace callEvent by merging to below method
if (event.isAsynchronous() && server.isPrimaryThread()) { if (event.isAsynchronous() && server.isPrimaryThread()) {
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously."); throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
@@ -658,9 +666,6 @@ public final class SimplePluginManager implements PluginManager { @@ -660,9 +668,6 @@ public final class SimplePluginManager implements PluginManager {
throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously."); throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
} }

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 1e27b9de47f111b9c000243214e22890e323f7fc..9ce603a0c905017f512260de110cf7d8d2097028 100644 index 19995314b01f19c312efa2a4584ccfba2d700c52..0a5b8bd9726fd77ad0b8dd3412d2ef3b6231d46d 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1466,6 +1466,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -1464,6 +1464,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@org.jetbrains.annotations.ApiStatus.Experimental // Paper @org.jetbrains.annotations.ApiStatus.Experimental // Paper
public boolean canSee(@NotNull Entity entity); public boolean canSee(@NotNull Entity entity);

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index fc0f70f7af8e12347ea67d9985d06c8323b2a3c0..f502bf2d511df86bc3c0b6a28682484e07a14120 100644 index aec6ef7197ed8caec451954727c1f7149491d3f9..7d0baa4306fecb79d069a7f5aed81e12a80a1f0e 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -1749,6 +1749,31 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -1751,6 +1751,31 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull @NotNull
public double[] getTPS(); public double[] getTPS();

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index f502bf2d511df86bc3c0b6a28682484e07a14120..ed787f736e36c08e10dfdca204011381123f1949 100644 index 7d0baa4306fecb79d069a7f5aed81e12a80a1f0e..bf387ffaca8e245af1b06adcb73b8a118aeb0263 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -1751,6 +1751,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -1753,6 +1753,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
// Gale start - specific interval TPS API // Gale start - specific interval TPS API

View File

@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
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. 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.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index ed787f736e36c08e10dfdca204011381123f1949..f3eaf734ee6414d8809f8da30de417da6677982c 100644 index bf387ffaca8e245af1b06adcb73b8a118aeb0263..4c519dbd706cac728f31a7ccd99cc1e165812599 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -2180,4 +2180,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -2182,4 +2182,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/ */
@NotNull org.bukkit.potion.PotionBrewer getPotionBrewer(); @NotNull org.bukkit.potion.PotionBrewer getPotionBrewer();
// Paper end // Paper end

View File

@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index b0e4f11e8af4b909a56bb5576d05ef0537fb25f7..3103e811e1f41b782a5b95537b921c59cac2054f 100644 index d5d49bb2b47c889e12d17dc87b8c439a60b3fe67..b7dab09e5cab1098211851ecd9555c9be68071e4 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -7,8 +7,14 @@ plugins { @@ -7,8 +7,14 @@ plugins {
@@ -20,7 +20,7 @@ index b0e4f11e8af4b909a56bb5576d05ef0537fb25f7..3103e811e1f41b782a5b95537b921c59
+ // Depend on own API + // Depend on own API
+ implementation(project(":gale-api")) + implementation(project(":gale-api"))
+ // Depend on Paper MojangAPI + // Depend on Paper MojangAPI
+ implementation("io.papermc.paper:paper-mojangapi:1.19.2-R0.1-SNAPSHOT") { + implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") {
+ exclude("io.papermc.paper", "paper-api") + exclude("io.papermc.paper", "paper-api")
+ } + }
+ // Gale end - project setup + // Gale end - project setup

View File

@@ -7,13 +7,13 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 3103e811e1f41b782a5b95537b921c59cac2054f..c2f60f3f638d8a94046d20ff1dfca316a3395861 100644 index b7dab09e5cab1098211851ecd9555c9be68071e4..977edc4adb5414e83d289cca295baa6bfbadaa52 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -56,6 +56,16 @@ dependencies { @@ -55,6 +55,16 @@ dependencies {
} }
val craftbukkitPackageVersion = "1_19_R1" // Paper val craftbukkitPackageVersion = "1_19_R2" // Paper
+ +
+// Gale start - hide irrelevant compilation warnings +// Gale start - hide irrelevant compilation warnings
+tasks.withType<JavaCompile> { +tasks.withType<JavaCompile> {

View File

@@ -190,10 +190,10 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..e45e6b44b2a8f2cdae6e0048a812b921
.completer(new ConsoleCommandCompleter(this.server)) .completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true); .option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6dc6c3bccb4ba34268a87b0754c87eb1e0df4135..18df8eab2e33a7cde7d12f111d3dbfcaeab3abd5 100644 index 710ca7d3a5659953f64bc6dccdd93b43300961cc..83e161c50f12e10afa481a85001c1d223cba6d89 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -921,7 +921,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -922,7 +922,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
shutdownThread = Thread.currentThread(); shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper org.spigotmc.WatchdogThread.doStop(); // Paper
if (!isSameThread()) { if (!isSameThread()) {
@@ -218,10 +218,10 @@ index 6dc6c3bccb4ba34268a87b0754c87eb1e0df4135..18df8eab2e33a7cde7d12f111d3dbfca
public SystemReport fillSystemReport(SystemReport details) { public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 07eac5439164a7345476c55277538a152359630a..f394324450ec17c8df5a40d27eb0297b091e912f 100644 index 47df6f4268a63118da8187f4102c876bd37d1680..454721406d596f65512eadf0e4b901990490f0c6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -248,7 +248,7 @@ import javax.annotation.Nullable; // Paper @@ -261,7 +261,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server { public final class CraftServer implements Server {
@@ -244,10 +244,10 @@ index cdefb2025eedea7e204d70d568adaf1c1ec4c03c..3997a7fec43e05b455644b4d58c68995
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code) // (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 103ab25119bfcdd21eac7e1deeac025108e3c138..f39c6f0a837c1a8f6477b8be2f6f9f007a15d566 100644 index 17336102d37a5ab05c3b3c93fcf46961d0ffa7e2..f5a7bbf467ce765ecf8ccc9e157bd51bbed72452 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -435,7 +435,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -433,7 +433,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@Override @Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {

View File

@@ -160,7 +160,7 @@ index a0aa1f1a7adf986d500a2135aa42e138aa3c4f08..6d19b985222d78750828fd2719c1fbf7
} }
} }
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index e731de3ac158c5a4cff236c6f5001674cd488a77..ceef4eed87363298816426dfc19f3207be1af682 100644 index 0b6d68350f608bb64a701d0e390283d50f12094e..3088d5f008a8cb5a75f1e11bd80a2614a4c1b75d 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -125,13 +125,13 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor @@ -125,13 +125,13 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -225,7 +225,7 @@ index e731de3ac158c5a4cff236c6f5001674cd488a77..ceef4eed87363298816426dfc19f3207
+ // Gale end - Gale configuration + // Gale end - Gale configuration
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 18df8eab2e33a7cde7d12f111d3dbfcaeab3abd5..121495135676a7de4d1e6b06cb6c77e5523a2b0d 100644 index 83e161c50f12e10afa481a85001c1d223cba6d89..3898e8a92edca52bc7d4e9ac061e24baceaec608 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2,9 +2,6 @@ package net.minecraft.server; @@ -2,9 +2,6 @@ package net.minecraft.server;
@@ -238,7 +238,7 @@ index 18df8eab2e33a7cde7d12f111d3dbfcaeab3abd5..121495135676a7de4d1e6b06cb6c77e5
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -80,7 +77,6 @@ import net.minecraft.server.level.ServerChunkCache; @@ -85,7 +82,6 @@ import net.minecraft.server.level.ServerChunkCache;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.level.ServerPlayerGameMode; import net.minecraft.server.level.ServerPlayerGameMode;
@@ -246,7 +246,7 @@ index 18df8eab2e33a7cde7d12f111d3dbfcaeab3abd5..121495135676a7de4d1e6b06cb6c77e5
import net.minecraft.server.level.progress.ChunkProgressListener; import net.minecraft.server.level.progress.ChunkProgressListener;
import net.minecraft.server.level.progress.ChunkProgressListenerFactory; import net.minecraft.server.level.progress.ChunkProgressListenerFactory;
import net.minecraft.server.network.ServerConnectionListener; import net.minecraft.server.network.ServerConnectionListener;
@@ -104,7 +100,6 @@ import net.minecraft.util.NativeModuleLister; @@ -109,7 +105,6 @@ import net.minecraft.util.NativeModuleLister;
import net.minecraft.util.ProgressListener; import net.minecraft.util.ProgressListener;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.util.SignatureValidator; import net.minecraft.util.SignatureValidator;
@@ -254,7 +254,7 @@ index 18df8eab2e33a7cde7d12f111d3dbfcaeab3abd5..121495135676a7de4d1e6b06cb6c77e5
import net.minecraft.util.datafix.DataFixers; import net.minecraft.util.datafix.DataFixers;
import net.minecraft.util.profiling.EmptyProfileResults; import net.minecraft.util.profiling.EmptyProfileResults;
import net.minecraft.util.profiling.ProfileResults; import net.minecraft.util.profiling.ProfileResults;
@@ -153,6 +148,7 @@ import net.minecraft.world.level.storage.loot.PredicateManager; @@ -164,6 +159,7 @@ import net.minecraft.world.level.storage.loot.PredicateManager;
import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
@@ -262,21 +262,7 @@ index 18df8eab2e33a7cde7d12f111d3dbfcaeab3abd5..121495135676a7de4d1e6b06cb6c77e5
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -170,13 +166,6 @@ import net.minecraft.world.level.levelgen.PhantomSpawner; @@ -304,6 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
import net.minecraft.world.level.levelgen.WorldGenSettings;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.presets.WorldPresets;
-import org.bukkit.Bukkit;
-import org.bukkit.craftbukkit.CraftServer;
-import org.bukkit.craftbukkit.Main;
-import org.bukkit.craftbukkit.generator.CustomWorldChunkManager;
-import org.bukkit.craftbukkit.util.CraftChatMessage;
-import org.bukkit.craftbukkit.util.LazyPlayerSet;
-import org.bukkit.event.player.AsyncPlayerChatPreviewEvent;
import org.bukkit.event.server.ServerLoadEvent;
// CraftBukkit end
@@ -293,6 +282,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final double[] recentTps = new double[ 3 ]; public final double[] recentTps = new double[ 3 ];
// Spigot end // Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
@@ -284,7 +270,7 @@ index 18df8eab2e33a7cde7d12f111d3dbfcaeab3abd5..121495135676a7de4d1e6b06cb6c77e5
public static long currentTickLong = 0L; // Paper public static long currentTickLong = 0L; // Paper
public volatile Thread shutdownThread; // Paper public volatile Thread shutdownThread; // Paper
@@ -395,6 +385,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -407,6 +404,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end // Paper end
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
this.paperConfigurations = services.paperConfigurations(); // Paper this.paperConfigurations = services.paperConfigurations(); // Paper
@@ -337,7 +323,7 @@ index ef6ff78af2ae747e939895b82ee9d11c75012dcd..b445d4562304fec912131ee32c4e0f89
} }
} }
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index ff3eced0e20c39b825586897ee2fed01dd471d88..661794310eb10d4b9fe29c9445abd57826214d41 100644 index 51b3db0b6c2cede95b584268e035c0fb36d38094..98f00bdc85ade95ccbfaa1999c70ac650192345d 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -1,20 +1,15 @@ @@ -1,20 +1,15 @@
@@ -362,7 +348,7 @@ index ff3eced0e20c39b825586897ee2fed01dd471d88..661794310eb10d4b9fe29c9445abd578
import java.util.Locale; import java.util.Locale;
import java.util.Optional; import java.util.Optional;
import java.util.function.BooleanSupplier; import java.util.function.BooleanSupplier;
@@ -213,6 +208,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -208,6 +203,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // Paper - load mappings for stacktrace deobf and etc. io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // Paper - load mappings for stacktrace deobf and etc.
paperConfigurations.initializeGlobalConfiguration(); paperConfigurations.initializeGlobalConfiguration();
paperConfigurations.initializeWorldDefaultsConfiguration(); paperConfigurations.initializeWorldDefaultsConfiguration();
@@ -374,10 +360,10 @@ index ff3eced0e20c39b825586897ee2fed01dd471d88..661794310eb10d4b9fe29c9445abd578
if (this.convertOldUsers()) { if (this.convertOldUsers()) {
this.getProfileCache().save(false); // Paper this.getProfileCache().save(false); // Paper
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 79aa3374fd47cd57d2e0810bb5afebbdb38a1892..6674c1bc0c6df3ad372975432ffac0143def9441 100644 index f3a19d00f78e19aa98c57461efb90d79f656a992..e9c7e0f0c411f4a810c9ab3b846c74353a6ef815 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -125,12 +125,10 @@ import net.minecraft.world.level.chunk.storage.EntityStorage; @@ -128,12 +128,10 @@ import net.minecraft.world.level.chunk.storage.EntityStorage;
import net.minecraft.world.level.dimension.BuiltinDimensionTypes; import net.minecraft.world.level.dimension.BuiltinDimensionTypes;
import net.minecraft.world.level.dimension.LevelStem; import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.dimension.end.EndDragonFight; import net.minecraft.world.level.dimension.end.EndDragonFight;
@@ -389,18 +375,18 @@ index 79aa3374fd47cd57d2e0810bb5afebbdb38a1892..6674c1bc0c6df3ad372975432ffac014
-import net.minecraft.world.level.entity.PersistentEntitySectionManager; -import net.minecraft.world.level.entity.PersistentEntitySectionManager;
import net.minecraft.world.level.gameevent.DynamicGameEventListener; import net.minecraft.world.level.gameevent.DynamicGameEventListener;
import net.minecraft.world.level.gameevent.GameEvent; import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.gameevent.GameEventListener; import net.minecraft.world.level.gameevent.GameEventDispatcher;
@@ -526,7 +524,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -529,7 +527,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// Holder holder = worlddimension.typeHolder(); // CraftBukkit - decompile error // Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
- super(iworlddataserver, resourcekey, worlddimension.typeHolder(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor - super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor
+ super(iworlddataserver, resourcekey, worlddimension.typeHolder(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration + super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration
this.pvpMode = minecraftserver.isPvpAllowed(); this.pvpMode = minecraftserver.isPvpAllowed();
this.convertable = convertable_conversionsession; this.convertable = convertable_conversionsession;
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 596fb8ee21ba8450db13a11890d241ef3974d81d..756e0ef8fa2226812c3322d1fe605c60132b01df 100644 index 3cbf801b2e5420c0e870f73788deb550e49ad54d..6b5740e4e73a753c9516d7cbde575c1826afa22a 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,10 +1,7 @@ @@ -1,10 +1,7 @@
@@ -422,7 +408,7 @@ index 596fb8ee21ba8450db13a11890d241ef3974d81d..756e0ef8fa2226812c3322d1fe605c60
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.Holder; import net.minecraft.core.Holder;
@@ -40,8 +36,6 @@ import net.minecraft.util.profiling.ProfilerFiller; @@ -42,8 +38,6 @@ import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.world.DifficultyInstance; import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
@@ -431,7 +417,7 @@ index 596fb8ee21ba8450db13a11890d241ef3974d81d..756e0ef8fa2226812c3322d1fe605c60
import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@@ -90,17 +84,15 @@ import net.minecraft.network.protocol.game.ClientboundSetBorderSizePacket; @@ -89,17 +83,15 @@ import net.minecraft.network.protocol.game.ClientboundSetBorderSizePacket;
import net.minecraft.network.protocol.game.ClientboundSetBorderWarningDelayPacket; import net.minecraft.network.protocol.game.ClientboundSetBorderWarningDelayPacket;
import net.minecraft.network.protocol.game.ClientboundSetBorderWarningDistancePacket; import net.minecraft.network.protocol.game.ClientboundSetBorderWarningDistancePacket;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@@ -450,7 +436,7 @@ index 596fb8ee21ba8450db13a11890d241ef3974d81d..756e0ef8fa2226812c3322d1fe605c60
// CraftBukkit end // CraftBukkit end
public abstract class Level implements LevelAccessor, AutoCloseable { public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -172,6 +164,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -171,6 +163,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return this.paperConfig; return this.paperConfig;
} }
// Paper end // Paper end
@@ -463,7 +449,7 @@ index 596fb8ee21ba8450db13a11890d241ef3974d81d..756e0ef8fa2226812c3322d1fe605c60
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final co.aikar.timings.WorldTimingsHandler timings; // Paper public final co.aikar.timings.WorldTimingsHandler timings; // Paper
@@ -271,9 +269,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -270,9 +268,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey(); public abstract ResourceKey<LevelStem> getTypeKey();
@@ -476,10 +462,10 @@ index 596fb8ee21ba8450db13a11890d241ef3974d81d..756e0ef8fa2226812c3322d1fe605c60
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f394324450ec17c8df5a40d27eb0297b091e912f..f63cadbecb126e58ededb61e87e600b7701df57b 100644 index 454721406d596f65512eadf0e4b901990490f0c6..0addf9c9db5895aaca03dc1781ed76e5ef5fd334 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -966,6 +966,7 @@ public final class CraftServer implements Server { @@ -979,6 +979,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console); this.console.paperConfigurations.reloadConfigs(this.console);
@@ -487,7 +473,7 @@ index f394324450ec17c8df5a40d27eb0297b091e912f..f63cadbecb126e58ededb61e87e600b7
for (ServerLevel world : this.console.getAllLevels()) { for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -2736,6 +2737,14 @@ public final class CraftServer implements Server { @@ -2760,6 +2761,14 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
} }
@@ -504,10 +490,10 @@ index f394324450ec17c8df5a40d27eb0297b091e912f..f63cadbecb126e58ededb61e87e600b7
org.spigotmc.RestartCommand.restart(); org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java b/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java b/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..51d37d9f9f0901b3f6dc702ad17158039ee96ebe index 0000000000000000000000000000000000000000..69acbab61a79c24312359a63086f9353d740113f
--- /dev/null --- /dev/null
+++ b/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java +++ b/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java
@@ -0,0 +1,291 @@ @@ -0,0 +1,292 @@
+// Gale - Gale configuration +// Gale - Gale configuration
+ +
+package org.galemc.gale.configuration; +package org.galemc.gale.configuration;
@@ -543,6 +529,7 @@ index 0000000000000000000000000000000000000000..51d37d9f9f0901b3f6dc702ad1715803
+import it.unimi.dsi.fastutil.objects.Reference2LongMap; +import it.unimi.dsi.fastutil.objects.Reference2LongMap;
+import it.unimi.dsi.fastutil.objects.Reference2LongOpenHashMap; +import it.unimi.dsi.fastutil.objects.Reference2LongOpenHashMap;
+import net.minecraft.core.Registry; +import net.minecraft.core.Registry;
+import net.minecraft.core.registries.Registries;
+import net.minecraft.server.MinecraftServer; +import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerLevel;
+import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.EntityType;
@@ -702,10 +689,10 @@ index 0000000000000000000000000000000000000000..51d37d9f9f0901b3f6dc702ad1715803
+ .register(Duration.SERIALIZER) + .register(Duration.SERIALIZER)
+ .register(EngineMode.SERIALIZER) + .register(EngineMode.SERIALIZER)
+ .register(FallbackValueSerializer.create(contextMap.require(PaperConfigurations.SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get(), MinecraftServer::getServer)) + .register(FallbackValueSerializer.create(contextMap.require(PaperConfigurations.SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get(), MinecraftServer::getServer))
+ .register(new RegistryValueSerializer<>(new TypeToken<EntityType<?>>() {}, Registry.ENTITY_TYPE_REGISTRY, true)) + .register(new RegistryValueSerializer<>(new TypeToken<EntityType<?>>() {}, Registries.ENTITY_TYPE, true))
+ .register(new RegistryValueSerializer<>(Item.class, Registry.ITEM_REGISTRY, true)) + .register(new RegistryValueSerializer<>(Item.class, Registries.ITEM, true))
+ .register(new RegistryHolderSerializer<>(new TypeToken<ConfiguredFeature<?, ?>>() {}, Registry.CONFIGURED_FEATURE_REGISTRY, false)) + .register(new RegistryHolderSerializer<>(new TypeToken<ConfiguredFeature<?, ?>>() {}, Registries.CONFIGURED_FEATURE, false))
+ .register(new RegistryHolderSerializer<>(Item.class, Registry.ITEM_REGISTRY, true)) + .register(new RegistryHolderSerializer<>(Item.class, Registries.ITEM, true))
+ ) + )
+ ); + );
+ } + }

View File

@@ -13,10 +13,10 @@ As part of: Paper (https://github.com/PaperMC/Paper)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 661794310eb10d4b9fe29c9445abd57826214d41..d2b14c65e6a925ba4a29d48bcedc0d9504092052 100644 index 98f00bdc85ade95ccbfaa1999c70ac650192345d..9c3ccbbd657d1605b8fabb6e01c11ff31f39a17e 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -50,6 +50,7 @@ import net.minecraft.world.level.GameRules; @@ -45,6 +45,7 @@ import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.GameType; import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.entity.SkullBlockEntity; import net.minecraft.world.level.block.entity.SkullBlockEntity;
import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.LevelStorageSource;
@@ -24,7 +24,7 @@ index 661794310eb10d4b9fe29c9445abd57826214d41..d2b14c65e6a925ba4a29d48bcedc0d95
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -221,6 +222,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -216,6 +217,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash);
thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized
io.papermc.paper.command.PaperCommands.registerCommands(this); io.papermc.paper.command.PaperCommands.registerCommands(this);

View File

@@ -40,10 +40,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 11d7c42d65b91bf57b7bba7812aa17e60e018c67..60f27cff9d03b5d09621b9daf428a00a916a4579 100644 index 9e075de3542bda8ae086c9ca68bcd00b16d565d0..a635319daf8b9a7de45c080ce71c24a90530c45b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3622,7 +3622,7 @@ public abstract class LivingEntity extends Entity { @@ -3647,7 +3647,7 @@ public abstract class LivingEntity extends Entity {
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
// Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists // Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
@@ -74,10 +74,10 @@ index d1eefa6ef3e9abfe7af4d8310aa64465fa2d5463..c970be55461f3063ec22ec0490781b97
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) { default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
// Paper start - Prevent raytrace from loading chunks // Paper start - Prevent raytrace from loading chunks
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 756e0ef8fa2226812c3322d1fe605c60132b01df..fbc55bb3bbde16a70bce38cb73f69867dce44a98 100644 index 6b5740e4e73a753c9516d7cbde575c1826afa22a..dde088d4ad90a63adc480492be42bc2dfc0f0cf7 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -407,6 +407,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -406,6 +406,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return null; return null;
} }

View File

@@ -37,25 +37,26 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
index ffe5476d8ed15ee4384b679c341688787205ce59..283aa4fe50c25ea272de2d7ec3826cd913b4c661 100644 index e7c06d98532160499f2610f69de27e30a326b16f..548f960a4cb3f0f023534c6ba22cbd5e48d863c4 100644
--- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java --- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
@@ -25,8 +25,14 @@ public class ShapelessRecipe implements CraftingRecipe { @@ -26,8 +26,15 @@ public class ShapelessRecipe implements CraftingRecipe {
final String group; final CraftingBookCategory category;
final ItemStack result; final ItemStack result;
final NonNullList<Ingredient> ingredients; final NonNullList<Ingredient> ingredients;
+ private final boolean isBukkit; // Gale - Airplane - simpler ShapelessRecipe comparison for vanilla + private final boolean isBukkit; // Gale - Airplane - simpler ShapelessRecipe comparison for vanilla
public ShapelessRecipe(ResourceLocation id, String group, ItemStack output, NonNullList<Ingredient> input) { public ShapelessRecipe(ResourceLocation id, String group, CraftingBookCategory category, ItemStack output, NonNullList<Ingredient> input) {
+ // Gale start - Airplane - simpler ShapelessRecipe comparison for vanilla + // Gale start - Airplane - simpler ShapelessRecipe comparison for vanilla
+ this(id, group, output, input, false); + this(id, group, category, output, input, false);
+ } + }
+ public ShapelessRecipe(ResourceLocation id, String group, ItemStack output, NonNullList<Ingredient> input, boolean isBukkit) { this.isBukkit = isBukkit; + public ShapelessRecipe(ResourceLocation id, String group, CraftingBookCategory category, ItemStack output, NonNullList<Ingredient> input, boolean isBukkit) {
+ this.isBukkit = isBukkit;
+ // Gale end - Airplane - simpler ShapelessRecipe comparison for vanilla + // Gale end - Airplane - simpler ShapelessRecipe comparison for vanilla
this.id = id; this.id = id;
this.group = group; this.group = group;
this.result = output; this.category = category;
@@ -73,6 +79,28 @@ public class ShapelessRecipe implements CraftingRecipe { @@ -81,6 +88,28 @@ public class ShapelessRecipe implements CraftingRecipe {
} }
public boolean matches(CraftingContainer inventory, Level world) { public boolean matches(CraftingContainer inventory, Level world) {
@@ -85,14 +86,15 @@ index ffe5476d8ed15ee4384b679c341688787205ce59..283aa4fe50c25ea272de2d7ec3826cd9
int i = 0; int i = 0;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
index 0b3b46348ac9195bff1492ffc11fcbff7d3f5c6f..a7ecaae493b937d764fcecb78b182cf36ea92afa 100644 index f7ea77dd82d978ad307f99c743efacfb34478b3d..965c38b2539258f12b06ab21d248ee09e266bb1d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
@@ -43,6 +43,6 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe @@ -44,6 +44,7 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe
data.set(i, toNMS(ingred.get(i), true)); data.set(i, toNMS(ingred.get(i), true));
} }
- MinecraftServer.getServer().getRecipeManager().addRecipe(new net.minecraft.world.item.crafting.ShapelessRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), CraftItemStack.asNMSCopy(this.getResult()), data)); - MinecraftServer.getServer().getRecipeManager().addRecipe(new net.minecraft.world.item.crafting.ShapelessRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data));
+ MinecraftServer.getServer().getRecipeManager().addRecipe(new net.minecraft.world.item.crafting.ShapelessRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), CraftItemStack.asNMSCopy(this.getResult()), data, true)); // Gale - Airplane - simpler ShapelessRecipe comparison for vanilla + MinecraftServer.getServer().getRecipeManager().addRecipe(new net.minecraft.world.item.crafting.ShapelessRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data, true)); // Gale - Airplane - simpler ShapelessRecipe comparison for vanilla
+
} }
} }

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index 713c11d6547cb02ac4b6a02aec07a8ba68019f3f..ea23e771ab2b77e8001d0eaaf834423353ef70c2 100644 index 66476b33cede1e44db5ec166a0cea81f82ffe47a..9948cc4c65d5681c171b38cdf7cf3e63a01e4364 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -42,6 +42,44 @@ public abstract class Projectile extends Entity { @@ -43,6 +43,44 @@ public abstract class Projectile extends Entity {
super(type, world); super(type, world);
} }

View File

@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
index def01d221f36d71640bf4ef982a984909aacc6da..2180277e77311a0bf087186d3fca8f67052af121 100644 index 320c558bbe80d4bbc641e895ec43cfa2b45e8d70..c4c048fffd3fb6bcce99cb46c09435b17ed075af 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -28,6 +28,7 @@ import net.minecraft.world.level.LevelAccessor; @@ -28,6 +28,7 @@ import net.minecraft.world.level.LevelAccessor;
@@ -42,7 +42,7 @@ index def01d221f36d71640bf4ef982a984909aacc6da..2180277e77311a0bf087186d3fca8f67
public class Bat extends AmbientCreature { public class Bat extends AmbientCreature {
@@ -253,12 +254,25 @@ public class Bat extends AmbientCreature { @@ -256,12 +257,25 @@ public class Bat extends AmbientCreature {
} }
} }

View File

@@ -19,7 +19,7 @@ require it to be initialized earlier. By moving it to the superclass, we
initialize it earlier, ensuring that it is available sooner. initialize it earlier, ensuring that it is available sooner.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 6674c1bc0c6df3ad372975432ffac0143def9441..5b4f34f255747048393cbb84b607090b9907c0ad 100644 index e9c7e0f0c411f4a810c9ab3b846c74353a6ef815..2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -793,7 +793,6 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -793,7 +793,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -31,10 +31,10 @@ index 6674c1bc0c6df3ad372975432ffac0143def9441..5b4f34f255747048393cbb84b607090b
public void tickChunk(LevelChunk chunk, int randomTickSpeed) { public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index fbc55bb3bbde16a70bce38cb73f69867dce44a98..76a6e5d1230e2f68f7ff9c0e3f54762050f24f03 100644 index dde088d4ad90a63adc480492be42bc2dfc0f0cf7..89f0914a2cc4e06363a0fb63774efc484ebcdab0 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -180,6 +180,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -179,6 +179,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here

View File

@@ -52,10 +52,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 4ff563d903633f181e1268daa77f250cfec204a0..4654995f9982e77abe4b825b32312c2913671cd4 100644 index ca84eddbdb1e198b899750e5f6b3eafd25ce970f..5b8260b6a309bd1aba2286e8c1f8cfc44326adbd 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -702,6 +702,7 @@ public class ServerChunkCache extends ChunkSource { @@ -703,6 +703,7 @@ public class ServerChunkCache extends ChunkSource {
ProfilerFiller gameprofilerfiller = this.level.getProfiler(); ProfilerFiller gameprofilerfiller = this.level.getProfiler();
gameprofilerfiller.push("pollingChunks"); gameprofilerfiller.push("pollingChunks");
@@ -64,7 +64,7 @@ index 4ff563d903633f181e1268daa77f250cfec204a0..4654995f9982e77abe4b825b32312c29
boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5b4f34f255747048393cbb84b607090b9907c0ad..ff83ad8f61fc6ae251501b7764373b7745b69d33 100644 index 2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2..aeaa5c08e8694b353b33f95e2973e6c38bc280a0 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -795,6 +795,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -795,6 +795,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -85,17 +85,17 @@ index 5b4f34f255747048393cbb84b607090b9907c0ad..ff83ad8f61fc6ae251501b7764373b77
blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
@@ -829,7 +831,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -835,7 +837,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
gameprofilerfiller.popPush("iceandsnow"); gameprofilerfiller.popPush("iceandsnow");
int l;
- if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow - if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
+ if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Gale - Airplane - optimize random calls in chunk ticking - optimize further random ticking + if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Gale - Airplane - optimize random calls in chunk ticking - optimize further random ticking
// Paper start - optimise chunk ticking // Paper start - optimise chunk ticking
this.getRandomBlockPosition(j, 0, k, 15, blockposition); this.getRandomBlockPosition(j, 0, k, 15, blockposition);
int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15) + 1; int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15) + 1;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 5e54cf312160e537d2fe6e6fedc618160359330e..e4da6ac80c0cef156d9c8e1ca77be42033622646 100644 index 28e4b302284f955a73e75d0f4276d55fb51826f5..9279e4fe06178528c2df539ca2dbf9e830ac787c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -88,6 +88,18 @@ public class LevelChunk extends ChunkAccess { @@ -88,6 +88,18 @@ public class LevelChunk extends ChunkAccess {

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
index f22e615dba31619c97bf58930da060476a52facf..f9b34853c8c37bf622f30c40b795929c05aac725 100644 index f4002ac7cba7d5e41b4f11b98212c625f6a92a65..2c141026c1ad03b408b607f6eb18b991d7b65211 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -317,11 +317,17 @@ public class EnderMan extends Monster implements NeutralMob { @@ -322,11 +322,17 @@ public class EnderMan extends Monster implements NeutralMob {
private boolean teleport(double x, double y, double z) { private boolean teleport(double x, double y, double z) {
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z); BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z);

View File

@@ -31,21 +31,45 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
index 43243537b765a2d270be6de3f053fea77ff67d18..ea6424d5e70470ffdcff689b58688cf665c940b2 100644 index d4c91e0a0c64fcb7f1145de3f30134cb1f1f8ee6..aed7e9affaae1e0d1e3324a41e5818435f76fd0f 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java --- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
@@ -65,7 +65,10 @@ public class AcquirePoi extends Behavior<PathfinderMob> { @@ -13,6 +13,7 @@ import net.minecraft.core.BlockPos;
this.nextScheduledStart = entity.level.getGameTime() + (long)world.random.nextInt(20); import net.minecraft.core.GlobalPos;
import net.minecraft.core.Holder;
import net.minecraft.network.protocol.game.DebugPackets;
+import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.PathfinderMob;
@@ -26,6 +27,13 @@ import org.apache.commons.lang3.mutable.MutableLong;
public class AcquirePoi {
public static final int SCAN_RANGE = 48;
+ // Gale start - Airplane - reduce acquire POI for stuck entities
+ public static void addAdditionalTimeToMutableLongIfEntityIsStuck(MutableLong mutableLong, ServerLevel world, PathfinderMob entity) {
+ long stuckEntityAdditionalWaitTime = world.galeConfig().smallOptimizations.reducedIntervals.acquirePoiForStuckEntity;
+ mutableLong.add(stuckEntityAdditionalWaitTime <= 0L ? 0L : entity.getNavigation().isStuck() ? stuckEntityAdditionalWaitTime : 0L);
+ }
+ // Gale end - Airplane - reduce acquire POI for stuck entities
+
public static BehaviorControl<PathfinderMob> create(Predicate<Holder<PoiType>> poiPredicate, MemoryModuleType<GlobalPos> poiPosModule, boolean onlyRunIfChild, Optional<Byte> entityStatus) {
return create(poiPredicate, poiPosModule, poiPosModule, onlyRunIfChild, entityStatus);
}
@@ -42,11 +50,13 @@ public class AcquirePoi {
return false;
} else if (mutableLong.getValue() == 0L) {
mutableLong.setValue(world.getGameTime() + (long)world.random.nextInt(20));
+ addAdditionalTimeToMutableLongIfEntityIsStuck(mutableLong, world, entity); // Gale - Airplane - reduce acquire POI for stuck entities
return false;
} else if (world.getGameTime() < mutableLong.getValue()) {
return false; return false;
} else { } else {
- return world.getGameTime() >= this.nextScheduledStart; mutableLong.setValue(time + 20L + (long)world.getRandom().nextInt(20));
+ // Gale start - Airplane - reduce acquire POI for stuck entities + addAdditionalTimeToMutableLongIfEntityIsStuck(mutableLong, world, entity); // Gale - Airplane - reduce acquire POI for stuck entities
+ long stuckEntityAdditionalWaitTime = world.galeConfig().smallOptimizations.reducedIntervals.acquirePoiForStuckEntity; PoiManager poiManager = world.getPoiManager();
+ return world.getGameTime() >= this.nextScheduledStart + (stuckEntityAdditionalWaitTime <= 0L ? 0L : entity.getNavigation().isStuck() ? stuckEntityAdditionalWaitTime : 0L); long2ObjectMap.long2ObjectEntrySet().removeIf((entry) -> {
+ // Gale end - Airplane - reduce acquire POI for stuck entities return !entry.getValue().isStillValid(time);
}
}
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
index a83675d8d2f94a8e73cc2c7fa11d0aaf6f78be2c..b993c2276d14c0a384898e9705a1af6fa6d585cf 100644 index a83675d8d2f94a8e73cc2c7fa11d0aaf6f78be2c..b993c2276d14c0a384898e9705a1af6fa6d585cf 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java

View File

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

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 60f27cff9d03b5d09621b9daf428a00a916a4579..6fa0f38aff0c5f4ea4961cabf070b8c6463a4a22 100644 index a635319daf8b9a7de45c080ce71c24a90530c45b..1ef947f46f63589ce0e11c8db357cb817eecbbd2 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1921,6 +1921,20 @@ public abstract class LivingEntity extends Entity { @@ -1934,6 +1934,20 @@ public abstract class LivingEntity extends Entity {
return this.lastClimbablePos; return this.lastClimbablePos;
} }

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 121495135676a7de4d1e6b06cb6c77e5523a2b0d..134c8b2acfaa2a8d7cd9a26a85ee4d0227f1a2cd 100644 index 3898e8a92edca52bc7d4e9ac061e24baceaec608..4e2cb2923d1d2a337ffda5b1990d5c9caf47b779 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -149,6 +149,7 @@ import net.minecraft.world.phys.Vec2; @@ -160,6 +160,7 @@ import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.galemc.gale.configuration.GaleConfigurations; import org.galemc.gale.configuration.GaleConfigurations;
@@ -42,7 +42,7 @@ index 121495135676a7de4d1e6b06cb6c77e5523a2b0d..134c8b2acfaa2a8d7cd9a26a85ee4d02
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -2230,6 +2231,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2243,6 +2244,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public ProfilerFiller getProfiler() { public ProfilerFiller getProfiler() {
@@ -55,10 +55,10 @@ index 121495135676a7de4d1e6b06cb6c77e5523a2b0d..134c8b2acfaa2a8d7cd9a26a85ee4d02
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 76a6e5d1230e2f68f7ff9c0e3f54762050f24f03..3e4f2b6a5c269df2bb64f879dd75731c2af227e7 100644 index 89f0914a2cc4e06363a0fb63774efc484ebcdab0..3adad35d0e63091a53e639c7027ec784d18bc4e7 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -92,6 +92,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData; @@ -91,6 +91,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.util.CraftSpawnCategory; import org.bukkit.craftbukkit.util.CraftSpawnCategory;
import org.bukkit.entity.SpawnCategory; import org.bukkit.entity.SpawnCategory;
import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.block.BlockPhysicsEvent;
@@ -66,7 +66,7 @@ index 76a6e5d1230e2f68f7ff9c0e3f54762050f24f03..3e4f2b6a5c269df2bb64f879dd75731c
import org.galemc.gale.configuration.GaleWorldConfiguration; import org.galemc.gale.configuration.GaleWorldConfiguration;
// CraftBukkit end // CraftBukkit end
@@ -1474,6 +1475,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1536,6 +1537,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
public ProfilerFiller getProfiler() { public ProfilerFiller getProfiler() {

View File

@@ -31,18 +31,18 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 2c500cfdd594e24b039d698bced1f9f9537722e3..e660a84251bc67435e905aacf628a84156b5d689 100644 index 663c1d8c1611af915a1bae733920dd75ad73feb1..19bdb2c717718f074ab2b4c5fb934ea29dd80c53 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java --- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java +++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -91,6 +91,7 @@ public class GameRules { @@ -98,6 +98,7 @@ public class GameRules {
public static final GameRules.Key<GameRules.BooleanValue> RULE_UNIVERSAL_ANGER = GameRules.register("universalAnger", GameRules.Category.MOBS, GameRules.BooleanValue.create(false)); public static final GameRules.Key<GameRules.BooleanValue> RULE_LAVA_SOURCE_CONVERSION = GameRules.register("lavaSourceConversion", GameRules.Category.UPDATES, GameRules.BooleanValue.create(false));
public static final GameRules.Key<GameRules.IntegerValue> RULE_PLAYERS_SLEEPING_PERCENTAGE = GameRules.register("playersSleepingPercentage", GameRules.Category.PLAYER, GameRules.IntegerValue.create(100)); public static final GameRules.Key<GameRules.BooleanValue> RULE_GLOBAL_SOUND_EVENTS = GameRules.register("globalSoundEvents", GameRules.Category.MISC, GameRules.BooleanValue.create(true));
private final Map<GameRules.Key<?>, GameRules.Value<?>> rules; private final Map<GameRules.Key<?>, GameRules.Value<?>> rules;
+ private final GameRules.Value<?>[] gameruleArray; // Gale - Airplane - use array for gamerule storage + private final GameRules.Value<?>[] gameruleArray; // Gale - Airplane - use array for gamerule storage
private static <T extends GameRules.Value<T>> GameRules.Key<T> register(String name, GameRules.Category category, GameRules.Type<T> type) { private static <T extends GameRules.Value<T>> GameRules.Key<T> register(String name, GameRules.Category category, GameRules.Type<T> type) {
GameRules.Key<T> gamerules_gamerulekey = new GameRules.Key<>(name, category); GameRules.Key<T> gamerules_gamerulekey = new GameRules.Key<>(name, category);
@@ -109,17 +110,33 @@ public class GameRules { @@ -116,17 +117,33 @@ public class GameRules {
} }
public GameRules() { public GameRules() {
@@ -79,7 +79,7 @@ index 2c500cfdd594e24b039d698bced1f9f9537722e3..e660a84251bc67435e905aacf628a841
} }
public CompoundTag createTag() { public CompoundTag createTag() {
@@ -178,6 +195,10 @@ public class GameRules { @@ -185,6 +202,10 @@ public class GameRules {
} }
public static final class Key<T extends GameRules.Value<T>> { public static final class Key<T extends GameRules.Value<T>> {

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 2358bb1788cfb902bac9b3b7588954af2d2cd823..1392c2e7487a2317496c48a013a745b02c8123d3 100644 index 190e9761087baec5827d722a8281f0ffb6798341..590b756842f5f9d1c2f0aed6517f9b46e3dc74db 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -166,6 +166,7 @@ public class ServerEntity { @@ -170,6 +170,7 @@ public class ServerEntity {
boolean flag4 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L; boolean flag4 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
if (!flag4 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround() && !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync if (!flag4 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround() && !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync
@@ -42,7 +42,7 @@ index 2358bb1788cfb902bac9b3b7588954af2d2cd823..1392c2e7487a2317496c48a013a745b0
if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) { if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) {
if (flag2) { if (flag2) {
packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.isOnGround()); packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.isOnGround());
@@ -175,6 +176,7 @@ public class ServerEntity { @@ -179,6 +180,7 @@ public class ServerEntity {
} else { } else {
packet1 = new ClientboundMoveEntityPacket.PosRot(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), (byte) i, (byte) j, this.entity.isOnGround()); packet1 = new ClientboundMoveEntityPacket.PosRot(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), (byte) i, (byte) j, this.entity.isOnGround());
} }

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index c8d8fdef7b8abc0f59b7d19462825ae30c8d4f48..298b7b2d2e306a22a511a56934fd985cb5d9f7de 100644 index f0ccdfbd7d7be8c6e302609accf8fe9cac8885c4..893eb4904df79a5fc629a0fc7a0c018548eeffb1 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -257,10 +257,16 @@ public class ItemEntity extends Entity { @@ -255,10 +255,16 @@ public class ItemEntity extends Entity {
if (entityitem.isMergable()) { if (entityitem.isMergable()) {
// Paper Start - Fix items merging through walls // Paper Start - Fix items merging through walls
if (this.level.paperConfig().fixes.fixItemsMergingThroughWalls) { if (this.level.paperConfig().fixes.fixItemsMergingThroughWalls) {

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 3e4f2b6a5c269df2bb64f879dd75731c2af227e7..66b2cde3be8109a881095ee5758542b70af10c1a 100644 index 3adad35d0e63091a53e639c7027ec784d18bc4e7..0ba38fddff7b3751d652d1148f993453164e2034 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -272,6 +272,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -271,6 +271,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey(); public abstract ResourceKey<LevelStem> getTypeKey();
@@ -50,7 +50,7 @@ index 3e4f2b6a5c269df2bb64f879dd75731c2af227e7..66b2cde3be8109a881095ee5758542b7
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
@@ -295,6 +304,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -294,6 +303,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}); });
final DimensionType dimensionmanager = (DimensionType) holder.value(); final DimensionType dimensionmanager = (DimensionType) holder.value();

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 7c7408b9686c8ff945c30892d45914c60f6c5e4a..64065317ca2fc166db317402de9b9f8f88358721 100644 index 01b21f520ef1c834b9bafc3de85c1fa4fcf539d6..6c5ff935adb434a67a8425f3b8b7335fbad92a43 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -415,13 +415,14 @@ public final class NaturalSpawner { @@ -417,13 +417,14 @@ public final class NaturalSpawner {
} }
} }

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 55d8ced734a408c990c6c4fbc81707bcb1f27daa..de844a1fefa9d4d0da6db105565cbb37f52de8c4 100644 index 2212f9f48636357265d8e44aba415ea4f09f1fe7..eea6753afdd7e9d52746d0decb5cde63044012b5 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1589,8 +1589,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1624,8 +1624,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance); return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
} }
@@ -65,7 +65,7 @@ index 55d8ced734a408c990c6c4fbc81707bcb1f27daa..de844a1fefa9d4d0da6db105565cbb37
Iterator iterator = this.entity.getIndirectPassengers().iterator(); Iterator iterator = this.entity.getIndirectPassengers().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -1602,6 +1624,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1637,6 +1659,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
i = j; i = j;
} }
} }

View File

@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 81ebee2362550c9193b70b4d2c3454f7b01c0e3e..5a8d3cd8e3c1a4e901d321aab11698aed328b8bb 100644 index 23ce63b70605fb672b56da55cf33b8e5a7566a94..e00c6d14d33b0b32ee77f68d5fc4b6fbc15e024a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -413,6 +413,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -413,6 +413,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -43,10 +43,10 @@ index 81ebee2362550c9193b70b4d2c3454f7b01c0e3e..5a8d3cd8e3c1a4e901d321aab11698ae
return this.yRot; return this.yRot;
} }
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 692524a69d43dcf52ae1b0f7f593fc53f3878137..81eb5e47715312afbedce0786e9a0d4264d32cbd 100644 index dd1102d5291ef6f18e82400a6d8a0a376cc071e9..d1602af2d6e5d4dd8d8b44ab66bca39c60195093 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -22,9 +22,11 @@ public class AttributeMap { @@ -23,9 +23,11 @@ public class AttributeMap {
private final Map<Attribute, AttributeInstance> attributes = Maps.newHashMap(); private final Map<Attribute, AttributeInstance> attributes = Maps.newHashMap();
private final Set<AttributeInstance> dirtyAttributes = Sets.newHashSet(); private final Set<AttributeInstance> dirtyAttributes = Sets.newHashSet();
private final AttributeSupplier supplier; private final AttributeSupplier supplier;
@@ -58,7 +58,7 @@ index 692524a69d43dcf52ae1b0f7f593fc53f3878137..81eb5e47715312afbedce0786e9a0d42
} }
private void onAttributeModified(AttributeInstance instance) { private void onAttributeModified(AttributeInstance instance) {
@@ -44,11 +46,10 @@ public class AttributeMap { @@ -45,11 +47,10 @@ public class AttributeMap {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@@ -71,4 +71,4 @@ index 692524a69d43dcf52ae1b0f7f593fc53f3878137..81eb5e47715312afbedce0786e9a0d42
+ return this.attributes.computeIfAbsent(attribute, this.createInstance); // Gale - Airplane - reduce entity allocations - cache lambda, as for some reason java allocates it anyways + return this.attributes.computeIfAbsent(attribute, this.createInstance); // Gale - Airplane - reduce entity allocations - cache lambda, as for some reason java allocates it anyways
} }
public boolean hasAttribute(Attribute attribute) { @Nullable

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ff83ad8f61fc6ae251501b7764373b7745b69d33..4ce7445b81ce4fe8c6a9395c719d483cc002c08b 100644 index aeaa5c08e8694b353b33f95e2973e6c38bc280a0..8924630ca5049f14e5e69323a2d4f7218e06a2aa 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -726,7 +726,20 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -728,7 +728,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
gameprofilerfiller.push("tick"); gameprofilerfiller.push("tick");
@@ -57,10 +57,10 @@ index ff83ad8f61fc6ae251501b7764373b7745b69d33..4ce7445b81ce4fe8c6a9395c719d483c
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 66b2cde3be8109a881095ee5758542b70af10c1a..7fdd5f7d7a060309b9b44088836621ad1e512f1d 100644 index 0ba38fddff7b3751d652d1148f993453164e2034..14c2e816e6bc5801846c296318afe223abf95c5d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -999,13 +999,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1020,13 +1020,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try { try {
tickConsumer.accept(entity); tickConsumer.accept(entity);
MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ff7599dbaecbf09f234a1b43b98ce13e1bf491f6..b524c2ef54821adce2a9b744aa6efcdd4aa03034 100644 index e00c6d14d33b0b32ee77f68d5fc4b6fbc15e024a..5295b32a2d0b758e878897aebdd8906680cd7bb5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4055,16 +4055,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4099,16 +4099,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) { public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
@@ -60,7 +60,7 @@ index ff7599dbaecbf09f234a1b43b98ce13e1bf491f6..b524c2ef54821adce2a9b744aa6efcdd
double d1 = 0.0D; double d1 = 0.0D;
boolean flag = this.isPushedByFluid(); boolean flag = this.isPushedByFluid();
boolean flag1 = false; boolean flag1 = false;
@@ -4072,14 +4074,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4116,14 +4118,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
int k1 = 0; int k1 = 0;
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
@@ -128,7 +128,7 @@ index ff7599dbaecbf09f234a1b43b98ce13e1bf491f6..b524c2ef54821adce2a9b744aa6efcdd
if (d2 >= axisalignedbb.minY) { if (d2 >= axisalignedbb.minY) {
flag1 = true; flag1 = true;
@@ -4101,9 +4150,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4145,9 +4194,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// CraftBukkit end // CraftBukkit end
} }
} }

View File

@@ -13,10 +13,10 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index c2f60f3f638d8a94046d20ff1dfca316a3395861..9839d38652d04fcc3e97a85a9120a1848e203de6 100644 index 977edc4adb5414e83d289cca295baa6bfbadaa52..a63dce4a46a9df755a6dce8c959f3a0f1e151f67 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -63,6 +63,7 @@ tasks.withType<JavaCompile> { @@ -62,6 +62,7 @@ tasks.withType<JavaCompile> {
compilerArgs.add("-Xlint:-module") compilerArgs.add("-Xlint:-module")
compilerArgs.add("-Xlint:-removal") compilerArgs.add("-Xlint:-removal")
compilerArgs.add("-Xlint:-dep-ann") compilerArgs.add("-Xlint:-dep-ann")
@@ -25,7 +25,7 @@ index c2f60f3f638d8a94046d20ff1dfca316a3395861..9839d38652d04fcc3e97a85a9120a184
// Gale end - hide irrelevant compilation warnings // Gale end - hide irrelevant compilation warnings
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index d2b14c65e6a925ba4a29d48bcedc0d9504092052..007fe6820e208c04e81acbd7bb7eaf0a22f6f64f 100644 index 9c3ccbbd657d1605b8fabb6e01c11ff31f39a17e..1d1db89362b78ac34d46cdd71b9ab27404b98e48 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -14,6 +14,8 @@ import java.util.Locale; @@ -14,6 +14,8 @@ import java.util.Locale;
@@ -37,7 +37,7 @@ index d2b14c65e6a925ba4a29d48bcedc0d9504092052..007fe6820e208c04e81acbd7bb7eaf0a
import net.minecraft.DefaultUncaughtExceptionHandler; import net.minecraft.DefaultUncaughtExceptionHandler;
import net.minecraft.DefaultUncaughtExceptionHandlerWithName; import net.minecraft.DefaultUncaughtExceptionHandlerWithName;
import net.minecraft.SharedConstants; import net.minecraft.SharedConstants;
@@ -51,6 +53,7 @@ import net.minecraft.world.level.GameType; @@ -46,6 +48,7 @@ import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.entity.SkullBlockEntity; import net.minecraft.world.level.block.entity.SkullBlockEntity;
import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.LevelStorageSource;
import org.galemc.gale.command.GaleCommands; import org.galemc.gale.command.GaleCommands;
@@ -45,7 +45,7 @@ index d2b14c65e6a925ba4a29d48bcedc0d9504092052..007fe6820e208c04e81acbd7bb7eaf0a
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -228,6 +231,21 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -223,6 +226,21 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
// Paper end // Paper end

View File

@@ -28,13 +28,13 @@ but is so much cheaper than the suffocation check that it's worth
keeping it. keeping it.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6fa0f38aff0c5f4ea4961cabf070b8c6463a4a22..5add41e429b176195a10115744305a2358b5fb7f 100644 index 1ef947f46f63589ce0e11c8db357cb817eecbbd2..b109c55a31a9e5a0813e360d8a3c1b13d1bfd416 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -400,7 +400,10 @@ public abstract class LivingEntity extends Entity { @@ -402,7 +402,10 @@ public abstract class LivingEntity extends Entity {
if (this.isAlive()) {
boolean flag = this instanceof net.minecraft.world.entity.player.Player; boolean flag = this instanceof net.minecraft.world.entity.player.Player;
if (!this.level.isClientSide) {
- if (this.isInWall()) { - if (this.isInWall()) {
+ // Gale start - Pufferfish - reduce in wall checks + // Gale start - Pufferfish - reduce in wall checks
+ long checkStuckInWallInterval = this.level.galeConfig().smallOptimizations.reducedIntervals.checkStuckInWall; + long checkStuckInWallInterval = this.level.galeConfig().smallOptimizations.reducedIntervals.checkStuckInWall;
@@ -43,7 +43,7 @@ index 6fa0f38aff0c5f4ea4961cabf070b8c6463a4a22..5add41e429b176195a10115744305a23
this.hurt(DamageSource.IN_WALL, 1.0F); this.hurt(DamageSource.IN_WALL, 1.0F);
} else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) { } else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) {
double d0 = this.level.getWorldBorder().getDistanceToBorder(this) + this.level.getWorldBorder().getDamageSafeZone(); double d0 = this.level.getWorldBorder().getDistanceToBorder(this) + this.level.getWorldBorder().getDamageSafeZone();
@@ -1328,6 +1331,15 @@ public abstract class LivingEntity extends Entity { @@ -1327,6 +1330,15 @@ public abstract class LivingEntity extends Entity {
return this.getHealth() <= 0.0F; return this.getHealth() <= 0.0F;
} }

View File

@@ -17,10 +17,10 @@ Licensed under: MIT (https://opensource.org/licenses/MIT)
Only do an item "suck in" action once per second Only do an item "suck in" action once per second
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 298b7b2d2e306a22a511a56934fd985cb5d9f7de..0b04f5342966d53dfef5441dd9f1acf62e5623d0 100644 index 893eb4904df79a5fc629a0fc7a0c018548eeffb1..7b0374b6e22105e59b29995983a6ac50268c722e 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -19,11 +19,13 @@ import net.minecraft.world.entity.Entity; @@ -10,11 +10,13 @@ import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MoverType; import net.minecraft.world.entity.MoverType;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
@@ -32,9 +32,9 @@ index 298b7b2d2e306a22a511a56934fd985cb5d9f7de..0b04f5342966d53dfef5441dd9f1acf6
import net.minecraft.world.level.gameevent.GameEvent; import net.minecraft.world.level.gameevent.GameEvent;
+import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
// CraftBukkit start import net.minecraft.Util;
import net.minecraft.server.MinecraftServer; import net.minecraft.core.BlockPos;
@@ -201,11 +203,31 @@ public class ItemEntity extends Entity { @@ -199,11 +201,31 @@ public class ItemEntity extends Entity {
} }
// CraftBukkit end // CraftBukkit end
this.discard(); this.discard();
@@ -66,7 +66,7 @@ index 298b7b2d2e306a22a511a56934fd985cb5d9f7de..0b04f5342966d53dfef5441dd9f1acf6
// Spigot start - copied from above // Spigot start - copied from above
@Override @Override
public void inactiveTick() { public void inactiveTick() {
@@ -225,7 +247,13 @@ public class ItemEntity extends Entity { @@ -223,7 +245,13 @@ public class ItemEntity extends Entity {
} }
// CraftBukkit end // CraftBukkit end
this.discard(); this.discard();

View File

@@ -18,10 +18,18 @@ Helps 1.8 Farms let hoppers pick it up before Villager
due to our hopper changes due to our hopper changes
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
index 098253e92bd95159de93fbbdf95daee341fc5752..edac2bbc9c1f7a7e2bdde012eb15e45430e09a94 100644 index b9fcff8862e624644fdb73afcb3ef2106b0a76fc..49f2c1ca0e175667202ba0d02175a61f50f9250f 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java --- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
@@ -102,7 +102,16 @@ public class BehaviorUtils { @@ -21,6 +21,7 @@ import net.minecraft.world.entity.ai.memory.NearestVisibleLivingEntities;
import net.minecraft.world.entity.ai.memory.WalkTarget;
import net.minecraft.world.entity.ai.util.DefaultRandomPos;
import net.minecraft.world.entity.item.ItemEntity;
+import net.minecraft.world.entity.npc.Villager;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.ProjectileWeaponItem;
@@ -101,7 +102,16 @@ public class BehaviorUtils {
vec3d2 = vec3d2.normalize().multiply(velocityFactor.x, velocityFactor.y, velocityFactor.z); vec3d2 = vec3d2.normalize().multiply(velocityFactor.x, velocityFactor.y, velocityFactor.z);
entityitem.setDeltaMovement(vec3d2); entityitem.setDeltaMovement(vec3d2);

View File

@@ -13,17 +13,17 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d31a345edfffe39f127073fc3aec8b3489bae79c..0d72941a124a6fddad70362b25647743e601aafd 100644 index 0c2255b6e2fb7752f85b0f83d4f84732758bd14d..4f828048114172c399c6ce7bfa4bead007473269 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2345,6 +2345,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2330,6 +2330,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
return false; return Optional.empty();
+ // Gale start - EMC - do not process chat/commands before player has joined + // Gale start - EMC - do not process chat/commands before player has joined
+ } else if (!player.didPlayerJoinEvent) { + } else if (!player.didPlayerJoinEvent) {
+ return false; + return Optional.empty();
+ // Gale end - EMC - do not process chat/commands before player has joined + // Gale end - EMC - do not process chat/commands before player has joined
} else { } else {
LastSeenMessagesValidator lastseenmessagesvalidator = this.lastSeenMessagesValidator; Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(acknowledgment);
Set set;

View File

@@ -13,10 +13,10 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
index c59f98ca3adfdd90cdc5999aeadbb0834efedc0f..efdea88c7d7de90330c2606435b52b60e204b56c 100644 index 72946e324c575ef39f3939225b96b68f724da460..75e2a7d19a7056b73c1524902e44cca05b03d622 100644
--- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java --- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java
+++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java +++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
@@ -35,6 +35,7 @@ import net.minecraft.server.level.ServerPlayer; @@ -36,6 +36,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.datafix.DataFixTypes; import net.minecraft.util.datafix.DataFixTypes;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
@@ -24,7 +24,7 @@ index c59f98ca3adfdd90cdc5999aeadbb0834efedc0f..efdea88c7d7de90330c2606435b52b60
import org.slf4j.Logger; import org.slf4j.Logger;
public class ServerStatsCounter extends StatsCounter { public class ServerStatsCounter extends StatsCounter {
@@ -134,15 +135,15 @@ public class ServerStatsCounter extends StatsCounter { @@ -135,15 +136,15 @@ public class ServerStatsCounter extends StatsCounter {
Util.ifElse(this.getStat(statisticwrapper, s2), (statistic) -> { Util.ifElse(this.getStat(statisticwrapper, s2), (statistic) -> {
this.stats.put(statistic, nbttagcompound2.getInt(s2)); this.stats.put(statistic, nbttagcompound2.getInt(s2));
}, () -> { }, () -> {

View File

@@ -7,26 +7,27 @@ License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0d72941a124a6fddad70362b25647743e601aafd..dd9d52552cc61729cdcd37caa87079e5026964d7 100644 index 4f828048114172c399c6ce7bfa4bead007473269..e09c18580ca31644112bae38a4c52a9a51896aec 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -185,6 +185,7 @@ import net.minecraft.world.phys.shapes.BooleanOp; @@ -182,6 +182,8 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.StringUtils;
+import org.galemc.gale.configuration.GaleGlobalConfiguration; +import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -2573,7 +2574,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2538,7 +2540,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// CraftBukkit start // CraftBukkit start
String s = message.signedContent().plain(); String s = message.signedContent();
if (s.isEmpty()) { if (s.isEmpty()) {
- ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); - ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message");
+ if (GaleGlobalConfiguration.get().logToConsole.chat.emptyMessageWarning) ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); // Gale - do not log empty message warnings + if (GaleGlobalConfiguration.get().logToConsole.chat.emptyMessageWarning) ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); // Gale - do not log empty message warnings
} else if (this.getCraftPlayer().isConversing()) { } else if (this.getCraftPlayer().isConversing()) {
OutgoingPlayerChatMessage outgoing = OutgoingPlayerChatMessage.create(message); final String conversationInput = s;
outgoing.sendHeadersToRemainingPlayers(this.server.getPlayerList()); this.server.processQueue.add(new Runnable() {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index c67adaa664bfe2b371f14efa83ea200b0e1006f0..f292156b411b4c0f5db8fa15c92df395acb6e901 100644 index c67adaa664bfe2b371f14efa83ea200b0e1006f0..f292156b411b4c0f5db8fa15c92df395acb6e901 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 0d3587e2d454fb0994ecff930b5e496a3999746a..0cc830d2c964727325501ef1b61126022430206c 100644 index 877498729c66de9aa6a27c9148f7494d7895615c..d2bbbb0e73dafd2294838137bfbd16acf1c76940 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -53,6 +53,7 @@ import net.minecraft.world.phys.AABB; @@ -54,6 +54,7 @@ import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.ticks.LevelTickAccess; import net.minecraft.world.ticks.LevelTickAccess;
import net.minecraft.world.ticks.WorldGenTickAccess; import net.minecraft.world.ticks.WorldGenTickAccess;
@@ -48,7 +48,7 @@ index 0d3587e2d454fb0994ecff930b5e496a3999746a..0cc830d2c964727325501ef1b6112602
import org.slf4j.Logger; import org.slf4j.Logger;
public class WorldGenRegion implements WorldGenLevel { public class WorldGenRegion implements WorldGenLevel {
@@ -296,6 +297,7 @@ public class WorldGenRegion implements WorldGenLevel { @@ -297,6 +298,7 @@ public class WorldGenRegion implements WorldGenLevel {
return true; return true;
} else { } else {
// Paper start // Paper start

View File

@@ -6,19 +6,27 @@ Subject: [PATCH] Do not log expired message warnings
License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html) License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
index dd9d52552cc61729cdcd37caa87079e5026964d7..3c63449a36c6882b6e47f69f3cdf83e874a9a694 100644 index c0a80824a0307ea673805015119cc834b268f0dc..d7c6e90ccf3a8ce58e5533c5158ce62668cbcb78 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
@@ -2614,7 +2614,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -8,6 +8,7 @@ import net.minecraft.util.SignatureUpdater;
import net.minecraft.util.SignatureValidator;
import net.minecraft.util.Signer;
import net.minecraft.world.entity.player.ProfilePublicKey;
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
public class SignedMessageChain {
@@ -42,7 +43,7 @@ public class SignedMessageChain {
throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.unsigned_chat"), true, org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event causes
} else {
if (playerChatMessage.hasExpiredServer(Instant.now())) {
- LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", (Object)body.content());
+ if (GaleGlobalConfiguration.get().logToConsole.chat.expiredMessageWarning) LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", (Object)body.content()); // Gale - do not log expired message warnings
} }
if (message.hasExpiredServer(Instant.now())) { return playerChatMessage;
- ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized? c: {} s: {}", this.player.getName().getString(), message.signedContent().plain(), message.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper
+ if (GaleGlobalConfiguration.get().logToConsole.chat.expiredMessageWarning) ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized? c: {} s: {}", this.player.getName().getString(), message.signedContent().plain(), message.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper // Gale - do not log expired message warnings
}
return true;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 0f276a6a3521e97afbb20ea5421a16180f626d45..6c6f9fabb208baf5419c5dd6290b83a7d983c6d7 100644 index 0f276a6a3521e97afbb20ea5421a16180f626d45..6c6f9fabb208baf5419c5dd6290b83a7d983c6d7 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java

View File

@@ -7,10 +7,10 @@ License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
index 28ddab1121e314e82bf764fd89f36714bd7445f8..e54ffbacb5c2ae0235fe60d462cb6dbd49de0029 100644 index fd5cbb45e9894b7895ea488e2b9876c0391f6f11..58afed3efbe5a2a316b6b71028c760a593da256c 100644
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java --- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java +++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
@@ -39,6 +39,7 @@ import org.bukkit.event.player.PlayerChatEvent; @@ -38,6 +38,7 @@ import org.bukkit.event.player.PlayerChatEvent;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.DefaultQualifier; import org.checkerframework.framework.qual.DefaultQualifier;
@@ -18,20 +18,20 @@ index 28ddab1121e314e82bf764fd89f36714bd7445f8..e54ffbacb5c2ae0235fe60d462cb6dbd
import static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection; import static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection;
@@ -313,7 +314,7 @@ public final class ChatProcessor { @@ -307,7 +308,7 @@ public final class ChatProcessor {
private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) { private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) {
final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console)); final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console));
- ChatProcessor.this.server.logChatMessage(toConsoleMessage.serverContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage, ChatProcessor.this.player.asChatSender()) ? null : "Not Secure"); - ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure");
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.serverContent(), chatType, !GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker || ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage, ChatProcessor.this.player.asChatSender()) ? null : "Not Secure"); // Gale - do not log Not Secure marker + ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, !GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker || ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure"); // Gale - do not log Not Secure marker
} }
record ConstantFunction(net.minecraft.network.chat.Component component) implements Function<Audience, net.minecraft.network.chat.Component> { record ConstantFunction(net.minecraft.network.chat.Component component) implements Function<Audience, net.minecraft.network.chat.Component> {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 3be9352ae9b0b84acf07064b45562ceffd30391b..a436c3d0ad3de877ced6c7e53600c48e25d8da26 100644 index b348d33726b2b14ea2d12ce3430df2c0b94295f4..fe7037310e1a2b5fc2956b565982847e4c2be041 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -96,6 +96,7 @@ import net.minecraft.world.scores.Objective; @@ -100,6 +100,7 @@ import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.PlayerTeam; import net.minecraft.world.scores.PlayerTeam;
import net.minecraft.world.scores.Scoreboard; // Paper import net.minecraft.world.scores.Scoreboard; // Paper
import net.minecraft.world.scores.Team; import net.minecraft.world.scores.Team;
@@ -39,15 +39,15 @@ index 3be9352ae9b0b84acf07064b45562ceffd30391b..a436c3d0ad3de877ced6c7e53600c48e
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -1439,7 +1440,7 @@ public abstract class PlayerList { @@ -1448,7 +1449,7 @@ public abstract class PlayerList {
// Paper end // Paper end
boolean flag = this.verifyChatTrusted(message, sourceProfile); boolean flag = this.verifyChatTrusted(message);
- this.server.logChatMessage((unsignedFunction == null ? message : message.withUnsignedContent(unsignedFunction.apply(this.server.console))).decoratedContent(), params, flag ? null : "Not Secure"); // Paper
+ this.server.logChatMessage((unsignedFunction == null ? message : message.withUnsignedContent(unsignedFunction.apply(this.server.console))).decoratedContent(), params, flag || !GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker ? null : "Not Secure"); // Paper // Gale - do not log Not Secure marker
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
boolean flag1 = false;
- this.server.logChatMessage((unsignedFunction == null ? message : message.withUnsignedContent(unsignedFunction.apply(this.server.console))).serverContent(), params, flag ? null : "Not Secure"); // Paper
+ this.server.logChatMessage((unsignedFunction == null ? message : message.withUnsignedContent(unsignedFunction.apply(this.server.console))).serverContent(), params, flag || !GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker ? null : "Not Secure"); // Paper // Gale - do not log Not Secure marker
OutgoingPlayerChatMessage outgoingplayerchatmessage = OutgoingPlayerChatMessage.create(message);
boolean flag1 = message.isFullyFiltered();
boolean flag2 = false;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 6c6f9fabb208baf5419c5dd6290b83a7d983c6d7..ce8c7032dff4e119d018d42fa579f9231cf41961 100644 index 6c6f9fabb208baf5419c5dd6290b83a7d983c6d7..ce8c7032dff4e119d018d42fa579f9231cf41961 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java

View File

@@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 007fe6820e208c04e81acbd7bb7eaf0a22f6f64f..8c7adc9edf941d5cc9aa2e427267eb035d4627d6 100644 index 1d1db89362b78ac34d46cdd71b9ab27404b98e48..9302502f59243fa254c88a7a8d513a2a65c17979 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -184,7 +184,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -179,7 +179,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} }
// Paper start - detect running as root // Paper start - detect running as root

View File

@@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 8c7adc9edf941d5cc9aa2e427267eb035d4627d6..8e45f712968303b7864d61adbf7325142c83f582 100644 index 9302502f59243fa254c88a7a8d513a2a65c17979..f5ed3fa20097bdd43a25c76b38353a23743bc9e5 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -298,7 +298,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -293,7 +293,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP); server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP);
// CraftBukkit end // CraftBukkit end

View File

@@ -38,10 +38,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
index f90eb6c50208879c4a2d5ad7e4181c06d38076f8..c374f2baff54b5ab1c8fdc1cedcecf2126da1783 100644 index 0725c39d9cbec3282f93975a0ae76f060f70d86d..c222fc336c997fea2204a7960055aa706605dc22 100644
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
@@ -153,6 +153,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene @@ -152,6 +152,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
this.connection.send(new ClientboundStatusResponsePacket(ping)); this.connection.send(new ClientboundStatusResponsePacket(ping));
// CraftBukkit end // CraftBukkit end
*/ */

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index b2d1a17867cdbaad0c6e5c2376c716f9461af124..9d8a8dd2e6ec76beb6552266da7ae7c1229516fd 100644 index 72f1866226269396ba0f0c1be269e237925d9322..ea099989d633764489396a48d52db9f6023a20af 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -128,7 +128,7 @@ public class FallingBlockEntity extends Entity { @@ -130,7 +130,7 @@ public class FallingBlockEntity extends Entity {
@Override @Override
public void tick() { public void tick() {
// Paper start - fix sand duping // Paper start - fix sand duping
@@ -49,7 +49,7 @@ index b2d1a17867cdbaad0c6e5c2376c716f9461af124..9d8a8dd2e6ec76beb6552266da7ae7c1
return; return;
} }
// Paper end - fix sand duping // Paper end - fix sand duping
@@ -145,7 +145,7 @@ public class FallingBlockEntity extends Entity { @@ -147,7 +147,7 @@ public class FallingBlockEntity extends Entity {
this.move(MoverType.SELF, this.getDeltaMovement()); this.move(MoverType.SELF, this.getDeltaMovement());
// Paper start - fix sand duping // Paper start - fix sand duping

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index b9cb39efe14a877ddedc5a5e4141ee5199ea8daf..c41a09fe1c6d496a730bac1f0def557f20aade3c 100644 index 428523feaa4f30260e32ba03937e88200246c693..29afe1f873c9c87fe5a83f22025cf7f773c4cf2c 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -282,6 +282,16 @@ public class ItemFrame extends HangingEntity { @@ -283,6 +283,16 @@ public class ItemFrame extends HangingEntity {
} }
} }

View File

@@ -37,11 +37,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
index c4441ef250b95663198cfc9607d714dbe346512c..81ca0f568e484b1d013a9abfa809f1ba9956933b 100644 index 68a5ee85e64802e4509ba0d184fc0ceb3cbe2d11..8ee1a0626e5a6c0ad19a25b8f476a2e12d69668d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java --- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
+++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java +++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
@@ -180,7 +180,17 @@ public class MushroomCow extends Cow implements Shearable { @@ -180,12 +180,21 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder<Mushroo
// this.discard(); // CraftBukkit - moved down
entitycow.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot()); entitycow.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
entitycow.setHealth(this.getHealth()); entitycow.setHealth(this.getHealth());
+ // Gale start - Purpur - fix cow rotation when shearing mooshroom + // Gale start - Purpur - fix cow rotation when shearing mooshroom
@@ -58,6 +58,11 @@ index c4441ef250b95663198cfc9607d714dbe346512c..81ca0f568e484b1d013a9abfa809f1ba
if (this.hasCustomName()) { if (this.hasCustomName()) {
entitycow.setCustomName(this.getCustomName()); entitycow.setCustomName(this.getCustomName());
entitycow.setCustomNameVisible(this.isCustomNameVisible()); entitycow.setCustomNameVisible(this.isCustomNameVisible());
}
-
if (this.isPersistenceRequired()) {
entitycow.setPersistenceRequired();
}
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
index 075af07a5c0e8328fb411d22fd29cea9c2b07711..a774fbeaa3829b1ae702fb61a0acb9d69d18a081 100644 index 075af07a5c0e8328fb411d22fd29cea9c2b07711..a774fbeaa3829b1ae702fb61a0acb9d69d18a081 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index 89bf5fc4fab2cf39378600aa8925ac4bb7707428..8f3fb24afd3df8e9e4caa2917f598fcf74289726 100644 index f80545f80948db27d1fbde77d0505c916eb504ed..2a596cc374206a85bb692f5e09ee2dd83cf6d1b1 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -177,6 +177,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { @@ -178,6 +178,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
public static void teleportEntity(Level world, BlockPos pos, BlockState state, Entity entity, TheEndGatewayBlockEntity blockEntity) { public static void teleportEntity(Level world, BlockPos pos, BlockState state, Entity entity, TheEndGatewayBlockEntity blockEntity) {
if (world instanceof ServerLevel && !blockEntity.isCoolingDown()) { if (world instanceof ServerLevel && !blockEntity.isCoolingDown()) {

View File

@@ -42,10 +42,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index def3b3f8dac4b28eaaafdd9bc2e7f4b9ec9d6855..ca28f41a5a0405adf07cc2898d53a77f5c7b3e8c 100644 index e7ef36dac559d03d127cf45373a7e0dc935b80a8..80b3f0a4ab3e57674a709ee9765df9710aa40bce 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -322,7 +322,7 @@ public abstract class AbstractArrow extends Projectile { @@ -323,7 +323,7 @@ public abstract class AbstractArrow extends Projectile {
Vec3 vec3d = this.getDeltaMovement(); Vec3 vec3d = this.getDeltaMovement();
this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F))); this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F)));

View File

@@ -177,7 +177,7 @@ index 051c1fb81d79c40be683edb86579bb975643bcb3..df1e7e7baa2caf716dbdd46595bed36e
String[][] createRequirements(Collection<String> criteriaNames); String[][] createRequirements(Collection<String> criteriaNames);
diff --git a/src/main/java/net/minecraft/nbt/ByteArrayTag.java b/src/main/java/net/minecraft/nbt/ByteArrayTag.java diff --git a/src/main/java/net/minecraft/nbt/ByteArrayTag.java b/src/main/java/net/minecraft/nbt/ByteArrayTag.java
index 3dd8a189c26f41759c59c3b9d0e5282038989a9f..34fef5558cf65ad65de98cb804cadc8e90be43fa 100644 index 163b1895bcbd16e93d36cd60d03e6b21df51cba7..28501ba714d313f3d349074fe49f0cedba2d09de 100644
--- a/src/main/java/net/minecraft/nbt/ByteArrayTag.java --- a/src/main/java/net/minecraft/nbt/ByteArrayTag.java
+++ b/src/main/java/net/minecraft/nbt/ByteArrayTag.java +++ b/src/main/java/net/minecraft/nbt/ByteArrayTag.java
@@ -6,6 +6,8 @@ import java.io.DataOutput; @@ -6,6 +6,8 @@ import java.io.DataOutput;
@@ -189,7 +189,7 @@ index 3dd8a189c26f41759c59c3b9d0e5282038989a9f..34fef5558cf65ad65de98cb804cadc8e
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
public class ByteArrayTag extends CollectionTag<ByteTag> { public class ByteArrayTag extends CollectionTag<ByteTag> {
@@ -170,7 +172,7 @@ public class ByteArrayTag extends CollectionTag<ByteTag> { @@ -175,7 +177,7 @@ public class ByteArrayTag extends CollectionTag<ByteTag> {
} }
public void clear() { public void clear() {
@@ -199,7 +199,7 @@ index 3dd8a189c26f41759c59c3b9d0e5282038989a9f..34fef5558cf65ad65de98cb804cadc8e
@Override @Override
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
index 912fd5135e89348bdd3c0a8b6c07860ebc106df3..1adf018daf78cf3f6e03bd73b2ece71b2dbe605c 100644 index 42ea3573c0e8559a264fd24fc09c3a5cd7628d9b..25589dcabeb9ba189c3eddd4d1032949c326c78a 100644
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java --- a/src/main/java/net/minecraft/nbt/CompoundTag.java
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java +++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
@@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
@@ -218,7 +218,7 @@ index 912fd5135e89348bdd3c0a8b6c07860ebc106df3..1adf018daf78cf3f6e03bd73b2ece71b
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory; import net.minecraft.CrashReportCategory;
import net.minecraft.ReportedException; import net.minecraft.ReportedException;
@@ -364,7 +365,7 @@ public class CompoundTag implements Tag { @@ -377,7 +378,7 @@ public class CompoundTag implements Tag {
throw new ReportedException(this.createReport(key, ByteArrayTag.TYPE, var3)); throw new ReportedException(this.createReport(key, ByteArrayTag.TYPE, var3));
} }
@@ -227,7 +227,7 @@ index 912fd5135e89348bdd3c0a8b6c07860ebc106df3..1adf018daf78cf3f6e03bd73b2ece71b
} }
public int[] getIntArray(String key) { public int[] getIntArray(String key) {
@@ -376,7 +377,7 @@ public class CompoundTag implements Tag { @@ -389,7 +390,7 @@ public class CompoundTag implements Tag {
throw new ReportedException(this.createReport(key, IntArrayTag.TYPE, var3)); throw new ReportedException(this.createReport(key, IntArrayTag.TYPE, var3));
} }
@@ -236,7 +236,7 @@ index 912fd5135e89348bdd3c0a8b6c07860ebc106df3..1adf018daf78cf3f6e03bd73b2ece71b
} }
public long[] getLongArray(String key) { public long[] getLongArray(String key) {
@@ -388,7 +389,7 @@ public class CompoundTag implements Tag { @@ -401,7 +402,7 @@ public class CompoundTag implements Tag {
throw new ReportedException(this.createReport(key, LongArrayTag.TYPE, var3)); throw new ReportedException(this.createReport(key, LongArrayTag.TYPE, var3));
} }
@@ -246,7 +246,7 @@ index 912fd5135e89348bdd3c0a8b6c07860ebc106df3..1adf018daf78cf3f6e03bd73b2ece71b
public CompoundTag getCompound(String key) { public CompoundTag getCompound(String key) {
diff --git a/src/main/java/net/minecraft/nbt/IntArrayTag.java b/src/main/java/net/minecraft/nbt/IntArrayTag.java diff --git a/src/main/java/net/minecraft/nbt/IntArrayTag.java b/src/main/java/net/minecraft/nbt/IntArrayTag.java
index a14b01cee7a8d7022c4fa7264d349a76be143ba5..1b55879fa18a1947146e418909119a818b6b69e8 100644 index 25ad2c6ff968f4a6b16b4dea3f67341a4261f2a4..5d95b7164bb576e1722fc2498e5e49660370788d 100644
--- a/src/main/java/net/minecraft/nbt/IntArrayTag.java --- a/src/main/java/net/minecraft/nbt/IntArrayTag.java
+++ b/src/main/java/net/minecraft/nbt/IntArrayTag.java +++ b/src/main/java/net/minecraft/nbt/IntArrayTag.java
@@ -6,6 +6,8 @@ import java.io.DataOutput; @@ -6,6 +6,8 @@ import java.io.DataOutput;
@@ -258,7 +258,7 @@ index a14b01cee7a8d7022c4fa7264d349a76be143ba5..1b55879fa18a1947146e418909119a81
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
public class IntArrayTag extends CollectionTag<IntTag> { public class IntArrayTag extends CollectionTag<IntTag> {
@@ -184,7 +186,7 @@ public class IntArrayTag extends CollectionTag<IntTag> { @@ -189,7 +191,7 @@ public class IntArrayTag extends CollectionTag<IntTag> {
} }
public void clear() { public void clear() {
@@ -268,7 +268,7 @@ index a14b01cee7a8d7022c4fa7264d349a76be143ba5..1b55879fa18a1947146e418909119a81
@Override @Override
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
index 6a5e33d9821221be73f9c16afc17c9130248a231..1120644c399926d6a064e0761b23c6c6f1360f26 100644 index 749d3e67a877d7d1ed47b5fef511a604ee6589b6..54ea449b87e012332a3a99807d7ab8afbd00e8de 100644
--- a/src/main/java/net/minecraft/nbt/ListTag.java --- a/src/main/java/net/minecraft/nbt/ListTag.java
+++ b/src/main/java/net/minecraft/nbt/ListTag.java +++ b/src/main/java/net/minecraft/nbt/ListTag.java
@@ -2,6 +2,8 @@ package net.minecraft.nbt; @@ -2,6 +2,8 @@ package net.minecraft.nbt;
@@ -280,7 +280,7 @@ index 6a5e33d9821221be73f9c16afc17c9130248a231..1120644c399926d6a064e0761b23c6c6
import java.io.DataInput; import java.io.DataInput;
import java.io.DataOutput; import java.io.DataOutput;
import java.io.IOException; import java.io.IOException;
@@ -218,7 +220,7 @@ public class ListTag extends CollectionTag<Tag> { @@ -230,7 +232,7 @@ public class ListTag extends CollectionTag<Tag> {
} }
} }
@@ -289,7 +289,7 @@ index 6a5e33d9821221be73f9c16afc17c9130248a231..1120644c399926d6a064e0761b23c6c6
} }
public long[] getLongArray(int index) { public long[] getLongArray(int index) {
@@ -229,7 +231,7 @@ public class ListTag extends CollectionTag<Tag> { @@ -241,7 +243,7 @@ public class ListTag extends CollectionTag<Tag> {
} }
} }
@@ -299,7 +299,7 @@ index 6a5e33d9821221be73f9c16afc17c9130248a231..1120644c399926d6a064e0761b23c6c6
public double getDouble(int index) { public double getDouble(int index) {
diff --git a/src/main/java/net/minecraft/nbt/LongArrayTag.java b/src/main/java/net/minecraft/nbt/LongArrayTag.java diff --git a/src/main/java/net/minecraft/nbt/LongArrayTag.java b/src/main/java/net/minecraft/nbt/LongArrayTag.java
index a39baec88dc9c73f1b592881ed96d11ab64ad785..72dfb0d467431bf039b7b514d4f9f3035d7ca967 100644 index bdc0adc652228328ebe8fe2455c73c257a89d3c5..699560214284bf64990a23111ea836fcd7502fb9 100644
--- a/src/main/java/net/minecraft/nbt/LongArrayTag.java --- a/src/main/java/net/minecraft/nbt/LongArrayTag.java
+++ b/src/main/java/net/minecraft/nbt/LongArrayTag.java +++ b/src/main/java/net/minecraft/nbt/LongArrayTag.java
@@ -6,6 +6,8 @@ import java.io.DataOutput; @@ -6,6 +6,8 @@ import java.io.DataOutput;
@@ -311,7 +311,7 @@ index a39baec88dc9c73f1b592881ed96d11ab64ad785..72dfb0d467431bf039b7b514d4f9f303
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
public class LongArrayTag extends CollectionTag<LongTag> { public class LongArrayTag extends CollectionTag<LongTag> {
@@ -188,7 +190,7 @@ public class LongArrayTag extends CollectionTag<LongTag> { @@ -193,7 +195,7 @@ public class LongArrayTag extends CollectionTag<LongTag> {
@Override @Override
public void clear() { public void clear() {
@@ -343,7 +343,7 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..43f402d9032e4570a81a80e412215598
protected CipherBase(Cipher cipher) { protected CipherBase(Cipher cipher) {
this.cipher = cipher; this.cipher = cipher;
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index f1e1a4a48349c0e431b31327fdf217989db027b3..40b3ca86faeb7374a2f67ed60769b7440e8dbbd7 100644 index 507e98438f6d13de1bcf063db673a8e483dbea47..82fcd448f2f2ac2c060d7a3fc672a9ffcfd6a93a 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -20,7 +20,6 @@ import io.netty.channel.epoll.EpollSocketChannel; @@ -20,7 +20,6 @@ import io.netty.channel.epoll.EpollSocketChannel;
@@ -374,7 +374,7 @@ index f1e1a4a48349c0e431b31327fdf217989db027b3..40b3ca86faeb7374a2f67ed60769b744
} }
// Paper start // Paper start
diff --git a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java diff --git a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
index 02fb51f7f699992caf13d088c75b8275ec5267bb..ba402b28fd1ac4464578e85d298c329db79e8feb 100644 index 88f795681f8f37a90212f6c9613f06d37b07fd0a..d2eed57fc908b719ebf17f4659ec39aefc119003 100644
--- a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java --- a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
+++ b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java +++ b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
@@ -9,6 +9,8 @@ import java.util.function.Consumer; @@ -9,6 +9,8 @@ import java.util.function.Consumer;
@@ -396,10 +396,10 @@ index 02fb51f7f699992caf13d088c75b8275ec5267bb..ba402b28fd1ac4464578e85d298c329d
private static final FormattedText TEXT_NULL = FormattedText.of("null"); private static final FormattedText TEXT_NULL = FormattedText.of("null");
private final String key; private final String key;
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 0066b1abc008d245825abf1d256cb87fa9c2d877..d8f8d2495c1e2e3f194485d16ea587d26cc3a23d 100644 index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..0c4c62674b4c7e8e3921c7eb3ef726759ac75075 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -85,7 +85,7 @@ public class Main { @@ -88,7 +88,7 @@ public class Main {
OptionSpec<Void> optionspec6 = optionparser.accepts("safeMode", "Loads level with vanilla datapack only"); OptionSpec<Void> optionspec6 = optionparser.accepts("safeMode", "Loads level with vanilla datapack only");
OptionSpec<Void> optionspec7 = optionparser.accepts("help").forHelp(); OptionSpec<Void> optionspec7 = optionparser.accepts("help").forHelp();
OptionSpec<String> optionspec8 = optionparser.accepts("singleplayer").withRequiredArg(); OptionSpec<String> optionspec8 = optionparser.accepts("singleplayer").withRequiredArg();
@@ -409,10 +409,10 @@ index 0066b1abc008d245825abf1d256cb87fa9c2d877..d8f8d2495c1e2e3f194485d16ea587d2
OptionSpec<Integer> optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]); OptionSpec<Integer> optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]);
OptionSpec<String> optionspec12 = optionparser.accepts("serverId").withRequiredArg(); OptionSpec<String> optionspec12 = optionparser.accepts("serverId").withRequiredArg();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 134c8b2acfaa2a8d7cd9a26a85ee4d0227f1a2cd..4311a2e22704606f7f2f0928df6dcbe65e3fa8d6 100644 index 4e2cb2923d1d2a337ffda5b1990d5c9caf47b779..1307801779caa69bdf967134ecbfcb42764243ac 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -48,6 +48,8 @@ import java.util.function.Function; @@ -49,6 +49,8 @@ import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
@@ -421,7 +421,7 @@ index 134c8b2acfaa2a8d7cd9a26a85ee4d0227f1a2cd..4311a2e22704606f7f2f0928df6dcbe6
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.ReportedException; import net.minecraft.ReportedException;
import net.minecraft.SharedConstants; import net.minecraft.SharedConstants;
@@ -1350,8 +1352,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1357,8 +1359,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try { try {
BufferedImage bufferedimage = ImageIO.read(file); BufferedImage bufferedimage = ImageIO.read(file);
@@ -435,10 +435,10 @@ index 134c8b2acfaa2a8d7cd9a26a85ee4d0227f1a2cd..4311a2e22704606f7f2f0928df6dcbe6
ImageIO.write(bufferedimage, "PNG", bytearrayoutputstream); ImageIO.write(bufferedimage, "PNG", bytearrayoutputstream);
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 1392c2e7487a2317496c48a013a745b02c8123d3..cceaf1a5a146998896cba0bbdc88f19dfea893e3 100644 index 590b756842f5f9d1c2f0aed6517f9b46e3dc74db..ce7f36f38165a58e3fab7a98bece75df2d0ec6ed 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -304,7 +304,7 @@ public class ServerEntity { @@ -308,7 +308,7 @@ public class ServerEntity {
if (this.entity instanceof LivingEntity) { if (this.entity instanceof LivingEntity) {
List<Pair<EquipmentSlot, ItemStack>> list = Lists.newArrayList(); List<Pair<EquipmentSlot, ItemStack>> list = Lists.newArrayList();
@@ -448,10 +448,10 @@ index 1392c2e7487a2317496c48a013a745b02c8123d3..cceaf1a5a146998896cba0bbdc88f19d
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 4ce7445b81ce4fe8c6a9395c719d483cc002c08b..c94b850aa33928c0d834b1897b3e0ace3486c3da 100644 index 8924630ca5049f14e5e69323a2d4f7218e06a2aa..a980908087b47869cd9326dbc62974567ed3170a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -39,6 +39,8 @@ import java.util.stream.Collectors; @@ -38,6 +38,8 @@ import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -460,16 +460,16 @@ index 4ce7445b81ce4fe8c6a9395c719d483cc002c08b..c94b850aa33928c0d834b1897b3e0ace
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.Util; import net.minecraft.Util;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@@ -907,7 +909,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -927,7 +929,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BlockPos blockposition2 = blockposition.set(j + randomX, randomY, k + randomZ); BlockPos blockposition2 = blockposition.set(j + randomX, randomY, k + randomZ);
BlockState iblockdata = com.destroystokyo.paper.util.maplist.IBlockDataList.getBlockDataFromRaw(raw); BlockState iblockdata = com.destroystokyo.paper.util.maplist.IBlockDataList.getBlockDataFromRaw(raw);
- iblockdata.randomTick(this, blockposition2, this.randomTickRandom); - iblockdata.randomTick(this, blockposition2, this.randomTickRandom);
+ iblockdata.randomTick(this, blockposition2.immutable(), this.randomTickRandom); // Gale - JettPack - reduce array allocations + iblockdata.randomTick(this, blockposition2.immutable(), this.randomTickRandom); // Gale - JettPack - reduce array allocations
// We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock). // We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock).
// TODO CHECK ON UPDATE // TODO CHECK ON UPDATE (ping the Canadian)
} }
@@ -1162,7 +1164,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1182,7 +1184,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public static List<Entity> getCurrentlyTickingEntities() { public static List<Entity> getCurrentlyTickingEntities() {
Entity ticking = currentlyTickingEntity.get(); Entity ticking = currentlyTickingEntity.get();
@@ -479,7 +479,7 @@ index 4ce7445b81ce4fe8c6a9395c719d483cc002c08b..c94b850aa33928c0d834b1897b3e0ace
return ret; return ret;
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 3c63449a36c6882b6e47f69f3cdf83e874a9a694..9de597c11c3bd0f23e87c3a6187b2036987356e0 100644 index e09c18580ca31644112bae38a4c52a9a51896aec..8f23c46faf83c945516632824ba4e07c4597ad67 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -28,6 +28,8 @@ import java.util.function.UnaryOperator; @@ -28,6 +28,8 @@ import java.util.function.UnaryOperator;
@@ -491,23 +491,15 @@ index 3c63449a36c6882b6e47f69f3cdf83e874a9a694..9de597c11c3bd0f23e87c3a6187b2036
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory; import net.minecraft.CrashReportCategory;
@@ -66,7 +68,6 @@ import net.minecraft.network.chat.PreviewableCommand; @@ -62,7 +64,6 @@ import net.minecraft.network.chat.SignedMessageBody;
import net.minecraft.network.chat.SignedMessageChain; import net.minecraft.network.chat.SignedMessageChain;
import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketUtils; import net.minecraft.network.protocol.PacketUtils;
-import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; -import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
import net.minecraft.network.protocol.game.ClientboundBlockChangedAckPacket; import net.minecraft.network.protocol.game.ClientboundBlockChangedAckPacket;
import net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket; import net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundChatPreviewPacket; import net.minecraft.network.protocol.game.ClientboundCommandSuggestionsPacket;
@@ -78,7 +79,6 @@ import net.minecraft.network.protocol.game.ClientboundMoveVehiclePacket; @@ -173,7 +174,6 @@ import net.minecraft.world.level.block.entity.CommandBlockEntity;
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket;
import net.minecraft.network.protocol.game.ClientboundSetCarriedItemPacket;
import net.minecraft.network.protocol.game.ClientboundSetDefaultSpawnPositionPacket;
-import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket;
import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket;
import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket;
import net.minecraft.network.protocol.game.ClientboundSystemChatPacket;
@@ -175,7 +175,6 @@ import net.minecraft.world.level.block.entity.CommandBlockEntity;
import net.minecraft.world.level.block.entity.JigsawBlockEntity; import net.minecraft.world.level.block.entity.JigsawBlockEntity;
import net.minecraft.world.level.block.entity.SignBlockEntity; import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.block.entity.StructureBlockEntity; import net.minecraft.world.level.block.entity.StructureBlockEntity;
@@ -515,7 +507,7 @@ index 3c63449a36c6882b6e47f69f3cdf83e874a9a694..9de597c11c3bd0f23e87c3a6187b2036
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
@@ -225,8 +224,6 @@ import org.bukkit.event.inventory.InventoryCreativeEvent; @@ -224,8 +224,6 @@ import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType; import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent; import org.bukkit.event.inventory.SmithItemEvent;
import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.AsyncPlayerChatEvent;
@@ -524,7 +516,7 @@ index 3c63449a36c6882b6e47f69f3cdf83e874a9a694..9de597c11c3bd0f23e87c3a6187b2036
import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.event.player.PlayerInteractAtEntityEvent;
@@ -411,7 +408,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -405,7 +403,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (this.keepAlivePending) { if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info
@@ -533,7 +525,7 @@ index 3c63449a36c6882b6e47f69f3cdf83e874a9a694..9de597c11c3bd0f23e87c3a6187b2036
} }
} else { } else {
if (elapsedTime >= 15000L) { // 15 seconds if (elapsedTime >= 15000L) { // 15 seconds
@@ -877,13 +874,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -870,13 +868,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async
// CraftBukkit start // CraftBukkit start
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
@@ -549,7 +541,7 @@ index 3c63449a36c6882b6e47f69f3cdf83e874a9a694..9de597c11c3bd0f23e87c3a6187b2036
return; return;
} }
// Paper end // Paper end
@@ -3402,7 +3399,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3257,7 +3255,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper start // Paper start
if (!org.bukkit.Bukkit.isPrimaryThread()) { if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@@ -559,10 +551,10 @@ index 3c63449a36c6882b6e47f69f3cdf83e874a9a694..9de597c11c3bd0f23e87c3a6187b2036
} }
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index fbd9807e3a9ad555999fa99e06211ecaf455a091..f9d9e3a1051eb19e7dfa9afe964d965df13c65bd 100644 index f3b340fc6be9878d677a76673450aac3e0b73d4b..e373f0a745db273c774afbe448b96cd876a1990c 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -13,8 +13,9 @@ import java.time.Duration; @@ -12,8 +12,9 @@ import java.security.PrivateKey;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -573,7 +565,7 @@ index fbd9807e3a9ad555999fa99e06211ecaf455a091..f9d9e3a1051eb19e7dfa9afe964d965d
import net.minecraft.DefaultUncaughtExceptionHandler; import net.minecraft.DefaultUncaughtExceptionHandler;
import net.minecraft.core.UUIDUtil; import net.minecraft.core.UUIDUtil;
import net.minecraft.network.Connection; import net.minecraft.network.Connection;
@@ -268,8 +269,10 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -236,8 +237,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override @Override
public void handleHello(ServerboundHelloPacket packet) { public void handleHello(ServerboundHelloPacket packet) {
@@ -586,7 +578,7 @@ index fbd9807e3a9ad555999fa99e06211ecaf455a091..f9d9e3a1051eb19e7dfa9afe964d965d
// Paper start - validate usernames // Paper start - validate usernames
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) { if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(packet.name())) { if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(packet.name())) {
@@ -329,7 +332,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -296,7 +299,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override @Override
public void handleKey(ServerboundKeyPacket packet) { public void handleKey(ServerboundKeyPacket packet) {
@@ -596,10 +588,10 @@ index fbd9807e3a9ad555999fa99e06211ecaf455a091..f9d9e3a1051eb19e7dfa9afe964d965d
final String s; final String s;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index a436c3d0ad3de877ced6c7e53600c48e25d8da26..507017c1ea03cd028be2149b18c8de7f8353e37e 100644 index fe7037310e1a2b5fc2956b565982847e4c2be041..c0226f0445e2554000f2fc0a3906f9b3ed404097 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -26,6 +26,8 @@ import java.util.UUID; @@ -27,6 +27,8 @@ import java.util.UUID;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Predicate; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -608,7 +600,7 @@ index a436c3d0ad3de877ced6c7e53600c48e25d8da26..507017c1ea03cd028be2149b18c8de7f
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.FileUtil; import net.minecraft.FileUtil;
import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.CommandSourceStack;
@@ -114,7 +116,6 @@ import org.bukkit.Location; @@ -118,7 +120,6 @@ import org.bukkit.Location;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.entity.CraftPlayer;
@@ -616,7 +608,7 @@ index a436c3d0ad3de877ced6c7e53600c48e25d8da26..507017c1ea03cd028be2149b18c8de7f
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
@@ -742,7 +743,7 @@ public abstract class PlayerList { @@ -750,7 +751,7 @@ public abstract class PlayerList {
while (iterator.hasNext()) { while (iterator.hasNext()) {
entityplayer = (ServerPlayer) iterator.next(); entityplayer = (ServerPlayer) iterator.next();
this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved
@@ -693,7 +685,7 @@ index 5d8e9bdf5538b19681f21949368d862fab8a89ad..75ca7ae6028e971f73988f5e71598696
public ZeroBitStorage(int size) { public ZeroBitStorage(int size) {
diff --git a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java diff --git a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java
index c82bb38b5b1c9204daef21455723d21509ad1c44..7ebb622c3e5961c730fbfe9e6113696d239fabfe 100644 index 97ff19efa0b3943ccb7a6e02cba6ed2fea61adac..b2ae2bd8bd4ff3cb6457e8c08172e348c1d345f7 100644
--- a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java --- a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java
+++ b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java +++ b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java
@@ -12,6 +12,7 @@ public enum EquipmentSlot { @@ -12,6 +12,7 @@ public enum EquipmentSlot {
@@ -705,10 +697,10 @@ index c82bb38b5b1c9204daef21455723d21509ad1c44..7ebb622c3e5961c730fbfe9e6113696d
private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) { private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) {
this.type = type; this.type = type;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 5add41e429b176195a10115744305a2358b5fb7f..214106611e449b0ab279fd256122f64b070fd34e 100644 index b109c55a31a9e5a0813e360d8a3c1b13d1bfd416..46ad26f8f6680446718bb13158eca3f712f1986e 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3092,7 +3092,7 @@ public abstract class LivingEntity extends Entity { @@ -3109,7 +3109,7 @@ public abstract class LivingEntity extends Entity {
@Nullable @Nullable
private Map<EquipmentSlot, ItemStack> collectEquipmentChanges() { private Map<EquipmentSlot, ItemStack> collectEquipmentChanges() {
Map<EquipmentSlot, ItemStack> map = null; Map<EquipmentSlot, ItemStack> map = null;
@@ -718,10 +710,10 @@ index 5add41e429b176195a10115744305a2358b5fb7f..214106611e449b0ab279fd256122f64b
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index cf40ebd06c52a7a00e6f704a29ae9d2b5186d35a..6d9e63060ea43d8b19c723bb97c1c92ec3a63193 100644 index 49b983064ea810382b6112f5dc7f93ba4e5710bd..aa58adbd6dde51e6902ca9af1ae1a63e8a11bb34 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1021,7 +1021,7 @@ public abstract class Mob extends LivingEntity { @@ -1039,7 +1039,7 @@ public abstract class Mob extends LivingEntity {
@Override @Override
protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) { protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) {
super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops); super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);
@@ -730,7 +722,7 @@ index cf40ebd06c52a7a00e6f704a29ae9d2b5186d35a..6d9e63060ea43d8b19c723bb97c1c92e
int j = aenumitemslot.length; int j = aenumitemslot.length;
for (int k = 0; k < j; ++k) { for (int k = 0; k < j; ++k) {
@@ -1083,7 +1083,7 @@ public abstract class Mob extends LivingEntity { @@ -1101,7 +1101,7 @@ public abstract class Mob extends LivingEntity {
} }
boolean flag = true; boolean flag = true;
@@ -739,7 +731,7 @@ index cf40ebd06c52a7a00e6f704a29ae9d2b5186d35a..6d9e63060ea43d8b19c723bb97c1c92e
int j = aenumitemslot.length; int j = aenumitemslot.length;
for (int k = 0; k < j; ++k) { for (int k = 0; k < j; ++k) {
@@ -1170,7 +1170,7 @@ public abstract class Mob extends LivingEntity { @@ -1188,7 +1188,7 @@ public abstract class Mob extends LivingEntity {
float f = localDifficulty.getSpecialMultiplier(); float f = localDifficulty.getSpecialMultiplier();
this.enchantSpawnedWeapon(random, f); this.enchantSpawnedWeapon(random, f);
@@ -748,7 +740,7 @@ index cf40ebd06c52a7a00e6f704a29ae9d2b5186d35a..6d9e63060ea43d8b19c723bb97c1c92e
int i = aenumitemslot.length; int i = aenumitemslot.length;
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
@@ -1384,7 +1384,7 @@ public abstract class Mob extends LivingEntity { @@ -1405,7 +1405,7 @@ public abstract class Mob extends LivingEntity {
t0.setInvulnerable(this.isInvulnerable()); t0.setInvulnerable(this.isInvulnerable());
if (flag) { if (flag) {
t0.setCanPickUpLoot(this.canPickUpLoot()); t0.setCanPickUpLoot(this.canPickUpLoot());
@@ -758,10 +750,10 @@ index cf40ebd06c52a7a00e6f704a29ae9d2b5186d35a..6d9e63060ea43d8b19c723bb97c1c92e
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
index d1f7d912ad274cf90a912e44d63b39f9387a694b..966a9b173b2a89b8726a6cf0c3cc94969f7930a2 100644 index 71a36cf9b976443cca9ab63cd0eb23253f638562..201b0e1b25d0773bbcf9c1ed69fd888a61c6a16f 100644
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -233,7 +233,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -234,7 +234,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
return; return;
} }
// CraftBukkit end // CraftBukkit end
@@ -771,10 +763,10 @@ index d1f7d912ad274cf90a912e44d63b39f9387a694b..966a9b173b2a89b8726a6cf0c3cc9496
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 6eda115b5cd3312123784e758b59973e0a55773c..e7c861b040afd8bc8d808dd00ae87958e861f7fb 100644 index 8450a22b0fc6e8dc5cad0f61ac52a82b3cd3791e..8fd080110ed4efaf6cb3a2561b32ed66ff8c78f0 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -969,7 +969,7 @@ public final class ItemStack { @@ -976,7 +976,7 @@ public final class ItemStack {
int k; int k;
if (ItemStack.shouldShowInTooltip(i, ItemStack.TooltipPart.MODIFIERS)) { if (ItemStack.shouldShowInTooltip(i, ItemStack.TooltipPart.MODIFIERS)) {
@@ -784,7 +776,7 @@ index 6eda115b5cd3312123784e758b59973e0a55773c..e7c861b040afd8bc8d808dd00ae87958
k = aenumitemslot.length; k = aenumitemslot.length;
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
index 9e3f9099cc47e6c6e40d11ef6d6e83fbf19a3cf7..a5e5df1ea83483a1fbcc42035ade95d7dd4def6e 100644 index ecc70d770e794e0ef27ef365f5a32555c2b06544..2fbe8ffd9fbf12549adecea7d4a0efdb5efd8f1e 100644
--- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java --- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
@@ -12,6 +12,8 @@ import java.util.Iterator; @@ -12,6 +12,8 @@ import java.util.Iterator;
@@ -794,9 +786,9 @@ index 9e3f9099cc47e6c6e40d11ef6d6e83fbf19a3cf7..a5e5df1ea83483a1fbcc42035ade95d7
+ +
+import me.titaniumtown.ArrayConstants; +import me.titaniumtown.ArrayConstants;
import net.minecraft.core.NonNullList; import net.minecraft.core.NonNullList;
import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
@@ -242,7 +244,7 @@ public class ShapedRecipe implements CraftingRecipe { @@ -250,7 +252,7 @@ public class ShapedRecipe implements CraftingRecipe {
} }
if (pattern.length == l) { if (pattern.length == l) {
@@ -806,10 +798,10 @@ index 9e3f9099cc47e6c6e40d11ef6d6e83fbf19a3cf7..a5e5df1ea83483a1fbcc42035ade95d7
String[] astring1 = new String[pattern.length - l - k]; String[] astring1 = new String[pattern.length - l - k];
diff --git a/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java b/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java diff --git a/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java b/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java
index 1367908a54e1c1703d14b3c25852da5ec1b02019..d783ba1a061b910721de8999afd5acd535086fb3 100644 index 2bfbdaeb2b0d99dfd956cd5936403fe8b0eeae64..84f1c4c3ded4f201899f3c74e639349b9d1f00ee 100644
--- a/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java --- a/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java
+++ b/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java +++ b/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java
@@ -43,8 +43,10 @@ public class Enchantments { @@ -44,8 +44,10 @@ public class Enchantments {
public static final Enchantment MULTISHOT = Enchantments.register("multishot", new MultiShotEnchantment(Enchantment.Rarity.RARE, new EquipmentSlot[]{EquipmentSlot.MAINHAND})); public static final Enchantment MULTISHOT = Enchantments.register("multishot", new MultiShotEnchantment(Enchantment.Rarity.RARE, new EquipmentSlot[]{EquipmentSlot.MAINHAND}));
public static final Enchantment QUICK_CHARGE = Enchantments.register("quick_charge", new QuickChargeEnchantment(Enchantment.Rarity.UNCOMMON, new EquipmentSlot[]{EquipmentSlot.MAINHAND})); public static final Enchantment QUICK_CHARGE = Enchantments.register("quick_charge", new QuickChargeEnchantment(Enchantment.Rarity.UNCOMMON, new EquipmentSlot[]{EquipmentSlot.MAINHAND}));
public static final Enchantment PIERCING = Enchantments.register("piercing", new ArrowPiercingEnchantment(Enchantment.Rarity.COMMON, new EquipmentSlot[]{EquipmentSlot.MAINHAND})); public static final Enchantment PIERCING = Enchantments.register("piercing", new ArrowPiercingEnchantment(Enchantment.Rarity.COMMON, new EquipmentSlot[]{EquipmentSlot.MAINHAND}));
@@ -820,10 +812,10 @@ index 1367908a54e1c1703d14b3c25852da5ec1b02019..d783ba1a061b910721de8999afd5acd5
+ public static final Enchantment VANISHING_CURSE = Enchantments.register("vanishing_curse", new VanishingCurseEnchantment(Enchantment.Rarity.VERY_RARE, EquipmentSlot.VALUES)); + public static final Enchantment VANISHING_CURSE = Enchantments.register("vanishing_curse", new VanishingCurseEnchantment(Enchantment.Rarity.VERY_RARE, EquipmentSlot.VALUES));
+ // Gale end - JettPack - reduce array allocations + // Gale end - JettPack - reduce array allocations
// CraftBukkit start public Enchantments() {}
static {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 7fdd5f7d7a060309b9b44088836621ad1e512f1d..5f8a0078f09468bb01a5d02082012eafbc43ad23 100644 index 14c2e816e6bc5801846c296318afe223abf95c5d..6fb3e25c7972c681284dd611eedb214c9335697e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -12,6 +12,8 @@ import java.util.function.Consumer; @@ -12,6 +12,8 @@ import java.util.function.Consumer;
@@ -835,7 +827,7 @@ index 7fdd5f7d7a060309b9b44088836621ad1e512f1d..5f8a0078f09468bb01a5d02082012eaf
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory; import net.minecraft.CrashReportCategory;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@@ -1525,7 +1527,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1593,7 +1595,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) { public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ); io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ);
if (slices == null) { if (slices == null) {
@@ -845,7 +837,7 @@ index 7fdd5f7d7a060309b9b44088836621ad1e512f1d..5f8a0078f09468bb01a5d02082012eaf
return slices.getChunkEntities(); return slices.getChunkEntities();
} }
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
index 492e3ffd6a4588a521486db631f3e8b2a25b74ec..b0ef8beeb973643656dac79b2084cb71ddd99873 100644 index 564822911c25238900b361d564c5db3103900fb3..ad6cd860d5d2accbfdf52ee24ffa52bff2045b74 100644
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java --- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
@@ -3,6 +3,8 @@ package net.minecraft.world.level.block; @@ -3,6 +3,8 @@ package net.minecraft.world.level.block;
@@ -885,7 +877,7 @@ index 492e3ffd6a4588a521486db631f3e8b2a25b74ec..b0ef8beeb973643656dac79b2084cb71
@Override @Override
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index c6aeda6497cb59673b469588142f5f15a338389d..a54ea502741a9ac01bce7af8c0d28405b8aa738d 100644 index cac2768fe520b591990c7bc943ae7e95f49efb31..07ef81d3d1359d10f0d2f207e671c010695f6119 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -9,6 +9,8 @@ import java.util.Iterator; @@ -9,6 +9,8 @@ import java.util.Iterator;

View File

@@ -13,7 +13,7 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index c73f2a697bcb4a670df37879dfc3e140290325bd..2a2e66449e816494a6c52cb771c63f60220e82fc 100644 index b1bb14fc038df5631acf4c905876636230897077..23e4851fc7806820581b79931f10491fe9ceeec3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -290,7 +290,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -290,7 +290,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -25,7 +25,7 @@ index c73f2a697bcb4a670df37879dfc3e140290325bd..2a2e66449e816494a6c52cb771c63f60
public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public
private ChunkPos chunkPosition; private ChunkPos chunkPosition;
private Vec3 deltaMovement; private Vec3 deltaMovement;
@@ -1861,9 +1861,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1876,9 +1876,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public float getLightLevelDependentMagicValue() { public float getLightLevelDependentMagicValue() {
@@ -45,10 +45,10 @@ index c73f2a697bcb4a670df37879dfc3e140290325bd..2a2e66449e816494a6c52cb771c63f60
this.absMoveTo(x, y, z); this.absMoveTo(x, y, z);
this.setYRot(yaw % 360.0F); this.setYRot(yaw % 360.0F);
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 6d9e63060ea43d8b19c723bb97c1c92ec3a63193..4b17ea0a27beb4c66d6915a3bd762f14a8548d92 100644 index aa58adbd6dde51e6902ca9af1ae1a63e8a11bb34..e601b50935fc7212050e01fd31235149a33daf3b 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1641,13 +1641,29 @@ public abstract class Mob extends LivingEntity { @@ -1667,13 +1667,29 @@ public abstract class Mob extends LivingEntity {
} }

View File

@@ -13,11 +13,11 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
index 1805aacd982dae8d971cfad0ead23c161badb095..ead2e1935e133e7729949dbd8fc48667ba6e088c 100644 index b738ee2d3801fadfd09313f05ae24593e56b0ec6..b4bbd34d983e559dc2716520561cac61108c6d5c 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java --- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -10,6 +10,8 @@ import java.util.Map; @@ -11,6 +11,8 @@ import java.util.Set;
import java.util.Set; import java.util.function.Predicate;
import java.util.function.Supplier; import java.util.function.Supplier;
import java.util.stream.Stream; import java.util.stream.Stream;
+ +
@@ -25,7 +25,7 @@ index 1805aacd982dae8d971cfad0ead23c161badb095..ead2e1935e133e7729949dbd8fc48667
import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.util.profiling.ProfilerFiller;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -27,7 +29,7 @@ public class GoalSelector { @@ -28,7 +30,7 @@ public class GoalSelector {
} }
}; };
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class); private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);

View File

@@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index e660a84251bc67435e905aacf628a84156b5d689..dfdd70fccc135b7c1cf89b8e4c2fcdb7738caea7 100644 index 19bdb2c717718f074ab2b4c5fb934ea29dd80c53..1af9fbd3f131caef18990cc8c2d3a2568207cd7a 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java --- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java +++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -19,6 +19,8 @@ import java.util.function.BiConsumer; @@ -19,6 +19,8 @@ import java.util.function.BiConsumer;
@@ -25,7 +25,7 @@ index e660a84251bc67435e905aacf628a84156b5d689..dfdd70fccc135b7c1cf89b8e4c2fcdb7
import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands; import net.minecraft.commands.Commands;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
@@ -118,7 +120,7 @@ public class GameRules { @@ -125,7 +127,7 @@ public class GameRules {
} }
private GameRules(Map<GameRules.Key<?>, GameRules.Value<?>> rules) { private GameRules(Map<GameRules.Key<?>, GameRules.Value<?>> rules) {

View File

@@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 81eb5e47715312afbedce0786e9a0d4264d32cbd..b0862a0126c642b12d3e17045d39fb704406e295 100644 index d1602af2d6e5d4dd8d8b44ab66bca39c60195093..c6f4e9e465e24a37b773b348feb24feb0ac3adf7 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -1,8 +1,6 @@ @@ -1,8 +1,6 @@
@@ -33,9 +33,9 @@ index 81eb5e47715312afbedce0786e9a0d4264d32cbd..b0862a0126c642b12d3e17045d39fb70
+import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap; +import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
+import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; +import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
import net.minecraft.Util; import net.minecraft.Util;
import net.minecraft.core.Registry; import net.minecraft.core.Holder;
import net.minecraft.nbt.CompoundTag; import net.minecraft.core.registries.BuiltInRegistries;
@@ -19,8 +20,10 @@ import org.slf4j.Logger; @@ -20,8 +21,10 @@ import org.slf4j.Logger;
public class AttributeMap { public class AttributeMap {
private static final Logger LOGGER = LogUtils.getLogger(); private static final Logger LOGGER = LogUtils.getLogger();

View File

@@ -82,7 +82,7 @@ index 0000000000000000000000000000000000000000..48c32b224095f606669a38f0e200505a
+ +
+} +}
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 2e65b44f10aeb44fd524a58e7eb815a566c1ad61..ee13a217a72a41d103789b66eef70bf351d1e624 100644 index 7b71073027f4cf79736546500ededdfbb83d968e..0a3fff9fc22f76dcef9f108bceea4da39145745c 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java --- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -11,6 +11,8 @@ import java.util.List; @@ -11,6 +11,8 @@ import java.util.List;
@@ -94,7 +94,7 @@ index 2e65b44f10aeb44fd524a58e7eb815a566c1ad61..ee13a217a72a41d103789b66eef70bf3
import net.minecraft.SharedConstants; import net.minecraft.SharedConstants;
import net.minecraft.Util; import net.minecraft.Util;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@@ -70,11 +72,12 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -68,11 +70,12 @@ public class Block extends BlockBehaviour implements ItemLike {
private static final Logger LOGGER = LogUtils.getLogger(); private static final Logger LOGGER = LogUtils.getLogger();
private final Holder.Reference<Block> builtInRegistryHolder; private final Holder.Reference<Block> builtInRegistryHolder;
public static final IdMapper<BlockState> BLOCK_STATE_REGISTRY = new IdMapper<>(); public static final IdMapper<BlockState> BLOCK_STATE_REGISTRY = new IdMapper<>();
@@ -112,7 +112,7 @@ index 2e65b44f10aeb44fd524a58e7eb815a566c1ad61..ee13a217a72a41d103789b66eef70bf3
public static final int UPDATE_NEIGHBORS = 1; public static final int UPDATE_NEIGHBORS = 1;
public static final int UPDATE_CLIENTS = 2; public static final int UPDATE_CLIENTS = 2;
public static final int UPDATE_INVISIBLE = 4; public static final int UPDATE_INVISIBLE = 4;
@@ -281,7 +284,7 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -279,7 +282,7 @@ public class Block extends BlockBehaviour implements ItemLike {
} }
public static boolean isShapeFullBlock(VoxelShape shape) { public static boolean isShapeFullBlock(VoxelShape shape) {

View File

@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index ee13a217a72a41d103789b66eef70bf351d1e624..3bb3dd974a74c58dd115f6f1d69e48dc8f6d700c 100644 index 0a3fff9fc22f76dcef9f108bceea4da39145745c..39981cd0003eb7ee416d887ffec70fb049599320 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java --- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -615,11 +615,18 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -609,11 +609,18 @@ public class Block extends BlockBehaviour implements ItemLike {
private final BlockState first; private final BlockState first;
private final BlockState second; private final BlockState second;
private final Direction direction; private final Direction direction;
@@ -35,7 +35,7 @@ index ee13a217a72a41d103789b66eef70bf351d1e624..3bb3dd974a74c58dd115f6f1d69e48dc
} }
public boolean equals(Object object) { public boolean equals(Object object) {
@@ -635,11 +642,7 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -629,11 +636,7 @@ public class Block extends BlockBehaviour implements ItemLike {
} }
public int hashCode() { public int hashCode() {

View File

@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 214106611e449b0ab279fd256122f64b070fd34e..7a2229f64a67530760b02ff1ac82495ec5f91b37 100644 index 46ad26f8f6680446718bb13158eca3f712f1986e..f2814df6d715910a3c8101a0af5f3190355bcc52 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -575,11 +575,10 @@ public abstract class LivingEntity extends Entity { @@ -574,11 +574,10 @@ public abstract class LivingEntity extends Entity {
} }
protected void tryAddFrost() { protected void tryAddFrost() {
@@ -29,7 +29,7 @@ index 214106611e449b0ab279fd256122f64b070fd34e..7a2229f64a67530760b02ff1ac82495e
if (attributemodifiable == null) { if (attributemodifiable == null) {
return; return;
@@ -589,7 +588,6 @@ public abstract class LivingEntity extends Entity { @@ -588,7 +587,6 @@ public abstract class LivingEntity extends Entity {
attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION)); attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION));
} }

View File

@@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
index 6a0a1731fd6804eb69d3641213712d31bce085b2..5f2a168e3e282cdb1d2e9cd3fd956eedaf4b4688 100644 index 08b18428e867baf14f551beb72e3875b0c420639..ef142a54f4b7277c3952e0730bdeaedfe218c78f 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java --- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -107,6 +107,7 @@ public class Raid { @@ -107,6 +107,7 @@ public class Raid {
@@ -37,7 +37,7 @@ index 6a0a1731fd6804eb69d3641213712d31bce085b2..5f2a168e3e282cdb1d2e9cd3fd956eed
if (!this.isStopped()) { if (!this.isStopped()) {
if (this.status == Raid.RaidStatus.ONGOING) { if (this.status == Raid.RaidStatus.ONGOING) {
boolean flag = this.active; boolean flag = this.active;
@@ -626,6 +633,12 @@ public class Raid { @@ -638,6 +645,12 @@ public class Raid {
} }
public void updateBossbar() { public void updateBossbar() {

View File

@@ -25,28 +25,11 @@ index b8ef0f9c815799d54edcdb26dc0b4c1c281fc03e..9bec8e9e91676238b41d03d8044bfbb3
private final ItemPredicate head; private final ItemPredicate head;
private final ItemPredicate chest; private final ItemPredicate chest;
private final ItemPredicate legs; private final ItemPredicate legs;
diff --git a/src/main/java/net/minecraft/data/advancements/AdventureAdvancements.java b/src/main/java/net/minecraft/data/advancements/AdventureAdvancements.java
index 892d016152fc68edc197795cb7db46f5540221ce..e083d0705e6d923735b9b3eb4acbdf976ef3f19e 100644
--- a/src/main/java/net/minecraft/data/advancements/AdventureAdvancements.java
+++ b/src/main/java/net/minecraft/data/advancements/AdventureAdvancements.java
@@ -81,8 +81,10 @@ public class AdventureAdvancements implements Consumer<Consumer<Advancement>> {
Advancement.Builder.advancement().parent(advancement7).display(Items.CROSSBOW, Component.translatable("advancements.adventure.whos_the_pillager_now.title"), Component.translatable("advancements.adventure.whos_the_pillager_now.description"), (ResourceLocation)null, FrameType.TASK, true, true, false).addCriterion("kill_pillager", KilledByCrossbowTrigger.TriggerInstance.crossbowKilled(EntityPredicate.Builder.entity().of(EntityType.PILLAGER))).save(consumer, "adventure/whos_the_pillager_now");
Advancement.Builder.advancement().parent(advancement7).display(Items.CROSSBOW, Component.translatable("advancements.adventure.two_birds_one_arrow.title"), Component.translatable("advancements.adventure.two_birds_one_arrow.description"), (ResourceLocation)null, FrameType.CHALLENGE, true, true, false).rewards(AdvancementRewards.Builder.experience(65)).addCriterion("two_birds", KilledByCrossbowTrigger.TriggerInstance.crossbowKilled(EntityPredicate.Builder.entity().of(EntityType.PHANTOM), EntityPredicate.Builder.entity().of(EntityType.PHANTOM))).save(consumer, "adventure/two_birds_one_arrow");
Advancement.Builder.advancement().parent(advancement7).display(Items.CROSSBOW, Component.translatable("advancements.adventure.arbalistic.title"), Component.translatable("advancements.adventure.arbalistic.description"), (ResourceLocation)null, FrameType.CHALLENGE, true, true, true).rewards(AdvancementRewards.Builder.experience(85)).addCriterion("arbalistic", KilledByCrossbowTrigger.TriggerInstance.crossbowKilled(MinMaxBounds.Ints.exactly(5))).save(consumer, "adventure/arbalistic");
- Advancement advancement8 = Advancement.Builder.advancement().parent(advancement).display(Raid.getLeaderBannerInstance(), Component.translatable("advancements.adventure.voluntary_exile.title"), Component.translatable("advancements.adventure.voluntary_exile.description"), (ResourceLocation)null, FrameType.TASK, true, true, true).addCriterion("voluntary_exile", KilledTrigger.TriggerInstance.playerKilledEntity(EntityPredicate.Builder.entity().of(EntityTypeTags.RAIDERS).equipment(EntityEquipmentPredicate.CAPTAIN))).save(consumer, "adventure/voluntary_exile");
- Advancement.Builder.advancement().parent(advancement8).display(Raid.getLeaderBannerInstance(), Component.translatable("advancements.adventure.hero_of_the_village.title"), Component.translatable("advancements.adventure.hero_of_the_village.description"), (ResourceLocation)null, FrameType.CHALLENGE, true, true, true).rewards(AdvancementRewards.Builder.experience(100)).addCriterion("hero_of_the_village", PlayerTrigger.TriggerInstance.raidWon()).save(consumer, "adventure/hero_of_the_village");
+ // Gale start - Lithium - cache ominous banner item
+ Advancement advancement8 = Advancement.Builder.advancement().parent(advancement).display(Raid.LEADER_BANNER, Component.translatable("advancements.adventure.voluntary_exile.title"), Component.translatable("advancements.adventure.voluntary_exile.description"), (ResourceLocation)null, FrameType.TASK, true, true, true).addCriterion("voluntary_exile", KilledTrigger.TriggerInstance.playerKilledEntity(EntityPredicate.Builder.entity().of(EntityTypeTags.RAIDERS).equipment(EntityEquipmentPredicate.CAPTAIN))).save(consumer, "adventure/voluntary_exile");
+ Advancement.Builder.advancement().parent(advancement8).display(Raid.LEADER_BANNER, Component.translatable("advancements.adventure.hero_of_the_village.title"), Component.translatable("advancements.adventure.hero_of_the_village.description"), (ResourceLocation)null, FrameType.CHALLENGE, true, true, true).rewards(AdvancementRewards.Builder.experience(100)).addCriterion("hero_of_the_village", PlayerTrigger.TriggerInstance.raidWon()).save(consumer, "adventure/hero_of_the_village");
+ // Gale end - Lithium - cache ominous banner item
Advancement.Builder.advancement().parent(advancement).display(Blocks.HONEY_BLOCK.asItem(), Component.translatable("advancements.adventure.honey_block_slide.title"), Component.translatable("advancements.adventure.honey_block_slide.description"), (ResourceLocation)null, FrameType.TASK, true, true, false).addCriterion("honey_block_slide", SlideDownBlockTrigger.TriggerInstance.slidesDownBlock(Blocks.HONEY_BLOCK)).save(consumer, "adventure/honey_block_slide");
Advancement.Builder.advancement().parent(advancement5).display(Blocks.TARGET.asItem(), Component.translatable("advancements.adventure.bullseye.title"), Component.translatable("advancements.adventure.bullseye.description"), (ResourceLocation)null, FrameType.CHALLENGE, true, true, false).rewards(AdvancementRewards.Builder.experience(50)).addCriterion("bullseye", TargetBlockTrigger.TriggerInstance.targetHit(MinMaxBounds.Ints.exactly(15), EntityPredicate.Composite.wrap(EntityPredicate.Builder.entity().distance(DistancePredicate.horizontal(MinMaxBounds.Doubles.atLeast(30.0D))).build()))).save(consumer, "adventure/bullseye");
Advancement.Builder.advancement().parent(advancement2).display(Items.LEATHER_BOOTS, Component.translatable("advancements.adventure.walk_on_powder_snow_with_leather_boots.title"), Component.translatable("advancements.adventure.walk_on_powder_snow_with_leather_boots.description"), (ResourceLocation)null, FrameType.TASK, true, true, false).addCriterion("walk_on_powder_snow_with_leather_boots", PlayerTrigger.TriggerInstance.walkOnBlockWithEquipment(Blocks.POWDER_SNOW, Items.LEATHER_BOOTS)).save(consumer, "adventure/walk_on_powder_snow_with_leather_boots");
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
index 5f2a168e3e282cdb1d2e9cd3fd956eedaf4b4688..d56e7e8cacdabb8f009eaba8164f65f4d824a282 100644 index ef142a54f4b7277c3952e0730bdeaedfe218c78f..b13ef853419d2783d09b3e685b9b506a4ff5676e 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java --- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -690,7 +690,7 @@ public class Raid { @@ -702,7 +702,7 @@ public class Raid {
this.level.getRaids().setDirty(); this.level.getRaids().setDirty();
} }
@@ -55,7 +38,7 @@ index 5f2a168e3e282cdb1d2e9cd3fd956eedaf4b4688..d56e7e8cacdabb8f009eaba8164f65f4
ItemStack itemstack = new ItemStack(Items.WHITE_BANNER); ItemStack itemstack = new ItemStack(Items.WHITE_BANNER);
CompoundTag nbttagcompound = new CompoundTag(); CompoundTag nbttagcompound = new CompoundTag();
ListTag nbttaglist = (new BannerPattern.Builder()).addPattern(BannerPatterns.RHOMBUS_MIDDLE, DyeColor.CYAN).addPattern(BannerPatterns.STRIPE_BOTTOM, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.STRIPE_CENTER, DyeColor.GRAY).addPattern(BannerPatterns.BORDER, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.STRIPE_MIDDLE, DyeColor.BLACK).addPattern(BannerPatterns.HALF_HORIZONTAL, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.CIRCLE_MIDDLE, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.BORDER, DyeColor.BLACK).toListTag(); ListTag nbttaglist = (new BannerPattern.Builder()).addPattern(BannerPatterns.RHOMBUS_MIDDLE, DyeColor.CYAN).addPattern(BannerPatterns.STRIPE_BOTTOM, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.STRIPE_CENTER, DyeColor.GRAY).addPattern(BannerPatterns.BORDER, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.STRIPE_MIDDLE, DyeColor.BLACK).addPattern(BannerPatterns.HALF_HORIZONTAL, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.CIRCLE_MIDDLE, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.BORDER, DyeColor.BLACK).toListTag();
@@ -702,6 +702,14 @@ public class Raid { @@ -714,6 +714,14 @@ public class Raid {
return itemstack; return itemstack;
} }

View File

@@ -35,10 +35,10 @@ index 0000000000000000000000000000000000000000..451934fa8b97d4b0ce2bb994e18e8d47
+ +
+} +}
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
index 4b61602a1d2d6817272e02cfd282ac5dabbd976d..c0a71e1b311f8a37909a61f10d202ef8d3658a5a 100644 index 221c5d080d55326e458c1182823d6b49224ef498..329adee82a5cafbb0a9b2d1b6c7fed660135db97 100644
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
@@ -52,6 +52,74 @@ public class PistonMovingBlockEntity extends BlockEntity { @@ -55,6 +55,74 @@ public class PistonMovingBlockEntity extends BlockEntity {
this.extending = extending; this.extending = extending;
this.isSourcePiston = source; this.isSourcePiston = source;
} }
@@ -113,7 +113,7 @@ index 4b61602a1d2d6817272e02cfd282ac5dabbd976d..c0a71e1b311f8a37909a61f10d202ef8
@Override @Override
public CompoundTag getUpdateTag() { public CompoundTag getUpdateTag() {
@@ -351,10 +419,27 @@ public class PistonMovingBlockEntity extends BlockEntity { @@ -355,10 +423,27 @@ public class PistonMovingBlockEntity extends BlockEntity {
} }
float f = this.getExtendedProgress(this.progress); float f = this.getExtendedProgress(this.progress);

View File

@@ -115,7 +115,7 @@ index 0000000000000000000000000000000000000000..f2f10b651e4fbecdd1ea1bc28ebf40d6
+ +
+} +}
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index c9e719e676ea26ee94673538db2dfd9ce5c957ae..0ee2cb850cd1039d8fe47b503027f0fcdbfe2daa 100644 index d2bbbb0e73dafd2294838137bfbd16acf1c76940..2ddfeb9edf691bbf10f1b1578ac3c132cea12739 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -8,6 +8,7 @@ import java.util.concurrent.atomic.AtomicLong; @@ -8,6 +8,7 @@ import java.util.concurrent.atomic.AtomicLong;
@@ -126,7 +126,7 @@ index c9e719e676ea26ee94673538db2dfd9ce5c957ae..0ee2cb850cd1039d8fe47b503027f0fc
import net.minecraft.Util; import net.minecraft.Util;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
@@ -83,6 +84,10 @@ public class WorldGenRegion implements WorldGenLevel { @@ -84,6 +85,10 @@ public class WorldGenRegion implements WorldGenLevel {
private Supplier<String> currentlyGenerating; private Supplier<String> currentlyGenerating;
private final AtomicLong subTickCount = new AtomicLong(); private final AtomicLong subTickCount = new AtomicLong();
private static final ResourceLocation WORLDGEN_REGION_RANDOM = new ResourceLocation("worldgen_region_random"); private static final ResourceLocation WORLDGEN_REGION_RANDOM = new ResourceLocation("worldgen_region_random");
@@ -137,7 +137,7 @@ index c9e719e676ea26ee94673538db2dfd9ce5c957ae..0ee2cb850cd1039d8fe47b503027f0fc
public WorldGenRegion(ServerLevel world, List<ChunkAccess> chunks, ChunkStatus status, int placementRadius) { public WorldGenRegion(ServerLevel world, List<ChunkAccess> chunks, ChunkStatus status, int placementRadius) {
this.generatingStatus = status; this.generatingStatus = status;
@@ -105,6 +110,11 @@ public class WorldGenRegion implements WorldGenLevel { @@ -106,6 +111,11 @@ public class WorldGenRegion implements WorldGenLevel {
this.lastPos = ((ChunkAccess) chunks.get(chunks.size() - 1)).getPos(); this.lastPos = ((ChunkAccess) chunks.get(chunks.size() - 1)).getPos();
this.structureManager = world.structureManager().forWorldGenRegion(this); this.structureManager = world.structureManager().forWorldGenRegion(this);
} }
@@ -149,7 +149,7 @@ index c9e719e676ea26ee94673538db2dfd9ce5c957ae..0ee2cb850cd1039d8fe47b503027f0fc
} }
public boolean isOldChunkAround(ChunkPos chunkPos, int checkRadius) { public boolean isOldChunkAround(ChunkPos chunkPos, int checkRadius) {
@@ -122,9 +132,29 @@ public class WorldGenRegion implements WorldGenLevel { @@ -123,9 +133,29 @@ public class WorldGenRegion implements WorldGenLevel {
@Override @Override
public ChunkAccess getChunk(int chunkX, int chunkZ) { public ChunkAccess getChunk(int chunkX, int chunkZ) {
@@ -180,7 +180,7 @@ index c9e719e676ea26ee94673538db2dfd9ce5c957ae..0ee2cb850cd1039d8fe47b503027f0fc
@Nullable @Nullable
@Override @Override
public ChunkAccess getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) { public ChunkAccess getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
@@ -182,7 +212,17 @@ public class WorldGenRegion implements WorldGenLevel { @@ -183,7 +213,17 @@ public class WorldGenRegion implements WorldGenLevel {
@Override @Override
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {

View File

@@ -13,26 +13,29 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
index cf87490a446285132daaf9d90154ac6d477a62fe..0d1f6ba9d337d2b4efe4e0b58b687d7b7cacae7a 100644 index 6b84633bf6956406d2e2c5dd32fa358f41ccc890..6c93e621d584927076b886c719e93039019e32be 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java --- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
@@ -67,6 +67,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator { @@ -62,12 +62,17 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
public final Registry<NormalNoise.NoiseParameters> noises; private static final BlockState AIR = Blocks.AIR.defaultBlockState();
public final Holder<NoiseGeneratorSettings> settings; public final Holder<NoiseGeneratorSettings> settings;
private final Aquifer.FluidPicker globalFluidPicker; private final Supplier<Aquifer.FluidPicker> globalFluidPicker;
+ private int cachedSeaLevel; // Gale - Lithium - cache world generator sea level + private int cachedSeaLevel; // Gale - Lithium - cache world generator sea level
public NoiseBasedChunkGenerator(Registry<StructureSet> structureSetRegistry, Registry<NormalNoise.NoiseParameters> noiseRegistry, BiomeSource populationSource, Holder<NoiseGeneratorSettings> settings) { public NoiseBasedChunkGenerator(BiomeSource biomeSource, Holder<NoiseGeneratorSettings> settings) {
super(structureSetRegistry, Optional.empty(), populationSource); super(biomeSource);
@@ -83,6 +84,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator { this.settings = settings;
this.globalFluidPicker = (j, k, l) -> { this.globalFluidPicker = Suppliers.memoize(() -> {
return k < Math.min(-54, i) ? aquifer_b : aquifer_b1; - return NoiseBasedChunkGenerator.createFluidPicker((NoiseGeneratorSettings) settings.value());
}; + // Gale start - Lithium - cache world generator sea level
+ this.cachedSeaLevel = this.settings.value().seaLevel(); // Gale - Lithium - cache world generator sea level + var fluidPicker = NoiseBasedChunkGenerator.createFluidPicker((NoiseGeneratorSettings) settings.value());
+ this.cachedSeaLevel = settings.value().seaLevel();
+ return fluidPicker;
+ // Gale end - Lithium - cache world generator sea level
});
} }
@Override @@ -397,7 +402,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
@@ -400,7 +402,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
@Override @Override
public int getSeaLevel() { public int getSeaLevel() {

View File

@@ -13,7 +13,7 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2a2e66449e816494a6c52cb771c63f60220e82fc..d6526c075bc82ae2d79e3e786bc469966f4cf92d 100644 index 23e4851fc7806820581b79931f10491fe9ceeec3..1a49b1f0c30c522190997653b04c61a2c439b793 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -299,6 +299,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -299,6 +299,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -36,7 +36,7 @@ index 2a2e66449e816494a6c52cb771c63f60220e82fc..d6526c075bc82ae2d79e3e786bc46996
// Paper start - detailed watchdog information // Paper start - detailed watchdog information
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main"); io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
synchronized (this.posLock) { synchronized (this.posLock) {
@@ -3758,6 +3764,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -3798,6 +3804,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
public final void setBoundingBox(AABB boundingBox) { public final void setBoundingBox(AABB boundingBox) {

View File

@@ -13,7 +13,7 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index de844a1fefa9d4d0da6db105565cbb37f52de8c4..5bc4f3f18bd4527a8110d0b7bfb424ea1b14e5d5 100644 index eea6753afdd7e9d52746d0decb5cde63044012b5..20e4178b1ce6fc25d2fb25d0c02a06e33ac03d19 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -14,6 +14,7 @@ import com.mojang.datafixers.util.Either; @@ -14,6 +14,7 @@ import com.mojang.datafixers.util.Either;
@@ -24,7 +24,7 @@ index de844a1fefa9d4d0da6db105565cbb37f52de8c4..5bc4f3f18bd4527a8110d0b7bfb424ea
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2ByteMap; import it.unimi.dsi.fastutil.longs.Long2ByteMap;
@@ -291,7 +292,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -295,7 +296,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper - rewrite chunk system // Paper - rewrite chunk system
this.tickingGenerated = new AtomicInteger(); this.tickingGenerated = new AtomicInteger();
this.playerMap = new PlayerMap(); this.playerMap = new PlayerMap();

View File

@@ -13,18 +13,45 @@ As part of: Slice (https://github.com/Cryptite/Slice)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 7a2229f64a67530760b02ff1ac82495ec5f91b37..03edc4274f0119b6c9134a7683541f6e126d4c43 100644 index f2814df6d715910a3c8101a0af5f3190355bcc52..91e5707efe39180811fbe78c7569baa5264dba2c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3110,7 +3110,7 @@ public abstract class LivingEntity extends Entity { @@ -3154,7 +3154,7 @@ public abstract class LivingEntity extends Entity {
}
ItemStack itemstack1 = this.getItemBySlot(enumitemslot); public boolean equipmentHasChanged(ItemStack stack, ItemStack stack2) {
- return !ItemStack.matches(stack2, stack);
+ return this.level.galeConfig().smallOptimizations.processFullEquipmentChangeIfOnlyDurabilityChanged ? !ItemStack.matches(stack2, stack) : !ItemStack.isSameIgnoreDurability(stack2, stack); // Gale - Slice - ignore durability change equipment updates
}
- if (!ItemStack.matches(itemstack1, itemstack)) { private void handleHandSwap(Map<EquipmentSlot, ItemStack> equipmentChanges) {
+ if (this.level.galeConfig().smallOptimizations.processFullEquipmentChangeIfOnlyDurabilityChanged ? !ItemStack.matches(itemstack1, itemstack) : !ItemStack.isSameIgnoreDurability(itemstack1, itemstack)) { // Gale - Slice - ignore durability change equipment updates diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
// Paper start - PlayerArmorChangeEvent index 8fd080110ed4efaf6cb3a2561b32ed66ff8c78f0..b1a01ef0090718923aff4365d8e93c776a5ebae4 100644
if (this instanceof ServerPlayer && enumitemslot.getType() == EquipmentSlot.Type.ARMOR) { --- a/src/main/java/net/minecraft/world/item/ItemStack.java
final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack); +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -720,10 +720,22 @@ public final class ItemStack {
return left == right ? true : (!left.isEmpty() && !right.isEmpty() ? left.sameItem(right) : false);
}
+ // Gale start - Slice - ignore durability change equipment updates
+ public static boolean isSameIgnoreDurability(ItemStack left, ItemStack right) {
+ return left == right ? true : (!left.isEmpty() && !right.isEmpty() ? left.sameItemStackIgnoreDurability(right) : false);
+ }
+ // Gale end - Slice - ignore durability change equipment updates
+
public boolean sameItem(ItemStack stack) {
return !stack.isEmpty() && this.is(stack.getItem());
}
+ // Gale start - Slice - ignore durability change equipment updates
+ public boolean sameItemStackIgnoreDurability(ItemStack stack) {
+ return !this.isDamageableItem() ? this.sameItem(stack) : !stack.isEmpty() && this.is(stack.getItem());
+ }
+ // Gale end - Slice - ignore durability change equipment updates
+
public static boolean isSameItemSameTags(ItemStack stack, ItemStack otherStack) {
return stack.is(otherStack.getItem()) && ItemStack.tagMatches(stack, otherStack);
}
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
index 201f30774536966bda6f79b4db2fba6352829e10..dcbda08a6246b21b370a9005ed095d4413be6a81 100644 index 201f30774536966bda6f79b4db2fba6352829e10..dcbda08a6246b21b370a9005ed095d4413be6a81 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a5220a4e514865c70700527bcd2f941d852564c0..db83c62770d5bac7255251d26c75771ec6897317 100644 index 52071101c16ae84f69f1a00857b4895f328f6edd..dfaef7423c6df404a267e9163ea50abdd75bb9e5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1890,6 +1890,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1848,6 +1848,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return !this.hiddenEntities.containsKey(entity.getUniqueId()); return !this.hiddenEntities.containsKey(entity.getUniqueId());
} }

View File

@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 507017c1ea03cd028be2149b18c8de7f8353e37e..d2e6a92a44416bfaa161c78dd4b9a7b3ad78792a 100644 index c0226f0445e2554000f2fc0a3906f9b3ed404097..5d21b033ac5ee10efe77ae1fbff0585414bd2d74 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -15,6 +15,8 @@ import java.net.SocketAddress; @@ -15,6 +15,8 @@ import java.net.SocketAddress;
@@ -47,9 +47,9 @@ index 507017c1ea03cd028be2149b18c8de7f8353e37e..d2e6a92a44416bfaa161c78dd4b9a7b3
+import java.util.ArrayList; +import java.util.ArrayList;
+import java.util.Arrays; +import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.EnumSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; @@ -136,10 +138,11 @@ public abstract class PlayerList {
@@ -132,10 +134,11 @@ public abstract class PlayerList {
public static final File WHITELIST_FILE = new File("whitelist.json"); public static final File WHITELIST_FILE = new File("whitelist.json");
public static final Component CHAT_FILTERED_FULL = Component.translatable("chat.filtered_full"); public static final Component CHAT_FILTERED_FULL = Component.translatable("chat.filtered_full");
private static final Logger LOGGER = LogUtils.getLogger(); private static final Logger LOGGER = LogUtils.getLogger();
@@ -62,15 +62,15 @@ index 507017c1ea03cd028be2149b18c8de7f8353e37e..d2e6a92a44416bfaa161c78dd4b9a7b3
private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap(); private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap();
private final UserBanList bans; private final UserBanList bans;
private final IpBanList ipBans; private final IpBanList ipBans;
@@ -354,6 +357,7 @@ public abstract class PlayerList { @@ -363,6 +366,7 @@ public abstract class PlayerList {
player.sendServerStatus(this.server.getStatus());
playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot()); player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players));
this.players.add(player); this.players.add(player);
+ this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info + this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info
this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
this.playersByUUID.put(player.getUUID(), player); this.playersByUUID.put(player.getUUID(), player);
// this.broadcastAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{entityplayer})); // CraftBukkit - replaced with loop below // this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(entityplayer))); // CraftBukkit - replaced with loop below
@@ -675,6 +679,7 @@ public abstract class PlayerList { @@ -683,6 +687,7 @@ public abstract class PlayerList {
worldserver.removePlayerImmediately(entityplayer, Entity.RemovalReason.UNLOADED_WITH_PLAYER); worldserver.removePlayerImmediately(entityplayer, Entity.RemovalReason.UNLOADED_WITH_PLAYER);
entityplayer.getAdvancements().stopListening(); entityplayer.getAdvancements().stopListening();
this.players.remove(entityplayer); this.players.remove(entityplayer);
@@ -78,7 +78,7 @@ index 507017c1ea03cd028be2149b18c8de7f8353e37e..d2e6a92a44416bfaa161c78dd4b9a7b3
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
this.server.getCustomBossEvents().onPlayerDisconnect(entityplayer); this.server.getCustomBossEvents().onPlayerDisconnect(entityplayer);
UUID uuid = entityplayer.getUUID(); UUID uuid = entityplayer.getUUID();
@@ -842,6 +847,7 @@ public abstract class PlayerList { @@ -850,6 +855,7 @@ public abstract class PlayerList {
// Paper end // Paper end
entityplayer.stopRiding(); // CraftBukkit entityplayer.stopRiding(); // CraftBukkit
this.players.remove(entityplayer); this.players.remove(entityplayer);
@@ -86,7 +86,7 @@ index 507017c1ea03cd028be2149b18c8de7f8353e37e..d2e6a92a44416bfaa161c78dd4b9a7b3
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
entityplayer.getLevel().removePlayerImmediately(entityplayer, Entity.RemovalReason.DISCARDED); entityplayer.getLevel().removePlayerImmediately(entityplayer, Entity.RemovalReason.DISCARDED);
BlockPos blockposition = entityplayer.getRespawnPosition(); BlockPos blockposition = entityplayer.getRespawnPosition();
@@ -977,6 +983,7 @@ public abstract class PlayerList { @@ -987,6 +993,7 @@ public abstract class PlayerList {
if (!entityplayer.connection.isDisconnected()) { if (!entityplayer.connection.isDisconnected()) {
worldserver1.addRespawnedPlayer(entityplayer1); worldserver1.addRespawnedPlayer(entityplayer1);
this.players.add(entityplayer1); this.players.add(entityplayer1);
@@ -94,7 +94,7 @@ index 507017c1ea03cd028be2149b18c8de7f8353e37e..d2e6a92a44416bfaa161c78dd4b9a7b3
this.playersByName.put(entityplayer1.getScoreboardName().toLowerCase(java.util.Locale.ROOT), entityplayer1); // Spigot this.playersByName.put(entityplayer1.getScoreboardName().toLowerCase(java.util.Locale.ROOT), entityplayer1); // Spigot
this.playersByUUID.put(entityplayer1.getUUID(), entityplayer1); this.playersByUUID.put(entityplayer1.getUUID(), entityplayer1);
} }
@@ -1027,20 +1034,55 @@ public abstract class PlayerList { @@ -1037,20 +1044,55 @@ public abstract class PlayerList {
this.sendPlayerPermissionLevel(player, i); this.sendPlayerPermissionLevel(player, i);
} }
@@ -141,7 +141,7 @@ index 507017c1ea03cd028be2149b18c8de7f8353e37e..d2e6a92a44416bfaa161c78dd4b9a7b3
+ if (sendAllPlayerInfoBucket != null) { + if (sendAllPlayerInfoBucket != null) {
+ for (ServerPlayer target : sendAllPlayerInfoBucket) { + for (ServerPlayer target : sendAllPlayerInfoBucket) {
+ // Gale end - Purpur - spread out sending all player info + // Gale end - Purpur - spread out sending all player info
target.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.UPDATE_LATENCY, this.players.stream().filter(new Predicate<ServerPlayer>() { target.connection.send(new ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LATENCY), this.players.stream().filter(new Predicate<ServerPlayer>() {
@Override @Override
public boolean test(ServerPlayer input) { public boolean test(ServerPlayer input) {
return target.getBukkitEntity().canSee(input.getBukkitEntity()); return target.getBukkitEntity().canSee(input.getBukkitEntity());
@@ -157,10 +157,10 @@ index 507017c1ea03cd028be2149b18c8de7f8353e37e..d2e6a92a44416bfaa161c78dd4b9a7b3
} }
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 0ea101f155936f7c340d9e1d1077c58b72551027..5337c80dba191c51202f1d8cf8106c9aa5720782 100644 index 2e6557a19523d18aecff709de30cb4466b46a9fa..6f071601266dff833270bbde9863cc0c4dcfa97d 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -42,6 +42,7 @@ import net.minecraft.network.syncher.SynchedEntityData; @@ -40,6 +40,7 @@ import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
@@ -168,13 +168,13 @@ index 0ea101f155936f7c340d9e1d1077c58b72551027..5337c80dba191c51202f1d8cf8106c9a
import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource; import net.minecraft.sounds.SoundSource;
@@ -198,12 +199,15 @@ public abstract class Player extends LivingEntity { @@ -193,12 +194,15 @@ public abstract class Player extends LivingEntity {
} }
// CraftBukkit end // CraftBukkit end
+ public final int sendAllPlayerInfoBucketIndex; // Gale - Purpur - spread out sending all player info + public final int sendAllPlayerInfoBucketIndex; // Gale - Purpur - spread out sending all player info
+ +
public Player(Level world, BlockPos pos, float yaw, GameProfile gameProfile, @Nullable ProfilePublicKey publicKey) { public Player(Level world, BlockPos pos, float yaw, GameProfile gameProfile) {
super(EntityType.PLAYER, world); super(EntityType.PLAYER, world);
this.lastItemInMainHand = ItemStack.EMPTY; this.lastItemInMainHand = ItemStack.EMPTY;
this.cooldowns = this.createItemCooldowns(); this.cooldowns = this.createItemCooldowns();
@@ -182,5 +182,5 @@ index 0ea101f155936f7c340d9e1d1077c58b72551027..5337c80dba191c51202f1d8cf8106c9a
this.setUUID(UUIDUtil.getOrCreatePlayerUUID(gameProfile)); this.setUUID(UUIDUtil.getOrCreatePlayerUUID(gameProfile));
+ this.sendAllPlayerInfoBucketIndex = Math.floorMod(this.uuid.hashCode(), PlayerList.SEND_PLAYER_INFO_INTERVAL); // Gale - Purpur - spread out sending all player info + this.sendAllPlayerInfoBucketIndex = Math.floorMod(this.uuid.hashCode(), PlayerList.SEND_PLAYER_INFO_INTERVAL); // Gale - Purpur - spread out sending all player info
this.gameProfile = gameProfile; this.gameProfile = gameProfile;
this.profilePublicKey = publicKey;
this.inventoryMenu = new InventoryMenu(this.inventory, !world.isClientSide, this); this.inventoryMenu = new InventoryMenu(this.inventory, !world.isClientSide, this);
this.containerMenu = this.inventoryMenu;

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index d2e6a92a44416bfaa161c78dd4b9a7b3ad78792a..a60db92d8c6afab40e12b3ac28241beac06bcf63 100644 index 5d21b033ac5ee10efe77ae1fbff0585414bd2d74..42a79988c14770cb3b19d31f6df41a3d5cf14f9b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1070,14 +1070,18 @@ public abstract class PlayerList { @@ -1080,14 +1080,18 @@ public abstract class PlayerList {
// Gale start - Purpur - spread out sending all player info // Gale start - Purpur - spread out sending all player info
ServerPlayer[] sendAllPlayerInfoBucket = this.sendAllPlayerInfoBuckets[this.sendAllPlayerInfoIn]; ServerPlayer[] sendAllPlayerInfoBucket = this.sendAllPlayerInfoBuckets[this.sendAllPlayerInfoIn];
if (sendAllPlayerInfoBucket != null) { if (sendAllPlayerInfoBucket != null) {
@@ -48,7 +48,7 @@ index d2e6a92a44416bfaa161c78dd4b9a7b3ad78792a..a60db92d8c6afab40e12b3ac28241bea
+ // Gale start - Purpur - optimize player list for sending player info + // Gale start - Purpur - optimize player list for sending player info
+ for (ServerPlayer targetPlayer : sendAllPlayerInfoBucket) { + for (ServerPlayer targetPlayer : sendAllPlayerInfoBucket) {
// Gale end - Purpur - spread out sending all player info // Gale end - Purpur - spread out sending all player info
- target.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.UPDATE_LATENCY, this.players.stream().filter(new Predicate<ServerPlayer>() { - target.connection.send(new ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LATENCY), this.players.stream().filter(new Predicate<ServerPlayer>() {
- @Override - @Override
- public boolean test(ServerPlayer input) { - public boolean test(ServerPlayer input) {
- return target.getBukkitEntity().canSee(input.getBukkitEntity()); - return target.getBukkitEntity().canSee(input.getBukkitEntity());
@@ -60,7 +60,7 @@ index d2e6a92a44416bfaa161c78dd4b9a7b3ad78792a..a60db92d8c6afab40e12b3ac28241bea
} }
- }).collect(Collectors.toList()))); - }).collect(Collectors.toList())));
+ } + }
+ target.getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.UPDATE_LATENCY, list)); + target.getHandle().connection.send(new ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LATENCY), list));
+ // Gale end - Purpur - optimize player list for sending player info + // Gale end - Purpur - optimize player list for sending player info
// Gale start - Purpur - spread out sending all player info // Gale start - Purpur - spread out sending all player info
} }

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 7c96f7fc5997761426a0c62cad0cab5cc668f282..89df1bb7a3f310e9fefef78e2645ddd50327c2ab 100644 index 330f6c79417378da855326b4da665f9d240e748d..b111f4c0972f01832f9c03bf85a1989f1e782558 100644
--- a/src/main/java/net/minecraft/commands/Commands.java --- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -417,6 +417,7 @@ public class Commands { @@ -425,6 +425,7 @@ public class Commands {
private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) { private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) {
// Paper end - Async command map building // Paper end - Async command map building
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper
@@ -48,7 +48,7 @@ index 7c96f7fc5997761426a0c62cad0cab5cc668f282..89df1bb7a3f310e9fefef78e2645ddd5
PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit)); PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit));
event.getPlayer().getServer().getPluginManager().callEvent(event); event.getPlayer().getServer().getPluginManager().callEvent(event);
@@ -427,6 +428,7 @@ public class Commands { @@ -435,6 +436,7 @@ public class Commands {
} }
} }
// CraftBukkit end // CraftBukkit end

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9de597c11c3bd0f23e87c3a6187b2036987356e0..c171c272d5fcf0900514e18eafaa1b5ee019c74d 100644 index 8f23c46faf83c945516632824ba4e07c4597ad67..406c71f84201bff5e46d49aaec10ae7efc419ebc 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -9,6 +9,8 @@ import com.mojang.datafixers.util.Pair; @@ -7,6 +7,8 @@ import com.mojang.brigadier.StringReader;
import com.mojang.logging.LogUtils; import com.mojang.logging.LogUtils;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry; import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry;
import it.unimi.dsi.fastutil.ints.Int2ObjectMaps; import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
@@ -48,8 +48,8 @@ index 9de597c11c3bd0f23e87c3a6187b2036987356e0..c171c272d5fcf0900514e18eafaa1b5e
+import it.unimi.dsi.fastutil.longs.LongList; +import it.unimi.dsi.fastutil.longs.LongList;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator; import it.unimi.dsi.fastutil.objects.ObjectIterator;
import java.time.Instant; import java.time.Duration;
@@ -258,6 +260,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -259,6 +261,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private long keepAliveTime = Util.getMillis(); private long keepAliveTime = Util.getMillis();
private boolean keepAlivePending; private boolean keepAlivePending;
private long keepAliveChallenge; private long keepAliveChallenge;
@@ -57,9 +57,9 @@ index 9de597c11c3bd0f23e87c3a6187b2036987356e0..c171c272d5fcf0900514e18eafaa1b5e
// CraftBukkit start - multithreaded fields // CraftBukkit start - multithreaded fields
private final AtomicInteger chatSpamTickCount = new AtomicInteger(); private final AtomicInteger chatSpamTickCount = new AtomicInteger();
private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits
@@ -294,7 +297,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -296,7 +299,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private final SignedMessageChain.Decoder signedMessageDecoder; private final LastSeenMessagesValidator lastSeenMessages;
private final LastSeenMessagesValidator lastSeenMessagesValidator; private final MessageSignatureCache messageSignatureCache;
private final FutureChain chatMessageChain; private final FutureChain chatMessageChain;
- private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit - private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
+ // Gale start - Purpur - send multiple keep-alive packets + // Gale start - Purpur - send multiple keep-alive packets
@@ -69,7 +69,7 @@ index 9de597c11c3bd0f23e87c3a6187b2036987356e0..c171c272d5fcf0900514e18eafaa1b5e
private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper
private String clientBrandName = null; // Paper - Brand name private String clientBrandName = null; // Paper - Brand name
@@ -405,6 +411,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -400,6 +406,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
long currentTime = Util.getMillis(); long currentTime = Util.getMillis();
long elapsedTime = currentTime - this.keepAliveTime; long elapsedTime = currentTime - this.keepAliveTime;
@@ -91,7 +91,7 @@ index 9de597c11c3bd0f23e87c3a6187b2036987356e0..c171c272d5fcf0900514e18eafaa1b5e
if (this.keepAlivePending) { if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info
@@ -3598,6 +3619,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3459,6 +3480,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) { public void handleKeepAlive(ServerboundKeepAlivePacket packet) {

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 874f17fd7e3ff945eeccdf5e0b1991366240ea6b..1aa9a73aed2851cc640945101623f6f448079234 100644 index 9470446a73518c049e65e324e91438076ada2979..13871dcc503e50ed75e22ac015d97fb8f04385f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2704,6 +2704,25 @@ public final class CraftServer implements Server { @@ -2728,6 +2728,25 @@ public final class CraftServer implements Server {
}; };
} }

View File

@@ -59,10 +59,10 @@ index fa56cd09102a89692b42f1d14257990508c5c720..fac07dda413002c12276131efbe4ee38
setListData(vector); setListData(vector);
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4311a2e22704606f7f2f0928df6dcbe65e3fa8d6..dccee7cb7075cba6877021ec0da1ba5603a00082 100644 index 1307801779caa69bdf967134ecbfcb42764243ac..481522ecd677c12e09121aa1eb54531e6d1fda3d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1045,6 +1045,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1053,6 +1053,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L; private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
private long lastTick = 0; private long lastTick = 0;
private long catchupTime = 0; private long catchupTime = 0;
@@ -70,7 +70,7 @@ index 4311a2e22704606f7f2f0928df6dcbe65e3fa8d6..dccee7cb7075cba6877021ec0da1ba56
public final RollingAverage tps1 = new RollingAverage(60); public final RollingAverage tps1 = new RollingAverage(60);
public final RollingAverage tps5 = new RollingAverage(60 * 5); public final RollingAverage tps5 = new RollingAverage(60 * 5);
public final RollingAverage tps15 = new RollingAverage(60 * 15); public final RollingAverage tps15 = new RollingAverage(60 * 15);
@@ -1148,6 +1149,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1155,6 +1156,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
{ {
final long diff = curTime - tickSection; final long diff = curTime - tickSection;
java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP); java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
@@ -79,10 +79,10 @@ index 4311a2e22704606f7f2f0928df6dcbe65e3fa8d6..dccee7cb7075cba6877021ec0da1ba56
tps5.add(currentTps, diff); tps5.add(currentTps, diff);
tps15.add(currentTps, diff); tps15.add(currentTps, diff);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1aa9a73aed2851cc640945101623f6f448079234..cd685f4d0e5973b0c0a217c30235a4b88645694f 100644 index 13871dcc503e50ed75e22ac015d97fb8f04385f5..506936f78081a73be3cce676c1a24f56b65ccd8f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2706,6 +2706,13 @@ public final class CraftServer implements Server { @@ -2730,6 +2730,13 @@ public final class CraftServer implements Server {
// Gale start - specific interval TPS API // Gale start - specific interval TPS API

View File

@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
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. 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.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index dccee7cb7075cba6877021ec0da1ba5603a00082..0b3b1400e9546060b4ee35236741670aaa226820 100644 index 481522ecd677c12e09121aa1eb54531e6d1fda3d..609d57dd7373531d35295152e543261e3b0fbe09 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1095,6 +1095,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1103,6 +1103,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system
@@ -38,7 +38,7 @@ index dccee7cb7075cba6877021ec0da1ba5603a00082..0b3b1400e9546060b4ee35236741670a
protected void runServer() { protected void runServer() {
try { try {
long serverStartTime = Util.getNanos(); // Paper long serverStartTime = Util.getNanos(); // Paper
@@ -1172,7 +1177,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1179,7 +1184,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.nextTickTime += 50L; this.nextTickTime += 50L;
this.startMetricsRecordingTick(); this.startMetricsRecordingTick();
this.profiler.push("tick"); this.profiler.push("tick");
@@ -48,7 +48,7 @@ index dccee7cb7075cba6877021ec0da1ba5603a00082..0b3b1400e9546060b4ee35236741670a
this.profiler.popPush("nextTickWait"); this.profiler.popPush("nextTickWait");
this.mayHaveDelayedTasks = true; this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime); this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
@@ -1288,9 +1295,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1295,9 +1302,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
protected void waitUntilNextTick() { protected void waitUntilNextTick() {
//this.executeAll(); // Paper - move this into the tick method for timings //this.executeAll(); // Paper - move this into the tick method for timings

View File

@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
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. 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.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index cd685f4d0e5973b0c0a217c30235a4b88645694f..947ad1463a973546bdaf68654086291a3414aa9b 100644 index 506936f78081a73be3cce676c1a24f56b65ccd8f..41013054b6046a17a94d3e181b3ffbc7a3824cd2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2953,4 +2953,22 @@ public final class CraftServer implements Server { @@ -2977,4 +2977,22 @@ public final class CraftServer implements Server {
} }
// Paper end // Paper end

View File

@@ -45,10 +45,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 8818ca46af000926ed9eacb47953f440bdac1342..2bf1663dc1e969ea9e192c9941155eb99efff715 100644 index 6f071601266dff833270bbde9863cc0c4dcfa97d..529df114eb0ca3020bf8c699889b9a543905a1f2 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -116,6 +116,7 @@ import net.minecraft.world.phys.AABB; @@ -114,6 +114,7 @@ import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.PlayerTeam; import net.minecraft.world.scores.PlayerTeam;
import net.minecraft.world.scores.Scoreboard; import net.minecraft.world.scores.Scoreboard;
@@ -56,10 +56,10 @@ index 8818ca46af000926ed9eacb47953f440bdac1342..2bf1663dc1e969ea9e192c9941155eb9
import org.slf4j.Logger; import org.slf4j.Logger;
import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -288,19 +289,24 @@ public abstract class Player extends LivingEntity { @@ -281,19 +282,24 @@ public abstract class Player extends LivingEntity {
this.moveCloak();
if (!this.level.isClientSide) { if (!this.level.isClientSide) {
this.foodData.tick(this); this.foodData.tick(this);
this.wardenSpawnTracker.tick();
- this.awardStat(Stats.PLAY_TIME); - this.awardStat(Stats.PLAY_TIME);
- this.awardStat(Stats.TOTAL_WORLD_TIME); - this.awardStat(Stats.TOTAL_WORLD_TIME);
+ // Gale start - Hydrinity - increase time statistics in intervals + // Gale start - Hydrinity - increase time statistics in intervals
@@ -87,7 +87,7 @@ index 8818ca46af000926ed9eacb47953f440bdac1342..2bf1663dc1e969ea9e192c9941155eb9
int i = 29999999; int i = 29999999;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index e92a4fc4a503a420b09e5373a6c1f5d2d71d32d6..ef430bc8b0527b919c91361aa9ddefc8eb2386d8 100644 index eb1a5b20810cbad9f47505a8534a42b20b8653d5..8aaa6e3a6c475258bea5f026a7e07efde825f112 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -43,6 +43,25 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -43,6 +43,25 @@ public class GaleGlobalConfiguration extends ConfigurationPart {

View File

@@ -16,10 +16,10 @@ As part of: Akarin (https://github.com/Akarin-project/Akarin)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 552198bd1a08d0967dba90104777105fafc67e35..f6b9c9c55effdc169d8226308b3163bc5c54b3ed 100644 index e4e78d4d7d9e2f2b6ad2e9f605c2ffc3bbe23dca..7c06b37201eaf0fd5c1af912c095c4e218d7a3bb 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1978,8 +1978,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1993,8 +1993,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void playerTouch(Player player) {} public void playerTouch(Player player) {}
public void push(Entity entity) { public void push(Entity entity) {

View File

@@ -26,10 +26,10 @@ index 23dcdc71a8a6fd5472cdc1c22331b56c6bb3ded9..c3f88980f1ea2f7b04ad110494962725
double d1 = (double) (center.y - maxRange); double d1 = (double) (center.y - maxRange);
double d2 = (double) (center.x + maxRange); double d2 = (double) (center.x + maxRange);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 9c9b4d7e0637348a94befce9377fdb69c1239694..88d1659f9ada662ada2d4c0c540fc8a0d3b0005a 100644 index c0b0a7fdb75266a7064d54bda6441953184ecc64..1a272d716a23ddf6bd7b8c2733199c5729f333c5 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -387,7 +387,7 @@ public class ServerPlayer extends Player { @@ -392,7 +392,7 @@ public class ServerPlayer extends Player {
long l = k * k; long l = k * k;
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l; int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
int j1 = this.getCoprime(i1); int j1 = this.getCoprime(i1);
@@ -38,7 +38,7 @@ index 9c9b4d7e0637348a94befce9377fdb69c1239694..88d1659f9ada662ada2d4c0c540fc8a0
for (int l1 = 0; l1 < i1; ++l1) { for (int l1 = 0; l1 < i1; ++l1) {
int i2 = (k1 + j1 * l1) % i1; int i2 = (k1 + j1 * l1) % i1;
@@ -424,7 +424,7 @@ public class ServerPlayer extends Player { @@ -429,7 +429,7 @@ public class ServerPlayer extends Player {
long l = k * k; long l = k * k;
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l; int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
int j1 = this.getCoprime(i1); int j1 = this.getCoprime(i1);
@@ -61,10 +61,10 @@ index 1ef089dbf83de35d875c00efdf468c397be56978..b9f5dc95f859acb8f8fd4739537485af
} }
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index f5886a88fd98ede5e85a91eccccb05ac33eb40e2..cf6499a232d57ffc5337a483086f13920cf95189 100644 index 7f3a7a769afec8449547c26453112064b9bcb04a..3da68454b8114cd52554670280107d5b5b156eab 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -79,7 +79,7 @@ public class FishingHook extends Projectile { @@ -80,7 +80,7 @@ public class FishingHook extends Projectile {
private FishingHook(EntityType<? extends FishingHook> type, Level world, int luckOfTheSeaLevel, int lureLevel) { private FishingHook(EntityType<? extends FishingHook> type, Level world, int luckOfTheSeaLevel, int lureLevel) {
super(type, world); super(type, world);
@@ -74,7 +74,7 @@ index f5886a88fd98ede5e85a91eccccb05ac33eb40e2..cf6499a232d57ffc5337a483086f1392
this.currentState = FishingHook.FishHookState.FLYING; this.currentState = FishingHook.FishHookState.FLYING;
this.noCulling = true; this.noCulling = true;
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
index d56e7e8cacdabb8f009eaba8164f65f4d824a282..c2dca83fb43244313c4ddaf93c5ded5f47b06ae0 100644 index b13ef853419d2783d09b3e685b9b506a4ff5676e..7a7e87954868c3eb267d3255652d67d34f7b04d2 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java --- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -111,7 +111,7 @@ public class Raid { @@ -111,7 +111,7 @@ public class Raid {
@@ -96,10 +96,10 @@ index d56e7e8cacdabb8f009eaba8164f65f4d824a282..c2dca83fb43244313c4ddaf93c5ded5f
this.level = world; this.level = world;
this.id = nbt.getInt("Id"); this.id = nbt.getInt("Id");
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 31708d1e94b557896d42199aa0bc6ed26a4c6d8a..22ded3f273ea0c198a8caa33472fee11fc1a97cb 100644 index e7ce14ab0732034107e735787354a6fb0ec90f54..d300629f99332b00c06264ab09a1dbac175d93b8 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java --- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -85,7 +85,7 @@ public class Explosion { @@ -81,7 +81,7 @@ public class Explosion {
} }
public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType) { public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType) {
@@ -109,10 +109,10 @@ index 31708d1e94b557896d42199aa0bc6ed26a4c6d8a..22ded3f273ea0c198a8caa33472fee11
this.hitPlayers = Maps.newHashMap(); this.hitPlayers = Maps.newHashMap();
this.level = world; this.level = world;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index 8f3fb24afd3df8e9e4caa2917f598fcf74289726..6ed3ed91671c151d8517cd4e208112324ca45006 100644 index 2a596cc374206a85bb692f5e09ee2dd83cf6d1b1..74686aa52113fcd0cbd5531e4161f6a1993dba60 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -355,7 +355,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { @@ -361,7 +361,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
} }
private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) { private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) {
@@ -122,19 +122,19 @@ index 8f3fb24afd3df8e9e4caa2917f598fcf74289726..6ed3ed91671c151d8517cd4e20811232
@Override @Override
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index a9052dd27005d244a96511fc5dbfa92f20a21f46..4d858d23feaee902bb0b04146d81919388f84457 100644 index e9eb32469a5c03f7a3677ef50fd4541c1ed662ad..dc0eb8eb2bf39e33bdee4daa3647510d24535091 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -406,7 +406,7 @@ public class EndDragonFight { @@ -411,7 +411,7 @@ public class EndDragonFight {
this.level.registryAccess().registry(Registries.CONFIGURED_FEATURE).flatMap((registry) -> {
private void spawnNewGateway(BlockPos pos) { return registry.getHolder(EndFeatures.END_GATEWAY_DELAYED);
this.level.levelEvent(3000, pos, 0); }).ifPresent((reference) -> {
- EndFeatures.END_GATEWAY_DELAYED.value().place(this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), pos); - reference.value().place(this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), pos);
+ EndFeatures.END_GATEWAY_DELAYED.value().place(this.level, this.level.getChunkSource().getGenerator(), this.level.random, pos); // Gale - Patina - reduce RandomSource instances + reference.value().place(this.level, this.level.getChunkSource().getGenerator(), this.level.random, pos); // Gale - Patina - reduce RandomSource instances
});
} }
public void spawnExitPortal(boolean previouslyKilled) { @@ -427,7 +427,7 @@ public class EndDragonFight {
@@ -421,7 +421,7 @@ public class EndDragonFight {
this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1); this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1);
} }
// Paper end // Paper end
@@ -142,7 +142,7 @@ index a9052dd27005d244a96511fc5dbfa92f20a21f46..4d858d23feaee902bb0b04146d819193
+ endPodiumFeature.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), this.level.random, this.portalLocation); // Gale - Patina - reduce RandomSource instances + endPodiumFeature.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), this.level.random, this.portalLocation); // Gale - Patina - reduce RandomSource instances
} }
private EnderDragon createNewDragon() { @Nullable
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java b/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java b/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java
index eb399244af70c8fe735657d429d883c48215af0a..e78a8d68c4af056af9e1452f76651fea545189ba 100644 index eb399244af70c8fe735657d429d883c48215af0a..e78a8d68c4af056af9e1452f76651fea545189ba 100644
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java --- a/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java

View File

@@ -7,10 +7,10 @@ License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 8e45f712968303b7864d61adbf7325142c83f582..b374f41b20b3ffa2ec2874a06715661f4fec83db 100644 index f5ed3fa20097bdd43a25c76b38353a23743bc9e5..eed9f125df46b616b7234a2d669971bc51bc231b 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -54,6 +54,7 @@ import net.minecraft.world.level.block.entity.SkullBlockEntity; @@ -49,6 +49,7 @@ import net.minecraft.world.level.block.entity.SkullBlockEntity;
import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.LevelStorageSource;
import org.galemc.gale.command.GaleCommands; import org.galemc.gale.command.GaleCommands;
import org.galemc.gale.configuration.GaleGlobalConfiguration; import org.galemc.gale.configuration.GaleGlobalConfiguration;
@@ -18,7 +18,7 @@ index 8e45f712968303b7864d61adbf7325142c83f582..b374f41b20b3ffa2ec2874a06715661f
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -231,6 +232,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -226,6 +227,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
// Paper end // Paper end
@@ -32,10 +32,10 @@ index 8e45f712968303b7864d61adbf7325142c83f582..b374f41b20b3ffa2ec2874a06715661f
// Attempt to detect vectorization // Attempt to detect vectorization
try { try {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 947ad1463a973546bdaf68654086291a3414aa9b..69bde99acff7bdae9af7cfe60e2221675a68b858 100644 index 41013054b6046a17a94d3e181b3ffbc7a3824cd2..c2ad33e5fbce8a16498dde2bfd555012660af969 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -238,6 +238,8 @@ import org.bukkit.scoreboard.Criteria; @@ -251,6 +251,8 @@ import org.bukkit.scoreboard.Criteria;
import org.bukkit.structure.StructureManager; import org.bukkit.structure.StructureManager;
import org.bukkit.util.StringUtil; import org.bukkit.util.StringUtil;
import org.bukkit.util.permissions.DefaultPermissions; import org.bukkit.util.permissions.DefaultPermissions;

View File

@@ -70,10 +70,10 @@ index b71404be2c82f7db35272b367af861e94d6c73d3..238e7aa6e8a9e9f26bc6dee8d7e49a85
protected final PrioritisedThreadedTaskQueue queue; protected final PrioritisedThreadedTaskQueue queue;
protected long id; protected long id;
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
index dabd93c35bdbac6a8b668a82d5f3d4173a1baa4a..08378da2915efa4eed313c30ea009fc52499f487 100644 index 4f3670b2bdb8b1b252e9f074a6af56a018a8c465..757229093ecce162c99e27c2f92ead2e1a1a2b10 100644
--- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java --- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
@@ -21,6 +21,7 @@ import net.minecraft.world.level.block.EntityBlock; @@ -22,6 +22,7 @@ import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.*; import net.minecraft.world.level.chunk.*;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@@ -81,7 +81,7 @@ index dabd93c35bdbac6a8b668a82d5f3d4173a1baa4a..08378da2915efa4eed313c30ea009fc5
import java.util.*; import java.util.*;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
@@ -180,7 +181,7 @@ public final class ChunkPacketBlockControllerAntiXray extends ChunkPacketBlockCo @@ -181,7 +182,7 @@ public final class ChunkPacketBlockControllerAntiXray extends ChunkPacketBlockCo
if (!Bukkit.isPrimaryThread()) { if (!Bukkit.isPrimaryThread()) {
// Plugins? // Plugins?
@@ -117,7 +117,7 @@ index cf6d50218769e3fecd12dbde70a03b5042feddf4..9b94defa9520ac5c17c9b8bf1cfb3b17
} }
return global; return global;
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index ceef4eed87363298816426dfc19f3207be1af682..03ab15f003115fcf51be1deca0c57337b5d3bed7 100644 index 3088d5f008a8cb5a75f1e11bd80a2614a4c1b75d..0c771f024cec0b3fbb68e4eeeeb778187a89456f 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -285,7 +285,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor @@ -285,7 +285,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -312,10 +312,10 @@ index ceec23a85aae625fbbe2db95c8e9c83fb9f9767c..2a7f2a410a0622d8c4bf45533ecb549a
} }
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 6b7943e8348b0a41ca69fb56ccfd5f1c1484eb07..0a04765912db7eebe18103f8cc2c53a0d2b498c8 100644 index 5ef58831a857fd8aa4ac30147762dc17d773a53e..352ed1db3399bc9453286e28c84f61b6325de78b 100644
--- a/src/main/java/net/minecraft/Util.java --- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java
@@ -27,9 +27,6 @@ import java.net.URL; @@ -26,9 +26,6 @@ import java.net.URL;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.spi.FileSystemProvider; import java.nio.file.spi.FileSystemProvider;
@@ -325,7 +325,7 @@ index 6b7943e8348b0a41ca69fb56ccfd5f1c1484eb07..0a04765912db7eebe18103f8cc2c53a0
import java.time.Duration; import java.time.Duration;
import java.time.Instant; import java.time.Instant;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
@@ -47,8 +44,6 @@ import java.util.concurrent.CompletionException; @@ -47,8 +44,6 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
@@ -367,10 +367,10 @@ index 6b7943e8348b0a41ca69fb56ccfd5f1c1484eb07..0a04765912db7eebe18103f8cc2c53a0
} }
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
index 40812e6518b8aacfbd2d8cd65a407d00bb19e991..f3489a1e01f8b53045fbee9d99943b85b0907c21 100644 index f25b9330e068c7d9e12cb57a7761cfef9ebaf7bc..c20f793c4792b5f06a90d305671ac6d473253644 100644
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java --- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java +++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
@@ -144,10 +144,7 @@ public class EntitySelector { @@ -152,10 +152,7 @@ public class EntitySelector {
if (this.isWorldLimited()) { if (this.isWorldLimited()) {
this.addEntities(list, source.getLevel(), vec3d, predicate); this.addEntities(list, source.getLevel(), vec3d, predicate);
} else { } else {
@@ -416,10 +416,10 @@ index 27d4aa45e585842c04491839826d405d6f447f0e..f36a0e29f2ba464eee3fabba0b98a714
engine.execute(() -> { // Paper - Fix preemptive player kick on a server shutdown. engine.execute(() -> { // Paper - Fix preemptive player kick on a server shutdown.
packetProcessing.push(listener); // Paper - detailed watchdog information packetProcessing.push(listener); // Paper - detailed watchdog information
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index d8f8d2495c1e2e3f194485d16ea587d26cc3a23d..263c0be0d81f841cbbec474b48de151e6ab437d9 100644 index 0c4c62674b4c7e8e3921c7eb3ef726759ac75075..31b488a3c1b81b99bf5bda9f90c3cf697d727841 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -1,12 +1,10 @@ @@ -1,27 +1,22 @@
package net.minecraft.server; package net.minecraft.server;
-import com.mojang.authlib.GameProfile; -import com.mojang.authlib.GameProfile;
@@ -433,12 +433,13 @@ index d8f8d2495c1e2e3f194485d16ea587d26cc3a23d..263c0be0d81f841cbbec474b48de151e
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
import java.io.File; import java.io.File;
import java.net.Proxy; import java.net.Proxy;
@@ -14,15 +12,10 @@ import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Objects;
import java.util.Optional; import java.util.Optional;
-import java.util.UUID; -import java.util.UUID;
import java.util.function.BooleanSupplier; import java.util.function.BooleanSupplier;
+
+import com.mojang.serialization.Lifecycle;
import io.papermc.paper.world.ThreadedWorldUpgrader; import io.papermc.paper.world.ThreadedWorldUpgrader;
-import joptsimple.NonOptionArgumentSpec; -import joptsimple.NonOptionArgumentSpec;
-import joptsimple.OptionParser; -import joptsimple.OptionParser;
@@ -449,31 +450,17 @@ index d8f8d2495c1e2e3f194485d16ea587d26cc3a23d..263c0be0d81f841cbbec474b48de151e
import net.minecraft.SharedConstants; import net.minecraft.SharedConstants;
import net.minecraft.Util; import net.minecraft.Util;
import net.minecraft.commands.Commands; import net.minecraft.commands.Commands;
@@ -33,7 +26,6 @@ import net.minecraft.network.chat.Component; @@ -57,6 +52,8 @@ import net.minecraft.world.level.storage.LevelStorageSource;
import net.minecraft.obfuscate.DontObfuscate;
import net.minecraft.resources.RegistryOps;
import net.minecraft.server.dedicated.DedicatedServer;
-import net.minecraft.server.dedicated.DedicatedServerProperties;
import net.minecraft.server.dedicated.DedicatedServerSettings;
import net.minecraft.server.level.progress.LoggerChunkProgressListener;
import net.minecraft.server.packs.PackType;
@@ -48,20 +40,20 @@ import net.minecraft.util.profiling.jfr.Environment;
import net.minecraft.util.profiling.jfr.JvmProfiler;
import net.minecraft.util.worldupdate.WorldUpgrader;
import net.minecraft.world.level.DataPackConfig;
-import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.levelgen.WorldGenSettings;
-import net.minecraft.world.level.levelgen.presets.WorldPresets;
import net.minecraft.world.level.storage.LevelResource;
import net.minecraft.world.level.storage.LevelStorageSource;
import net.minecraft.world.level.storage.LevelSummary; import net.minecraft.world.level.storage.LevelSummary;
import net.minecraft.world.level.storage.PrimaryLevelData;
import net.minecraft.world.level.storage.WorldData;
+import org.galemc.gale.executor.queue.BaseTaskQueues; +import org.galemc.gale.executor.queue.BaseTaskQueues;
+import org.galemc.gale.executor.thread.pooled.AsyncThreadPool; +import org.galemc.gale.executor.thread.pooled.AsyncThreadPool;
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
import com.google.common.base.Charsets; @@ -64,7 +61,7 @@ import com.google.common.base.Charsets;
import com.mojang.bridge.game.PackType;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
-import net.minecraft.SharedConstants; -import net.minecraft.SharedConstants;
@@ -481,7 +468,7 @@ index d8f8d2495c1e2e3f194485d16ea587d26cc3a23d..263c0be0d81f841cbbec474b48de151e
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
// CraftBukkit end // CraftBukkit end
@@ -226,6 +218,15 @@ public class Main { @@ -228,6 +225,15 @@ public class Main {
WorldStem worldstem; WorldStem worldstem;
@@ -495,10 +482,10 @@ index d8f8d2495c1e2e3f194485d16ea587d26cc3a23d..263c0be0d81f841cbbec474b48de151e
+ // Gale end - base thread pools + // Gale end - base thread pools
+ +
try { try {
DataPackConfig datapackconfiguration = (DataPackConfig) Objects.requireNonNullElse(convertable_conversionsession.getDataPacks(), DataPackConfig.DEFAULT); WorldLoader.InitConfig worldloader_c = Main.loadOrCreateConfig(dedicatedserversettings.getProperties(), convertable_conversionsession, flag, resourcepackrepository);
WorldLoader.PackConfig worldloader_b = new WorldLoader.PackConfig(resourcepackrepository, datapackconfiguration, flag);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca390bc17e 100644 index 609d57dd7373531d35295152e543261e3b0fbe09..79c56e1aeb12ecaed2a17e01a4f9ec905b936b9a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -40,7 +40,6 @@ import java.util.Optional; @@ -40,7 +40,6 @@ import java.util.Optional;
@@ -509,7 +496,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BooleanSupplier; import java.util.function.BooleanSupplier;
import java.util.function.Consumer; import java.util.function.Consumer;
@@ -115,7 +114,6 @@ import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; @@ -120,7 +119,6 @@ import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder;
import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder;
import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider;
import net.minecraft.util.profiling.metrics.storage.MetricsPersister; import net.minecraft.util.profiling.metrics.storage.MetricsPersister;
@@ -517,7 +504,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
import net.minecraft.world.Difficulty; import net.minecraft.world.Difficulty;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.ai.village.VillageSiege; import net.minecraft.world.entity.ai.village.VillageSiege;
@@ -150,8 +148,16 @@ import net.minecraft.world.level.storage.loot.PredicateManager; @@ -161,8 +159,16 @@ import net.minecraft.world.level.storage.loot.PredicateManager;
import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
@@ -534,7 +521,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -174,9 +180,17 @@ import org.bukkit.event.server.ServerLoadEvent; @@ -193,9 +199,17 @@ import org.bukkit.event.server.ServerLoadEvent;
import co.aikar.timings.MinecraftTimings; // Paper import co.aikar.timings.MinecraftTimings; // Paper
@@ -554,9 +541,9 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
public static final Logger LOGGER = LogUtils.getLogger(); public static final Logger LOGGER = LogUtils.getLogger();
public static final String VANILLA_BRAND = "vanilla"; public static final String VANILLA_BRAND = "vanilla";
private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F; private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F;
@@ -214,6 +228,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -233,6 +247,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private int port; private int port;
public final RegistryAccess.Frozen registryHolder; private final LayeredRegistryAccess<RegistryLayer> registries;
private Map<ResourceKey<Level>, ServerLevel> levels; private Map<ResourceKey<Level>, ServerLevel> levels;
+ // Gale start - base thread pools - optimize server levels + // Gale start - base thread pools - optimize server levels
+ private @NotNull ServerLevel @NotNull [] levelArray = ArrayConstants.emptyServerLevelArray; + private @NotNull ServerLevel @NotNull [] levelArray = ArrayConstants.emptyServerLevelArray;
@@ -565,7 +552,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
private PlayerList playerList; private PlayerList playerList;
private volatile boolean running; private volatile boolean running;
private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart
@@ -243,10 +261,66 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -262,10 +280,66 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private long lastOverloadWarning; private long lastOverloadWarning;
protected final Services services; protected final Services services;
private long lastServerStatus; private long lastServerStatus;
@@ -636,7 +623,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
private final PackRepository packRepository; private final PackRepository packRepository;
private final ServerScoreboard scoreboard; private final ServerScoreboard scoreboard;
@Nullable @Nullable
@@ -276,7 +350,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -294,7 +368,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
public Commands vanillaCommandDispatcher; public Commands vanillaCommandDispatcher;
@@ -645,7 +632,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
// CraftBukkit end // CraftBukkit end
// Spigot start // Spigot start
public static final int TPS = 20; public static final int TPS = 20;
@@ -292,9 +366,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -310,9 +384,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile boolean abnormalExit = false; // Paper public volatile boolean abnormalExit = false; // Paper
public boolean isIteratingOverLevels = false; // Paper public boolean isIteratingOverLevels = false; // Paper
@@ -657,20 +644,22 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
((MinecraftServer) atomicreference.get()).runServer(); ((MinecraftServer) atomicreference.get()).runServer();
}, "Server thread"); }, "Server thread");
@@ -313,9 +387,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -331,9 +405,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return s0; return s0;
} }
- public MinecraftServer(OptionSet options, DataPackConfig datapackconfiguration, DynamicOps<Tag> registryreadops, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { - public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
- super("Server"); - super("Server");
+ public MinecraftServer(OptionSet options, DataPackConfig datapackconfiguration, DynamicOps<Tag> registryreadops, OriginalServerThread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { // Gale - base thread pools + // Gale start - base thread pools
+ super(); // Gale - base thread pools + public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, OriginalServerThread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
+ super();
+ // Gale end - base thread pools
SERVER = this; // Paper - better singleton SERVER = this; // Paper - better singleton
+ isConstructed = true; // Gale - base thread pools + isConstructed = true; // Gale - base thread pools
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
this.profiler = this.metricsRecorder.getProfiler(); this.profiler = this.metricsRecorder.getProfiler();
this.onMetricsRecordingStopped = (methodprofilerresults) -> { this.onMetricsRecordingStopped = (methodprofilerresults) -> {
@@ -329,7 +404,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -347,7 +424,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.levels = Maps.newLinkedHashMap(); this.levels = Maps.newLinkedHashMap();
this.running = true; this.running = true;
this.tickTimes = new long[100]; this.tickTimes = new long[100];
@@ -679,10 +668,10 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
this.scoreboard = new ServerScoreboard(this); this.scoreboard = new ServerScoreboard(this);
this.customBossEvents = new CustomBossEvents(); this.customBossEvents = new CustomBossEvents();
this.frameTimer = new FrameTimer(); this.frameTimer = new FrameTimer();
@@ -353,7 +428,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -373,7 +450,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.fixerUpper = datafixer; HolderGetter<Block> holdergetter = this.registries.compositeAccess().registryOrThrow(Registries.BLOCK).asLookup().filterFeatures(this.worldData.enabledFeatures());
this.functionManager = new ServerFunctionManager(this, this.resources.managers.getFunctionLibrary());
this.structureTemplateManager = new StructureTemplateManager(worldstem.resourceManager(), convertable_conversionsession, datafixer); this.structureTemplateManager = new StructureTemplateManager(worldstem.resourceManager(), convertable_conversionsession, datafixer, holdergetter);
- this.serverThread = thread; - this.serverThread = thread;
+ // Gale start - base thread pools + // Gale start - base thread pools
+ serverThread = thread; + serverThread = thread;
@@ -691,7 +680,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
this.executor = Util.backgroundExecutor(); this.executor = Util.backgroundExecutor();
} }
// CraftBukkit start // CraftBukkit start
@@ -607,7 +685,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -613,7 +693,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
this.forceDifficulty(); this.forceDifficulty();
@@ -700,7 +689,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver); this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver);
//worldserver.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system, not required to "tick" anything //worldserver.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system, not required to "tick" anything
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
@@ -764,7 +842,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -772,7 +852,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//ChunkProviderServer chunkproviderserver = worldserver.getChunkProvider(); // Paper - move up //ChunkProviderServer chunkproviderserver = worldserver.getChunkProvider(); // Paper - move up
chunkproviderserver.getLightEngine().setTaskPerBatch(500); chunkproviderserver.getLightEngine().setTaskPerBatch(500);
@@ -709,7 +698,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
// Paper start - configurable spawn reason // Paper start - configurable spawn reason
int radiusBlocks = worldserver.paperConfig().spawn.keepSpawnLoadedRange * 16; int radiusBlocks = worldserver.paperConfig().spawn.keepSpawnLoadedRange * 16;
int radiusChunks = radiusBlocks / 16 + ((radiusBlocks & 15) != 0 ? 1 : 0); int radiusChunks = radiusBlocks / 16 + ((radiusBlocks & 15) != 0 ? 1 : 0);
@@ -834,8 +912,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -842,8 +922,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end - rewrite chunk system - add close param // Paper end - rewrite chunk system - add close param
boolean flag3 = false; boolean flag3 = false;
@@ -724,7 +713,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
if (!suppressLogs) { if (!suppressLogs) {
MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.dimension().location()); MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.dimension().location());
@@ -859,14 +941,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -867,14 +951,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
*/ */
// CraftBukkit end // CraftBukkit end
if (flush) { if (flush) {
@@ -739,7 +728,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved"); MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved");
} }
@@ -893,7 +967,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -901,7 +977,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
// CraftBukkit start // CraftBukkit start
@@ -748,7 +737,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
public volatile boolean hasFullyShutdown = false; // Paper public volatile boolean hasFullyShutdown = false; // Paper
private boolean hasLoggedStop = false; // Paper private boolean hasLoggedStop = false; // Paper
private final Object stopLock = new Object(); private final Object stopLock = new Object();
@@ -922,8 +996,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -930,8 +1006,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
*/ */
MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER - If you think this is a Gale bug, please report it at https://github.com/GaleMC/Gale/issues )"); MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER - If you think this is a Gale bug, please report it at https://github.com/GaleMC/Gale/issues )");
// Gale end - branding changes // Gale end - branding changes
@@ -761,7 +750,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
try { try {
Thread.sleep(1); Thread.sleep(1);
} catch (InterruptedException e) {} } catch (InterruptedException e) {}
@@ -957,12 +1033,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -965,12 +1043,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
MinecraftServer.LOGGER.info("Saving worlds"); MinecraftServer.LOGGER.info("Saving worlds");
@@ -775,7 +764,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
if (worldserver != null) { if (worldserver != null) {
worldserver.noSave = false; worldserver.noSave = false;
} }
@@ -979,9 +1050,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -987,9 +1060,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1); MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1);
} }
// Spigot start // Spigot start
@@ -785,7 +774,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
MinecraftServer.LOGGER.info("Saving usercache.json"); MinecraftServer.LOGGER.info("Saving usercache.json");
this.getProfileCache().save(false); // Paper this.getProfileCache().save(false); // Paper
@@ -991,6 +1059,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -999,6 +1069,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
LOGGER.info("Flushing Chunk IO"); LOGGER.info("Flushing Chunk IO");
io.papermc.paper.chunk.system.io.RegionFileIOThread.close(true); // Paper // Paper - rewrite chunk system io.papermc.paper.chunk.system.io.RegionFileIOThread.close(true); // Paper // Paper - rewrite chunk system
LOGGER.info("Closing Thread Pool"); LOGGER.info("Closing Thread Pool");
@@ -799,16 +788,16 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
Util.shutdownExecutors(); // Paper Util.shutdownExecutors(); // Paper
LOGGER.info("Closing Server"); LOGGER.info("Closing Server");
try { try {
@@ -1026,7 +1101,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1034,7 +1111,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.running = false; this.running = false;
if (flag) { if (waitForShutdown) {
try { try {
- this.serverThread.join(); - this.serverThread.join();
+ serverThread.join(); // Gale - base thread pools + serverThread.join(); // Gale - base thread pools
} catch (InterruptedException interruptedexception) { } catch (InterruptedException interruptedexception) {
MinecraftServer.LOGGER.error("Error while shutting down", interruptedexception); MinecraftServer.LOGGER.error("Error while shutting down", interruptedexception);
} }
@@ -1100,6 +1175,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1108,6 +1185,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static long lastTickOversleepTime; public static long lastTickOversleepTime;
// Gale end - YAPFA - last tick time // Gale end - YAPFA - last tick time
@@ -816,7 +805,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
protected void runServer() { protected void runServer() {
try { try {
long serverStartTime = Util.getNanos(); // Paper long serverStartTime = Util.getNanos(); // Paper
@@ -1107,7 +1183,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1115,7 +1193,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new IllegalStateException("Failed to initialize server"); throw new IllegalStateException("Failed to initialize server");
} }
@@ -824,8 +813,8 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
+ this.setNextTickTime(Util.getMillis()); // Gale - base thread pools + this.setNextTickTime(Util.getMillis()); // Gale - base thread pools
this.status.setDescription(Component.literal(this.motd)); this.status.setDescription(Component.literal(this.motd));
this.status.setVersion(new ServerStatus.Version(SharedConstants.getCurrentVersion().getName(), SharedConstants.getCurrentVersion().getProtocolVersion())); this.status.setVersion(new ServerStatus.Version(SharedConstants.getCurrentVersion().getName(), SharedConstants.getCurrentVersion().getProtocolVersion()));
this.status.setPreviewsChat(this.previewsChat()); this.status.setEnforcesSecureChat(this.enforceSecureProfile());
@@ -1145,7 +1221,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1152,7 +1230,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.server.getWarnOnOverload()) // CraftBukkit if (this.server.getWarnOnOverload()) // CraftBukkit
MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j); MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j);
@@ -834,7 +823,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
this.lastOverloadWarning = this.nextTickTime; this.lastOverloadWarning = this.nextTickTime;
} }
@@ -1174,14 +1250,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1181,14 +1259,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
lastTick = curTime; lastTick = curTime;
@@ -850,7 +839,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime); this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
this.waitUntilNextTick(); this.waitUntilNextTick();
this.profiler.pop(); this.profiler.pop();
@@ -1265,7 +1340,47 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1272,7 +1349,47 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return crashreport; return crashreport;
} }
@@ -899,7 +888,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
// Paper start // Paper start
if (this.forceTicks) { if (this.forceTicks) {
return true; return true;
@@ -1273,13 +1388,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1280,13 +1397,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end // Paper end
// CraftBukkit start // CraftBukkit start
if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken
@@ -916,7 +905,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
} }
private boolean canSleepForTickNoOversleep() { private boolean canSleepForTickNoOversleep() {
@@ -1288,7 +1403,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1295,7 +1412,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end // Paper end
private void executeModerately() { private void executeModerately() {
@@ -925,7 +914,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L); java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L);
} }
// CraftBukkit end // CraftBukkit end
@@ -1296,62 +1411,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1303,62 +1420,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
protected void waitUntilNextTick() { protected void waitUntilNextTick() {
//this.executeAll(); // Paper - move this into the tick method for timings //this.executeAll(); // Paper - move this into the tick method for timings
long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time
@@ -992,7 +981,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
private void updateStatusIcon(ServerStatus metadata) { private void updateStatusIcon(ServerStatus metadata) {
Optional<File> optional = Optional.of(this.getFile("server-icon.png")).filter(File::isFile); Optional<File> optional = Optional.of(this.getFile("server-icon.png")).filter(File::isFile);
@@ -1399,14 +1468,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1406,14 +1477,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper start - move oversleep into full server tick // Paper start - move oversleep into full server tick
isOversleep = true;MinecraftTimings.serverOversleep.startTiming(); isOversleep = true;MinecraftTimings.serverOversleep.startTiming();
@@ -1012,7 +1001,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
this.tickChildren(shouldKeepTicking); this.tickChildren(shouldKeepTicking);
if (i - this.lastServerStatus >= 5000000000L) { if (i - this.lastServerStatus >= 5000000000L) {
this.lastServerStatus = i; this.lastServerStatus = i;
@@ -1442,7 +1516,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1449,7 +1525,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (playerSaveInterval > 0) { if (playerSaveInterval > 0) {
this.playerList.saveAll(playerSaveInterval); this.playerList.saveAll(playerSaveInterval);
} }
@@ -1021,7 +1010,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
if (level.paperConfig().chunks.autoSaveInterval.value() > 0) { if (level.paperConfig().chunks.autoSaveInterval.value() > 0) {
level.saveIncrementally(fullSave); level.saveIncrementally(fullSave);
} }
@@ -1455,7 +1529,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1462,7 +1538,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
io.papermc.paper.util.CachedLists.reset(); // Paper io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing // Paper start - move executeAll() into full server tick timing
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
@@ -1030,7 +1019,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
} }
// Paper end // Paper end
// Paper start // Paper start
@@ -1503,7 +1577,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1510,7 +1586,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
// Send time updates to everyone, it will get the right time from the world the player is in. // Send time updates to everyone, it will get the right time from the world the player is in.
// Paper start - optimize time updates // Paper start - optimize time updates
@@ -1039,7 +1028,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
final boolean doDaylight = world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT); final boolean doDaylight = world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT);
final long dayTime = world.getDayTime(); final long dayTime = world.getDayTime();
long worldTime = world.getGameTime(); long worldTime = world.getGameTime();
@@ -1523,9 +1597,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1530,9 +1606,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
this.isIteratingOverLevels = true; // Paper this.isIteratingOverLevels = true; // Paper
@@ -1050,7 +1039,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper
@@ -1609,7 +1681,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1616,7 +1690,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public boolean isShutdown() { public boolean isShutdown() {
@@ -1059,7 +1048,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
} }
public File getFile(String path) { public File getFile(String path) {
@@ -1617,7 +1689,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1624,7 +1698,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public final ServerLevel overworld() { public final ServerLevel overworld() {
@@ -1073,7 +1062,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
} }
@Nullable @Nullable
@@ -1631,6 +1708,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1638,6 +1717,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels); Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels);
newLevels.put(level.dimension(), level); newLevels.put(level.dimension(), level);
this.levels = Collections.unmodifiableMap(newLevels); this.levels = Collections.unmodifiableMap(newLevels);
@@ -1087,7 +1076,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
} }
public void removeLevel(ServerLevel level) { public void removeLevel(ServerLevel level) {
@@ -1638,6 +1722,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1645,6 +1731,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels); Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels);
newLevels.remove(level.dimension()); newLevels.remove(level.dimension());
this.levels = Collections.unmodifiableMap(newLevels); this.levels = Collections.unmodifiableMap(newLevels);
@@ -1102,7 +1091,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
} }
// CraftBukkit end // CraftBukkit end
@@ -1645,8 +1737,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1652,8 +1746,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return this.levels.keySet(); return this.levels.keySet();
} }
@@ -1118,7 +1107,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
} }
public String getServerVersion() { public String getServerVersion() {
@@ -1775,10 +1873,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1773,10 +1873,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
private void updateMobSpawningFlags() { private void updateMobSpawningFlags() {
@@ -1130,7 +1119,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
worldserver.setSpawnSettings(worldserver.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && ((DedicatedServer) this).settings.getProperties().spawnMonsters, this.isSpawningAnimals()); // Paper - per level difficulty (from setDifficulty(ServerLevel, Difficulty, boolean)) worldserver.setSpawnSettings(worldserver.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && ((DedicatedServer) this).settings.getProperties().spawnMonsters, this.isSpawningAnimals()); // Paper - per level difficulty (from setDifficulty(ServerLevel, Difficulty, boolean))
} }
@@ -1981,25 +2076,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1975,25 +2072,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return 29999984; return 29999984;
} }
@@ -1156,7 +1145,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
public int getCompressionThreshold() { public int getCompressionThreshold() {
return 256; return 256;
} }
@@ -2064,7 +2140,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2060,7 +2138,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
// Paper start // Paper start
@@ -1165,7 +1154,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
return; return;
} }
// this.getPlayerList().saveAll(); // Paper - we don't need to save everything, just advancements // this.getPlayerList().saveAll(); // Paper - we don't need to save everything, just advancements
@@ -2289,7 +2365,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2302,7 +2380,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
BufferedWriter bufferedwriter = Files.newBufferedWriter(path); BufferedWriter bufferedwriter = Files.newBufferedWriter(path);
try { try {
@@ -1174,7 +1163,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
bufferedwriter.write(String.format(Locale.ROOT, "average_tick_time: %f\n", this.getAverageTickTime())); bufferedwriter.write(String.format(Locale.ROOT, "average_tick_time: %f\n", this.getAverageTickTime()));
bufferedwriter.write(String.format(Locale.ROOT, "tick_times: %s\n", Arrays.toString(this.tickTimes))); bufferedwriter.write(String.format(Locale.ROOT, "tick_times: %s\n", Arrays.toString(this.tickTimes)));
bufferedwriter.write(String.format(Locale.ROOT, "queue: %s\n", Util.backgroundExecutor())); bufferedwriter.write(String.format(Locale.ROOT, "queue: %s\n", Util.backgroundExecutor()));
@@ -2475,7 +2551,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2488,7 +2566,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
// CraftBukkit start // CraftBukkit start
@@ -1182,7 +1171,7 @@ index 0b3b1400e9546060b4ee35236741670aaa226820..7b627f6e68c4c4033876df6b9bf587ca
public boolean isSameThread() { public boolean isSameThread() {
return io.papermc.paper.util.TickThread.isTickThread(); // Paper - rewrite chunk system return io.papermc.paper.util.TickThread.isTickThread(); // Paper - rewrite chunk system
} }
@@ -2725,7 +2800,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2742,7 +2819,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// give all worlds a fair chance at by targetting them all. // give all worlds a fair chance at by targetting them all.
// if we execute too many tasks, that's fine - we have logic to correctly handle overuse of allocated time. // if we execute too many tasks, that's fine - we have logic to correctly handle overuse of allocated time.
boolean executed = false; boolean executed = false;
@@ -1226,10 +1215,10 @@ index f0a7a8df3caa2ea765bb0a87cfede71d0995d276..59022fd5c784046ec65a473236a0788e
// CraftBukkit start // CraftBukkit start
TimeSkipEvent event = new TimeSkipEvent(worldserver.getWorld(), TimeSkipEvent.SkipReason.COMMAND, time); TimeSkipEvent event = new TimeSkipEvent(worldserver.getWorld(), TimeSkipEvent.SkipReason.COMMAND, time);
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index b374f41b20b3ffa2ec2874a06715661f4fec83db..00c000c57d614a84aa15aaff58523419fe66bbbc 100644 index eed9f125df46b616b7234a2d669971bc51bc231b..396258cb21a8e5488f0f456b65dc629ff895601e 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -54,6 +54,7 @@ import net.minecraft.world.level.block.entity.SkullBlockEntity; @@ -49,6 +49,7 @@ import net.minecraft.world.level.block.entity.SkullBlockEntity;
import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.LevelStorageSource;
import org.galemc.gale.command.GaleCommands; import org.galemc.gale.command.GaleCommands;
import org.galemc.gale.configuration.GaleGlobalConfiguration; import org.galemc.gale.configuration.GaleGlobalConfiguration;
@@ -1237,17 +1226,17 @@ index b374f41b20b3ffa2ec2874a06715661f4fec83db..00c000c57d614a84aa15aaff58523419
import org.galemc.gale.util.CPUCoresEstimation; import org.galemc.gale.util.CPUCoresEstimation;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -87,7 +88,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -82,7 +83,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
private final TextFilterClient textFilterClient; private final TextFilterClient textFilterClient;
// CraftBukkit start - Signature changed // CraftBukkit start - Signature changed
- public DedicatedServer(joptsimple.OptionSet options, DataPackConfig datapackconfiguration, DynamicOps<Tag> registryreadops, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { - public DedicatedServer(joptsimple.OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
+ public DedicatedServer(joptsimple.OptionSet options, DataPackConfig datapackconfiguration, DynamicOps<Tag> registryreadops, OriginalServerThread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { // Gale - base thread pools + public DedicatedServer(joptsimple.OptionSet options, WorldLoader.DataLoadContext worldLoader, OriginalServerThread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { // Gale - base thread pools
super(options, datapackconfiguration, registryreadops, thread, convertable_conversionsession, resourcepackrepository, worldstem, Proxy.NO_PROXY, datafixer, services, worldloadlistenerfactory); super(options, worldLoader, thread, convertable_conversionsession, resourcepackrepository, worldstem, Proxy.NO_PROXY, datafixer, services, worldloadlistenerfactory);
// CraftBukkit end // CraftBukkit end
this.settings = dedicatedserversettings; this.settings = dedicatedserversettings;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 4654995f9982e77abe4b825b32312c2913671cd4..ea23009b8f5a02429db514a374edb5db884e9496 100644 index 5b8260b6a309bd1aba2286e8c1f8cfc44326adbd..e064398e0fdb8e7e0600b6993a70f6c87de7f357 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -11,7 +11,6 @@ import java.util.Collections; @@ -11,7 +11,6 @@ import java.util.Collections;
@@ -1266,7 +1255,7 @@ index 4654995f9982e77abe4b825b32312c2913671cd4..ea23009b8f5a02429db514a374edb5db
import net.minecraft.server.level.progress.ChunkProgressListener; import net.minecraft.server.level.progress.ChunkProgressListener;
import net.minecraft.util.VisibleForDebug; import net.minecraft.util.VisibleForDebug;
import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.util.profiling.ProfilerFiller;
@@ -48,6 +48,7 @@ import net.minecraft.world.level.storage.DimensionDataStorage; @@ -49,6 +49,7 @@ import net.minecraft.world.level.storage.DimensionDataStorage;
import net.minecraft.world.level.storage.LevelData; import net.minecraft.world.level.storage.LevelData;
import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.LevelStorageSource;
import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; // Paper import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; // Paper
@@ -1274,7 +1263,7 @@ index 4654995f9982e77abe4b825b32312c2913671cd4..ea23009b8f5a02429db514a374edb5db
public class ServerChunkCache extends ChunkSource { public class ServerChunkCache extends ChunkSource {
@@ -994,6 +995,14 @@ public class ServerChunkCache extends ChunkSource { @@ -999,6 +1000,14 @@ public class ServerChunkCache extends ChunkSource {
super.doRunTask(task); super.doRunTask(task);
} }
@@ -1290,18 +1279,19 @@ index 4654995f9982e77abe4b825b32312c2913671cd4..ea23009b8f5a02429db514a374edb5db
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
public boolean pollTask() { public boolean pollTask() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c94b850aa33928c0d834b1897b3e0ace3486c3da..784a05d3df96b4d24d9f262ee09f48947ada8353 100644 index a980908087b47869cd9326dbc62974567ed3170a..dce257dadb12cae5d6bc280c7ee4815055160258 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -22,6 +22,7 @@ import java.io.Writer; @@ -22,6 +22,8 @@ import java.io.Writer;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.ArrayList; import java.util.ArrayList;
+import java.util.Arrays; +import java.util.Arrays;
import java.util.Collections; +import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Iterator; import java.util.Iterator;
@@ -155,6 +156,8 @@ import net.minecraft.world.phys.shapes.BooleanOp; import java.util.List;
@@ -158,6 +160,8 @@ import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.LevelTicks; import net.minecraft.world.ticks.LevelTicks;
@@ -1310,7 +1300,7 @@ index c94b850aa33928c0d834b1897b3e0ace3486c3da..784a05d3df96b4d24d9f262ee09f4894
import org.slf4j.Logger; import org.slf4j.Logger;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
@@ -188,6 +191,10 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -191,6 +195,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
private static final int MAX_SCHEDULED_TICKS_PER_TICK = 65536; private static final int MAX_SCHEDULED_TICKS_PER_TICK = 65536;
final List<ServerPlayer> players; final List<ServerPlayer> players;
public final ServerChunkCache chunkSource; public final ServerChunkCache chunkSource;
@@ -1321,7 +1311,7 @@ index c94b850aa33928c0d834b1897b3e0ace3486c3da..784a05d3df96b4d24d9f262ee09f4894
private final MinecraftServer server; private final MinecraftServer server;
public final PrimaryLevelData serverLevelData; // CraftBukkit - type public final PrimaryLevelData serverLevelData; // CraftBukkit - type
final EntityTickList entityTickList; final EntityTickList entityTickList;
@@ -2610,7 +2617,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2590,7 +2598,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot start // Spigot start
if ( entity instanceof Player ) if ( entity instanceof Player )
{ {
@@ -1331,10 +1321,10 @@ index c94b850aa33928c0d834b1897b3e0ace3486c3da..784a05d3df96b4d24d9f262ee09f4894
for (Object o : worldData.cache.values() ) for (Object o : worldData.cache.values() )
{ {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a504a620b5 100644 index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba563ce55c8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -187,6 +187,8 @@ import net.minecraft.world.phys.shapes.Shapes; @@ -186,6 +186,8 @@ import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.galemc.gale.configuration.GaleGlobalConfiguration; import org.galemc.gale.configuration.GaleGlobalConfiguration;
@@ -1343,7 +1333,7 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -556,7 +558,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -550,7 +552,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Objects.requireNonNull(this.connection); Objects.requireNonNull(this.connection);
// CraftBukkit - Don't wait // CraftBukkit - Don't wait
@@ -1352,7 +1342,7 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
} }
private <T, R> CompletableFuture<R> filterTextPacket(T text, BiFunction<TextFilter, T, CompletableFuture<R>> filterer) { private <T, R> CompletableFuture<R> filterTextPacket(T text, BiFunction<TextFilter, T, CompletableFuture<R>> filterer) {
@@ -887,21 +889,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -881,21 +883,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// Paper start // Paper start
@@ -1377,7 +1367,7 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
return; return;
} }
// Paper end // Paper end
@@ -926,7 +927,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -920,7 +921,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (!event.isHandled()) { if (!event.isHandled()) {
if (!event.isCancelled()) { if (!event.isCancelled()) {
@@ -1386,7 +1376,7 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
@@ -937,7 +938,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -931,7 +932,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions()));
// Paper end - Brigadier API // Paper end - Brigadier API
}); });
@@ -1395,7 +1385,7 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
} }
} else if (!completions.isEmpty()) { } else if (!completions.isEmpty()) {
final com.mojang.brigadier.suggestion.SuggestionsBuilder builder0 = new com.mojang.brigadier.suggestion.SuggestionsBuilder(command, stringreader.getTotalLength()); final com.mojang.brigadier.suggestion.SuggestionsBuilder builder0 = new com.mojang.brigadier.suggestion.SuggestionsBuilder(command, stringreader.getTotalLength());
@@ -1246,7 +1247,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1240,7 +1241,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
if (byteLength > 256 * 4) { if (byteLength > 256 * 4) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!"); ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!");
@@ -1404,7 +1394,7 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
return; return;
} }
byteTotal += byteLength; byteTotal += byteLength;
@@ -1269,14 +1270,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1263,14 +1264,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (byteTotal > byteAllowed) { if (byteTotal > byteAllowed) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
@@ -1421,7 +1411,7 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
return; return;
} }
this.lastBookTick = MinecraftServer.currentTick; this.lastBookTick = MinecraftServer.currentTick;
@@ -2077,10 +2078,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2074,10 +2075,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleTeleportToEntityPacket(ServerboundTeleportToEntityPacket packet) { public void handleTeleportToEntityPacket(ServerboundTeleportToEntityPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (this.player.isSpectator()) { if (this.player.isSpectator()) {
@@ -1433,7 +1423,7 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
Entity entity = packet.getEntity(worldserver); Entity entity = packet.getEntity(worldserver);
if (entity != null) { if (entity != null) {
@@ -2228,9 +2226,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2226,9 +2224,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// CraftBukkit end // CraftBukkit end
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) {
@@ -1443,9 +1433,9 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
- }); // Paper - push to main for event firing - }); // Paper - push to main for event firing
+ }, ScheduledServerThreadTaskQueues.KICK_FOR_ILLEGAL_CHARACTERS_IN_CHAT_PACKET_TASK_MAX_DELAY); // Paper - push to main for event firing // Gale - base thread pools + }, ScheduledServerThreadTaskQueues.KICK_FOR_ILLEGAL_CHARACTERS_IN_CHAT_PACKET_TASK_MAX_DELAY); // Paper - push to main for event firing // Gale - base thread pools
} else { } else {
if (this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages())) { Optional<LastSeenMessages> optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages());
// this.server.submit(() -> { // CraftBukkit - async chat
@@ -2258,9 +2256,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2262,9 +2260,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleChatCommand(ServerboundChatCommandPacket packet) { public void handleChatCommand(ServerboundChatCommandPacket packet) {
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) {
@@ -1455,21 +1445,22 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
- }); // Paper - push to main for event firing - }); // Paper - push to main for event firing
+ }, ScheduledServerThreadTaskQueues.KICK_FOR_ILLEGAL_CHARACTERS_IN_CHAT_PACKET_TASK_MAX_DELAY); // Paper - push to main for event firing // Gale - base thread pools + }, ScheduledServerThreadTaskQueues.KICK_FOR_ILLEGAL_CHARACTERS_IN_CHAT_PACKET_TASK_MAX_DELAY); // Paper - push to main for event firing // Gale - base thread pools
} else { } else {
if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) { Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages());
this.server.submit(() -> {
@@ -2357,9 +2355,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2344,9 +2342,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
if (!this.updateChatOrder(timestamp)) { if (!this.updateChatOrder(timestamp)) {
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper
- this.server.scheduleOnMain(() -> { // Paper - push to main - this.server.scheduleOnMain(() -> { // Paper - push to main
+ ScheduledServerThreadTaskQueues.add(() -> { // Paper - push to main // Gale - base thread pools - this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event ca
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event cause
- }); // Paper - push to main - }); // Paper - push to main
+ ScheduledServerThreadTaskQueues.add(() -> { // Paper - push to main // Gale - base thread pools
+ this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event cause
+ }, ScheduledServerThreadTaskQueues.KICK_FOR_OUT_OF_ORDER_CHAT_PACKET_TASK_MAX_DELAY); // Paper - push to main // Gale - base thread pools + }, ScheduledServerThreadTaskQueues.KICK_FOR_OUT_OF_ORDER_CHAT_PACKET_TASK_MAX_DELAY); // Paper - push to main // Gale - base thread pools
return false; return Optional.empty();
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
@@ -3420,7 +3418,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3276,7 +3274,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper start // Paper start
if (!org.bukkit.Bukkit.isPrimaryThread()) { if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@@ -1479,7 +1470,7 @@ index c171c272d5fcf0900514e18eafaa1b5ee019c74d..30eed43488bce2f785dc528a597927a5
} }
} }
diff --git a/src/main/java/net/minecraft/server/network/TextFilterClient.java b/src/main/java/net/minecraft/server/network/TextFilterClient.java diff --git a/src/main/java/net/minecraft/server/network/TextFilterClient.java b/src/main/java/net/minecraft/server/network/TextFilterClient.java
index 2393b6a5f3f12c2b17b172ee8ca42ead218e2a10..193c08de3715d8a41a7171accbb886ed5480d56c 100644 index 4b3d2280326c7eeda4952c36edff141cbff90e16..fa3a58f09178604e301b107f1a029e59a7164e13 100644
--- a/src/main/java/net/minecraft/server/network/TextFilterClient.java --- a/src/main/java/net/minecraft/server/network/TextFilterClient.java
+++ b/src/main/java/net/minecraft/server/network/TextFilterClient.java +++ b/src/main/java/net/minecraft/server/network/TextFilterClient.java
@@ -23,7 +23,6 @@ import java.util.List; @@ -23,7 +23,6 @@ import java.util.List;
@@ -1508,7 +1499,7 @@ index 2393b6a5f3f12c2b17b172ee8ca42ead218e2a10..193c08de3715d8a41a7171accbb886ed
private static URL getEndpoint(URI root, @Nullable JsonObject endpoints, String key, String fallback) throws MalformedURLException { private static URL getEndpoint(URI root, @Nullable JsonObject endpoints, String key, String fallback) throws MalformedURLException {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index a60db92d8c6afab40e12b3ac28241beac06bcf63..712f9759b1fbf8d994d0a3edbeff346250d7f82f 100644 index 42a79988c14770cb3b19d31f6df41a3d5cf14f9b..7ff86594779c54dc8c1d02ce2c3c298bd8a78047 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -15,7 +15,6 @@ import java.net.SocketAddress; @@ -15,7 +15,6 @@ import java.net.SocketAddress;
@@ -1518,8 +1509,8 @@ index a60db92d8c6afab40e12b3ac28241beac06bcf63..712f9759b1fbf8d994d0a3edbeff3462
-import java.util.ArrayList; -import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.EnumSet;
@@ -101,10 +100,10 @@ import net.minecraft.world.scores.PlayerTeam; @@ -105,10 +104,10 @@ import net.minecraft.world.scores.PlayerTeam;
import net.minecraft.world.scores.Scoreboard; // Paper import net.minecraft.world.scores.Scoreboard; // Paper
import net.minecraft.world.scores.Team; import net.minecraft.world.scores.Team;
import org.galemc.gale.configuration.GaleGlobalConfiguration; import org.galemc.gale.configuration.GaleGlobalConfiguration;
@@ -1531,7 +1522,7 @@ index a60db92d8c6afab40e12b3ac28241beac06bcf63..712f9759b1fbf8d994d0a3edbeff3462
import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.dedicated.DedicatedServer;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
@@ -306,7 +305,7 @@ public abstract class PlayerList { @@ -313,7 +312,7 @@ public abstract class PlayerList {
worldserver1, chunkX, chunkZ, net.minecraft.server.level.ChunkHolder.FullChunkStatus.ENTITY_TICKING, true, worldserver1, chunkX, chunkZ, net.minecraft.server.level.ChunkHolder.FullChunkStatus.ENTITY_TICKING, true,
ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGHEST, ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGHEST,
(chunk) -> { (chunk) -> {
@@ -1540,7 +1531,7 @@ index a60db92d8c6afab40e12b3ac28241beac06bcf63..712f9759b1fbf8d994d0a3edbeff3462
try { try {
if (!playerconnection.connection.isConnected()) { if (!playerconnection.connection.isConnected()) {
return; return;
@@ -319,7 +318,7 @@ public abstract class PlayerList { @@ -326,7 +325,7 @@ public abstract class PlayerList {
} finally { } finally {
finalWorldserver.pendingLogin.remove(player); finalWorldserver.pendingLogin.remove(player);
} }
@@ -1549,7 +1540,7 @@ index a60db92d8c6afab40e12b3ac28241beac06bcf63..712f9759b1fbf8d994d0a3edbeff3462
} }
); );
} }
@@ -1578,10 +1577,8 @@ public abstract class PlayerList { @@ -1569,10 +1568,8 @@ public abstract class PlayerList {
public void setViewDistance(int viewDistance) { public void setViewDistance(int viewDistance) {
this.viewDistance = viewDistance; this.viewDistance = viewDistance;
//this.broadcastAll(new ClientboundSetChunkCacheRadiusPacket(viewDistance)); // Paper - move into setViewDistance //this.broadcastAll(new ClientboundSetChunkCacheRadiusPacket(viewDistance)); // Paper - move into setViewDistance
@@ -1561,7 +1552,7 @@ index a60db92d8c6afab40e12b3ac28241beac06bcf63..712f9759b1fbf8d994d0a3edbeff3462
if (worldserver != null) { if (worldserver != null) {
worldserver.getChunkSource().setViewDistance(viewDistance); worldserver.getChunkSource().setViewDistance(viewDistance);
@@ -1593,10 +1590,8 @@ public abstract class PlayerList { @@ -1584,10 +1581,8 @@ public abstract class PlayerList {
public void setSimulationDistance(int simulationDistance) { public void setSimulationDistance(int simulationDistance) {
this.simulationDistance = simulationDistance; this.simulationDistance = simulationDistance;
//this.broadcastAll(new ClientboundSetSimulationDistancePacket(simulationDistance)); // Paper - handled by playerchunkloader //this.broadcastAll(new ClientboundSetSimulationDistancePacket(simulationDistance)); // Paper - handled by playerchunkloader
@@ -1628,10 +1619,10 @@ index 83701fbfaa56a232593ee8f11a3afb8941238bfa..321be4cfea7228f5f5131eb521daa675
this.execute(runnable); this.execute(runnable);
} }
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index ea23e771ab2b77e8001d0eaaf834423353ef70c2..1eee91bd8999e43182854354092b8229bc82b7ae 100644 index 9948cc4c65d5681c171b38cdf7cf3e63a01e4364..c37793871951b0044168610bc05ee0529f3c4611 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -97,7 +97,7 @@ public abstract class Projectile extends Entity { @@ -98,7 +98,7 @@ public abstract class Projectile extends Entity {
this.cachedOwner = ((ServerLevel) this.level).getEntity(this.ownerUUID); this.cachedOwner = ((ServerLevel) this.level).getEntity(this.ownerUUID);
// Paper start - check all worlds // Paper start - check all worlds
if (this.cachedOwner == null) { if (this.cachedOwner == null) {
@@ -1641,10 +1632,10 @@ index ea23e771ab2b77e8001d0eaaf834423353ef70c2..1eee91bd8999e43182854354092b8229
final Entity entity = level.getEntity(this.ownerUUID); final Entity entity = level.getEntity(this.ownerUUID);
if (entity != null) { if (entity != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 69bde99acff7bdae9af7cfe60e2221675a68b858..1f4191c0ae580b885275de21887d3184974627e4 100644 index c2ad33e5fbce8a16498dde2bfd555012660af969..d12ec5f506755d17a57ccdf431a0917eac871ef2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -969,7 +969,7 @@ public final class CraftServer implements Server { @@ -982,7 +982,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console); this.console.paperConfigurations.reloadConfigs(this.console);
this.console.galeConfigurations.reloadConfigs(this.console); // Gale - Gale configuration this.console.galeConfigurations.reloadConfigs(this.console); // Gale - Gale configuration
@@ -1653,7 +1644,7 @@ index 69bde99acff7bdae9af7cfe60e2221675a68b858..1f4191c0ae580b885275de21887d3184
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -1153,7 +1153,7 @@ public final class CraftServer implements Server { @@ -1166,7 +1166,7 @@ public final class CraftServer implements Server {
@Override @Override
public World createWorld(WorldCreator creator) { public World createWorld(WorldCreator creator) {
@@ -1662,7 +1653,7 @@ index 69bde99acff7bdae9af7cfe60e2221675a68b858..1f4191c0ae580b885275de21887d3184
//Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot create a world while worlds are being ticked"); // Paper - Cat - Temp disable. We'll see how this goes. //Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot create a world while worlds are being ticked"); // Paper - Cat - Temp disable. We'll see how this goes.
Validate.notNull(creator, "Creator may not be null"); Validate.notNull(creator, "Creator may not be null");
@@ -2498,7 +2498,7 @@ public final class CraftServer implements Server { @@ -2522,7 +2522,7 @@ public final class CraftServer implements Server {
public Entity getEntity(UUID uuid) { public Entity getEntity(UUID uuid) {
Validate.notNull(uuid, "UUID cannot be null"); Validate.notNull(uuid, "UUID cannot be null");
@@ -1672,7 +1663,7 @@ index 69bde99acff7bdae9af7cfe60e2221675a68b858..1f4191c0ae580b885275de21887d3184
if (entity != null) { if (entity != null) {
return entity.getBukkitEntity(); return entity.getBukkitEntity();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 55d83a9a691d11c9408d2c3260c3e77dfb51b97e..367503092090c1ade673f865cd19956cdac60d47 100644 index f8d321e925bf2708e51590542325c1bdc67d5964..a190bb9ce7b3701963f315452359f6f9c3aae329 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -5,7 +5,6 @@ import com.google.common.base.Predicates; @@ -5,7 +5,6 @@ import com.google.common.base.Predicates;
@@ -1683,7 +1674,7 @@ index 55d83a9a691d11c9408d2c3260c3e77dfb51b97e..367503092090c1ade673f865cd19956c
import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import java.io.File; import java.io.File;
@@ -21,7 +20,6 @@ import java.util.Objects; @@ -20,7 +19,6 @@ import java.util.Objects;
import java.util.Random; import java.util.Random;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
@@ -1691,15 +1682,7 @@ index 55d83a9a691d11c9408d2c3260c3e77dfb51b97e..367503092090c1ade673f865cd19956c
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@@ -43,7 +41,6 @@ import net.minecraft.server.level.ServerPlayer; @@ -114,7 +112,6 @@ import org.bukkit.entity.TippedArrow;
import net.minecraft.server.level.Ticket;
import net.minecraft.server.level.TicketType;
import net.minecraft.sounds.SoundSource;
-import net.minecraft.tags.TagKey;
import net.minecraft.util.SortedArraySet;
import net.minecraft.util.Unit;
import net.minecraft.world.entity.EntityType;
@@ -115,7 +112,6 @@ import org.bukkit.entity.TippedArrow;
import org.bukkit.entity.Trident; import org.bukkit.entity.Trident;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.event.weather.LightningStrikeEvent; import org.bukkit.event.weather.LightningStrikeEvent;
@@ -1707,7 +1690,7 @@ index 55d83a9a691d11c9408d2c3260c3e77dfb51b97e..367503092090c1ade673f865cd19956c
import org.bukkit.event.world.TimeSkipEvent; import org.bukkit.event.world.TimeSkipEvent;
import org.bukkit.generator.BiomeProvider; import org.bukkit.generator.BiomeProvider;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
@@ -135,6 +131,7 @@ import org.bukkit.util.Consumer; @@ -134,6 +131,7 @@ import org.bukkit.util.Consumer;
import org.bukkit.util.RayTraceResult; import org.bukkit.util.RayTraceResult;
import org.bukkit.util.StructureSearchResult; import org.bukkit.util.StructureSearchResult;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@@ -1715,7 +1698,7 @@ index 55d83a9a691d11c9408d2c3260c3e77dfb51b97e..367503092090c1ade673f865cd19956c
public class CraftWorld extends CraftRegionAccessor implements World { public class CraftWorld extends CraftRegionAccessor implements World {
public static final int CUSTOM_DIMENSION_OFFSET = 10; public static final int CUSTOM_DIMENSION_OFFSET = 10;
@@ -2353,11 +2350,11 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -2356,11 +2354,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
java.util.concurrent.CompletableFuture<Chunk> ret = new java.util.concurrent.CompletableFuture<>(); java.util.concurrent.CompletableFuture<Chunk> ret = new java.util.concurrent.CompletableFuture<>();
io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> { io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> {
@@ -1730,10 +1713,10 @@ index 55d83a9a691d11c9408d2c3260c3e77dfb51b97e..367503092090c1ade673f865cd19956c
return ret; return ret;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 01132b10799034232e7e5cbb460d848601e04012..85ecf1530e26fd908b804b853edb6a50d27b1b69 100644 index 6cd6cb256bde958416a0e4b13fc1d3df74f230fd..0b062d6c7c7806a4099374944c8e9f16042b5a1d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -189,6 +189,7 @@ import org.bukkit.plugin.Plugin; @@ -190,6 +190,7 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.util.BoundingBox; import org.bukkit.util.BoundingBox;
import org.bukkit.util.NumberConversions; import org.bukkit.util.NumberConversions;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@@ -1741,7 +1724,7 @@ index 01132b10799034232e7e5cbb460d848601e04012..85ecf1530e26fd908b804b853edb6a50
public abstract class CraftEntity implements org.bukkit.entity.Entity { public abstract class CraftEntity implements org.bukkit.entity.Entity {
private static PermissibleBase perm; private static PermissibleBase perm;
@@ -1266,7 +1267,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1268,7 +1269,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
for (net.minecraft.world.level.chunk.ChunkAccess chunk : list) { for (net.minecraft.world.level.chunk.ChunkAccess chunk : list) {
chunkProviderServer.addTicketAtLevel(net.minecraft.server.level.TicketType.POST_TELEPORT, chunk.getPos(), 33, CraftEntity.this.getEntityId()); chunkProviderServer.addTicketAtLevel(net.minecraft.server.level.TicketType.POST_TELEPORT, chunk.getPos(), 33, CraftEntity.this.getEntityId());
} }
@@ -1750,7 +1733,7 @@ index 01132b10799034232e7e5cbb460d848601e04012..85ecf1530e26fd908b804b853edb6a50
try { try {
ret.complete(CraftEntity.this.teleport(locationClone, cause) ? Boolean.TRUE : Boolean.FALSE); ret.complete(CraftEntity.this.teleport(locationClone, cause) ? Boolean.TRUE : Boolean.FALSE);
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -1276,7 +1277,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1278,7 +1279,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
net.minecraft.server.MinecraftServer.LOGGER.error("Failed to teleport entity " + CraftEntity.this, throwable); net.minecraft.server.MinecraftServer.LOGGER.error("Failed to teleport entity " + CraftEntity.this, throwable);
ret.completeExceptionally(throwable); ret.completeExceptionally(throwable);
} }
@@ -1799,10 +1782,10 @@ index b4d6e136b9d8f41f070c4f720c1f64e2c729a445..a38f6a8b409ece8307a1cbe17e9d9ee2
@AnyThreadSafe @YieldFree @AnyThreadSafe @YieldFree
public class SemaphoreMutex extends Semaphore implements Mutex { public class SemaphoreMutex extends Semaphore implements Mutex {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java b/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java b/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java
index 51d37d9f9f0901b3f6dc702ad17158039ee96ebe..c5aac390e5bc6a4ce816f11293cc7a3b205f8ea5 100644 index 69acbab61a79c24312359a63086f9353d740113f..49ace73d901b6f55545bb21a93d026a04c5757ad 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java --- a/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java +++ b/src/main/java/org/galemc/gale/configuration/GaleConfigurations.java
@@ -266,7 +266,7 @@ public class GaleConfigurations extends Configurations<GaleGlobalConfiguration, @@ -267,7 +267,7 @@ public class GaleConfigurations extends Configurations<GaleGlobalConfiguration,
try { try {
this.initializeGlobalConfiguration(reloader(this.globalConfigClass, GaleGlobalConfiguration.get())); this.initializeGlobalConfiguration(reloader(this.globalConfigClass, GaleGlobalConfiguration.get()));
this.initializeWorldDefaultsConfiguration(); this.initializeWorldDefaultsConfiguration();