diff --git a/feature-patches/0001-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch b/paper-server/patches/features/0001-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch similarity index 96% rename from feature-patches/0001-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch rename to paper-server/patches/features/0001-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch index 51f8cb9c22eb..4f1d53e0e3d9 100644 --- a/feature-patches/0001-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch +++ b/paper-server/patches/features/0001-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch @@ -29,10 +29,10 @@ index 03e2178430849d26c9826517e34ad069c94fc00a..11555ce7159ca6c8ddfe9691f86d3720 this.x = x; this.y = y; diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index da264246f9d1909980c281248e64a522806b36f4..d3a22634c5e76cde78011aa6d40f67370763f83e 100644 +index e0239091729f6be138c037951fd5c138497ee358..691fee2e2097244126f4fac0f5d00bf6916b9766 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -351,7 +351,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -350,7 +350,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Paper end public boolean isInWorldBounds(BlockPos pos) { diff --git a/feature-patches/1039-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/paper-server/patches/features/0002-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch similarity index 96% rename from feature-patches/1039-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch rename to paper-server/patches/features/0002-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index 8cd9865ac489..a98c97715f24 100644 --- a/feature-patches/1039-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/paper-server/patches/features/0002-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -1,3 +1,5 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar Date: Fri, 29 Apr 2016 20:02:00 -0400 Subject: [PATCH] Improve Maps (in item frames) performance and bug fixes @@ -11,10 +13,10 @@ custom renderers are in use, defaulting to the much simpler Vanilla system. Additionally, numerous issues to player position tracking on maps has been fixed. diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 91a1330d7308c9faadaf773d056493e1df5dcd1e..1d7e9492a474c99dff372d6b57f1f195e42d5114 100644 +index 678b3027e8c53e6021ea49afa69cdbe5f60dcf25..cce78d73e8adafd66d0f3ffb3fabb5e6c025c7df 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -2296,7 +2296,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -2282,7 +2282,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } map.carriedByPlayers.remove(player); diff --git a/feature-patches/1040-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/paper-server/patches/features/0003-Optimize-Network-Manager-and-add-advanced-packet-sup.patch similarity index 100% rename from feature-patches/1040-Optimize-Network-Manager-and-add-advanced-packet-sup.patch rename to paper-server/patches/features/0003-Optimize-Network-Manager-and-add-advanced-packet-sup.patch diff --git a/feature-patches/1041-Allow-Saving-of-Oversized-Chunks.patch b/paper-server/patches/features/0004-Allow-Saving-of-Oversized-Chunks.patch similarity index 100% rename from feature-patches/1041-Allow-Saving-of-Oversized-Chunks.patch rename to paper-server/patches/features/0004-Allow-Saving-of-Oversized-Chunks.patch diff --git a/feature-patches/1043-Entity-Activation-Range-2.0.patch b/paper-server/patches/features/0005-Entity-Activation-Range-2.0.patch similarity index 99% rename from feature-patches/1043-Entity-Activation-Range-2.0.patch rename to paper-server/patches/features/0005-Entity-Activation-Range-2.0.patch index 3767bb01b0b7..322c566db998 100644 --- a/feature-patches/1043-Entity-Activation-Range-2.0.patch +++ b/paper-server/patches/features/0005-Entity-Activation-Range-2.0.patch @@ -366,7 +366,7 @@ index 9bbcafa8e70f95d5ab6318211a0265acbfc76b1c..f8f145cd9614f7e38d6aa72501fe3183 import org.slf4j.Logger; diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 678b3027e8c53e6021ea49afa69cdbe5f60dcf25..c2d9f1e6c68f4945e3b9e5b95326e8180fa7a0fb 100644 +index cce78d73e8adafd66d0f3ffb3fabb5e6c025c7df..a4b523ac1926895ccc87464892fa81753ae8f73c 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java @@ -551,6 +551,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -824,7 +824,7 @@ index c553cf0592dfa606dbbb1e6854d3377b9feb5efb..dec705ec57e4f63ef2ccaa87c5400c11 + } diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index e0239091729f6be138c037951fd5c138497ee358..051a86e8a723aeb86ffa06e3cd5fab102a808cde 100644 +index 691fee2e2097244126f4fac0f5d00bf6916b9766..25fb8a91bd3012da383711d58cc25cbada510f56 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -153,6 +153,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/feature-patches/1044-Anti-Xray.patch b/paper-server/patches/features/0006-Anti-Xray.patch similarity index 99% rename from feature-patches/1044-Anti-Xray.patch rename to paper-server/patches/features/0006-Anti-Xray.patch index 6b16ff833eef..30ae5f9c6df1 100644 --- a/feature-patches/1044-Anti-Xray.patch +++ b/paper-server/patches/features/0006-Anti-Xray.patch @@ -157,7 +157,7 @@ index aadf2dccb996e422cacf8bb510cc642e69ee4972..d2d21fe8d7275b01454e09be252d7dd7 private ClientboundLevelChunkWithLightPacket(RegistryFriendlyByteBuf buffer) { diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index c2d9f1e6c68f4945e3b9e5b95326e8180fa7a0fb..bb43dff0d55af335ed54f3a8843633b20b7ee63b 100644 +index a4b523ac1926895ccc87464892fa81753ae8f73c..ca9427a7eae9a66f4f1ccedda7b1def7ac2a88da 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java @@ -348,7 +348,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -222,7 +222,7 @@ index 2580b249d9a024400e295ca5beab551b3571ceb3..d227714de0fe13544779fae6cf0e9ff6 } // Paper end - Send empty chunk diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 051a86e8a723aeb86ffa06e3cd5fab102a808cde..2c2eae0c8656055940c6e1457fc77a20bb58dd8e 100644 +index 25fb8a91bd3012da383711d58cc25cbada510f56..872c3b8826f436b15f6ab0a3619692c5202eadc3 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -168,6 +168,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -260,7 +260,7 @@ index 051a86e8a723aeb86ffa06e3cd5fab102a808cde..2c2eae0c8656055940c6e1457fc77a20 if (blockState == null) { // CraftBukkit start - remove blockstate if failed (or the same) diff --git a/net/minecraft/world/level/chunk/ChunkAccess.java b/net/minecraft/world/level/chunk/ChunkAccess.java -index f68f3f5e8ef39a0dc371e75110227a39791c04c8..254ca42e08148915b96ce77310a46e09de84ef53 100644 +index 12d9b532e466ec4e46920d409b5f1b3ae60b80f8..bc688ad1097ef4159dfc5f96d963a9fa63262e20 100644 --- a/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/net/minecraft/world/level/chunk/ChunkAccess.java @@ -114,14 +114,14 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh diff --git a/feature-patches/1045-Use-Velocity-compression-and-cipher-natives.patch b/paper-server/patches/features/0007-Use-Velocity-compression-and-cipher-natives.patch similarity index 100% rename from feature-patches/1045-Use-Velocity-compression-and-cipher-natives.patch rename to paper-server/patches/features/0007-Use-Velocity-compression-and-cipher-natives.patch diff --git a/feature-patches/1046-Optimize-Collision-to-not-load-chunks.patch b/paper-server/patches/features/0008-Optimize-Collision-to-not-load-chunks.patch similarity index 98% rename from feature-patches/1046-Optimize-Collision-to-not-load-chunks.patch rename to paper-server/patches/features/0008-Optimize-Collision-to-not-load-chunks.patch index 201ac3ffeb51..940badfeb991 100644 --- a/feature-patches/1046-Optimize-Collision-to-not-load-chunks.patch +++ b/paper-server/patches/features/0008-Optimize-Collision-to-not-load-chunks.patch @@ -13,9 +13,8 @@ If that serting is not enabled, collisions will be ignored for players, since 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/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index f70e77dcce4d94b06efd27273194ce95f4b336ec..0aed1e455dec32c3d53d8fb2f1047e1bf177f171 100644 +index 2e5f1dc15ea6a20f8cbdef97ecbf00e5d56603cf..5a67aa9f1fe103e5622ed6fa93bc4bc25ddbb688 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -218,6 +218,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/feature-patches/1047-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/paper-server/patches/features/0009-Optimize-GoalSelector-Goal.Flag-Set-operations.patch similarity index 95% rename from feature-patches/1047-Optimize-GoalSelector-Goal.Flag-Set-operations.patch rename to paper-server/patches/features/0009-Optimize-GoalSelector-Goal.Flag-Set-operations.patch index a550caaf22a5..74942c0f7e99 100644 --- a/feature-patches/1047-Optimize-GoalSelector-Goal.Flag-Set-operations.patch +++ b/paper-server/patches/features/0009-Optimize-GoalSelector-Goal.Flag-Set-operations.patch @@ -69,21 +69,20 @@ index e99836c4073d8b25eddd3b4c784dbdb1f0c4f2b1..a2d788a656b2a5767c8a00bbcaca16ef // Paper end - Mob Goal API diff --git a/net/minecraft/world/entity/ai/goal/GoalSelector.java b/net/minecraft/world/entity/ai/goal/GoalSelector.java -index 9338e63cc28413f5559bb0122ef5e04a84bd51d1..88e7e245824b670652878e03a2142a13e97508fe 100644 +index eeba224bd575451ba6023df65ef9d9b97f7f1c71..0846ad1f26ee73d72c77b53579a00c321d696b73 100644 --- a/net/minecraft/world/entity/ai/goal/GoalSelector.java +++ b/net/minecraft/world/entity/ai/goal/GoalSelector.java -@@ -24,7 +24,9 @@ public class GoalSelector { +@@ -24,7 +24,8 @@ public class GoalSelector { }; private final Map lockedFlags = new EnumMap<>(Goal.Flag.class); private final Set availableGoals = new ObjectLinkedOpenHashSet<>(); - private final EnumSet disabledFlags = EnumSet.noneOf(Goal.Flag.class); + private static final Goal.Flag[] GOAL_FLAG_VALUES = Goal.Flag.values(); // Paper - remove streams from pathfindergoalselector + private final ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet goalTypes = new ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector -+ + private int curRate; // Paper - EAR 2 public void addGoal(int priority, Goal goal) { - this.availableGoals.add(new WrappedGoal(priority, goal)); -@@ -45,18 +47,18 @@ public class GoalSelector { +@@ -62,18 +63,18 @@ public class GoalSelector { this.availableGoals.removeIf(wrappedGoal1 -> wrappedGoal1.getGoal() == goal); } @@ -111,7 +110,7 @@ index 9338e63cc28413f5559bb0122ef5e04a84bd51d1..88e7e245824b670652878e03a2142a13 if (!flag.getOrDefault(flag1, NO_GOAL).canBeReplacedBy(goal)) { return false; } -@@ -70,7 +72,7 @@ public class GoalSelector { +@@ -87,7 +88,7 @@ public class GoalSelector { profilerFiller.push("goalCleanup"); for (WrappedGoal wrappedGoal : this.availableGoals) { @@ -120,7 +119,7 @@ index 9338e63cc28413f5559bb0122ef5e04a84bd51d1..88e7e245824b670652878e03a2142a13 wrappedGoal.stop(); } } -@@ -80,11 +82,14 @@ public class GoalSelector { +@@ -97,11 +98,14 @@ public class GoalSelector { profilerFiller.push("goalUpdate"); for (WrappedGoal wrappedGoalx : this.availableGoals) { @@ -140,7 +139,7 @@ index 9338e63cc28413f5559bb0122ef5e04a84bd51d1..88e7e245824b670652878e03a2142a13 WrappedGoal wrappedGoal1 = this.lockedFlags.getOrDefault(flag, NO_GOAL); wrappedGoal1.stop(); this.lockedFlags.put(flag, wrappedGoalx); -@@ -116,11 +121,11 @@ public class GoalSelector { +@@ -133,11 +137,11 @@ public class GoalSelector { } public void disableControlFlag(Goal.Flag flag) { diff --git a/feature-patches/1049-Optimize-Voxel-Shape-Merging.patch b/paper-server/patches/features/0010-Optimize-Voxel-Shape-Merging.patch similarity index 100% rename from feature-patches/1049-Optimize-Voxel-Shape-Merging.patch rename to paper-server/patches/features/0010-Optimize-Voxel-Shape-Merging.patch diff --git a/feature-patches/1053-Fix-entity-type-tags-suggestions-in-selectors.patch b/paper-server/patches/features/0011-Fix-entity-type-tags-suggestions-in-selectors.patch similarity index 100% rename from feature-patches/1053-Fix-entity-type-tags-suggestions-in-selectors.patch rename to paper-server/patches/features/0011-Fix-entity-type-tags-suggestions-in-selectors.patch diff --git a/feature-patches/1054-Handle-Oversized-block-entities-in-chunks.patch b/paper-server/patches/features/0012-Handle-Oversized-block-entities-in-chunks.patch similarity index 85% rename from feature-patches/1054-Handle-Oversized-block-entities-in-chunks.patch rename to paper-server/patches/features/0012-Handle-Oversized-block-entities-in-chunks.patch index 127068aa94fa..3d61143e0e62 100644 --- a/feature-patches/1054-Handle-Oversized-block-entities-in-chunks.patch +++ b/paper-server/patches/features/0012-Handle-Oversized-block-entities-in-chunks.patch @@ -9,7 +9,7 @@ creating too large of a packet to sed. Co-authored-by: Spottedleaf diff --git a/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java -index 5d1943d37dfad0c12e77179f0866851532d983e9..0a7e6c639d5125a135a43476bbb2ef2d682f743c 100644 +index 3aea76690bc3e35758d3bf274777130af17d8a0f..9e321ef1c3d5803519b243685f4ee598dc0cf640 100644 --- a/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java +++ b/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java @@ -27,6 +27,14 @@ public class ClientboundLevelChunkPacketData { @@ -25,11 +25,11 @@ index 5d1943d37dfad0c12e77179f0866851532d983e9..0a7e6c639d5125a135a43476bbb2ef2d + } + // Paper end - Handle oversized block entities in chunks - public ClientboundLevelChunkPacketData(LevelChunk levelChunk) { - this.heightmaps = new CompoundTag(); -@@ -40,8 +48,18 @@ public class ClientboundLevelChunkPacketData { - this.buffer = new byte[calculateChunkSize(levelChunk)]; - extractChunkData(new FriendlyByteBuf(this.getWriteBuffer()), levelChunk); + // Paper start - Anti-Xray - Add chunk packet info + @Deprecated @io.papermc.paper.annotation.DoNotUse +@@ -50,8 +58,18 @@ public class ClientboundLevelChunkPacketData { + } + extractChunkData(new FriendlyByteBuf(this.getWriteBuffer()), levelChunk, chunkPacketInfo); this.blockEntitiesData = Lists.newArrayList(); + int totalTileEntities = 0; // Paper - Handle oversized block entities in chunks @@ -47,10 +47,10 @@ index 5d1943d37dfad0c12e77179f0866851532d983e9..0a7e6c639d5125a135a43476bbb2ef2d } } diff --git a/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java b/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java -index aadf2dccb996e422cacf8bb510cc642e69ee4972..5288de783481b7e932017c679b9eaa715b8826c6 100644 +index d2d21fe8d7275b01454e09be252d7dd7710cdc2d..5eef540242413df3ed136aa8837866a94cc285b3 100644 --- a/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java +++ b/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java -@@ -66,4 +66,11 @@ public class ClientboundLevelChunkWithLightPacket implements Packet Collector, ?, Map> toMap() { return Collectors.toMap(Entry::getKey, Entry::getValue); diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 88f8d462728231627c3ee7557518a2e04b4fd199..e118fd567427064c6ad6637f874ed146e67b2ee8 100644 +index 9de400977ec33e485e87cdf1cf145588527e1e10..c83aeaf4e50dd7290c608dfe260a3bd2404b6004 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -1392,7 +1392,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1385,7 +1385,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.hurtCurrentlyUsedShield(amount); f1 = amount; amount = 0.0F; @@ -29,7 +29,7 @@ index 88f8d462728231627c3ee7557518a2e04b4fd199..e118fd567427064c6ad6637f874ed146 this.blockUsingShield(livingEntity); } -@@ -1477,6 +1477,14 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1470,6 +1470,14 @@ public abstract class LivingEntity extends Entity implements Attackable { d = damageSource.getSourcePosition().x() - this.getX(); d1 = damageSource.getSourcePosition().z() - this.getZ(); } @@ -44,7 +44,7 @@ index 88f8d462728231627c3ee7557518a2e04b4fd199..e118fd567427064c6ad6637f874ed146 this.knockback(0.4F, d, d1, damageSource.getDirectEntity(), damageSource.getDirectEntity() == null ? io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.DAMAGE : io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.ENTITY_ATTACK); // CraftBukkit // Paper - knockback events if (!flag) { -@@ -2352,7 +2360,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2345,7 +2353,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING)); Entity entity = damageSource.getDirectEntity(); diff --git a/feature-patches/1056-optimize-dirt-and-snow-spreading.patch b/paper-server/patches/features/0014-optimize-dirt-and-snow-spreading.patch similarity index 100% rename from feature-patches/1056-optimize-dirt-and-snow-spreading.patch rename to paper-server/patches/features/0014-optimize-dirt-and-snow-spreading.patch diff --git a/feature-patches/1057-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/paper-server/patches/features/0015-Optimise-getChunkAt-calls-for-loaded-chunks.patch similarity index 96% rename from feature-patches/1057-Optimise-getChunkAt-calls-for-loaded-chunks.patch rename to paper-server/patches/features/0015-Optimise-getChunkAt-calls-for-loaded-chunks.patch index bb441c574216..5d23cbf3470c 100644 --- a/feature-patches/1057-Optimise-getChunkAt-calls-for-loaded-chunks.patch +++ b/paper-server/patches/features/0015-Optimise-getChunkAt-calls-for-loaded-chunks.patch @@ -7,7 +7,7 @@ bypass the need to get a player chunk, then get the either, then unwrap it... diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java -index d310e7489fc4ecede8deef59241444769d87b0a1..f268808cb250e374f2d5652b20eece011e87dcfb 100644 +index d310e7489fc4ecede8deef59241444769d87b0a1..796b5f8541b0cf84482ab2b5a60adde544d43593 100644 --- a/net/minecraft/server/level/ServerChunkCache.java +++ b/net/minecraft/server/level/ServerChunkCache.java @@ -218,6 +218,12 @@ public class ServerChunkCache extends ChunkSource {