diff --git a/patches/unapplied/server/0343-Guard-against-serializing-mismatching-chunk-coordina.patch b/patches/server/0343-Guard-against-serializing-mismatching-chunk-coordina.patch similarity index 100% rename from patches/unapplied/server/0343-Guard-against-serializing-mismatching-chunk-coordina.patch rename to patches/server/0343-Guard-against-serializing-mismatching-chunk-coordina.patch diff --git a/patches/unapplied/server/0344-Optimise-IEntityAccess-getPlayerByUUID.patch b/patches/server/0344-Optimise-IEntityAccess-getPlayerByUUID.patch similarity index 90% rename from patches/unapplied/server/0344-Optimise-IEntityAccess-getPlayerByUUID.patch rename to patches/server/0344-Optimise-IEntityAccess-getPlayerByUUID.patch index b4a66435dc..7ee9512d04 100644 --- a/patches/unapplied/server/0344-Optimise-IEntityAccess-getPlayerByUUID.patch +++ b/patches/server/0344-Optimise-IEntityAccess-getPlayerByUUID.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimise IEntityAccess#getPlayerByUUID Use the world entity map instead of iterating over all players diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index aa77a3dbbcb77fb6f3ad070b83426042dd284aa0..9993b6a8f40896166c2f86befa7222c6e714da81 100644 +index 7667c185178cf8cc15dd9c9b70402b1279e226a7..0cb83e84f8287bfaf170e78ed4cbce0ad00e3897 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -391,6 +391,14 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -392,6 +392,14 @@ public class ServerLevel extends Level implements WorldGenLevel { public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager; // Paper end diff --git a/patches/unapplied/server/0345-Fix-items-not-falling-correctly.patch b/patches/server/0345-Fix-items-not-falling-correctly.patch similarity index 93% rename from patches/unapplied/server/0345-Fix-items-not-falling-correctly.patch rename to patches/server/0345-Fix-items-not-falling-correctly.patch index 72f9d60111..96b422d772 100644 --- a/patches/unapplied/server/0345-Fix-items-not-falling-correctly.patch +++ b/patches/server/0345-Fix-items-not-falling-correctly.patch @@ -15,10 +15,10 @@ This patch resolves the conflict by offsetting checking Spigot's entity activation range check from an item's move method. 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 23506fd3a98c240606a00e29624012ae3bbab21a..a0de239a8497c906c2329131b14587637b0fdfcf 100644 +index 95dc82a0a9bd8a3fa9c704696e7b3dc48bf4d6a0..ebcf58fe51d1fd0cb8a0f5a84cdd349f29c9442e 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -144,7 +144,7 @@ public class ItemEntity extends Entity { +@@ -142,7 +142,7 @@ public class ItemEntity extends Entity { } } diff --git a/patches/unapplied/server/0346-Lag-compensate-eating.patch b/patches/server/0346-Lag-compensate-eating.patch similarity index 88% rename from patches/unapplied/server/0346-Lag-compensate-eating.patch rename to patches/server/0346-Lag-compensate-eating.patch index 696b8217eb..5e5385d34c 100644 --- a/patches/unapplied/server/0346-Lag-compensate-eating.patch +++ b/patches/server/0346-Lag-compensate-eating.patch @@ -7,10 +7,10 @@ When the server is lagging, players will wait longer when eating. Change to also use a time check instead if it passes. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 90f6fcb6c0a53133ecf7d9adbd5e526e29be3fa2..dc885d9a20205bfa3b77e315ebe17287a6c3d4bf 100644 +index 590b8af46f8e060aa568dde50025b4f4c6bb162e..383a892a5c34ec5e8f7d102f5a9bec11ae193c0e 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3539,6 +3539,11 @@ public abstract class LivingEntity extends Entity { +@@ -3542,6 +3542,11 @@ public abstract class LivingEntity extends Entity { return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND; } @@ -22,7 +22,7 @@ index 90f6fcb6c0a53133ecf7d9adbd5e526e29be3fa2..dc885d9a20205bfa3b77e315ebe17287 private void updatingUsingItem() { if (this.isUsingItem()) { if (ItemStack.isSameIgnoreDurability(this.getItemInHand(this.getUsedItemHand()), this.useItem)) { -@@ -3556,8 +3561,12 @@ public abstract class LivingEntity extends Entity { +@@ -3559,8 +3564,12 @@ public abstract class LivingEntity extends Entity { if (this.shouldTriggerItemUseEffects()) { this.triggerItemUseEffects(stack, 5); } @@ -37,7 +37,7 @@ index 90f6fcb6c0a53133ecf7d9adbd5e526e29be3fa2..dc885d9a20205bfa3b77e315ebe17287 this.completeUsingItem(); } -@@ -3605,7 +3614,10 @@ public abstract class LivingEntity extends Entity { +@@ -3608,7 +3617,10 @@ public abstract class LivingEntity extends Entity { if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag this.useItem = itemstack; @@ -49,7 +49,7 @@ index 90f6fcb6c0a53133ecf7d9adbd5e526e29be3fa2..dc885d9a20205bfa3b77e315ebe17287 if (!this.level.isClientSide) { this.setLivingEntityFlag(1, true); this.setLivingEntityFlag(2, hand == InteractionHand.OFF_HAND); -@@ -3630,7 +3642,10 @@ public abstract class LivingEntity extends Entity { +@@ -3633,7 +3645,10 @@ public abstract class LivingEntity extends Entity { } } else if (!this.isUsingItem() && !this.useItem.isEmpty()) { this.useItem = ItemStack.EMPTY; @@ -61,7 +61,7 @@ index 90f6fcb6c0a53133ecf7d9adbd5e526e29be3fa2..dc885d9a20205bfa3b77e315ebe17287 } } -@@ -3763,7 +3778,10 @@ public abstract class LivingEntity extends Entity { +@@ -3766,7 +3781,10 @@ public abstract class LivingEntity extends Entity { } this.useItem = ItemStack.EMPTY; diff --git a/patches/unapplied/server/0347-Optimize-call-to-getFluid-for-explosions.patch b/patches/server/0347-Optimize-call-to-getFluid-for-explosions.patch similarity index 100% rename from patches/unapplied/server/0347-Optimize-call-to-getFluid-for-explosions.patch rename to patches/server/0347-Optimize-call-to-getFluid-for-explosions.patch diff --git a/patches/unapplied/server/0348-Fix-last-firework-in-stack-not-having-effects-when-d.patch b/patches/server/0348-Fix-last-firework-in-stack-not-having-effects-when-d.patch similarity index 100% rename from patches/unapplied/server/0348-Fix-last-firework-in-stack-not-having-effects-when-d.patch rename to patches/server/0348-Fix-last-firework-in-stack-not-having-effects-when-d.patch diff --git a/patches/unapplied/server/0349-Add-effect-to-block-break-naturally.patch b/patches/server/0349-Add-effect-to-block-break-naturally.patch similarity index 100% rename from patches/unapplied/server/0349-Add-effect-to-block-break-naturally.patch rename to patches/server/0349-Add-effect-to-block-break-naturally.patch diff --git a/patches/unapplied/server/0350-Entity-Activation-Range-2.0.patch b/patches/server/0350-Entity-Activation-Range-2.0.patch similarity index 98% rename from patches/unapplied/server/0350-Entity-Activation-Range-2.0.patch rename to patches/server/0350-Entity-Activation-Range-2.0.patch index ed8b616a30..0db0537bd0 100644 --- a/patches/unapplied/server/0350-Entity-Activation-Range-2.0.patch +++ b/patches/server/0350-Entity-Activation-Range-2.0.patch @@ -14,7 +14,7 @@ Adds flying monsters to control ghast and phantoms Adds villagers as separate config diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 9993b6a8f40896166c2f86befa7222c6e714da81..ff902ae5a96616bb70897d9326fc65a3261b07d9 100644 +index 0cb83e84f8287bfaf170e78ed4cbce0ad00e3897..0013fdf7dd4074a9684eb4b93ea2735185c7ac1c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2,7 +2,6 @@ package net.minecraft.server.level; @@ -25,7 +25,7 @@ index 9993b6a8f40896166c2f86befa7222c6e714da81..ff902ae5a96616bb70897d9326fc65a3 import com.google.common.collect.Lists; import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.util.Pair; -@@ -990,17 +989,17 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -991,17 +990,17 @@ public class ServerLevel extends Level implements WorldGenLevel { ++TimingHistory.entityTicks; // Paper - timings // Spigot start co.aikar.timings.Timing timer; // Paper @@ -47,7 +47,7 @@ index 9993b6a8f40896166c2f86befa7222c6e714da81..ff902ae5a96616bb70897d9326fc65a3 try { // Paper end - timings entity.setOldPosAndRot(); -@@ -1011,9 +1010,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1012,9 +1011,13 @@ public class ServerLevel extends Level implements WorldGenLevel { return Registry.ENTITY_TYPE.getKey(entity.getType()).toString(); }); gameprofilerfiller.incrementCounter("tickNonPassenger"); @@ -61,7 +61,7 @@ index 9993b6a8f40896166c2f86befa7222c6e714da81..ff902ae5a96616bb70897d9326fc65a3 Iterator iterator = entity.getPassengers().iterator(); while (iterator.hasNext()) { -@@ -1021,13 +1024,18 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1022,13 +1025,18 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(entity, entity1); } @@ -81,7 +81,7 @@ index 9993b6a8f40896166c2f86befa7222c6e714da81..ff902ae5a96616bb70897d9326fc65a3 passenger.setOldPosAndRot(); ++passenger.tickCount; ProfilerFiller gameprofilerfiller = this.getProfiler(); -@@ -1036,8 +1044,17 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1037,8 +1045,17 @@ public class ServerLevel extends Level implements WorldGenLevel { return Registry.ENTITY_TYPE.getKey(passenger.getType()).toString(); }); gameprofilerfiller.incrementCounter("tickPassenger"); @@ -99,7 +99,7 @@ index 9993b6a8f40896166c2f86befa7222c6e714da81..ff902ae5a96616bb70897d9326fc65a3 gameprofilerfiller.pop(); Iterator iterator = passenger.getPassengers().iterator(); -@@ -1047,6 +1064,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1048,6 +1065,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(passenger, entity2); } @@ -108,7 +108,7 @@ index 9993b6a8f40896166c2f86befa7222c6e714da81..ff902ae5a96616bb70897d9326fc65a3 } else { passenger.stopRiding(); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1ac0e8996ece6bd7be521a9a45fb8c398838b94e..79026ea84a6efca425b351467651332d2d3b9fdd 100644 +index 5f613eac047703b6f1521fcd2d802e381d5f42d5..a9f1b5fe81bef3e948d128598407d23c723fc075 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -384,6 +384,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { diff --git a/patches/unapplied/server/0351-Increase-Light-Queue-Size.patch b/patches/server/0351-Increase-Light-Queue-Size.patch similarity index 89% rename from patches/unapplied/server/0351-Increase-Light-Queue-Size.patch rename to patches/server/0351-Increase-Light-Queue-Size.patch index df199500d9..e60d563086 100644 --- a/patches/unapplied/server/0351-Increase-Light-Queue-Size.patch +++ b/patches/server/0351-Increase-Light-Queue-Size.patch @@ -14,10 +14,10 @@ light engine on shutdown... The queue size only puts a cap on max loss, doesn't solve that problem. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a4bfec79fa93b45084adbf502d5900bc420300ab..51b33848d9a3af3a9b9dfe482f9f8d9150c57b82 100644 +index 8be6de893f1df78afc0e2c023e548a50ff7c2629..b04c5433a1e2cdfe69c5b5cbe77b867ebd55c126 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -778,7 +778,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> worldgenMailbox; public final ProcessorHandle> mainThreadMailbox; @@ -170,7 +170,7 @@ index 375f66bf1617e255b3465b736076a65e080eb36e..d95db45e21861eb9f1623c44dd797429 public final ChunkProgressListener progressListener; private final ChunkStatusUpdateListener chunkStatusListener; public final ChunkMap.ChunkDistanceManager distanceManager; -@@ -264,11 +270,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -261,11 +267,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.progressListener = worldGenerationProgressListener; this.chunkStatusListener = chunkStatusChangeListener; diff --git a/patches/unapplied/server/0353-Anti-Xray.patch b/patches/server/0353-Anti-Xray.patch similarity index 96% rename from patches/unapplied/server/0353-Anti-Xray.patch rename to patches/server/0353-Anti-Xray.patch index a89586783f..ed8587ea53 100644 --- a/patches/unapplied/server/0353-Anti-Xray.patch +++ b/patches/server/0353-Anti-Xray.patch @@ -1044,10 +1044,10 @@ index 7825d6f0fdcfda6212cff8033ec55fb7db236154..000853110c7a89f2d0403a7a2737025a public ClientboundLevelChunkWithLightPacket(FriendlyByteBuf buf) { diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index d95db45e21861eb9f1623c44dd797429ae158760..f15ad47696574d7668374729de44286258a36f3b 100644 +index 8ab5fd86e626958646935e460b603c875b8a841b..993a74bb16116622dc968f1f240fed1c377de5fa 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -997,7 +997,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -994,7 +994,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider completablefuture1.thenAcceptAsync((either) -> { either.ifLeft((chunk) -> { this.tickingGenerated.getAndIncrement(); @@ -1056,7 +1056,7 @@ index d95db45e21861eb9f1623c44dd797429ae158760..f15ad47696574d7668374729de442862 this.getPlayers(chunkcoordintpair, false).forEach((entityplayer) -> { this.playerLoadedChunk(entityplayer, mutableobject, chunk); -@@ -1176,7 +1176,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1173,7 +1173,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider while (objectiterator.hasNext()) { ChunkHolder playerchunk = (ChunkHolder) objectiterator.next(); ChunkPos chunkcoordintpair = playerchunk.getPos(); @@ -1065,7 +1065,7 @@ index d95db45e21861eb9f1623c44dd797429ae158760..f15ad47696574d7668374729de442862 this.getPlayers(chunkcoordintpair, false).forEach((entityplayer) -> { SectionPos sectionposition = entityplayer.getLastSectionPos(); -@@ -1190,7 +1190,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1187,7 +1187,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -1074,7 +1074,7 @@ index d95db45e21861eb9f1623c44dd797429ae158760..f15ad47696574d7668374729de442862 if (player.level == this.level) { if (newWithinViewDistance && !oldWithinViewDistance) { ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos.toLong()); -@@ -1727,12 +1727,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1724,12 +1724,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -1097,10 +1097,10 @@ index d95db45e21861eb9f1623c44dd797429ae158760..f15ad47696574d7668374729de442862 List list = Lists.newArrayList(); List list1 = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index ff902ae5a96616bb70897d9326fc65a3261b07d9..57abbcd9d59ea29e2feb238ee342f28a66122006 100644 +index 0013fdf7dd4074a9684eb4b93ea2735185c7ac1c..fb7954d4d4dbd35bf771b362f241294d79cf9933 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -402,7 +402,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -403,7 +403,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List 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 // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error @@ -1169,7 +1169,7 @@ index 4c1d34bd274d8e2a4003a286536652367da9488a..8e5e773fffcb17d20328903d1b1fc9d9 if (iblockdata1 == null) { // CraftBukkit start - remove blockstate if failed (or the same) diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java -index 0d815a39d50bb8c06f81e3386764db6a00d84985..8dd9879d52ba9bd816fcfa5413ef3bfc25d562c7 100644 +index 6cec5cda20531aadf8e2148908a70f8b573d7d82..dc164608bfb2fb18a1adf83fa10bac4028dcac0a 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java @@ -99,17 +99,19 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom @@ -1247,7 +1247,7 @@ index ae37e97e52557b48f129cc02eeea395378a48444..785fbcf9bafcdec1c5be213de3d85126 public int getSerializedSize() { diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 1152bf7f7a7784457c778b215db91b9e02066fba..c36de77b3124a519b3f324c5a187337884fe9e28 100644 +index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..34d8fbb441def2e89415729a2f39b9a32eec95c7 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -29,6 +29,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer @@ -1258,30 +1258,22 @@ index 1152bf7f7a7784457c778b215db91b9e02066fba..c36de77b3124a519b3f324c5a1873378 private volatile PalettedContainer.Data data; private final PalettedContainer.Strategy strategy; private final ThreadingDetector threadingDetector = new ThreadingDetector("PalettedContainer"); -@@ -41,14 +42,19 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -41,7 +42,13 @@ public class PalettedContainer implements PaletteResize, PalettedContainer this.threadingDetector.checkAndUnlock(); } -- public static Codec> codecRW(IdMap idMap, Codec codec, PalettedContainer.Strategy strategy, T object) { -- PalettedContainerRO.Unpacker> unpacker = PalettedContainer::unpack; +- public static Codec> codecRW(IdMap idList, Codec entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue) { + // Paper start - Anti-Xray - Add preset values -+ @Deprecated @io.papermc.paper.annotation.DoNotUse public static Codec> codecRW(IdMap idMap, Codec codec, PalettedContainer.Strategy strategy, T object) { return PalettedContainer.codecRW(idMap, codec, strategy, object, null); } -+ public static Codec> codecRW(IdMap idMap, Codec codec, PalettedContainer.Strategy strategy, T object, T @org.jetbrains.annotations.Nullable [] presetValues) { ++ @Deprecated @io.papermc.paper.annotation.DoNotUse public static Codec> codecRW(IdMap idList, Codec entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue) {return codecRW(idList, entryCodec, paletteProvider, defaultValue, null);} ++ public static Codec> codecRW(IdMap idList, Codec entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { + PalettedContainerRO.Unpacker> unpacker = (idMapx, strategyx, packedData) -> { + return unpack(idMapx, strategyx, packedData, object, presetValues); + }; + // Paper end - return codec(idMap, codec, strategy, object, unpacker); + PalettedContainerRO.Unpacker> unpacker = PalettedContainer::unpack; + return codec(idList, entryCodec, paletteProvider, defaultValue, unpacker); } - - public static Codec> codecRO(IdMap idMap, Codec codec, PalettedContainer.Strategy strategy, T object) { - PalettedContainerRO.Unpacker> unpacker = (idMapx, strategyx, packedData) -> { -- return unpack(idMapx, strategyx, packedData).map((palettedContainer) -> { -+ return unpack(idMapx, strategyx, packedData, object, null).map((palettedContainer) -> { // Paper - Anti-Xray - Add preset values - return palettedContainer; - }); - }; -@@ -65,19 +71,52 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -65,19 +72,52 @@ public class PalettedContainer implements PaletteResize, PalettedContainer }); } @@ -1337,7 +1329,7 @@ index 1152bf7f7a7784457c778b215db91b9e02066fba..c36de77b3124a519b3f324c5a1873378 this.strategy = paletteProvider; this.registry = idList; this.data = this.createOrReuseData((PalettedContainer.Data)null, 0); -@@ -92,11 +131,33 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -92,11 +132,33 @@ public class PalettedContainer implements PaletteResize, PalettedContainer @Override public int onResize(int newBits, T object) { PalettedContainer.Data data = this.data; @@ -1372,7 +1364,7 @@ index 1152bf7f7a7784457c778b215db91b9e02066fba..c36de77b3124a519b3f324c5a1873378 public T getAndSet(int x, int y, int z, T value) { this.acquire(); -@@ -166,25 +227,36 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -166,25 +228,36 @@ public class PalettedContainer implements PaletteResize, PalettedContainer data.palette.read(buf); buf.readLongArray(data.storage.getRaw()); this.data = data; @@ -1407,21 +1399,21 @@ index 1152bf7f7a7784457c778b215db91b9e02066fba..c36de77b3124a519b3f324c5a1873378 } -- private static DataResult> unpack(IdMap idMap, PalettedContainer.Strategy strategy, PalettedContainerRO.PackedData packedData) { -+ private static DataResult> unpack(IdMap idMap, PalettedContainer.Strategy strategy, PalettedContainerRO.PackedData packedData, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { // Paper - Anti-Xray - Add preset values - List list = packedData.paletteEntries(); - int i = strategy.size(); - int j = strategy.calculateBitsForSerialization(idMap, list.size()); -@@ -220,7 +292,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +- private static DataResult> unpack(IdMap idList, PalettedContainer.Strategy paletteProvider, PalettedContainerRO.PackedData serialized) { ++ private static DataResult> unpack(IdMap idList, PalettedContainer.Strategy paletteProvider, PalettedContainerRO.PackedData serialized, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { // Paper - Anti-Xray - Add preset values + List list = serialized.paletteEntries(); + int i = paletteProvider.size(); + int j = paletteProvider.calculateBitsForSerialization(idList, list.size()); +@@ -220,7 +293,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer } } -- return DataResult.success(new PalettedContainer<>(idMap, strategy, configuration, bitStorage, list)); -+ return DataResult.success(new PalettedContainer<>(idMap, strategy, configuration, bitStorage, list, defaultValue, presetValues)); // Paper - Anti-Xray - Add preset values +- return DataResult.success(new PalettedContainer<>(idList, paletteProvider, configuration, bitStorage, list)); ++ return DataResult.success(new PalettedContainer<>(idList, paletteProvider, configuration, bitStorage, list, defaultValue, presetValues)); // Paper - Anti-Xray - Add preset values } @Override -@@ -280,12 +352,12 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -280,12 +353,12 @@ public class PalettedContainer implements PaletteResize, PalettedContainer } public PalettedContainer copy() { @@ -1436,7 +1428,7 @@ index 1152bf7f7a7784457c778b215db91b9e02066fba..c36de77b3124a519b3f324c5a1873378 } @Override -@@ -329,9 +401,20 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -329,9 +402,20 @@ public class PalettedContainer implements PaletteResize, PalettedContainer return 1 + this.palette.getSerializedSize() + FriendlyByteBuf.getVarIntSize(this.storage.getSize()) + this.storage.getRaw().length * 8; } @@ -1459,12 +1451,12 @@ index 1152bf7f7a7784457c778b215db91b9e02066fba..c36de77b3124a519b3f324c5a1873378 } diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainerRO.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainerRO.java -index e1c7a5909be7b8bf1156fc62b3965f3562c729e6..e561a45c5115c3c3930999b2a10108bc4fab99af 100644 +index 9a2bf744abd8916d492e901be889223591bac3fd..a27fce0f1af9776a713bf1b5277869ed5d3e0c8e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainerRO.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainerRO.java @@ -14,7 +14,10 @@ public interface PalettedContainerRO { - void getAll(Consumer consumer); + void getAll(Consumer action); - void write(FriendlyByteBuf buf); + // Paper start - Anti-Xray - Add chunk packet info diff --git a/patches/unapplied/server/0354-Implement-alternative-item-despawn-rate.patch b/patches/server/0354-Implement-alternative-item-despawn-rate.patch similarity index 88% rename from patches/unapplied/server/0354-Implement-alternative-item-despawn-rate.patch rename to patches/server/0354-Implement-alternative-item-despawn-rate.patch index f1d44765bf..db8d53f699 100644 --- a/patches/unapplied/server/0354-Implement-alternative-item-despawn-rate.patch +++ b/patches/server/0354-Implement-alternative-item-despawn-rate.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement alternative item-despawn-rate Co-authored-by: Noah van der Aa 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 a0de239a8497c906c2329131b14587637b0fdfcf..b491186d66609046016370e56b96e2c09e7d3a32 100644 +index ebcf58fe51d1fd0cb8a0f5a84cdd349f29c9442e..7e293167e73238f42fc213ee29d89aa775cf9e60 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java @@ -54,6 +54,7 @@ public class ItemEntity extends Entity { @@ -17,7 +17,7 @@ index a0de239a8497c906c2329131b14587637b0fdfcf..b491186d66609046016370e56b96e2c0 public ItemEntity(EntityType type, Level world) { super(type, world); -@@ -184,7 +185,7 @@ public class ItemEntity extends Entity { +@@ -182,7 +183,7 @@ public class ItemEntity extends Entity { } } @@ -26,7 +26,7 @@ index a0de239a8497c906c2329131b14587637b0fdfcf..b491186d66609046016370e56b96e2c0 // CraftBukkit start - fire ItemDespawnEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { this.age = 0; -@@ -208,7 +209,7 @@ public class ItemEntity extends Entity { +@@ -206,7 +207,7 @@ public class ItemEntity extends Entity { this.lastTick = MinecraftServer.currentTick; // CraftBukkit end @@ -35,7 +35,7 @@ index a0de239a8497c906c2329131b14587637b0fdfcf..b491186d66609046016370e56b96e2c0 // CraftBukkit start - fire ItemDespawnEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { this.age = 0; -@@ -259,7 +260,7 @@ public class ItemEntity extends Entity { +@@ -257,7 +258,7 @@ public class ItemEntity extends Entity { private boolean isMergable() { ItemStack itemstack = this.getItem(); @@ -44,7 +44,7 @@ index a0de239a8497c906c2329131b14587637b0fdfcf..b491186d66609046016370e56b96e2c0 } private void tryToMerge(ItemEntity other) { -@@ -503,6 +504,7 @@ public class ItemEntity extends Entity { +@@ -501,6 +502,7 @@ public class ItemEntity extends Entity { com.google.common.base.Preconditions.checkArgument(!stack.isEmpty(), "Cannot drop air"); // CraftBukkit this.getEntityData().set(ItemEntity.DATA_ITEM, stack); this.getEntityData().markDirty(ItemEntity.DATA_ITEM); // CraftBukkit - SPIGOT-4591, must mark dirty @@ -52,7 +52,7 @@ index a0de239a8497c906c2329131b14587637b0fdfcf..b491186d66609046016370e56b96e2c0 } @Override -@@ -566,7 +568,7 @@ public class ItemEntity extends Entity { +@@ -564,7 +566,7 @@ public class ItemEntity extends Entity { public void makeFakeItem() { this.setNeverPickUp(); diff --git a/patches/unapplied/server/0355-Tracking-Range-Improvements.patch b/patches/server/0355-Tracking-Range-Improvements.patch similarity index 95% rename from patches/unapplied/server/0355-Tracking-Range-Improvements.patch rename to patches/server/0355-Tracking-Range-Improvements.patch index 84ad9dcefd..035cfe82f8 100644 --- a/patches/unapplied/server/0355-Tracking-Range-Improvements.patch +++ b/patches/server/0355-Tracking-Range-Improvements.patch @@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code Also ignores Enderdragon, defaulting it to Mojang's setting diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index f15ad47696574d7668374729de44286258a36f3b..a80d4620eadd78fcaa0786680766cee196c35f8d 100644 +index 993a74bb16116622dc968f1f240fed1c377de5fa..1a06d0f8eedc4ef1e9a860c873aeff746669bfce 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1915,6 +1915,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1912,6 +1912,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); int j = entity.getType().clientTrackingRange() * 16; diff --git a/patches/unapplied/server/0356-Fix-items-vanishing-through-end-portal.patch b/patches/server/0356-Fix-items-vanishing-through-end-portal.patch similarity index 89% rename from patches/unapplied/server/0356-Fix-items-vanishing-through-end-portal.patch rename to patches/server/0356-Fix-items-vanishing-through-end-portal.patch index e9979d4382..a972dd7ef4 100644 --- a/patches/unapplied/server/0356-Fix-items-vanishing-through-end-portal.patch +++ b/patches/server/0356-Fix-items-vanishing-through-end-portal.patch @@ -13,10 +13,10 @@ Quickly loading the exact world spawn chunk before searching the heightmap resolves the issue without having to load all spawn chunks. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 79026ea84a6efca425b351467651332d2d3b9fdd..22ea44067f742008e82114155867cecb841a67b3 100644 +index a9f1b5fe81bef3e948d128598407d23c723fc075..8576fbaedf3076e8b492c499d4176b1116e7ef56 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3112,6 +3112,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3109,6 +3109,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (flag1) { blockposition1 = ServerLevel.END_SPAWN_POINT; } else { diff --git a/patches/unapplied/server/0357-implement-optional-per-player-mob-spawns.patch b/patches/server/0357-implement-optional-per-player-mob-spawns.patch similarity index 97% rename from patches/unapplied/server/0357-implement-optional-per-player-mob-spawns.patch rename to patches/server/0357-implement-optional-per-player-mob-spawns.patch index 3f76b68451..2bc510b602 100644 --- a/patches/unapplied/server/0357-implement-optional-per-player-mob-spawns.patch +++ b/patches/server/0357-implement-optional-per-player-mob-spawns.patch @@ -252,10 +252,10 @@ index 0000000000000000000000000000000000000000..11de56afaf059b00fa5bec293516bcdc + } +} diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index a80d4620eadd78fcaa0786680766cee196c35f8d..e22a472bef6cc5b6b892379160aaea876084e8c8 100644 +index 1a06d0f8eedc4ef1e9a860c873aeff746669bfce..f20b93c6372e36016b21591d3cd63c5d7a47721e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -159,6 +159,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -156,6 +156,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private final Long2LongMap chunkSaveCooldowns; private final Queue unloadQueue; int viewDistance; @@ -263,7 +263,7 @@ index a80d4620eadd78fcaa0786680766cee196c35f8d..e22a472bef6cc5b6b892379160aaea87 // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback() public final CallbackExecutor callbackExecutor = new CallbackExecutor(); -@@ -188,16 +189,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -185,16 +186,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int chunkX = MCUtil.getChunkCoordinate(player.getX()); int chunkZ = MCUtil.getChunkCoordinate(player.getZ()); // Note: players need to be explicitly added to distance maps before they can be updated @@ -295,7 +295,7 @@ index a80d4620eadd78fcaa0786680766cee196c35f8d..e22a472bef6cc5b6b892379160aaea87 } // Paper end // Paper start -@@ -285,6 +301,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -282,6 +298,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); this.regionManagers.add(this.dataRegionManager); // Paper end @@ -303,7 +303,7 @@ index a80d4620eadd78fcaa0786680766cee196c35f8d..e22a472bef6cc5b6b892379160aaea87 } protected ChunkGenerator generator() { -@@ -306,6 +323,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -303,6 +320,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }); } @@ -377,10 +377,10 @@ index d66ec02b09bb7ae46aae8e55f00626139f074ae3..de5b80fce9757517e51f2ef55340e884 this.lastSpawnState = spawnercreature_d; diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 3ba550d0de4b88379331cf56fe114f7c7e0ea558..8421ecaec9a475163860966fea28ec66943b6f86 100644 +index 628ef18b5043504f206c6b60b7805892870e5736..75bcab623004159f36a5a976c7b6f69873a108dd 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -234,6 +234,11 @@ public class ServerPlayer extends Player { +@@ -235,6 +235,11 @@ public class ServerPlayer extends Player { public boolean queueHealthUpdatePacket = false; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; // Paper end @@ -392,7 +392,7 @@ index 3ba550d0de4b88379331cf56fe114f7c7e0ea558..8421ecaec9a475163860966fea28ec66 // CraftBukkit start public String displayName; -@@ -324,6 +329,7 @@ public class ServerPlayer extends Player { +@@ -325,6 +330,7 @@ public class ServerPlayer extends Player { this.adventure$displayName = net.kyori.adventure.text.Component.text(this.getScoreboardName()); // Paper this.bukkitPickUpLoot = true; this.maxHealthCache = this.getMaxHealth(); diff --git a/patches/unapplied/server/0358-Avoid-hopper-searches-if-there-are-no-items.patch b/patches/server/0358-Avoid-hopper-searches-if-there-are-no-items.patch similarity index 100% rename from patches/unapplied/server/0358-Avoid-hopper-searches-if-there-are-no-items.patch rename to patches/server/0358-Avoid-hopper-searches-if-there-are-no-items.patch diff --git a/patches/unapplied/server/0359-Bees-get-gravity-in-void.-Fixes-MC-167279.patch b/patches/server/0359-Bees-get-gravity-in-void.-Fixes-MC-167279.patch similarity index 100% rename from patches/unapplied/server/0359-Bees-get-gravity-in-void.-Fixes-MC-167279.patch rename to patches/server/0359-Bees-get-gravity-in-void.-Fixes-MC-167279.patch diff --git a/patches/unapplied/server/0360-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/patches/server/0360-Optimise-getChunkAt-calls-for-loaded-chunks.patch similarity index 100% rename from patches/unapplied/server/0360-Optimise-getChunkAt-calls-for-loaded-chunks.patch rename to patches/server/0360-Optimise-getChunkAt-calls-for-loaded-chunks.patch diff --git a/patches/unapplied/server/0361-Add-debug-for-sync-chunk-loads.patch b/patches/server/0361-Add-debug-for-sync-chunk-loads.patch similarity index 98% rename from patches/unapplied/server/0361-Add-debug-for-sync-chunk-loads.patch rename to patches/server/0361-Add-debug-for-sync-chunk-loads.patch index 8c29b00d34..1ea33e7ff0 100644 --- a/patches/unapplied/server/0361-Add-debug-for-sync-chunk-loads.patch +++ b/patches/server/0361-Add-debug-for-sync-chunk-loads.patch @@ -310,10 +310,10 @@ index c12c03b9e79f264ee593373f8a72ed37c0ae8514..509b2ee115584ce80717cc12a7ab548d chunkproviderserver_b.managedBlock(completablefuture::isDone); com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 57abbcd9d59ea29e2feb238ee342f28a66122006..2531592ba605b15f16d7438829de51de65d7305c 100644 +index fb7954d4d4dbd35bf771b362f241294d79cf9933..8724396e7b2bb58b22c4f3262855f9f523dd6635 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -389,6 +389,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -390,6 +390,12 @@ public class ServerLevel extends Level implements WorldGenLevel { }; public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager; // Paper end diff --git a/patches/unapplied/server/0362-Remove-garbage-Java-version-check.patch b/patches/server/0362-Remove-garbage-Java-version-check.patch similarity index 100% rename from patches/unapplied/server/0362-Remove-garbage-Java-version-check.patch rename to patches/server/0362-Remove-garbage-Java-version-check.patch diff --git a/patches/unapplied/server/0363-Add-ThrownEggHatchEvent.patch b/patches/server/0363-Add-ThrownEggHatchEvent.patch similarity index 100% rename from patches/unapplied/server/0363-Add-ThrownEggHatchEvent.patch rename to patches/server/0363-Add-ThrownEggHatchEvent.patch diff --git a/patches/unapplied/server/0364-Entity-Jump-API.patch b/patches/server/0364-Entity-Jump-API.patch similarity index 96% rename from patches/unapplied/server/0364-Entity-Jump-API.patch rename to patches/server/0364-Entity-Jump-API.patch index 477b71d8ab..13b50ec3de 100644 --- a/patches/unapplied/server/0364-Entity-Jump-API.patch +++ b/patches/server/0364-Entity-Jump-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity Jump API diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index dc885d9a20205bfa3b77e315ebe17287a6c3d4bf..34509a40933eb48ad1fc745fa4ee7709cdd15b92 100644 +index 383a892a5c34ec5e8f7d102f5a9bec11ae193c0e..878dd05e0a67a2c6bf48eab7f2d58bbfaf53d2d7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3215,8 +3215,10 @@ public abstract class LivingEntity extends Entity { +@@ -3218,8 +3218,10 @@ public abstract class LivingEntity extends Entity { } else if (this.isInLava() && (!this.onGround || d7 > d8)) { this.jumpInLiquid(FluidTags.LAVA); } else if ((this.onGround || flag && d7 <= d8) && this.noJumpDelay == 0) { diff --git a/patches/unapplied/server/0365-Add-option-to-nerf-pigmen-from-nether-portals.patch b/patches/server/0365-Add-option-to-nerf-pigmen-from-nether-portals.patch similarity index 91% rename from patches/unapplied/server/0365-Add-option-to-nerf-pigmen-from-nether-portals.patch rename to patches/server/0365-Add-option-to-nerf-pigmen-from-nether-portals.patch index 13eddf2311..e1e7b38b6d 100644 --- a/patches/unapplied/server/0365-Add-option-to-nerf-pigmen-from-nether-portals.patch +++ b/patches/server/0365-Add-option-to-nerf-pigmen-from-nether-portals.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add option to nerf pigmen from nether portals diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 22ea44067f742008e82114155867cecb841a67b3..a2bc22baf3de2fa41e093347ae36845329498290 100644 +index 8576fbaedf3076e8b492c499d4176b1116e7ef56..8bdaee1054f64fa5a0f4058ac3dc7d3626138ac4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -386,6 +386,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -16,7 +16,7 @@ index 22ea44067f742008e82114155867cecb841a67b3..a2bc22baf3de2fa41e093347ae368453 protected int numCollisions = 0; // Paper public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one @javax.annotation.Nullable -@@ -1983,6 +1984,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1978,6 +1979,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (spawnedViaMobSpawner) { nbt.putBoolean("Paper.FromMobSpawner", true); } @@ -26,7 +26,7 @@ index 22ea44067f742008e82114155867cecb841a67b3..a2bc22baf3de2fa41e093347ae368453 // Paper end return nbt; } catch (Throwable throwable) { -@@ -2122,6 +2126,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2119,6 +2123,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status diff --git a/patches/unapplied/server/0366-Make-the-GUI-graph-fancier.patch b/patches/server/0366-Make-the-GUI-graph-fancier.patch similarity index 100% rename from patches/unapplied/server/0366-Make-the-GUI-graph-fancier.patch rename to patches/server/0366-Make-the-GUI-graph-fancier.patch diff --git a/patches/unapplied/server/0367-add-hand-to-BlockMultiPlaceEvent.patch b/patches/server/0367-add-hand-to-BlockMultiPlaceEvent.patch similarity index 100% rename from patches/unapplied/server/0367-add-hand-to-BlockMultiPlaceEvent.patch rename to patches/server/0367-add-hand-to-BlockMultiPlaceEvent.patch diff --git a/patches/unapplied/server/0368-Validate-tripwire-hook-placement-before-update.patch b/patches/server/0368-Validate-tripwire-hook-placement-before-update.patch similarity index 100% rename from patches/unapplied/server/0368-Validate-tripwire-hook-placement-before-update.patch rename to patches/server/0368-Validate-tripwire-hook-placement-before-update.patch diff --git a/patches/unapplied/server/0369-Add-option-to-allow-iron-golems-to-spawn-in-air.patch b/patches/server/0369-Add-option-to-allow-iron-golems-to-spawn-in-air.patch similarity index 100% rename from patches/unapplied/server/0369-Add-option-to-allow-iron-golems-to-spawn-in-air.patch rename to patches/server/0369-Add-option-to-allow-iron-golems-to-spawn-in-air.patch diff --git a/patches/unapplied/server/0370-Configurable-chance-of-villager-zombie-infection.patch b/patches/server/0370-Configurable-chance-of-villager-zombie-infection.patch similarity index 100% rename from patches/unapplied/server/0370-Configurable-chance-of-villager-zombie-infection.patch rename to patches/server/0370-Configurable-chance-of-villager-zombie-infection.patch diff --git a/patches/unapplied/server/0371-Optimise-Chunk-getFluid.patch b/patches/server/0371-Optimise-Chunk-getFluid.patch similarity index 100% rename from patches/unapplied/server/0371-Optimise-Chunk-getFluid.patch rename to patches/server/0371-Optimise-Chunk-getFluid.patch diff --git a/patches/unapplied/server/0372-Set-spigots-verbose-world-setting-to-false-by-def.patch b/patches/server/0372-Set-spigots-verbose-world-setting-to-false-by-def.patch similarity index 100% rename from patches/unapplied/server/0372-Set-spigots-verbose-world-setting-to-false-by-def.patch rename to patches/server/0372-Set-spigots-verbose-world-setting-to-false-by-def.patch diff --git a/patches/unapplied/server/0373-Add-tick-times-API-and-mspt-command.patch b/patches/server/0373-Add-tick-times-API-and-mspt-command.patch similarity index 97% rename from patches/unapplied/server/0373-Add-tick-times-API-and-mspt-command.patch rename to patches/server/0373-Add-tick-times-API-and-mspt-command.patch index 4f37b7ad9d..812faa072a 100644 --- a/patches/unapplied/server/0373-Add-tick-times-API-and-mspt-command.patch +++ b/patches/server/0373-Add-tick-times-API-and-mspt-command.patch @@ -125,10 +125,10 @@ index 6a00f3d38da8107825ab1d405f337fd077b09f72..d31b5ed47cffc61c90c926a0cd2005b7 public static void registerCommands(final MinecraftServer server) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 51b33848d9a3af3a9b9dfe482f9f8d9150c57b82..003d49ad608815171a0d183305509ec3590aedd4 100644 +index b04c5433a1e2cdfe69c5b5cbe77b867ebd55c126..d8166025ddd229c065e8c4c3082549f1716c0384 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -235,6 +235,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop entitytypes = entity.getType(); int i = entitytypes.clientTrackingRange() * 16; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 2531592ba605b15f16d7438829de51de65d7305c..cf0976f7352919197a322fb4f7f8e20c24509db5 100644 +index 8724396e7b2bb58b22c4f3262855f9f523dd6635..e531c2ed2432b0184878cc3fcfe0bc91a551977c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2291,7 +2291,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2292,7 +2292,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public void onTrackingStart(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot @@ -38,7 +38,7 @@ index 2531592ba605b15f16d7438829de51de65d7305c..cf0976f7352919197a322fb4f7f8e20c if (entity instanceof ServerPlayer) { ServerPlayer entityplayer = (ServerPlayer) entity; -@@ -2325,6 +2325,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2326,6 +2326,7 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.valid = true; // CraftBukkit diff --git a/patches/unapplied/server/0380-Don-t-tick-dead-players.patch b/patches/server/0380-Don-t-tick-dead-players.patch similarity index 85% rename from patches/unapplied/server/0380-Don-t-tick-dead-players.patch rename to patches/server/0380-Don-t-tick-dead-players.patch index 14174b88fa..a727a4a80a 100644 --- a/patches/unapplied/server/0380-Don-t-tick-dead-players.patch +++ b/patches/server/0380-Don-t-tick-dead-players.patch @@ -7,10 +7,10 @@ Causes sync chunk loads and who knows what all else. This is safe because Spectators are skipped in unloaded chunks too in vanilla. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d777fa8dd3529faf14bf82d023e00e9a118b45e5..6469472fedd9f28a3d609714ddf7255824a7f72a 100644 +index 1c97da7c291c985bf53c88d569077edce1a2d662..2b2810ee58eea7b703cb46690752f02c49cc0376 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -651,7 +651,7 @@ public class ServerPlayer extends Player { +@@ -652,7 +652,7 @@ public class ServerPlayer extends Player { public void doTick() { try { diff --git a/patches/unapplied/server/0381-Dead-Player-s-shouldn-t-be-able-to-move.patch b/patches/server/0381-Dead-Player-s-shouldn-t-be-able-to-move.patch similarity index 84% rename from patches/unapplied/server/0381-Dead-Player-s-shouldn-t-be-able-to-move.patch rename to patches/server/0381-Dead-Player-s-shouldn-t-be-able-to-move.patch index 3f94fb7fbe..83aebd18e6 100644 --- a/patches/unapplied/server/0381-Dead-Player-s-shouldn-t-be-able-to-move.patch +++ b/patches/server/0381-Dead-Player-s-shouldn-t-be-able-to-move.patch @@ -7,10 +7,10 @@ This fixes a lot of game state issues where packets were delayed for processing due to 1.15's new queue but processed while dead. 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 6b7aea148b7a979201dd51bf842a552644fd0a63..f1a1a251256646d0d3a457f1fc8af20ae085f5ef 100644 +index d308c671ec1c4440777bccf1609ceca6670b98a8..0960e5ecc25fad3eb46a871c2749dd176b812460 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1171,7 +1171,7 @@ public abstract class Player extends LivingEntity { +@@ -1172,7 +1172,7 @@ public abstract class Player extends LivingEntity { @Override protected boolean isImmobile() { diff --git a/patches/unapplied/server/0382-Optimize-Collision-to-not-load-chunks.patch b/patches/server/0382-Optimize-Collision-to-not-load-chunks.patch similarity index 96% rename from patches/unapplied/server/0382-Optimize-Collision-to-not-load-chunks.patch rename to patches/server/0382-Optimize-Collision-to-not-load-chunks.patch index 4711964eb4..7682d105ce 100644 --- a/patches/unapplied/server/0382-Optimize-Collision-to-not-load-chunks.patch +++ b/patches/server/0382-Optimize-Collision-to-not-load-chunks.patch @@ -14,10 +14,10 @@ movement will load only the chunk the player enters anyways and avoids loading massive amounts of surrounding chunks due to large AABB lookups. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f14d4bfd5ac03eeffefcf98e1077d915fd3fa2cb..d8b34055aff358cb2c236199da1e22d84213ea1e 100644 +index be1bdcc99b3f2cc1103bce4ecdc5077bec6a1e85..f1bbfb0acbe79304b2e1c10221bc31b162e63959 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -795,6 +795,7 @@ public abstract class PlayerList { +@@ -799,6 +799,7 @@ public abstract class PlayerList { entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // CraftBukkit end @@ -26,7 +26,7 @@ index f14d4bfd5ac03eeffefcf98e1077d915fd3fa2cb..d8b34055aff358cb2c236199da1e22d8 entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a2bc22baf3de2fa41e093347ae36845329498290..6f1ff17fd75163ee7905a2e37f176813293652af 100644 +index 8bdaee1054f64fa5a0f4058ac3dc7d3626138ac4..ccfb7dfe2327cd2e187ad7909342fc137fa126db 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -236,6 +236,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { diff --git a/patches/unapplied/server/0383-Don-t-move-existing-players-to-world-spawn.patch b/patches/server/0383-Don-t-move-existing-players-to-world-spawn.patch similarity index 85% rename from patches/unapplied/server/0383-Don-t-move-existing-players-to-world-spawn.patch rename to patches/server/0383-Don-t-move-existing-players-to-world-spawn.patch index c005c89083..0d813d1921 100644 --- a/patches/unapplied/server/0383-Don-t-move-existing-players-to-world-spawn.patch +++ b/patches/server/0383-Don-t-move-existing-players-to-world-spawn.patch @@ -10,10 +10,10 @@ larger than the keep loaded range. By skipping this, we avoid potential for a large spike on server start. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 6469472fedd9f28a3d609714ddf7255824a7f72a..6546991000cb40d1299497f21717d470d4ee7efb 100644 +index 2b2810ee58eea7b703cb46690752f02c49cc0376..104d8dd2941da8153fdeb799c48f884c33e3e585 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -321,7 +321,7 @@ public class ServerPlayer extends Player { +@@ -322,7 +322,7 @@ public class ServerPlayer extends Player { this.stats = server.getPlayerList().getPlayerStats(this); this.advancements = server.getPlayerList().getPlayerAdvancements(this); this.maxUpStep = 1.0F; @@ -22,7 +22,7 @@ index 6469472fedd9f28a3d609714ddf7255824a7f72a..6546991000cb40d1299497f21717d470 this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper -@@ -539,7 +539,7 @@ public class ServerPlayer extends Player { +@@ -540,7 +540,7 @@ public class ServerPlayer extends Player { position = Vec3.atCenterOf(((ServerLevel) world).getSharedSpawnPos()); } this.level = world; @@ -32,10 +32,10 @@ index 6469472fedd9f28a3d609714ddf7255824a7f72a..6546991000cb40d1299497f21717d470 this.gameMode.setLevel((ServerLevel) world); } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d8b34055aff358cb2c236199da1e22d84213ea1e..d6b8796ed7eca4ba2af979fb5c2cbff4b92ae329 100644 +index f1bbfb0acbe79304b2e1c10221bc31b162e63959..ca89bb5bf4de85ca22b004c91f2c7501bb133c55 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -214,6 +214,8 @@ public abstract class PlayerList { +@@ -215,6 +215,8 @@ public abstract class PlayerList { worldserver1 = worldserver; } diff --git a/patches/unapplied/server/0384-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/0384-Optimize-GoalSelector-Goal.Flag-Set-operations.patch similarity index 100% rename from patches/unapplied/server/0384-Optimize-GoalSelector-Goal.Flag-Set-operations.patch rename to patches/server/0384-Optimize-GoalSelector-Goal.Flag-Set-operations.patch diff --git a/patches/unapplied/server/0385-Improved-Watchdog-Support.patch b/patches/server/0385-Improved-Watchdog-Support.patch similarity index 96% rename from patches/unapplied/server/0385-Improved-Watchdog-Support.patch rename to patches/server/0385-Improved-Watchdog-Support.patch index 60ccbe7318..480c89b906 100644 --- a/patches/unapplied/server/0385-Improved-Watchdog-Support.patch +++ b/patches/server/0385-Improved-Watchdog-Support.patch @@ -59,10 +59,10 @@ index 5a19e30a9b7e65a70f68a429b8ca741f788a303b..7b1843e16745ca8db2244e17490d2914 // Many servers tend to restart at a fixed time at xx:00 which causes an uneven distribution of requests on the // bStats backend. To circumvent this problem, we introduce some randomness into the initial and second delay. diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java -index 8cc4cb2163a93b9491550fe6d0f5d980fb216920..4dd14d73a37b32288a64fbd67ee22c435b6e6d57 100644 +index 336795dff742b7c6957fbd3476aff31d25a5e659..30a58229aa6dac5039511d0c0df5f2912ea7de9f 100644 --- a/src/main/java/net/minecraft/CrashReport.java +++ b/src/main/java/net/minecraft/CrashReport.java -@@ -228,6 +228,7 @@ public class CrashReport { +@@ -230,6 +230,7 @@ public class CrashReport { } public static CrashReport forThrowable(Throwable cause, String title) { @@ -71,10 +71,10 @@ index 8cc4cb2163a93b9491550fe6d0f5d980fb216920..4dd14d73a37b32288a64fbd67ee22c43 cause = cause.getCause(); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 003d49ad608815171a0d183305509ec3590aedd4..fe3faf1e8a102cd63c1976cf63403bbd1e8e2a90 100644 +index d8166025ddd229c065e8c4c3082549f1716c0384..e25451056b6eedde2c5ffc281918ca13967e0a67 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -282,7 +282,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; @@ -83,7 +83,7 @@ index 003d49ad608815171a0d183305509ec3590aedd4..fe3faf1e8a102cd63c1976cf63403bbd // CraftBukkit end // Spigot start public static final int TPS = 20; -@@ -293,6 +293,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new Thread(() -> { -@@ -865,6 +868,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { CompletableFuture completablefuture; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d6b8796ed7eca4ba2af979fb5c2cbff4b92ae329..3459a7b74be03de8cf29ea1f54b7d54de2838911 100644 +index ca89bb5bf4de85ca22b004c91f2c7501bb133c55..73d22c0f5f2998050de8a231677639c60f535229 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -516,7 +516,7 @@ public abstract class PlayerList { +@@ -520,7 +520,7 @@ public abstract class PlayerList { this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); diff --git a/patches/unapplied/server/0386-Optimize-Pathfinding.patch b/patches/server/0386-Optimize-Pathfinding.patch similarity index 100% rename from patches/unapplied/server/0386-Optimize-Pathfinding.patch rename to patches/server/0386-Optimize-Pathfinding.patch diff --git a/patches/unapplied/server/0387-Reduce-Either-Optional-allocation.patch b/patches/server/0387-Reduce-Either-Optional-allocation.patch similarity index 100% rename from patches/unapplied/server/0387-Reduce-Either-Optional-allocation.patch rename to patches/server/0387-Reduce-Either-Optional-allocation.patch diff --git a/patches/unapplied/server/0388-Reduce-memory-footprint-of-NBTTagCompound.patch b/patches/server/0388-Reduce-memory-footprint-of-NBTTagCompound.patch similarity index 100% rename from patches/unapplied/server/0388-Reduce-memory-footprint-of-NBTTagCompound.patch rename to patches/server/0388-Reduce-memory-footprint-of-NBTTagCompound.patch diff --git a/patches/unapplied/server/0389-Prevent-opening-inventories-when-frozen.patch b/patches/server/0389-Prevent-opening-inventories-when-frozen.patch similarity index 94% rename from patches/unapplied/server/0389-Prevent-opening-inventories-when-frozen.patch rename to patches/server/0389-Prevent-opening-inventories-when-frozen.patch index f1d4031ffc..0d1a9b5a4f 100644 --- a/patches/unapplied/server/0389-Prevent-opening-inventories-when-frozen.patch +++ b/patches/server/0389-Prevent-opening-inventories-when-frozen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent opening inventories when frozen diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 6546991000cb40d1299497f21717d470d4ee7efb..a39ee6af70cdd027dd5e7ddf7ed16393a2b08aab 100644 +index 104d8dd2941da8153fdeb799c48f884c33e3e585..0b173c66aaab86ca33eb32ac912543ebcb7c380d 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -620,7 +620,7 @@ public class ServerPlayer extends Player { +@@ -621,7 +621,7 @@ public class ServerPlayer extends Player { containerUpdateDelay = level.paperConfig().tickRates.containerUpdate; } // Paper end @@ -17,7 +17,7 @@ index 6546991000cb40d1299497f21717d470d4ee7efb..a39ee6af70cdd027dd5e7ddf7ed16393 this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper this.containerMenu = this.inventoryMenu; } -@@ -1493,7 +1493,7 @@ public class ServerPlayer extends Player { +@@ -1491,7 +1491,7 @@ public class ServerPlayer extends Player { } else { // CraftBukkit start this.containerMenu = container; diff --git a/patches/unapplied/server/0390-Optimise-ArraySetSorted-removeIf.patch b/patches/server/0390-Optimise-ArraySetSorted-removeIf.patch similarity index 100% rename from patches/unapplied/server/0390-Optimise-ArraySetSorted-removeIf.patch rename to patches/server/0390-Optimise-ArraySetSorted-removeIf.patch diff --git a/patches/unapplied/server/0391-Don-t-run-entity-collision-code-if-not-needed.patch b/patches/server/0391-Don-t-run-entity-collision-code-if-not-needed.patch similarity index 90% rename from patches/unapplied/server/0391-Don-t-run-entity-collision-code-if-not-needed.patch rename to patches/server/0391-Don-t-run-entity-collision-code-if-not-needed.patch index 692a677c55..17bc39fe8d 100644 --- a/patches/unapplied/server/0391-Don-t-run-entity-collision-code-if-not-needed.patch +++ b/patches/server/0391-Don-t-run-entity-collision-code-if-not-needed.patch @@ -7,10 +7,10 @@ Will not run if max entity craming is disabled and the max collisions per entity is less than or equal to 0 diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 34509a40933eb48ad1fc745fa4ee7709cdd15b92..f9ec497b3212a2c2d87edc4350d8479c6c20abbd 100644 +index 878dd05e0a67a2c6bf48eab7f2d58bbfaf53d2d7..b3b3b163fb1a506fb048dba173517eeeaf2f8007 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3312,10 +3312,16 @@ public abstract class LivingEntity extends Entity { +@@ -3315,10 +3315,16 @@ public abstract class LivingEntity extends Entity { protected void serverAiStep() {} protected void pushEntities() { diff --git a/patches/unapplied/server/0392-Implement-Player-Client-Options-API.patch b/patches/server/0392-Implement-Player-Client-Options-API.patch similarity index 96% rename from patches/unapplied/server/0392-Implement-Player-Client-Options-API.patch rename to patches/server/0392-Implement-Player-Client-Options-API.patch index 3a3a1b2015..b5d5a0ca99 100644 --- a/patches/unapplied/server/0392-Implement-Player-Client-Options-API.patch +++ b/patches/server/0392-Implement-Player-Client-Options-API.patch @@ -85,10 +85,10 @@ index 0000000000000000000000000000000000000000..b6f4400df3d8ec7e06a996de54f8cabb + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index a39ee6af70cdd027dd5e7ddf7ed16393a2b08aab..6550e7a3e3d0f8cf86b9f6d8d3435ed9fb597a86 100644 +index 0b173c66aaab86ca33eb32ac912543ebcb7c380d..db8400c7ca9aad9aeee192427661c76778bf9e47 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1857,6 +1857,7 @@ public class ServerPlayer extends Player { +@@ -1850,6 +1850,7 @@ public class ServerPlayer extends Player { public String locale = null; // CraftBukkit - add, lowercase // Paper - default to null public java.util.Locale adventure$locale = java.util.Locale.US; // Paper public void updateOptions(ServerboundClientInformationPacket packet) { @@ -97,7 +97,7 @@ index a39ee6af70cdd027dd5e7ddf7ed16393a2b08aab..6550e7a3e3d0f8cf86b9f6d8d3435ed9 if (getMainArm() != packet.mainHand()) { PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 226bfb38b8b1c3463e5527c831d22875cfc051ba..daea1ca1d3288b6c3b0cf2e58fe35cb5e4069698 100644 +index c8b9c55c2d927ed5f9a0597822ceef95842abe5e..14dc5a18bffc4d8a7d3e786142a3fd853aaeeac4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -574,6 +574,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/unapplied/server/0393-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch b/patches/server/0393-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch similarity index 100% rename from patches/unapplied/server/0393-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch rename to patches/server/0393-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch diff --git a/patches/unapplied/server/0394-Fix-Chunk-Post-Processing-deadlock-risk.patch b/patches/server/0394-Fix-Chunk-Post-Processing-deadlock-risk.patch similarity index 94% rename from patches/unapplied/server/0394-Fix-Chunk-Post-Processing-deadlock-risk.patch rename to patches/server/0394-Fix-Chunk-Post-Processing-deadlock-risk.patch index 70a84a37da..d0b17eef56 100644 --- a/patches/unapplied/server/0394-Fix-Chunk-Post-Processing-deadlock-risk.patch +++ b/patches/server/0394-Fix-Chunk-Post-Processing-deadlock-risk.patch @@ -25,10 +25,10 @@ This successfully fixed a reoccurring and highly reproducible crash for heightmaps. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 3afadbd25cb002966869db6e07cd26cf6d52646b..71d76ce0d873c665597a7d28f6caea5bf059e796 100644 +index 48fc5d6ca854de036013586be634b3e05e2c52bc..0fdf33bfab3191dbb582bc401f6f0b62aadacb4e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -182,6 +182,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -179,6 +179,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }; // CraftBukkit end @@ -36,7 +36,7 @@ index 3afadbd25cb002966869db6e07cd26cf6d52646b..71d76ce0d873c665597a7d28f6caea5b // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); -@@ -1026,16 +1027,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1023,16 +1024,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }); CompletableFuture> completablefuture1 = completablefuture.thenApplyAsync((either) -> { return either.mapLeft((list) -> { diff --git a/patches/unapplied/server/0395-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/patches/server/0395-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch similarity index 88% rename from patches/unapplied/server/0395-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch rename to patches/server/0395-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch index 9b49d32f90..0ac56f4dbd 100644 --- a/patches/unapplied/server/0395-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch +++ b/patches/server/0395-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch @@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick delays anymore. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 71d76ce0d873c665597a7d28f6caea5bf059e796..ee64657a838b9b661b8accc997b6d149d21bce56 100644 +index 0fdf33bfab3191dbb582bc401f6f0b62aadacb4e..5187988a22b55ac783147afe455a139662b67f7d 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1656,6 +1656,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1653,6 +1653,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider .printStackTrace(); return; } @@ -40,10 +40,10 @@ index 71d76ce0d873c665597a7d28f6caea5bf059e796..ee64657a838b9b661b8accc997b6d149 if (!(entity instanceof EnderDragonPart)) { EntityType entitytypes = entity.getType(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 6550e7a3e3d0f8cf86b9f6d8d3435ed9fb597a86..ee6281551ccf57e1785f1e36f52bdfe2cd60cff2 100644 +index db8400c7ca9aad9aeee192427661c76778bf9e47..3a40d6fe9edbd997dc9a6b8ac009c3f621ecfe51 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -253,6 +253,7 @@ public class ServerPlayer extends Player { +@@ -254,6 +254,7 @@ public class ServerPlayer extends Player { public double maxHealthCache; public boolean joining = true; public boolean sentListPacket = false; @@ -52,10 +52,10 @@ index 6550e7a3e3d0f8cf86b9f6d8d3435ed9fb597a86..ee6281551ccf57e1785f1e36f52bdfe2 public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 3459a7b74be03de8cf29ea1f54b7d54de2838911..ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837 100644 +index 73d22c0f5f2998050de8a231677639c60f535229..b33a7cf936fec6c1c4d39f6c156d3e6fefa3e795 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -280,6 +280,12 @@ public abstract class PlayerList { +@@ -281,6 +281,12 @@ public abstract class PlayerList { this.playersByUUID.put(player.getUUID(), player); // this.broadcastAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{entityplayer})); // CraftBukkit - replaced with loop below @@ -68,7 +68,7 @@ index 3459a7b74be03de8cf29ea1f54b7d54de2838911..ac0bae0f7ce766a67cf2dc2c5c35f244 // CraftBukkit start CraftPlayer bukkitPlayer = player.getBukkitEntity(); -@@ -318,6 +324,8 @@ public abstract class PlayerList { +@@ -322,6 +328,8 @@ public abstract class PlayerList { player.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, new ServerPlayer[]{entityplayer1})); } player.sentListPacket = true; @@ -77,7 +77,7 @@ index 3459a7b74be03de8cf29ea1f54b7d54de2838911..ac0bae0f7ce766a67cf2dc2c5c35f244 // CraftBukkit end player.connection.send(new ClientboundSetEntityDataPacket(player.getId(), player.getEntityData(), true)); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn -@@ -343,6 +351,11 @@ public abstract class PlayerList { +@@ -347,6 +355,11 @@ public abstract class PlayerList { playerconnection.send(new ClientboundUpdateMobEffectPacket(player.getId(), mobeffect)); } @@ -89,7 +89,7 @@ index 3459a7b74be03de8cf29ea1f54b7d54de2838911..ac0bae0f7ce766a67cf2dc2c5c35f244 if (nbttagcompound != null && nbttagcompound.contains("RootVehicle", 10)) { CompoundTag nbttagcompound1 = nbttagcompound.getCompound("RootVehicle"); // CraftBukkit start -@@ -391,6 +404,10 @@ public abstract class PlayerList { +@@ -395,6 +408,10 @@ public abstract class PlayerList { } } @@ -100,7 +100,7 @@ index 3459a7b74be03de8cf29ea1f54b7d54de2838911..ac0bae0f7ce766a67cf2dc2c5c35f244 player.initInventoryMenu(); // CraftBukkit - Moved from above, added world // Paper start - Add to collideRule team if needed -@@ -400,6 +417,7 @@ public abstract class PlayerList { +@@ -404,6 +421,7 @@ public abstract class PlayerList { scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); } // Paper end diff --git a/patches/unapplied/server/0396-Load-Chunks-for-Login-Asynchronously.patch b/patches/server/0396-Load-Chunks-for-Login-Asynchronously.patch similarity index 88% rename from patches/unapplied/server/0396-Load-Chunks-for-Login-Asynchronously.patch rename to patches/server/0396-Load-Chunks-for-Login-Asynchronously.patch index d0e288f45b..0b7a6787fd 100644 --- a/patches/unapplied/server/0396-Load-Chunks-for-Login-Asynchronously.patch +++ b/patches/server/0396-Load-Chunks-for-Login-Asynchronously.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Load Chunks for Login Asynchronously diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index ee6281551ccf57e1785f1e36f52bdfe2cd60cff2..e7210672073de654a8cf1670642a2f2035dec635 100644 +index 3a40d6fe9edbd997dc9a6b8ac009c3f621ecfe51..8dc31f65126db6b2527d4106a885cb9b6dbc7a75 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -181,6 +181,7 @@ public class ServerPlayer extends Player { +@@ -182,6 +182,7 @@ public class ServerPlayer extends Player { private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; public ServerGamePacketListenerImpl connection; @@ -16,7 +16,7 @@ index ee6281551ccf57e1785f1e36f52bdfe2cd60cff2..e7210672073de654a8cf1670642a2f20 public final MinecraftServer server; public final ServerPlayerGameMode gameMode; private final PlayerAdvancements advancements; -@@ -254,6 +255,7 @@ public class ServerPlayer extends Player { +@@ -255,6 +256,7 @@ public class ServerPlayer extends Player { public boolean joining = true; public boolean sentListPacket = false; public boolean supressTrackerForLogin = false; // Paper @@ -37,20 +37,20 @@ index be677d437d17b74c6188ce1bd5fc6fdc228fd92f..78fbb4c3e52e900956ae0811aaf934c8 public static final TicketType UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1); public static final TicketType PLUGIN = TicketType.create("plugin", (a, b) -> 0); // CraftBukkit diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7b78a7f5e4257f929fd870913e27b6090fa882ce..21126008755c79990205359226a27546f08ec044 100644 +index 97dc7785b50873ee132825bced24cdf2d8217a60..bb870abae77d8fbf107bc9596637d4fac204c501 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -238,6 +238,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser - private static final int NO_BLOCK_UPDATES_TO_ACK = -1; +@@ -251,6 +251,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + private static final int PENDING_MESSAGE_DISCONNECT_THRESHOLD = 4096; public final Connection connection; private final MinecraftServer server; + public Runnable playerJoinReady; // Paper public ServerPlayer player; private int tickCount; private int ackBlockChangesUpTo = -1; -@@ -315,6 +316,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser - // CraftBukkit end +@@ -343,6 +344,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + @Override public void tick() { + // Paper start - login async + Runnable playerJoinReady = this.playerJoinReady; @@ -64,7 +64,7 @@ index 7b78a7f5e4257f929fd870913e27b6090fa882ce..21126008755c79990205359226a27546 if (this.ackBlockChangesUpTo > -1) { this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo)); this.ackBlockChangesUpTo = -1; -@@ -361,7 +371,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -389,7 +399,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.lastVehicle = null; this.clientVehicleIsFloating = false; this.aboveGroundVehicleTickCount = 0; @@ -74,10 +74,10 @@ index 7b78a7f5e4257f929fd870913e27b6090fa882ce..21126008755c79990205359226a27546 this.server.getProfiler().push("keepAlive"); // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 8b5eddce4845619603ccfeec158d97cb86568e0d..ec2825b6d276b6200c4bec5580d012f1eaed722e 100644 +index c501e41ed7dd41a51cb87d4cf7ac62d694601156..31a506e78264f354394afc37fb7ebb3d0c7d6ebd 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -93,7 +93,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener +@@ -95,7 +95,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se } // Paper end } else if (this.state == ServerLoginPacketListenerImpl.State.DELAY_ACCEPT) { @@ -86,7 +86,7 @@ index 8b5eddce4845619603ccfeec158d97cb86568e0d..ec2825b6d276b6200c4bec5580d012f1 if (entityplayer == null) { this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT; -@@ -192,7 +192,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener +@@ -204,7 +204,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se } this.connection.send(new ClientboundGameProfilePacket(this.gameProfile)); @@ -96,10 +96,10 @@ index 8b5eddce4845619603ccfeec158d97cb86568e0d..ec2825b6d276b6200c4bec5580d012f1 try { ServerPlayer entityplayer1 = this.server.getPlayerList().getPlayerForLogin(this.gameProfile, s); // CraftBukkit - add player reference diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1480b8702 100644 +index b33a7cf936fec6c1c4d39f6c156d3e6fefa3e795..c9f0aa145b3f05b42b134654a841e88d6c39c3d1 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -138,6 +138,7 @@ public abstract class PlayerList { +@@ -139,6 +139,7 @@ public abstract class PlayerList { private final IpBanList ipBans; private final ServerOpList ops; private final UserWhiteList whitelist; @@ -107,7 +107,7 @@ index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1 // CraftBukkit start // private final Map stats; // private final Map advancements; -@@ -177,6 +178,11 @@ public abstract class PlayerList { +@@ -178,6 +179,11 @@ public abstract class PlayerList { } public void placeNewPlayer(Connection connection, ServerPlayer player) { @@ -119,7 +119,7 @@ index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1 player.loginTime = System.currentTimeMillis(); // Paper GameProfile gameprofile = player.getGameProfile(); GameProfileCache usercache = this.server.getProfileCache(); -@@ -190,7 +196,7 @@ public abstract class PlayerList { +@@ -191,7 +197,7 @@ public abstract class PlayerList { if (nbttagcompound != null && nbttagcompound.contains("bukkit")) { CompoundTag bukkit = nbttagcompound.getCompound("bukkit"); s = bukkit.contains("lastKnownName", 8) ? bukkit.getString("lastKnownName") : s; @@ -128,7 +128,7 @@ index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1 // CraftBukkit end if (nbttagcompound != null) { -@@ -217,11 +223,15 @@ public abstract class PlayerList { +@@ -218,11 +224,15 @@ public abstract class PlayerList { if (nbttagcompound == null) player.fudgeSpawnLocation(worldserver1); // Paper - only move to spawn on first login, otherwise, stay where you are.... player.setLevel(worldserver1); @@ -145,7 +145,7 @@ index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1 // Spigot start - spawn location event Player spawnPlayer = player.getBukkitEntity(); -@@ -263,6 +273,52 @@ public abstract class PlayerList { +@@ -264,6 +274,52 @@ public abstract class PlayerList { player.getRecipeBook().sendInitialRecipeBook(player); this.updateEntireScoreboard(worldserver1.getScoreboard(), player); this.server.invalidateStatus(); @@ -198,7 +198,7 @@ index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1 MutableComponent ichatmutablecomponent; if (player.getGameProfile().getName().equalsIgnoreCase(s)) { -@@ -504,6 +560,7 @@ public abstract class PlayerList { +@@ -508,6 +564,7 @@ public abstract class PlayerList { protected void save(ServerPlayer player) { if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit @@ -206,7 +206,7 @@ index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1 this.playerIo.save(player); ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit -@@ -531,7 +588,7 @@ public abstract class PlayerList { +@@ -535,7 +592,7 @@ public abstract class PlayerList { } PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); @@ -215,7 +215,7 @@ index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1 entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); if (server.isSameThread()) entityplayer.doTick(); // SPIGOT-924 // Paper - don't tick during emergency shutdowns (Watchdog) -@@ -576,6 +633,13 @@ public abstract class PlayerList { +@@ -580,6 +637,13 @@ public abstract class PlayerList { // this.advancements.remove(uuid); // CraftBukkit end } @@ -229,7 +229,7 @@ index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1 // CraftBukkit start // this.broadcastAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[]{entityplayer})); -@@ -593,7 +657,7 @@ public abstract class PlayerList { +@@ -597,7 +661,7 @@ public abstract class PlayerList { this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity()); // CraftBukkit end @@ -238,7 +238,7 @@ index ac0bae0f7ce766a67cf2dc2c5c35f244e5a08837..4b9e030016bef762c01ace5181ade7d1 } // CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer -@@ -612,6 +676,13 @@ public abstract class PlayerList { +@@ -616,6 +680,13 @@ public abstract class PlayerList { list.add(entityplayer); } } diff --git a/patches/unapplied/server/0397-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/0397-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch similarity index 89% rename from patches/unapplied/server/0397-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch rename to patches/server/0397-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch index d0e02df90c..70e92d4754 100644 --- a/patches/unapplied/server/0397-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch +++ b/patches/server/0397-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch @@ -7,10 +7,10 @@ The code following this has better support for null worlds to move them back to the world spawn. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 6f1ff17fd75163ee7905a2e37f176813293652af..c7f70ca9e4b19476b368f3c4133a36e7f310519b 100644 +index ccfb7dfe2327cd2e187ad7909342fc137fa126db..15c551347badbd0177d57c2b7d3500006eb7e0f7 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2099,9 +2099,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2096,9 +2096,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { bworld = server.getWorld(worldName); } diff --git a/patches/unapplied/server/0398-Add-PlayerAttackEntityCooldownResetEvent.patch b/patches/server/0398-Add-PlayerAttackEntityCooldownResetEvent.patch similarity index 95% rename from patches/unapplied/server/0398-Add-PlayerAttackEntityCooldownResetEvent.patch rename to patches/server/0398-Add-PlayerAttackEntityCooldownResetEvent.patch index 984cebcdfd..98d462b590 100644 --- a/patches/unapplied/server/0398-Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/patches/server/0398-Add-PlayerAttackEntityCooldownResetEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index f9ec497b3212a2c2d87edc4350d8479c6c20abbd..d6dc08d5501cc8b09cec3da107506760a99f5f81 100644 +index b3b3b163fb1a506fb048dba173517eeeaf2f8007..1eb53dd9c0ddef725e96aa7d5f6e335fb48eec9e 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -2090,7 +2090,16 @@ public abstract class LivingEntity extends Entity { diff --git a/patches/unapplied/server/0399-Don-t-fire-BlockFade-on-worldgen-threads.patch b/patches/server/0399-Don-t-fire-BlockFade-on-worldgen-threads.patch similarity index 100% rename from patches/unapplied/server/0399-Don-t-fire-BlockFade-on-worldgen-threads.patch rename to patches/server/0399-Don-t-fire-BlockFade-on-worldgen-threads.patch diff --git a/patches/unapplied/server/0400-Add-phantom-creative-and-insomniac-controls.patch b/patches/server/0400-Add-phantom-creative-and-insomniac-controls.patch similarity index 100% rename from patches/unapplied/server/0400-Add-phantom-creative-and-insomniac-controls.patch rename to patches/server/0400-Add-phantom-creative-and-insomniac-controls.patch diff --git a/patches/unapplied/server/0401-Fix-numerous-item-duplication-issues-and-teleport-is.patch b/patches/server/0401-Fix-numerous-item-duplication-issues-and-teleport-is.patch similarity index 95% rename from patches/unapplied/server/0401-Fix-numerous-item-duplication-issues-and-teleport-is.patch rename to patches/server/0401-Fix-numerous-item-duplication-issues-and-teleport-is.patch index 1b3e64ae0e..ffa011ceed 100644 --- a/patches/unapplied/server/0401-Fix-numerous-item-duplication-issues-and-teleport-is.patch +++ b/patches/server/0401-Fix-numerous-item-duplication-issues-and-teleport-is.patch @@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the same item twice because the source was destroyed. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index c7f70ca9e4b19476b368f3c4133a36e7f310519b..7d6507ef6b50e62c2d5e02483337124390f7bf59 100644 +index 15c551347badbd0177d57c2b7d3500006eb7e0f7..70978ba28cec4dd3e64bf380c0669b3bcf4a640b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2229,11 +2229,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2226,11 +2226,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } else { // CraftBukkit start - Capture drops for death event if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) { @@ -34,7 +34,7 @@ index c7f70ca9e4b19476b368f3c4133a36e7f310519b..7d6507ef6b50e62c2d5e024833371243 entityitem.setDefaultPickUpDelay(); // CraftBukkit start -@@ -2997,6 +2998,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2994,6 +2995,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @Nullable public Entity teleportTo(ServerLevel worldserver, PositionImpl location) { // CraftBukkit end @@ -47,7 +47,7 @@ index c7f70ca9e4b19476b368f3c4133a36e7f310519b..7d6507ef6b50e62c2d5e024833371243 if (this.level instanceof ServerLevel && !this.isRemoved()) { this.level.getProfiler().push("changeDimension"); // CraftBukkit start -@@ -3023,6 +3030,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3020,6 +3027,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // CraftBukkit end this.level.getProfiler().popPush("reloading"); @@ -59,7 +59,7 @@ index c7f70ca9e4b19476b368f3c4133a36e7f310519b..7d6507ef6b50e62c2d5e024833371243 Entity entity = this.getType().create(worldserver); if (entity != null) { -@@ -3036,10 +3048,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3033,10 +3045,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // CraftBukkit start - Forward the CraftEntity to the new entity this.getBukkitEntity().setHandle(entity); entity.bukkitEntity = this.getBukkitEntity(); @@ -70,7 +70,7 @@ index c7f70ca9e4b19476b368f3c4133a36e7f310519b..7d6507ef6b50e62c2d5e024833371243 // CraftBukkit end } -@@ -3160,7 +3168,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3157,7 +3165,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public boolean canChangeDimensions() { @@ -80,7 +80,7 @@ index c7f70ca9e4b19476b368f3c4133a36e7f310519b..7d6507ef6b50e62c2d5e024833371243 public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index d6dc08d5501cc8b09cec3da107506760a99f5f81..cf691b94b478dc058af706e1f2d13b51df231779 100644 +index 1eb53dd9c0ddef725e96aa7d5f6e335fb48eec9e..4a2a8566c9d68f21a98774fcecac0f4fa43d88c4 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -1643,9 +1643,9 @@ public abstract class LivingEntity extends Entity { diff --git a/patches/unapplied/server/0402-Villager-Restocks-API.patch b/patches/server/0402-Villager-Restocks-API.patch similarity index 100% rename from patches/unapplied/server/0402-Villager-Restocks-API.patch rename to patches/server/0402-Villager-Restocks-API.patch diff --git a/patches/unapplied/server/0403-Validate-PickItem-Packet-and-kick-for-invalid.patch b/patches/server/0403-Validate-PickItem-Packet-and-kick-for-invalid.patch similarity index 89% rename from patches/unapplied/server/0403-Validate-PickItem-Packet-and-kick-for-invalid.patch rename to patches/server/0403-Validate-PickItem-Packet-and-kick-for-invalid.patch index 945b68b7ae..7a5ea4882c 100644 --- a/patches/unapplied/server/0403-Validate-PickItem-Packet-and-kick-for-invalid.patch +++ b/patches/server/0403-Validate-PickItem-Packet-and-kick-for-invalid.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 21126008755c79990205359226a27546f08ec044..de7d5711885bdba0222513e0a4818a1f23306bf0 100644 +index bb870abae77d8fbf107bc9596637d4fac204c501..569a8b6889e7085e3e408ebd47a71e8b5af8ca5e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -918,7 +918,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -960,7 +960,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handlePickItem(ServerboundPickItemPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); diff --git a/patches/unapplied/server/0404-Expose-game-version.patch b/patches/server/0404-Expose-game-version.patch similarity index 100% rename from patches/unapplied/server/0404-Expose-game-version.patch rename to patches/server/0404-Expose-game-version.patch diff --git a/patches/unapplied/server/0405-Optimize-Voxel-Shape-Merging.patch b/patches/server/0405-Optimize-Voxel-Shape-Merging.patch similarity index 100% rename from patches/unapplied/server/0405-Optimize-Voxel-Shape-Merging.patch rename to patches/server/0405-Optimize-Voxel-Shape-Merging.patch diff --git a/patches/unapplied/server/0406-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch b/patches/server/0406-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch similarity index 100% rename from patches/unapplied/server/0406-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch rename to patches/server/0406-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch diff --git a/patches/unapplied/server/0407-misc-debugging-dumps.patch b/patches/server/0407-misc-debugging-dumps.patch similarity index 89% rename from patches/unapplied/server/0407-misc-debugging-dumps.patch rename to patches/server/0407-misc-debugging-dumps.patch index 7ae3dc55da..159e6cfb11 100644 --- a/patches/unapplied/server/0407-misc-debugging-dumps.patch +++ b/patches/server/0407-misc-debugging-dumps.patch @@ -29,10 +29,10 @@ index 0000000000000000000000000000000000000000..2d5494d2813b773e60ddba6790b750a9 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fe3faf1e8a102cd63c1976cf63403bbd1e8e2a90..3de332f5b08a6f7651437f8f5579632de6d3ef77 100644 +index e25451056b6eedde2c5ffc281918ca13967e0a67..af2d703fe3cb74ced502ca89c5bf6ca1f47474bb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -869,6 +869,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop set, boolean flag) { diff --git a/patches/unapplied/server/0409-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0409-Deobfuscate-stacktraces-in-log-messages-crash-report.patch similarity index 93% rename from patches/unapplied/server/0409-Deobfuscate-stacktraces-in-log-messages-crash-report.patch rename to patches/server/0409-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 981e5c6969..14331bc03f 100644 --- a/patches/unapplied/server/0409-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0409-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -478,10 +478,10 @@ index 2d5494d2813b773e60ddba6790b750a9a08f21f8..7695bf44503f161523ea612ef8a884ae } } diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java -index 4dd14d73a37b32288a64fbd67ee22c435b6e6d57..1a859fef0848cf23a672012e9764965ae1c07ec5 100644 +index 30a58229aa6dac5039511d0c0df5f2912ea7de9f..abe37c7c3c6f5ab73afd738ec78f06d7e4d2ed96 100644 --- a/src/main/java/net/minecraft/CrashReport.java +++ b/src/main/java/net/minecraft/CrashReport.java -@@ -30,6 +30,7 @@ public class CrashReport { +@@ -32,6 +32,7 @@ public class CrashReport { private final SystemReport systemReport = new SystemReport(); public CrashReport(String message, Throwable cause) { @@ -490,7 +490,7 @@ index 4dd14d73a37b32288a64fbd67ee22c435b6e6d57..1a859fef0848cf23a672012e9764965a this.exception = cause; this.systemReport.setDetail("CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit diff --git a/src/main/java/net/minecraft/CrashReportCategory.java b/src/main/java/net/minecraft/CrashReportCategory.java -index 3941e14d1c3e6e688e28904948039c8b2200de5f..a4fda4a3bae9ce600e778b44cd3ef432a8b65667 100644 +index f114d5dab86aa2cdd59c78406c9d82f9caededca..99fa9f1952ee7ed79b223ff210a658e4b119b3e4 100644 --- a/src/main/java/net/minecraft/CrashReportCategory.java +++ b/src/main/java/net/minecraft/CrashReportCategory.java @@ -104,6 +104,7 @@ public class CrashReportCategory { @@ -502,10 +502,10 @@ index 3941e14d1c3e6e688e28904948039c8b2200de5f..a4fda4a3bae9ce600e778b44cd3ef432 } } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 97166c362a5468e3f7e2fcfd5e318dc519bfbf6c..ed4587248fada36c4c206be1fa36fef42fc969e2 100644 +index a18e2146c4398b45ae50623fc6800a78718f4c81..c06cb0f0e300c4d00b3aeed12772c38e8379cb0c 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -66,13 +66,13 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -62,13 +62,13 @@ public class Connection extends SimpleChannelInboundHandler> { }); public static final AttributeKey ATTRIBUTE_PROTOCOL = AttributeKey.valueOf("protocol"); public static final LazyLoadedValue NETWORK_WORKER_GROUP = new LazyLoadedValue<>(() -> { @@ -522,21 +522,8 @@ index 97166c362a5468e3f7e2fcfd5e318dc519bfbf6c..ed4587248fada36c4c206be1fa36fef4 }); private final PacketFlow receiving; private final Queue queue = Queues.newConcurrentLinkedQueue(); -diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java -index 72932b13d71f71896f07810c8850eb45749ae2e6..5c92aa1cc1a7e7fd0b7a06ae9b21e734fab71c74 100644 ---- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java -+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java -@@ -41,7 +41,7 @@ public class ServerboundChatPacket implements Packet { - - // Spigot Start - private static final java.util.concurrent.ExecutorService executors = java.util.concurrent.Executors.newCachedThreadPool( -- new com.google.common.util.concurrent.ThreadFactoryBuilder().setDaemon( true ).setNameFormat( "Async Chat Thread - #%d" ).build() ); -+ new com.google.common.util.concurrent.ThreadFactoryBuilder().setDaemon( true ).setNameFormat( "Async Chat Thread - #%d" ).setUncaughtExceptionHandler(new net.minecraft.DefaultUncaughtExceptionHandlerWithName(net.minecraft.server.MinecraftServer.LOGGER)).build() ); // Paper - public void handle(final ServerGamePacketListener listener) { - if ( !this.message.startsWith("/") ) - { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index e585cdd8a598df2b04c265d5568f8ba868018178..a44a9b4b3c78395cdd1d859407a880cb54386d86 100644 +index 648bc209938364a387c3f81dcd073db398e9f864..e42df2956e2d852a5a4c8fdeda395a3efd32c44c 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -200,6 +200,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -548,10 +535,10 @@ index e585cdd8a598df2b04c265d5568f8ba868018178..a44a9b4b3c78395cdd1d859407a880cb paperConfigurations.initializeWorldDefaultsConfiguration(); org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -index 78808e6239070121d36b6c377202d76e8fb3fa32..72fbc58f7d003b7af3c35e5fc504010307c7086b 100644 +index a24ef433d0c9d06b86fd612978cfd6d877036791..1b38326c9a709536dc4cccf9af93aede98a1a782 100644 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -@@ -53,10 +53,10 @@ public class ServerConnectionListener { +@@ -54,10 +54,10 @@ public class ServerConnectionListener { private static final Logger LOGGER = LogUtils.getLogger(); public static final LazyLoadedValue SERVER_EVENT_GROUP = new LazyLoadedValue<>(() -> { diff --git a/patches/unapplied/server/0410-Implement-Mob-Goal-API.patch b/patches/server/0410-Implement-Mob-Goal-API.patch similarity index 100% rename from patches/unapplied/server/0410-Implement-Mob-Goal-API.patch rename to patches/server/0410-Implement-Mob-Goal-API.patch diff --git a/patches/unapplied/server/0411-Add-villager-reputation-API.patch b/patches/server/0411-Add-villager-reputation-API.patch similarity index 100% rename from patches/unapplied/server/0411-Add-villager-reputation-API.patch rename to patches/server/0411-Add-villager-reputation-API.patch diff --git a/patches/unapplied/server/0412-Option-for-maximum-exp-value-when-merging-orbs.patch b/patches/server/0412-Option-for-maximum-exp-value-when-merging-orbs.patch similarity index 100% rename from patches/unapplied/server/0412-Option-for-maximum-exp-value-when-merging-orbs.patch rename to patches/server/0412-Option-for-maximum-exp-value-when-merging-orbs.patch diff --git a/patches/unapplied/server/0413-ExperienceOrbMergeEvent.patch b/patches/server/0413-ExperienceOrbMergeEvent.patch similarity index 100% rename from patches/unapplied/server/0413-ExperienceOrbMergeEvent.patch rename to patches/server/0413-ExperienceOrbMergeEvent.patch diff --git a/patches/unapplied/server/0414-Fix-PotionEffect-ignores-icon-flag.patch b/patches/server/0414-Fix-PotionEffect-ignores-icon-flag.patch similarity index 100% rename from patches/unapplied/server/0414-Fix-PotionEffect-ignores-icon-flag.patch rename to patches/server/0414-Fix-PotionEffect-ignores-icon-flag.patch diff --git a/patches/unapplied/server/0415-Optimize-brigadier-child-sorting-performance.patch b/patches/server/0415-Optimize-brigadier-child-sorting-performance.patch similarity index 100% rename from patches/unapplied/server/0415-Optimize-brigadier-child-sorting-performance.patch rename to patches/server/0415-Optimize-brigadier-child-sorting-performance.patch diff --git a/patches/unapplied/server/0416-Potential-bed-API.patch b/patches/server/0416-Potential-bed-API.patch similarity index 100% rename from patches/unapplied/server/0416-Potential-bed-API.patch rename to patches/server/0416-Potential-bed-API.patch diff --git a/patches/unapplied/server/0417-Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/0417-Wait-for-Async-Tasks-during-shutdown.patch similarity index 94% rename from patches/unapplied/server/0417-Wait-for-Async-Tasks-during-shutdown.patch rename to patches/server/0417-Wait-for-Async-Tasks-during-shutdown.patch index 545bdda31c..dea6993d32 100644 --- a/patches/unapplied/server/0417-Wait-for-Async-Tasks-during-shutdown.patch +++ b/patches/server/0417-Wait-for-Async-Tasks-during-shutdown.patch @@ -10,10 +10,10 @@ Adds a 5 second grace period for any async tasks to finish and warns if any are still running after that delay just as reload does. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3de332f5b08a6f7651437f8f5579632de6d3ef77..1774d6011ea165a36576f283de6531eed873ee4c 100644 +index af2d703fe3cb74ced502ca89c5bf6ca1f47474bb..8e74c4b6b5186663537be304cfe462bb462e92f9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -908,6 +908,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 15) { return 15; diff --git a/src/main/java/net/minecraft/world/level/lighting/SkyLightEngine.java b/src/main/java/net/minecraft/world/level/lighting/SkyLightEngine.java -index 4252247acd5c71e46d90f454663a9737e22e2a61..d122475c1a9d340046c478087d3ff5bf1ff8932c 100644 +index 56b8f6ac53e7598da4dea2180825242222f86731..ca710a20e8b97341616463f4058b61cf4999af28 100644 --- a/src/main/java/net/minecraft/world/level/lighting/SkyLightEngine.java +++ b/src/main/java/net/minecraft/world/level/lighting/SkyLightEngine.java -@@ -14,6 +14,7 @@ import org.apache.commons.lang3.mutable.MutableInt; +@@ -15,6 +15,7 @@ import org.apache.commons.lang3.mutable.MutableInt; public final class SkyLightEngine extends LayerLightEngine { private static final Direction[] DIRECTIONS = Direction.values(); private static final Direction[] HORIZONTALS = new Direction[]{Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST}; @@ -39,7 +39,7 @@ index 4252247acd5c71e46d90f454663a9737e22e2a61..d122475c1a9d340046c478087d3ff5bf public SkyLightEngine(LightChunkGetter chunkProvider) { super(chunkProvider, LightLayer.SKY, new SkyLightSectionStorage(chunkProvider)); -@@ -25,7 +26,7 @@ public final class SkyLightEngine extends LayerLightEngine= 15) { return level; } else { diff --git a/patches/unapplied/server/0421-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0421-Reduce-allocation-of-Vec3D-by-entity-tracker.patch similarity index 95% rename from patches/unapplied/server/0421-Reduce-allocation-of-Vec3D-by-entity-tracker.patch rename to patches/server/0421-Reduce-allocation-of-Vec3D-by-entity-tracker.patch index 1de506b9e3..f15e955db3 100644 --- a/patches/unapplied/server/0421-Reduce-allocation-of-Vec3D-by-entity-tracker.patch +++ b/patches/server/0421-Reduce-allocation-of-Vec3D-by-entity-tracker.patch @@ -18,10 +18,10 @@ index 3167f5c6be39757e3cc42cbb17ab0cf13a2fe470..3768a71491ef7836b9739bdaec7a077c private static long encode(double value) { return Mth.lfloor(value * 4096.0D); diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index ee64657a838b9b661b8accc997b6d149d21bce56..d6887ac56991eee37cff7f0d978b8f5977e43c39 100644 +index 5187988a22b55ac783147afe455a139662b67f7d..9077af957d284e341ca8327cb837dc9b4bb3ffee 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1934,9 +1934,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1931,9 +1931,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void updatePlayer(ServerPlayer player) { org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot if (player != this.entity) { diff --git a/patches/unapplied/server/0422-Ensure-safe-gateway-teleport.patch b/patches/server/0422-Ensure-safe-gateway-teleport.patch similarity index 100% rename from patches/unapplied/server/0422-Ensure-safe-gateway-teleport.patch rename to patches/server/0422-Ensure-safe-gateway-teleport.patch diff --git a/patches/unapplied/server/0423-Add-option-for-console-having-all-permissions.patch b/patches/server/0423-Add-option-for-console-having-all-permissions.patch similarity index 100% rename from patches/unapplied/server/0423-Add-option-for-console-having-all-permissions.patch rename to patches/server/0423-Add-option-for-console-having-all-permissions.patch diff --git a/patches/unapplied/server/0424-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch b/patches/server/0424-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch similarity index 97% rename from patches/unapplied/server/0424-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch rename to patches/server/0424-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch index b1b132ffcf..d1757b83c1 100644 --- a/patches/unapplied/server/0424-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch +++ b/patches/server/0424-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch @@ -42,10 +42,10 @@ index 6e7d09cd48048957a14835b857ac708aafe8f664..4e8a79f2d3b6f52c6284bc9b0ce2423d // Paper start diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index d6887ac56991eee37cff7f0d978b8f5977e43c39..bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5 100644 +index 9077af957d284e341ca8327cb837dc9b4bb3ffee..6e27a89af794d411cce3c1c932c1f4910cec889c 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -185,11 +185,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -182,11 +182,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider final CallbackExecutor chunkLoadConversionCallbackExecutor = new CallbackExecutor(); // Paper // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); @@ -69,7 +69,7 @@ index d6887ac56991eee37cff7f0d978b8f5977e43c39..bc698f8aee7eb5f2dbc1affd24e9af9f // Paper start - per player mob spawning if (this.playerMobDistanceMap != null) { this.playerMobDistanceMap.add(player, chunkX, chunkZ, this.distanceManager.getSimulationDistance()); -@@ -199,6 +211,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -196,6 +208,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider void removePlayerFromDistanceMaps(ServerPlayer player) { @@ -80,7 +80,7 @@ index d6887ac56991eee37cff7f0d978b8f5977e43c39..bc698f8aee7eb5f2dbc1affd24e9af9f // Paper start - per player mob spawning if (this.playerMobDistanceMap != null) { this.playerMobDistanceMap.remove(player); -@@ -210,6 +226,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -207,6 +223,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int chunkX = MCUtil.getChunkCoordinate(player.getX()); int chunkZ = MCUtil.getChunkCoordinate(player.getZ()); // Note: players need to be explicitly added to distance maps before they can be updated @@ -88,7 +88,7 @@ index d6887ac56991eee37cff7f0d978b8f5977e43c39..bc698f8aee7eb5f2dbc1affd24e9af9f // Paper start - per player mob spawning if (this.playerMobDistanceMap != null) { this.playerMobDistanceMap.update(player, chunkX, chunkZ, this.distanceManager.getSimulationDistance()); -@@ -303,6 +320,38 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -300,6 +317,38 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.regionManagers.add(this.dataRegionManager); // Paper end this.playerMobDistanceMap = this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets) : null; // Paper @@ -127,7 +127,7 @@ index d6887ac56991eee37cff7f0d978b8f5977e43c39..bc698f8aee7eb5f2dbc1affd24e9af9f } protected ChunkGenerator generator() { -@@ -558,6 +607,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -555,6 +604,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider holder = (ChunkHolder) this.pendingUnloads.remove(pos); if (holder != null) { holder.setTicketLevel(level); @@ -135,7 +135,7 @@ index d6887ac56991eee37cff7f0d978b8f5977e43c39..bc698f8aee7eb5f2dbc1affd24e9af9f } else { holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this); // Paper start -@@ -653,6 +703,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -650,6 +700,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkHolder playerchunk = (ChunkHolder) this.updatingChunkMap.remove(j); if (playerchunk != null) { @@ -143,7 +143,7 @@ index d6887ac56991eee37cff7f0d978b8f5977e43c39..bc698f8aee7eb5f2dbc1affd24e9af9f this.pendingUnloads.put(j, playerchunk); this.modified = true; ++i; -@@ -1418,43 +1469,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1415,43 +1466,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return this.anyPlayerCloseEnoughForSpawning(pos, false); } @@ -357,10 +357,10 @@ index 42b4214a1319691e9a6cb0c5fafaeeff821f3f99..1d9a0f6effa1654609f4d0752ec69eed } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index e7210672073de654a8cf1670642a2f2035dec635..86574b86b02dc0b0814cc0d0540e82957f094025 100644 +index 8dc31f65126db6b2527d4106a885cb9b6dbc7a75..be00b0f9c15e1e7c22c2d2ebf3063639520f2030 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -261,6 +261,7 @@ public class ServerPlayer extends Player { +@@ -262,6 +262,7 @@ public class ServerPlayer extends Player { // CraftBukkit end public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper diff --git a/patches/unapplied/server/0425-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/0425-Use-distance-map-to-optimise-entity-tracker.patch similarity index 95% rename from patches/unapplied/server/0425-Use-distance-map-to-optimise-entity-tracker.patch rename to patches/server/0425-Use-distance-map-to-optimise-entity-tracker.patch index 1bf77d801c..a1f1dae611 100644 --- a/patches/unapplied/server/0425-Use-distance-map-to-optimise-entity-tracker.patch +++ b/patches/server/0425-Use-distance-map-to-optimise-entity-tracker.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Use distance map to optimise entity tracker Use the distance map to find candidate players for tracking. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9bbf920c60 100644 +index 6e27a89af794d411cce3c1c932c1f4910cec889c..6188f35e2b5300b6ff4a16e4d6e0e4a846261f8a 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -69,6 +69,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket; +@@ -66,6 +66,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket; import net.minecraft.network.protocol.game.ClientboundSetPassengersPacket; import net.minecraft.network.protocol.game.DebugPackets; import net.minecraft.server.MCUtil; @@ -17,7 +17,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b import net.minecraft.server.level.progress.ChunkProgressListener; import net.minecraft.server.network.ServerPlayerConnection; import net.minecraft.util.CsvOutput; -@@ -196,10 +197,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -193,10 +194,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap; // this map is absent from updateMaps since it's controlled at the start of the chunkproviderserver tick public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerChunkTickRangeMap; // Paper end - optimise ChunkMap#anyPlayerCloseEnoughForSpawning @@ -53,7 +53,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b // Note: players need to be explicitly added to distance maps before they can be updated this.playerChunkTickRangeMap.add(player, chunkX, chunkZ, DistanceManager.MOB_SPAWN_RANGE); // Paper - optimise ChunkMap#anyPlayerCloseEnoughForSpawning // Paper start - per player mob spawning -@@ -211,6 +237,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -208,6 +234,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider void removePlayerFromDistanceMaps(ServerPlayer player) { @@ -65,7 +65,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b // Paper start - optimise ChunkMap#anyPlayerCloseEnoughForSpawning this.playerMobSpawnMap.remove(player); this.playerChunkTickRangeMap.remove(player); -@@ -226,6 +257,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -223,6 +254,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int chunkX = MCUtil.getChunkCoordinate(player.getX()); int chunkZ = MCUtil.getChunkCoordinate(player.getZ()); // Note: players need to be explicitly added to distance maps before they can be updated @@ -80,7 +80,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b this.playerChunkTickRangeMap.update(player, chunkX, chunkZ, DistanceManager.MOB_SPAWN_RANGE); // Paper - optimise ChunkMap#anyPlayerCloseEnoughForSpawning // Paper start - per player mob spawning if (this.playerMobDistanceMap != null) { -@@ -320,6 +359,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -317,6 +356,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.regionManagers.add(this.dataRegionManager); // Paper end this.playerMobDistanceMap = this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets) : null; // Paper @@ -126,7 +126,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b // Paper start - optimise ChunkMap#anyPlayerCloseEnoughForSpawning this.playerChunkTickRangeMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, (ServerPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, -@@ -1592,17 +1670,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1589,17 +1667,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public void move(ServerPlayer player) { @@ -145,7 +145,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b int i = SectionPos.blockToSectionCoord(player.getBlockX()); int j = SectionPos.blockToSectionCoord(player.getBlockZ()); -@@ -1729,7 +1797,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1726,7 +1794,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker this.entityMap.put(entity.getId(), playerchunkmap_entitytracker); @@ -154,7 +154,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b if (entity instanceof ServerPlayer) { ServerPlayer entityplayer = (ServerPlayer) entity; -@@ -1773,7 +1841,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1770,7 +1838,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider entity.tracker = null; // Paper - We're no longer tracked } @@ -192,7 +192,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b List list = Lists.newArrayList(); List list1 = this.level.players(); ObjectIterator objectiterator = this.entityMap.values().iterator(); -@@ -1849,23 +1947,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1846,23 +1944,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider DebugPackets.sendPoiPacketsForChunk(this.level, chunk.getPos()); List list = Lists.newArrayList(); List list1 = Lists.newArrayList(); @@ -236,7 +236,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b Iterator iterator; Entity entity1; -@@ -1941,6 +2047,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1938,6 +2044,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.lastSectionPos = SectionPos.of((EntityAccess) entity); } @@ -280,7 +280,7 @@ index bc698f8aee7eb5f2dbc1affd24e9af9f7c1ad2d5..86cdc8951544c16f8dc5148bc2c7bf9b return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false; } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7d6507ef6b50e62c2d5e02483337124390f7bf59..175f5400225584f1fedc940d967a3d6f8ede84c0 100644 +index 70978ba28cec4dd3e64bf380c0669b3bcf4a640b..0f85956d4d1c98225ff7cff7abad217a124f0dfc 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -57,6 +57,7 @@ import net.minecraft.network.syncher.EntityDataSerializers; diff --git a/patches/unapplied/server/0426-Optimize-ServerLevels-chunk-level-checking-methods.patch b/patches/server/0426-Optimize-ServerLevels-chunk-level-checking-methods.patch similarity index 95% rename from patches/unapplied/server/0426-Optimize-ServerLevels-chunk-level-checking-methods.patch rename to patches/server/0426-Optimize-ServerLevels-chunk-level-checking-methods.patch index 7c253c9113..97a753c00b 100644 --- a/patches/unapplied/server/0426-Optimize-ServerLevels-chunk-level-checking-methods.patch +++ b/patches/server/0426-Optimize-ServerLevels-chunk-level-checking-methods.patch @@ -8,10 +8,10 @@ so inline where possible, and avoid the abstraction of the Either class. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index cf0976f7352919197a322fb4f7f8e20c24509db5..443044aa09b80bdbbcd202b53d265c635b50015f 100644 +index e531c2ed2432b0184878cc3fcfe0bc91a551977c..c3db29bc1b24a976617068a4ddae062857d61097 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2250,19 +2250,22 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2251,19 +2251,22 @@ public class ServerLevel extends Level implements WorldGenLevel { } private boolean isPositionTickingWithEntitiesLoaded(long chunkPos) { diff --git a/patches/unapplied/server/0427-Delay-Chunk-Unloads-based-on-Player-Movement.patch b/patches/server/0427-Delay-Chunk-Unloads-based-on-Player-Movement.patch similarity index 100% rename from patches/unapplied/server/0427-Delay-Chunk-Unloads-based-on-Player-Movement.patch rename to patches/server/0427-Delay-Chunk-Unloads-based-on-Player-Movement.patch diff --git a/patches/unapplied/server/0428-Fix-villager-trading-demand-MC-163962.patch b/patches/server/0428-Fix-villager-trading-demand-MC-163962.patch similarity index 100% rename from patches/unapplied/server/0428-Fix-villager-trading-demand-MC-163962.patch rename to patches/server/0428-Fix-villager-trading-demand-MC-163962.patch diff --git a/patches/unapplied/server/0429-Maps-shouldn-t-load-chunks.patch b/patches/server/0429-Maps-shouldn-t-load-chunks.patch similarity index 100% rename from patches/unapplied/server/0429-Maps-shouldn-t-load-chunks.patch rename to patches/server/0429-Maps-shouldn-t-load-chunks.patch diff --git a/patches/unapplied/server/0430-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch b/patches/server/0430-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch similarity index 100% rename from patches/unapplied/server/0430-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch rename to patches/server/0430-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch diff --git a/patches/unapplied/server/0431-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch b/patches/server/0431-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch similarity index 100% rename from patches/unapplied/server/0431-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch rename to patches/server/0431-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch diff --git a/patches/unapplied/server/0432-Fix-piston-physics-inconsistency-MC-188840.patch b/patches/server/0432-Fix-piston-physics-inconsistency-MC-188840.patch similarity index 100% rename from patches/unapplied/server/0432-Fix-piston-physics-inconsistency-MC-188840.patch rename to patches/server/0432-Fix-piston-physics-inconsistency-MC-188840.patch diff --git a/patches/unapplied/server/0433-Fix-sand-duping.patch b/patches/server/0433-Fix-sand-duping.patch similarity index 100% rename from patches/unapplied/server/0433-Fix-sand-duping.patch rename to patches/server/0433-Fix-sand-duping.patch diff --git a/patches/unapplied/server/0434-Fix-missing-chunks-due-to-integer-overflow.patch b/patches/server/0434-Fix-missing-chunks-due-to-integer-overflow.patch similarity index 75% rename from patches/unapplied/server/0434-Fix-missing-chunks-due-to-integer-overflow.patch rename to patches/server/0434-Fix-missing-chunks-due-to-integer-overflow.patch index 8b62d6533b..94b8d07c3a 100644 --- a/patches/unapplied/server/0434-Fix-missing-chunks-due-to-integer-overflow.patch +++ b/patches/server/0434-Fix-missing-chunks-due-to-integer-overflow.patch @@ -15,15 +15,15 @@ allows the distance calculation to avoid overflow and work as intended. This issue is being tracked in Mojira ticket MC-159283 diff --git a/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java b/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java -index 8a5826d80f9275de1a2a6a2e23369dd1920f560f..6825feea42667a0f14c4c730e5f1ac970c654c56 100644 +index 30b6c5839b0da1aea792b7e092f0fcf5e83835db..683474cd96d3a0cdfb3b22d0111c8d3231f01d92 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java +++ b/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java @@ -501,7 +501,7 @@ public final class DensityFunctions { - int l = j / 2; - int m = i % 2; - int n = j % 2; -- float f = 100.0F - Mth.sqrt((float)(i * i + j * j)) * 8.0F; -+ float f = 100.0F - Mth.sqrt((long) i * (long) i + (long) j * (long) j) * 8.0F; // Paper - cast ints to long to avoid integer overflow + int j = z / 2; + int k = x % 2; + int l = z % 2; +- float f = 100.0F - Mth.sqrt((float)(x * x + z * z)) * 8.0F; ++ float f = 100.0F - Mth.sqrt((long) x * (long) x + (long) z * (long) z) * 8.0F; // Paper - cast ints to long to avoid integer overflow f = Mth.clamp(f, -100.0F, 80.0F); - for(int o = -12; o <= 12; ++o) { + for(int m = -12; m <= 12; ++m) { diff --git a/patches/unapplied/server/0435-Prevent-position-desync-in-playerconnection-causing-.patch b/patches/server/0435-Prevent-position-desync-in-playerconnection-causing-.patch similarity index 89% rename from patches/unapplied/server/0435-Prevent-position-desync-in-playerconnection-causing-.patch rename to patches/server/0435-Prevent-position-desync-in-playerconnection-causing-.patch index cbf8b7bff9..203472da06 100644 --- a/patches/unapplied/server/0435-Prevent-position-desync-in-playerconnection-causing-.patch +++ b/patches/server/0435-Prevent-position-desync-in-playerconnection-causing-.patch @@ -14,10 +14,10 @@ behaviour, we need to move all of this dangerous logic outside of the move call and into an appropriate place in the tick method. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ea83ac86eb392652c55c5a4a774481d631b76dd1..c03867ed9a66a408900cadf81b09704e415dfca6 100644 +index 408c2071ea8f99721bc13cf4da27a17e64bc9e8a..a0f492b0c7783fc8c5ce2e1a60707ae2db74ab9f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1373,6 +1373,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1439,6 +1439,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9)); this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move diff --git a/patches/unapplied/server/0436-Inventory-getHolder-method-without-block-snapshot.patch b/patches/server/0436-Inventory-getHolder-method-without-block-snapshot.patch similarity index 100% rename from patches/unapplied/server/0436-Inventory-getHolder-method-without-block-snapshot.patch rename to patches/server/0436-Inventory-getHolder-method-without-block-snapshot.patch diff --git a/patches/unapplied/server/0437-Improve-Arrow-API.patch b/patches/server/0437-Improve-Arrow-API.patch similarity index 100% rename from patches/unapplied/server/0437-Improve-Arrow-API.patch rename to patches/server/0437-Improve-Arrow-API.patch