From 66719a05d37b6ffa841a278c0614b11b119fb582 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Wed, 6 Dec 2023 10:17:00 -0500 Subject: [PATCH] Patches!!! --- .../Add-API-for-item-entity-health.patch | 0 .../Add-PlayerItemFrameChangeEvent.patch | 0 .../server/Add-more-Campfire-API.patch | 0 .../server/Add-packet-limiter-config.patch | 0 .../Add-root-admin-user-detection.patch | 0 ...llow-delegation-to-vanilla-chunk-gen.patch | 0 ...ways-allow-item-changing-in-Fireball.patch | 0 ...culate-regionfile-header-if-it-is-co.patch | 0 ...irement-before-suggesting-root-nodes.patch | 0 .../server/Collision-optimisations.patch | 6 +-- .../server/Configurable-feature-seeds.patch | 0 ...l-more-information-in-watchdog-dumps.patch | 8 +-- .../Distance-manager-tick-timings.patch | 2 +- .../Do-not-run-raytrace-logic-for-AIR.patch | 0 ...n-t-log-debug-logging-being-disabled.patch | 0 ...-ServerboundCommandSuggestionPacket-.patch | 0 .../server/Ensure-valid-vehicle-status.patch | 0 .../server/Entity-powdered-snow-API.patch | 0 .../server/Execute-chunk-tasks-mid-tick.patch | 49 +++++++++---------- ...Fix-Bukkit-NamespacedKey-shenanigans.patch | 0 ...t-isSectionEmpty-int-and-optimize-Pa.patch | 0 ...or-causing-a-crash-when-trying-to-ge.patch | 0 .../Fix-CraftCriteria-defaults-map.patch | 0 .../server/Fix-Spigot-growth-modifiers.patch | 16 +++--- ...y-type-tags-suggestions-in-selectors.patch | 4 +- ...entory-not-closing-on-entity-removal.patch | 0 ...removing-recipes-from-RecipeIterator.patch | 0 ...rnColor-on-tropical-fish-bucket-meta.patch | 0 .../Fix-tripwire-state-inconsistency.patch | 34 +++++++------ .../Fix-upstreams-block-state-factories.patch | 4 ++ ...ward-CraftEntity-in-teleport-command.patch | 8 +-- ...de-unnecessary-itemmeta-from-clients.patch | 0 .../server/Improve-scoreboard-entries.patch | 11 +++-- ...-data-to-disk-if-it-serializes-witho.patch | 0 ...primise-map-impl-for-tracked-players.patch | 0 ...timise-BlockSoil-nearby-water-lookup.patch | 0 ...on-checking-in-player-move-packet-ha.patch | 0 .../Optimise-random-block-ticking.patch | 23 +++++---- .../server/Optimize-HashMapPalette.patch | 0 .../server/Preserve-overstacked-loot.patch | 0 ...rOpenersCounter-openCount-from-going.patch | 0 ...sive-velocity-through-repeated-crits.patch | 0 ...oversized-item-data-in-equipment-and.patch | 0 ...oftlocked-end-exit-portal-generation.patch | 0 ...thread-worker-count-for-low-core-cou.patch | 0 ...de-code-using-deprecated-for-removal.patch | 0 ...-packets-for-hard-colliding-entities.patch | 0 .../server/Time-scoreboard-search.patch | 5 +- ...date-head-rotation-in-missing-places.patch | 4 +- ...ocity-compression-and-cipher-natives.patch | 0 ...-t-attempt-to-teleport-dead-entities.patch | 2 +- ...ious-menus-with-empty-level-accesses.patch | 0 ...-unintended-light-block-manipulation.patch | 0 53 files changed, 92 insertions(+), 84 deletions(-) rename patches/{unapplied => }/server/Add-API-for-item-entity-health.patch (100%) rename patches/{unapplied => }/server/Add-PlayerItemFrameChangeEvent.patch (100%) rename patches/{unapplied => }/server/Add-more-Campfire-API.patch (100%) rename patches/{unapplied => }/server/Add-packet-limiter-config.patch (100%) rename patches/{unapplied => }/server/Add-root-admin-user-detection.patch (100%) rename patches/{unapplied => }/server/Allow-delegation-to-vanilla-chunk-gen.patch (100%) rename patches/{unapplied => }/server/Always-allow-item-changing-in-Fireball.patch (100%) rename patches/{unapplied => }/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch (100%) rename patches/{unapplied => }/server/Check-requirement-before-suggesting-root-nodes.patch (100%) rename patches/{unapplied => }/server/Collision-optimisations.patch (99%) rename patches/{unapplied => }/server/Configurable-feature-seeds.patch (100%) rename patches/{unapplied => }/server/Detail-more-information-in-watchdog-dumps.patch (99%) rename patches/{unapplied => }/server/Distance-manager-tick-timings.patch (100%) rename patches/{unapplied => }/server/Do-not-run-raytrace-logic-for-AIR.patch (100%) rename patches/{unapplied => }/server/Don-t-log-debug-logging-being-disabled.patch (100%) rename patches/{unapplied => }/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch (100%) rename patches/{unapplied => }/server/Ensure-valid-vehicle-status.patch (100%) rename patches/{unapplied => }/server/Entity-powdered-snow-API.patch (100%) rename patches/{unapplied => }/server/Execute-chunk-tasks-mid-tick.patch (85%) rename patches/{unapplied => }/server/Fix-Bukkit-NamespacedKey-shenanigans.patch (100%) rename patches/{unapplied => }/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch (100%) rename patches/{unapplied => }/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch (100%) rename patches/{unapplied => }/server/Fix-CraftCriteria-defaults-map.patch (100%) rename patches/{unapplied => }/server/Fix-Spigot-growth-modifiers.patch (98%) rename patches/{unapplied => }/server/Fix-entity-type-tags-suggestions-in-selectors.patch (98%) rename patches/{unapplied => }/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch (100%) rename patches/{unapplied => }/server/Fix-removing-recipes-from-RecipeIterator.patch (100%) rename patches/{unapplied => }/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch (100%) rename patches/{unapplied => }/server/Fix-tripwire-state-inconsistency.patch (62%) rename patches/{unapplied => }/server/Fix-upstreams-block-state-factories.patch (98%) rename patches/{unapplied => }/server/Forward-CraftEntity-in-teleport-command.patch (87%) rename patches/{unapplied => }/server/Hide-unnecessary-itemmeta-from-clients.patch (100%) rename patches/{unapplied => }/server/Improve-scoreboard-entries.patch (95%) rename patches/{unapplied => }/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch (100%) rename patches/{unapplied => }/server/Oprimise-map-impl-for-tracked-players.patch (100%) rename patches/{unapplied => }/server/Optimise-BlockSoil-nearby-water-lookup.patch (100%) rename patches/{unapplied => }/server/Optimise-collision-checking-in-player-move-packet-ha.patch (100%) rename patches/{unapplied => }/server/Optimise-random-block-ticking.patch (96%) rename patches/{unapplied => }/server/Optimize-HashMapPalette.patch (100%) rename patches/{unapplied => }/server/Preserve-overstacked-loot.patch (100%) rename patches/{unapplied => }/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch (100%) rename patches/{unapplied => }/server/Prevent-excessive-velocity-through-repeated-crits.patch (100%) rename patches/{unapplied => }/server/Prevent-sending-oversized-item-data-in-equipment-and.patch (100%) rename patches/{unapplied => }/server/Prevent-softlocked-end-exit-portal-generation.patch (100%) rename patches/{unapplied => }/server/Reduce-worldgen-thread-worker-count-for-low-core-cou.patch (100%) rename patches/{unapplied => }/server/Remove-client-side-code-using-deprecated-for-removal.patch (100%) rename patches/{unapplied => }/server/Send-full-pos-packets-for-hard-colliding-entities.patch (100%) rename patches/{unapplied => }/server/Time-scoreboard-search.patch (91%) rename patches/{unapplied => }/server/Update-head-rotation-in-missing-places.patch (95%) rename patches/{unapplied => }/server/Use-Velocity-compression-and-cipher-natives.patch (100%) rename patches/{unapplied => }/server/don-t-attempt-to-teleport-dead-entities.patch (96%) rename patches/{unapplied => }/server/fix-various-menus-with-empty-level-accesses.patch (100%) rename patches/{unapplied => }/server/prevent-unintended-light-block-manipulation.patch (100%) diff --git a/patches/unapplied/server/Add-API-for-item-entity-health.patch b/patches/server/Add-API-for-item-entity-health.patch similarity index 100% rename from patches/unapplied/server/Add-API-for-item-entity-health.patch rename to patches/server/Add-API-for-item-entity-health.patch diff --git a/patches/unapplied/server/Add-PlayerItemFrameChangeEvent.patch b/patches/server/Add-PlayerItemFrameChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerItemFrameChangeEvent.patch rename to patches/server/Add-PlayerItemFrameChangeEvent.patch diff --git a/patches/unapplied/server/Add-more-Campfire-API.patch b/patches/server/Add-more-Campfire-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Campfire-API.patch rename to patches/server/Add-more-Campfire-API.patch diff --git a/patches/unapplied/server/Add-packet-limiter-config.patch b/patches/server/Add-packet-limiter-config.patch similarity index 100% rename from patches/unapplied/server/Add-packet-limiter-config.patch rename to patches/server/Add-packet-limiter-config.patch diff --git a/patches/unapplied/server/Add-root-admin-user-detection.patch b/patches/server/Add-root-admin-user-detection.patch similarity index 100% rename from patches/unapplied/server/Add-root-admin-user-detection.patch rename to patches/server/Add-root-admin-user-detection.patch diff --git a/patches/unapplied/server/Allow-delegation-to-vanilla-chunk-gen.patch b/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch similarity index 100% rename from patches/unapplied/server/Allow-delegation-to-vanilla-chunk-gen.patch rename to patches/server/Allow-delegation-to-vanilla-chunk-gen.patch diff --git a/patches/unapplied/server/Always-allow-item-changing-in-Fireball.patch b/patches/server/Always-allow-item-changing-in-Fireball.patch similarity index 100% rename from patches/unapplied/server/Always-allow-item-changing-in-Fireball.patch rename to patches/server/Always-allow-item-changing-in-Fireball.patch diff --git a/patches/unapplied/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch similarity index 100% rename from patches/unapplied/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch rename to patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch diff --git a/patches/unapplied/server/Check-requirement-before-suggesting-root-nodes.patch b/patches/server/Check-requirement-before-suggesting-root-nodes.patch similarity index 100% rename from patches/unapplied/server/Check-requirement-before-suggesting-root-nodes.patch rename to patches/server/Check-requirement-before-suggesting-root-nodes.patch diff --git a/patches/unapplied/server/Collision-optimisations.patch b/patches/server/Collision-optimisations.patch similarity index 99% rename from patches/unapplied/server/Collision-optimisations.patch rename to patches/server/Collision-optimisations.patch index e9be3a5300..ce53d7029a 100644 --- a/patches/unapplied/server/Collision-optimisations.patch +++ b/patches/server/Collision-optimisations.patch @@ -2242,7 +2242,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S float f = this.getBlockSpeedFactor(); this.setDeltaMovement(this.getDeltaMovement().multiply((double) f, 1.0D, (double) f)); @@ -2290,7 +2290,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.remainingFireTicks <= 0) { this.setRemainingFireTicks(-this.getFireImmuneTicks()); } -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } private Vec3 collide(Vec3 movement) { @@ -2393,7 +2393,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List collisions) { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S float f = this.dimensions.width * 0.8F; AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f); diff --git a/patches/unapplied/server/Configurable-feature-seeds.patch b/patches/server/Configurable-feature-seeds.patch similarity index 100% rename from patches/unapplied/server/Configurable-feature-seeds.patch rename to patches/server/Configurable-feature-seeds.patch diff --git a/patches/unapplied/server/Detail-more-information-in-watchdog-dumps.patch b/patches/server/Detail-more-information-in-watchdog-dumps.patch similarity index 99% rename from patches/unapplied/server/Detail-more-information-in-watchdog-dumps.patch rename to patches/server/Detail-more-information-in-watchdog-dumps.patch index d142d2b557..fd1cddbaae 100644 --- a/patches/unapplied/server/Detail-more-information-in-watchdog-dumps.patch +++ b/patches/server/Detail-more-information-in-watchdog-dumps.patch @@ -125,7 +125,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return this.onGround; } @@ -168,7 +168,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.noPhysics) { this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.level().getProfiler().pop(); } } @@ -182,7 +182,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } private boolean isStateClimbable(BlockState state) { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void setDeltaMovement(Vec3 velocity) { @@ -192,7 +192,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public void addDeltaMovement(Vec3 velocity) { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // Paper end - fix MC-4 if (this.position.x != x || this.position.y != y || this.position.z != z) { diff --git a/patches/unapplied/server/Distance-manager-tick-timings.patch b/patches/server/Distance-manager-tick-timings.patch similarity index 100% rename from patches/unapplied/server/Distance-manager-tick-timings.patch rename to patches/server/Distance-manager-tick-timings.patch index 62c083248a..232113d1b4 100644 --- a/patches/unapplied/server/Distance-manager-tick-timings.patch +++ b/patches/server/Distance-manager-tick-timings.patch @@ -16,8 +16,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search + public static final Timing distanceManagerTick = Timings.ofSafe("Distance Manager Tick"); // Paper - add timings for distance manager - public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks"); + diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java diff --git a/patches/unapplied/server/Do-not-run-raytrace-logic-for-AIR.patch b/patches/server/Do-not-run-raytrace-logic-for-AIR.patch similarity index 100% rename from patches/unapplied/server/Do-not-run-raytrace-logic-for-AIR.patch rename to patches/server/Do-not-run-raytrace-logic-for-AIR.patch diff --git a/patches/unapplied/server/Don-t-log-debug-logging-being-disabled.patch b/patches/server/Don-t-log-debug-logging-being-disabled.patch similarity index 100% rename from patches/unapplied/server/Don-t-log-debug-logging-being-disabled.patch rename to patches/server/Don-t-log-debug-logging-being-disabled.patch diff --git a/patches/unapplied/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch b/patches/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch similarity index 100% rename from patches/unapplied/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch rename to patches/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch diff --git a/patches/unapplied/server/Ensure-valid-vehicle-status.patch b/patches/server/Ensure-valid-vehicle-status.patch similarity index 100% rename from patches/unapplied/server/Ensure-valid-vehicle-status.patch rename to patches/server/Ensure-valid-vehicle-status.patch diff --git a/patches/unapplied/server/Entity-powdered-snow-API.patch b/patches/server/Entity-powdered-snow-API.patch similarity index 100% rename from patches/unapplied/server/Entity-powdered-snow-API.patch rename to patches/server/Entity-powdered-snow-API.patch diff --git a/patches/unapplied/server/Execute-chunk-tasks-mid-tick.patch b/patches/server/Execute-chunk-tasks-mid-tick.patch similarity index 85% rename from patches/unapplied/server/Execute-chunk-tasks-mid-tick.patch rename to patches/server/Execute-chunk-tasks-mid-tick.patch index 15adc28210..98f056bd59 100644 --- a/patches/unapplied/server/Execute-chunk-tasks-mid-tick.patch +++ b/patches/server/Execute-chunk-tasks-mid-tick.patch @@ -10,9 +10,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/MinecraftTimings.java +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java @@ -0,0 +0,0 @@ public final class MinecraftTimings { + public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate"); public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search - + public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks"); + private static final Map, String> taskNameCache = new MapMaker().weakKeys().makeMap(); @@ -23,18 +23,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { - return Component.translatable("argument.entity.options.type.invalid", entity); + return Component.translatableEscape("argument.entity.options.type.invalid", entity); }); + // Paper start + public static final DynamicCommandExceptionType ERROR_ENTITY_TAG_INVALID = new DynamicCommandExceptionType((object) -> { diff --git a/patches/unapplied/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch similarity index 100% rename from patches/unapplied/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch rename to patches/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch diff --git a/patches/unapplied/server/Fix-removing-recipes-from-RecipeIterator.patch b/patches/server/Fix-removing-recipes-from-RecipeIterator.patch similarity index 100% rename from patches/unapplied/server/Fix-removing-recipes-from-RecipeIterator.patch rename to patches/server/Fix-removing-recipes-from-RecipeIterator.patch diff --git a/patches/unapplied/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch b/patches/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch similarity index 100% rename from patches/unapplied/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch rename to patches/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch diff --git a/patches/unapplied/server/Fix-tripwire-state-inconsistency.patch b/patches/server/Fix-tripwire-state-inconsistency.patch similarity index 62% rename from patches/unapplied/server/Fix-tripwire-state-inconsistency.patch rename to patches/server/Fix-tripwire-state-inconsistency.patch index 4852270594..1db620881e 100644 --- a/patches/unapplied/server/Fix-tripwire-state-inconsistency.patch +++ b/patches/server/Fix-tripwire-state-inconsistency.patch @@ -33,10 +33,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 int j = 0; @@ -0,0 +0,0 @@ public class TripWireBlock extends Block { - if (iblockdata1.is((Block) this.hook)) { + if (iblockdata1.is(this.hook)) { if (iblockdata1.getValue(TripWireHookBlock.FACING) == enumdirection.getOpposite()) { -- this.hook.calculateState(world, blockposition1, iblockdata1, false, true, k, state); -+ this.hook.calculateState(world, blockposition1, iblockdata1, false, true, k, state, beingRemoved); // Paper - fix state inconsistency +- TripWireHookBlock.calculateState(world, blockposition1, iblockdata1, false, true, k, state); ++ TripWireHookBlock.calculateState(world, blockposition1, iblockdata1, false, true, k, state, beingRemoved); // Paper - fix state inconsistency } } else if (iblockdata1.is((Block) this)) { ++k; @@ -45,23 +45,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java @@ -0,0 +0,0 @@ public class TripWireHookBlock extends Block { + TripWireHookBlock.calculateState(world, pos, state, false, false, -1, (BlockState) null); } - public void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1) { +- public static void calculateState(Level world, BlockPos pos, BlockState state, boolean flag, boolean flag1, int i, @Nullable BlockState iblockdata1) { ++ public static void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1) { + // Paper start - fix tripwire inconsistency -+ this.calculateState(world, pos, state, beingRemoved, flag1, i, iblockdata1, false); ++ calculateState(world, pos, state, beingRemoved, flag1, i, iblockdata1, false); + } + -+ public void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1, boolean tripWireBeingRemoved) { ++ public static void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1, boolean tripWireBeingRemoved) { + // Paper end - Direction enumdirection = (Direction) state.getValue(TripWireHookBlock.FACING); - boolean flag2 = (Boolean) state.getValue(TripWireHookBlock.ATTACHED); - boolean flag3 = (Boolean) state.getValue(TripWireHookBlock.POWERED); -@@ -0,0 +0,0 @@ public class TripWireHookBlock extends Block { - boolean flag7 = (Boolean) iblockdata2.getValue(TripWireBlock.POWERED); + Optional optional = state.getOptionalValue(TripWireHookBlock.FACING); - flag5 |= flag6 && flag7; -+ if (k != i || !tripWireBeingRemoved || !flag6) // Paper - don't update the tripwire again if being removed and not disarmed - aiblockdata[k] = iblockdata2; - if (k == i) { - world.scheduleTick(pos, (Block) this, 10); + if (optional.isPresent()) { +@@ -0,0 +0,0 @@ public class TripWireHookBlock extends Block { + boolean flag7 = (Boolean) iblockdata2.getValue(TripWireBlock.POWERED); + + flag5 |= flag6 && flag7; ++ if (k != i || !tripWireBeingRemoved || !flag6) // Paper - don't update the tripwire again if being removed and not disarmed + aiblockdata[k] = iblockdata2; + if (k == i) { + world.scheduleTick(pos, block, 10); diff --git a/patches/unapplied/server/Fix-upstreams-block-state-factories.patch b/patches/server/Fix-upstreams-block-state-factories.patch similarity index 98% rename from patches/unapplied/server/Fix-upstreams-block-state-factories.patch rename to patches/server/Fix-upstreams-block-state-factories.patch index cb0248cf3d..07258513a4 100644 --- a/patches/unapplied/server/Fix-upstreams-block-state-factories.patch +++ b/patches/server/Fix-upstreams-block-state-factories.patch @@ -291,6 +291,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - register(Material.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new, BrushableBlockEntity::new); - register(Material.SUSPICIOUS_GRAVEL, CraftBrushableBlock.class, CraftBrushableBlock::new, BrushableBlockEntity::new); - register(Material.TRAPPED_CHEST, CraftChest.class, CraftChest::new, TrappedChestBlockEntity::new); +- register(Material.CRAFTER, CraftCrafter.class, CraftCrafter::new, CrafterBlockEntity::new); +- register(Material.TRIAL_SPAWNER, CraftTrialSpawner.class, CraftTrialSpawner::new, TrialSpawnerBlockEntity::new); + // Paper start - simplify + register(BlockEntityType.SIGN, CraftSign.class, CraftSign::new); + register(BlockEntityType.HANGING_SIGN, CraftHangingSign.class, CraftHangingSign::new); @@ -333,6 +335,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + register(BlockEntityType.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new); + register(BlockEntityType.BRUSHABLE_BLOCK, CraftBrushableBlock.class, CraftBrushableBlock::new); // note: spigot still uses CraftSuspiciousSand impl for that block type + register(BlockEntityType.TRAPPED_CHEST, CraftChest.class, CraftChest::new); ++ register(BlockEntityType.CRAFTER, CraftCrafter.class, CraftCrafter::new); ++ register(BlockEntityType.TRIAL_SPAWNER, CraftTrialSpawner.class, CraftTrialSpawner::new); + // Paper end } diff --git a/patches/unapplied/server/Forward-CraftEntity-in-teleport-command.patch b/patches/server/Forward-CraftEntity-in-teleport-command.patch similarity index 87% rename from patches/unapplied/server/Forward-CraftEntity-in-teleport-command.patch rename to patches/server/Forward-CraftEntity-in-teleport-command.patch index 1b028aa408..6de845f832 100644 --- a/patches/unapplied/server/Forward-CraftEntity-in-teleport-command.patch +++ b/patches/server/Forward-CraftEntity-in-teleport-command.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void restoreFrom(Entity original) { @@ -22,10 +22,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag()); nbttagcompound.remove("Dimension"); -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - if (worldserver.getTypeKey() == LevelStem.END) { // CraftBukkit - ServerLevel.makeObsidianPlatform(worldserver, this); // CraftBukkit +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S + } } + // CraftBukkit end - // CraftBukkit start - Forward the CraftEntity to the new entity - this.getBukkitEntity().setHandle(entity); - entity.bukkitEntity = this.getBukkitEntity(); diff --git a/patches/unapplied/server/Hide-unnecessary-itemmeta-from-clients.patch b/patches/server/Hide-unnecessary-itemmeta-from-clients.patch similarity index 100% rename from patches/unapplied/server/Hide-unnecessary-itemmeta-from-clients.patch rename to patches/server/Hide-unnecessary-itemmeta-from-clients.patch diff --git a/patches/unapplied/server/Improve-scoreboard-entries.patch b/patches/server/Improve-scoreboard-entries.patch similarity index 95% rename from patches/unapplied/server/Improve-scoreboard-entries.patch rename to patches/server/Improve-scoreboard-entries.patch index 6b6d8c9dae..9d1a016dd7 100644 --- a/patches/unapplied/server/Improve-scoreboard-entries.patch +++ b/patches/server/Improve-scoreboard-entries.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java @@ -0,0 +0,0 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective - return new CraftScore(this, entry); + return new CraftScore(this, CraftScoreboard.getScoreHolder(entry)); } + // Paper start @@ -28,9 +28,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java @@ -0,0 +0,0 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { - public Scoreboard getHandle() { - return this.board; + this.board.setDisplayObjective(CraftScoreboardTranslations.fromBukkitSlot(slot), null); } + + // Paper start + @Override + public ImmutableSet getScoresFor(org.bukkit.entity.Entity entity) throws IllegalArgumentException { @@ -50,7 +50,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return this.getEntryTeam(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle().getScoreboardName()); + } + // Paper end - } ++ + // CraftBukkit method + public Scoreboard getHandle() { + return this.board; diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java diff --git a/patches/unapplied/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch b/patches/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch similarity index 100% rename from patches/unapplied/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch rename to patches/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch diff --git a/patches/unapplied/server/Oprimise-map-impl-for-tracked-players.patch b/patches/server/Oprimise-map-impl-for-tracked-players.patch similarity index 100% rename from patches/unapplied/server/Oprimise-map-impl-for-tracked-players.patch rename to patches/server/Oprimise-map-impl-for-tracked-players.patch diff --git a/patches/unapplied/server/Optimise-BlockSoil-nearby-water-lookup.patch b/patches/server/Optimise-BlockSoil-nearby-water-lookup.patch similarity index 100% rename from patches/unapplied/server/Optimise-BlockSoil-nearby-water-lookup.patch rename to patches/server/Optimise-BlockSoil-nearby-water-lookup.patch diff --git a/patches/unapplied/server/Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/Optimise-collision-checking-in-player-move-packet-ha.patch similarity index 100% rename from patches/unapplied/server/Optimise-collision-checking-in-player-move-packet-ha.patch rename to patches/server/Optimise-collision-checking-in-player-move-packet-ha.patch diff --git a/patches/unapplied/server/Optimise-random-block-ticking.patch b/patches/server/Optimise-random-block-ticking.patch similarity index 96% rename from patches/unapplied/server/Optimise-random-block-ticking.patch rename to patches/server/Optimise-random-block-ticking.patch index 3f11e3e19b..b27d62b2c2 100644 --- a/patches/unapplied/server/Optimise-random-block-ticking.patch +++ b/patches/server/Optimise-random-block-ticking.patch @@ -120,14 +120,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (!this.paperConfig().environment.disableIceAndSnow) { // Paper for (int l = 0; l < randomTickSpeed; ++l) { if (this.random.nextInt(48) == 0) { -- this.tickIceAndSnow(flag, this.getBlockRandomPos(j, 0, k, 15)); +- this.tickPrecipitation(this.getBlockRandomPos(j, 0, k, 15)); ++ // Paper start + this.getRandomBlockPosition(j, 0, k, 15, blockposition); -+ this.tickIceAndSnow(flag, blockposition, chunk); ++ this.tickPrecipitation(blockposition, chunk); ++ // Paper end } } } // Paper - -+ // Paper start - optimise random block ticking +@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { gameprofilerfiller.popPush("tickBlocks"); timings.chunkTicksBlocks.startTiming(); // Paper if (randomTickSpeed > 0) { @@ -149,6 +150,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - if (iblockdata.isRandomlyTicking()) { - iblockdata.randomTick(this, blockposition1, this.random); - } ++ // Paper start - optimize random block ticking + LevelChunkSection[] sections = chunk.getSections(); + final int minSection = io.papermc.paper.util.WorldUtil.getMinSection(this); + for (int sectionIndex = 0; sectionIndex < sections.length; sectionIndex++) { @@ -179,9 +181,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - gameprofilerfiller.pop(); - } + iblockdata.randomTick(this, blockposition2, this.randomTickRandom); -+ // We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock). -+ // TODO CHECK ON UPDATE (ping the Canadian) } ++ // We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock). ++ // TODO CHECK ON UPDATE (ping the Canadian) } } + // Paper end - optimise random block ticking @@ -190,14 +192,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 gameprofilerfiller.pop(); } -- private void tickIceAndSnow(boolean raining, BlockPos pos) { + @VisibleForTesting +- public void tickPrecipitation(BlockPos pos) { - BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos); - BlockPos blockposition2 = blockposition1.below(); -+ private void tickIceAndSnow(boolean raining, BlockPos.MutableBlockPos blockposition1, final LevelChunk chunk) { // Paper - optimise chunk ticking ++ public void tickPrecipitation(BlockPos.MutableBlockPos blockposition1, final LevelChunk chunk) { // Paper - optimise chunk ticking + // Paper start - optimise chunk ticking + int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition1.getX() & 15, blockposition1.getZ() & 15) + 1; + int downY = normalY - 1; + blockposition1.setY(normalY); ++ // Paper end - optimise chunk ticking Biome biomebase = (Biome) this.getBiome(blockposition1).value(); - if (biomebase.shouldFreeze(this, blockposition2)) { @@ -206,9 +210,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (biomebase.shouldFreeze(this, blockposition1)) { + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition1, Blocks.ICE.defaultBlockState(), null); // CraftBukkit } -+ // Paper end - optimise chunk ticking - if (raining) { + if (this.isRaining()) { int i = this.getGameRules().getInt(GameRules.RULE_SNOW_ACCUMULATION_HEIGHT); + blockposition1.setY(normalY); // Paper - optimise chunk ticking diff --git a/patches/unapplied/server/Optimize-HashMapPalette.patch b/patches/server/Optimize-HashMapPalette.patch similarity index 100% rename from patches/unapplied/server/Optimize-HashMapPalette.patch rename to patches/server/Optimize-HashMapPalette.patch diff --git a/patches/unapplied/server/Preserve-overstacked-loot.patch b/patches/server/Preserve-overstacked-loot.patch similarity index 100% rename from patches/unapplied/server/Preserve-overstacked-loot.patch rename to patches/server/Preserve-overstacked-loot.patch diff --git a/patches/unapplied/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch b/patches/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch similarity index 100% rename from patches/unapplied/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch rename to patches/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch diff --git a/patches/unapplied/server/Prevent-excessive-velocity-through-repeated-crits.patch b/patches/server/Prevent-excessive-velocity-through-repeated-crits.patch similarity index 100% rename from patches/unapplied/server/Prevent-excessive-velocity-through-repeated-crits.patch rename to patches/server/Prevent-excessive-velocity-through-repeated-crits.patch diff --git a/patches/unapplied/server/Prevent-sending-oversized-item-data-in-equipment-and.patch b/patches/server/Prevent-sending-oversized-item-data-in-equipment-and.patch similarity index 100% rename from patches/unapplied/server/Prevent-sending-oversized-item-data-in-equipment-and.patch rename to patches/server/Prevent-sending-oversized-item-data-in-equipment-and.patch diff --git a/patches/unapplied/server/Prevent-softlocked-end-exit-portal-generation.patch b/patches/server/Prevent-softlocked-end-exit-portal-generation.patch similarity index 100% rename from patches/unapplied/server/Prevent-softlocked-end-exit-portal-generation.patch rename to patches/server/Prevent-softlocked-end-exit-portal-generation.patch diff --git a/patches/unapplied/server/Reduce-worldgen-thread-worker-count-for-low-core-cou.patch b/patches/server/Reduce-worldgen-thread-worker-count-for-low-core-cou.patch similarity index 100% rename from patches/unapplied/server/Reduce-worldgen-thread-worker-count-for-low-core-cou.patch rename to patches/server/Reduce-worldgen-thread-worker-count-for-low-core-cou.patch diff --git a/patches/unapplied/server/Remove-client-side-code-using-deprecated-for-removal.patch b/patches/server/Remove-client-side-code-using-deprecated-for-removal.patch similarity index 100% rename from patches/unapplied/server/Remove-client-side-code-using-deprecated-for-removal.patch rename to patches/server/Remove-client-side-code-using-deprecated-for-removal.patch diff --git a/patches/unapplied/server/Send-full-pos-packets-for-hard-colliding-entities.patch b/patches/server/Send-full-pos-packets-for-hard-colliding-entities.patch similarity index 100% rename from patches/unapplied/server/Send-full-pos-packets-for-hard-colliding-entities.patch rename to patches/server/Send-full-pos-packets-for-hard-colliding-entities.patch diff --git a/patches/unapplied/server/Time-scoreboard-search.patch b/patches/server/Time-scoreboard-search.patch similarity index 91% rename from patches/unapplied/server/Time-scoreboard-search.patch rename to patches/server/Time-scoreboard-search.patch index cb551a956b..2070d2dc48 100644 --- a/patches/unapplied/server/Time-scoreboard-search.patch +++ b/patches/server/Time-scoreboard-search.patch @@ -15,7 +15,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update"); public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate"); + public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search -+ private static final Map, String> taskNameCache = new MapMaker().weakKeys().makeMap(); @@ -26,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public final class CraftScoreboardManager implements ScoreboardManager { // CraftBukkit method - public void getScoreboardScores(ObjectiveCriteria criteria, String name, Consumer consumer) { + public void forAllObjectives(ObjectiveCriteria criteria, ScoreHolder holder, Consumer consumer) { + // Paper start - add timings for scoreboard search + // plugins leaking scoreboards will make this very expensive, let server owners debug it easily + co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.startTimingIfSync(); @@ -34,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - add timings for scoreboard search for (CraftScoreboard scoreboard : this.scoreboards) { Scoreboard board = scoreboard.board; - board.forAllObjectives(criteria, name, (score) -> consumer.accept(score)); + board.forAllObjectives(criteria, holder, (score) -> consumer.accept(score)); } + } finally { // Paper start - add timings for scoreboard search + co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.stopTimingIfSync(); diff --git a/patches/unapplied/server/Update-head-rotation-in-missing-places.patch b/patches/server/Update-head-rotation-in-missing-places.patch similarity index 95% rename from patches/unapplied/server/Update-head-rotation-in-missing-places.patch rename to patches/server/Update-head-rotation-in-missing-places.patch index 45538ea44b..7c17a2feaa 100644 --- a/patches/unapplied/server/Update-head-rotation-in-missing-places.patch +++ b/patches/server/Update-head-rotation-in-missing-places.patch @@ -11,7 +11,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F); this.yRotO = this.getYRot(); this.xRotO = this.getXRot(); @@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public void absMoveTo(double x, double y, double z) { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setXRot(pitch); this.setOldPosAndRot(); this.reapplyPosition(); diff --git a/patches/unapplied/server/Use-Velocity-compression-and-cipher-natives.patch b/patches/server/Use-Velocity-compression-and-cipher-natives.patch similarity index 100% rename from patches/unapplied/server/Use-Velocity-compression-and-cipher-natives.patch rename to patches/server/Use-Velocity-compression-and-cipher-natives.patch diff --git a/patches/unapplied/server/don-t-attempt-to-teleport-dead-entities.patch b/patches/server/don-t-attempt-to-teleport-dead-entities.patch similarity index 96% rename from patches/unapplied/server/don-t-attempt-to-teleport-dead-entities.patch rename to patches/server/don-t-attempt-to-teleport-dead-entities.patch index ec927d8e0f..1fe0c06822 100644 --- a/patches/unapplied/server/don-t-attempt-to-teleport-dead-entities.patch +++ b/patches/server/don-t-attempt-to-teleport-dead-entities.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // CraftBukkit start public void postTick() { // No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle diff --git a/patches/unapplied/server/fix-various-menus-with-empty-level-accesses.patch b/patches/server/fix-various-menus-with-empty-level-accesses.patch similarity index 100% rename from patches/unapplied/server/fix-various-menus-with-empty-level-accesses.patch rename to patches/server/fix-various-menus-with-empty-level-accesses.patch diff --git a/patches/unapplied/server/prevent-unintended-light-block-manipulation.patch b/patches/server/prevent-unintended-light-block-manipulation.patch similarity index 100% rename from patches/unapplied/server/prevent-unintended-light-block-manipulation.patch rename to patches/server/prevent-unintended-light-block-manipulation.patch