From 2d702b9badbbfb1cd48b46479e1d4d0cad369327 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 5 Dec 2023 20:57:46 -0700 Subject: [PATCH] more patch --- .../server/Add-BellRevealRaiderEvent.patch | 0 .../Add-ElderGuardianAppearanceEvent.patch | 0 .../server/Add-EntityInsideBlockEvent.patch | 2 +- .../server/Add-Mob-lookAt-API.patch | 0 .../server/Add-PlayerKickEvent-causes.patch | 47 ++++++++++--------- .../server/Add-PlayerSetSpawnEvent.patch | 0 .../Add-PufferFishStateChangeEvent.patch | 0 .../server/Add-System.out-err-catcher.patch | 0 .../Add-Unix-domain-socket-support.patch | 0 ...a-bunch-of-missing-forceDrop-toggles.patch | 0 ...n-in-sunlight-API-for-Phantoms-and-S.patch | 0 .../server/Add-basic-Datapack-API.patch | 0 ...cause-to-Weather-ThunderChangeEvents.patch | 4 +- ...g-for-mobs-immune-to-default-effects.patch | 0 ...nment-variable-to-disable-server-gui.patch | 0 .../server/Add-more-LimitedRegion-API.patch | 6 +-- ...n-to-fix-items-merging-through-walls.patch | 0 ...-address-to-AsyncPlayerPreLoginEvent.patch | 0 .../server/Added-EntityDamageItemEvent.patch | 0 .../server/Adds-PlayerArmSwingEvent.patch | 0 ...riting-of-comments-to-server.propert.patch | 0 .../Attributes-API-for-item-defaults.patch | 0 ...g-option-for-Piglins-guarding-chests.patch | 0 ...n-t-apply-cramming-damage-to-players.patch | 0 ...nect-for-book-edit-is-called-on-main.patch | 0 ...yerBucketEmptyEvent-result-itemstack.patch | 0 ...PlayerDropItemEvent-using-wrong-item.patch | 0 ...x-and-optimise-world-force-upgrading.patch | 10 +--- ...from-signs-not-firing-command-events.patch | 0 .../Fix-dangerous-end-portal-logic.patch | 4 +- ...ncorrect-message-for-outdated-client.patch | 0 ...ncy-issue-with-empty-map-items-in-CB.patch | 0 .../Fix-invulnerable-end-crystals.patch | 0 .../server/Fix-potions-splash-events.patch | 0 ...-of-Block-applyBoneMeal-always-being.patch | 0 ...k-event-leave-message-not-being-sent.patch | 0 .../Improve-boat-collision-performance.patch | 2 +- .../server/Inventory-close.patch | 0 .../server/ItemStack-repair-check-API.patch | 0 .../Limit-item-frame-cursors-on-maps.patch | 0 .../server/Line-Of-Sight-Changes.patch | 0 ...ers-respect-inventory-max-stack-size.patch | 0 .../Make-item-validations-configurable.patch | 0 .../server/Missing-Entity-API.patch | 0 .../server/More-Enchantment-API.patch | 6 +-- .../server/More-Lidded-Block-API.patch | 0 ...ove-range-check-for-block-placing-up.patch | 0 ...e-Biome-Mob-Lookups-for-Mob-Spawning.patch | 0 ...mize-entity-tracker-passenger-checks.patch | 0 ...ptimize-indirect-passenger-iteration.patch | 10 ++-- ...-AFK-kick-while-watching-end-credits.patch | 0 ...nd-timings-for-sensors-and-behaviors.patch | 0 ...s-to-contain-the-source-jars-in-stac.patch | 0 .../{unapplied => }/server/Stinger-API.patch | 0 ...ttedContainer-instead-of-ThreadingDe.patch | 0 ...etChunkIfLoadedImmediately-in-places.patch | 0 .../server/add-per-world-spawn-limits.patch | 0 ...ditions-to-PlayerGameModeChangeEvent.patch | 0 58 files changed, 43 insertions(+), 48 deletions(-) rename patches/{unapplied => }/server/Add-BellRevealRaiderEvent.patch (100%) rename patches/{unapplied => }/server/Add-ElderGuardianAppearanceEvent.patch (100%) rename patches/{unapplied => }/server/Add-EntityInsideBlockEvent.patch (99%) rename patches/{unapplied => }/server/Add-Mob-lookAt-API.patch (100%) rename patches/{unapplied => }/server/Add-PlayerKickEvent-causes.patch (93%) rename patches/{unapplied => }/server/Add-PlayerSetSpawnEvent.patch (100%) rename patches/{unapplied => }/server/Add-PufferFishStateChangeEvent.patch (100%) rename patches/{unapplied => }/server/Add-System.out-err-catcher.patch (100%) rename patches/{unapplied => }/server/Add-Unix-domain-socket-support.patch (100%) rename patches/{unapplied => }/server/Add-a-bunch-of-missing-forceDrop-toggles.patch (100%) rename patches/{unapplied => }/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch (100%) rename patches/{unapplied => }/server/Add-basic-Datapack-API.patch (100%) rename patches/{unapplied => }/server/Add-cause-to-Weather-ThunderChangeEvents.patch (99%) rename patches/{unapplied => }/server/Add-config-for-mobs-immune-to-default-effects.patch (100%) rename patches/{unapplied => }/server/Add-environment-variable-to-disable-server-gui.patch (100%) rename patches/{unapplied => }/server/Add-more-LimitedRegion-API.patch (91%) rename patches/{unapplied => }/server/Add-option-to-fix-items-merging-through-walls.patch (100%) rename patches/{unapplied => }/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch (100%) rename patches/{unapplied => }/server/Added-EntityDamageItemEvent.patch (100%) rename patches/{unapplied => }/server/Adds-PlayerArmSwingEvent.patch (100%) rename patches/{unapplied => }/server/Allow-skipping-writing-of-comments-to-server.propert.patch (100%) rename patches/{unapplied => }/server/Attributes-API-for-item-defaults.patch (100%) rename patches/{unapplied => }/server/Config-option-for-Piglins-guarding-chests.patch (100%) rename patches/{unapplied => }/server/Don-t-apply-cramming-damage-to-players.patch (100%) rename patches/{unapplied => }/server/Ensure-disconnect-for-book-edit-is-called-on-main.patch (100%) rename patches/{unapplied => }/server/Fix-PlayerBucketEmptyEvent-result-itemstack.patch (100%) rename patches/{unapplied => }/server/Fix-PlayerDropItemEvent-using-wrong-item.patch (100%) rename patches/{unapplied => }/server/Fix-and-optimise-world-force-upgrading.patch (97%) rename patches/{unapplied => }/server/Fix-commands-from-signs-not-firing-command-events.patch (100%) rename patches/{unapplied => }/server/Fix-dangerous-end-portal-logic.patch (98%) rename patches/{unapplied => }/server/Fix-incorrect-message-for-outdated-client.patch (100%) rename patches/{unapplied => }/server/Fix-incosistency-issue-with-empty-map-items-in-CB.patch (100%) rename patches/{unapplied => }/server/Fix-invulnerable-end-crystals.patch (100%) rename patches/{unapplied => }/server/Fix-potions-splash-events.patch (100%) rename patches/{unapplied => }/server/Fix-return-value-of-Block-applyBoneMeal-always-being.patch (100%) rename patches/{unapplied => }/server/Fixes-kick-event-leave-message-not-being-sent.patch (100%) rename patches/{unapplied => }/server/Improve-boat-collision-performance.patch (97%) rename patches/{unapplied => }/server/Inventory-close.patch (100%) rename patches/{unapplied => }/server/ItemStack-repair-check-API.patch (100%) rename patches/{unapplied => }/server/Limit-item-frame-cursors-on-maps.patch (100%) rename patches/{unapplied => }/server/Line-Of-Sight-Changes.patch (100%) rename patches/{unapplied => }/server/Make-hoppers-respect-inventory-max-stack-size.patch (100%) rename patches/{unapplied => }/server/Make-item-validations-configurable.patch (100%) rename patches/{unapplied => }/server/Missing-Entity-API.patch (100%) rename patches/{unapplied => }/server/More-Enchantment-API.patch (96%) rename patches/{unapplied => }/server/More-Lidded-Block-API.patch (100%) rename patches/{unapplied => }/server/Move-range-check-for-block-placing-up.patch (100%) rename patches/{unapplied => }/server/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch (100%) rename patches/{unapplied => }/server/Optimize-entity-tracker-passenger-checks.patch (100%) rename patches/{unapplied => }/server/Optimize-indirect-passenger-iteration.patch (91%) rename patches/{unapplied => }/server/Prevent-AFK-kick-while-watching-end-credits.patch (100%) rename patches/{unapplied => }/server/Rate-options-and-timings-for-sensors-and-behaviors.patch (100%) rename patches/{unapplied => }/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch (100%) rename patches/{unapplied => }/server/Stinger-API.patch (100%) rename patches/{unapplied => }/server/Synchronize-PalettedContainer-instead-of-ThreadingDe.patch (100%) rename patches/{unapplied => }/server/Use-getChunkIfLoadedImmediately-in-places.patch (100%) rename patches/{unapplied => }/server/add-per-world-spawn-limits.patch (100%) rename patches/{unapplied => }/server/additions-to-PlayerGameModeChangeEvent.patch (100%) diff --git a/patches/unapplied/server/Add-BellRevealRaiderEvent.patch b/patches/server/Add-BellRevealRaiderEvent.patch similarity index 100% rename from patches/unapplied/server/Add-BellRevealRaiderEvent.patch rename to patches/server/Add-BellRevealRaiderEvent.patch diff --git a/patches/unapplied/server/Add-ElderGuardianAppearanceEvent.patch b/patches/server/Add-ElderGuardianAppearanceEvent.patch similarity index 100% rename from patches/unapplied/server/Add-ElderGuardianAppearanceEvent.patch rename to patches/server/Add-ElderGuardianAppearanceEvent.patch diff --git a/patches/unapplied/server/Add-EntityInsideBlockEvent.patch b/patches/server/Add-EntityInsideBlockEvent.patch similarity index 99% rename from patches/unapplied/server/Add-EntityInsideBlockEvent.patch rename to patches/server/Add-EntityInsideBlockEvent.patch index 78f73c5cd5..a16cebf738 100644 --- a/patches/unapplied/server/Add-EntityInsideBlockEvent.patch +++ b/patches/server/Add-EntityInsideBlockEvent.patch @@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - if (!world.isClientSide && this.arrowsCanPress && !(Boolean) state.getValue(ButtonBlock.POWERED)) { + if (!world.isClientSide && this.type.canButtonBeActivatedByArrows() && !(Boolean) state.getValue(ButtonBlock.POWERED)) { this.checkPressed(state, world, pos); } diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java diff --git a/patches/unapplied/server/Add-Mob-lookAt-API.patch b/patches/server/Add-Mob-lookAt-API.patch similarity index 100% rename from patches/unapplied/server/Add-Mob-lookAt-API.patch rename to patches/server/Add-Mob-lookAt-API.patch diff --git a/patches/unapplied/server/Add-PlayerKickEvent-causes.patch b/patches/server/Add-PlayerKickEvent-causes.patch similarity index 93% rename from patches/unapplied/server/Add-PlayerKickEvent-causes.patch rename to patches/server/Add-PlayerKickEvent-causes.patch index 232296e1e5..4ce72c1d71 100644 --- a/patches/unapplied/server/Add-PlayerKickEvent-causes.patch +++ b/patches/server/Add-PlayerKickEvent-causes.patch @@ -9,7 +9,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java +++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java @@ -0,0 +0,0 @@ public class SignedMessageChain { + return (signature, body) -> { + SignedMessageLink signedMessageLink = this.advanceLink(); + if (signedMessageLink == null) { +- throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false); ++ throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false); // Paper - TODO 1.20.3 - new kick cause? + } else if (playerPublicKey.data().hasExpired()) { +- throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey"), false); ++ throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey", org.bukkit.event.player.PlayerKickEvent.Cause.EXPIRED_PROFILE_PUBLIC_KEY), false); // Paper - kick event causes + } else if (body.timeStamp().isBefore(this.lastTimeStamp)) { +- throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.out_of_order_chat"), true); ++ throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.out_of_order_chat", org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT), true); // Paper - kick event causes } else { + this.lastTimeStamp = body.timeStamp(); PlayerChatMessage playerChatMessage = new PlayerChatMessage(signedMessageLink, signature, body, (Component)null, FilterMask.PASS_THROUGH); if (!playerChatMessage.verify(signatureValidator)) { - throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.unsigned_chat"), true); @@ -80,13 +92,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/commands/KickCommand.java @@ -0,0 +0,0 @@ public class KickCommand { - private static int kickPlayers(CommandSourceStack source, Collection targets, Component reason) { - for(ServerPlayer serverPlayer : targets) { -- serverPlayer.connection.disconnect(reason); -+ serverPlayer.connection.disconnect(reason, org.bukkit.event.player.PlayerKickEvent.Cause.KICK_COMMAND); // Paper - kick event cause - source.sendSuccess(() -> { - return Component.translatable("commands.kick.success", serverPlayer.getDisplayName(), reason); - }, true); + for(ServerPlayer serverPlayer : targets) { + if (!source.getServer().isSingleplayerOwner(serverPlayer.getGameProfile())) { +- serverPlayer.connection.disconnect(reason); ++ serverPlayer.connection.disconnect(reason, org.bukkit.event.player.PlayerKickEvent.Cause.KICK_COMMAND); // Paper - kick event cause + source.sendSuccess(() -> { + return Component.translatable("commands.kick.success", serverPlayer.getDisplayName(), reason); + }, true); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -129,13 +141,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack PacketUtils.ensureRunningOnSameThread(packet, this, (BlockableEventLoop) this.server); - if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { - ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.playerProfile().getName()); + if (packet.action() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { + ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack {} rejection", this.playerProfile().getName(), packet.id()); - this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); + this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"), org.bukkit.event.player.PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // Paper - kick event cause } // Paper start - PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()]; + PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()]; @@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack if (this.keepAlivePending) { if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected @@ -323,7 +335,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters")); + this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause } else { - Optional optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages()); + Optional optional = this.tryHandleChat(packet.lastSeenMessages()); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override @@ -332,11 +344,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters")); + this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper } else { - Optional optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages()); + Optional optional = this.tryHandleChat(packet.lastSeenMessages()); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) { + ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString()); if (exception.shouldDisconnect()) { - this.disconnect(exception.getComponent()); + this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes @@ -344,15 +356,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED)); } @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - private Optional tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { - if (!this.updateChatOrder(timestamp)) { - ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); -- this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat")); -+ this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes - return Optional.empty(); - } else { - Optional optional = this.unpackAndApplyLastSeen(acknowledgment); -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (optional.isEmpty()) { ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); diff --git a/patches/unapplied/server/Add-PlayerSetSpawnEvent.patch b/patches/server/Add-PlayerSetSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerSetSpawnEvent.patch rename to patches/server/Add-PlayerSetSpawnEvent.patch diff --git a/patches/unapplied/server/Add-PufferFishStateChangeEvent.patch b/patches/server/Add-PufferFishStateChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PufferFishStateChangeEvent.patch rename to patches/server/Add-PufferFishStateChangeEvent.patch diff --git a/patches/unapplied/server/Add-System.out-err-catcher.patch b/patches/server/Add-System.out-err-catcher.patch similarity index 100% rename from patches/unapplied/server/Add-System.out-err-catcher.patch rename to patches/server/Add-System.out-err-catcher.patch diff --git a/patches/unapplied/server/Add-Unix-domain-socket-support.patch b/patches/server/Add-Unix-domain-socket-support.patch similarity index 100% rename from patches/unapplied/server/Add-Unix-domain-socket-support.patch rename to patches/server/Add-Unix-domain-socket-support.patch diff --git a/patches/unapplied/server/Add-a-bunch-of-missing-forceDrop-toggles.patch b/patches/server/Add-a-bunch-of-missing-forceDrop-toggles.patch similarity index 100% rename from patches/unapplied/server/Add-a-bunch-of-missing-forceDrop-toggles.patch rename to patches/server/Add-a-bunch-of-missing-forceDrop-toggles.patch diff --git a/patches/unapplied/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/patches/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch similarity index 100% rename from patches/unapplied/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch rename to patches/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch diff --git a/patches/unapplied/server/Add-basic-Datapack-API.patch b/patches/server/Add-basic-Datapack-API.patch similarity index 100% rename from patches/unapplied/server/Add-basic-Datapack-API.patch rename to patches/server/Add-basic-Datapack-API.patch diff --git a/patches/unapplied/server/Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/Add-cause-to-Weather-ThunderChangeEvents.patch similarity index 99% rename from patches/unapplied/server/Add-cause-to-Weather-ThunderChangeEvents.patch rename to patches/server/Add-cause-to-Weather-ThunderChangeEvents.patch index 415e4fee42..6287e76b51 100644 --- a/patches/unapplied/server/Add-cause-to-Weather-ThunderChangeEvents.patch +++ b/patches/server/Add-cause-to-Weather-ThunderChangeEvents.patch @@ -31,8 +31,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.oThunderLevel = this.thunderLevel; @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - - private void resetWeatherCycle() { + @VisibleForTesting + public void resetWeatherCycle() { // CraftBukkit start - this.serverLevelData.setRaining(false); + this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - when passing the night diff --git a/patches/unapplied/server/Add-config-for-mobs-immune-to-default-effects.patch b/patches/server/Add-config-for-mobs-immune-to-default-effects.patch similarity index 100% rename from patches/unapplied/server/Add-config-for-mobs-immune-to-default-effects.patch rename to patches/server/Add-config-for-mobs-immune-to-default-effects.patch diff --git a/patches/unapplied/server/Add-environment-variable-to-disable-server-gui.patch b/patches/server/Add-environment-variable-to-disable-server-gui.patch similarity index 100% rename from patches/unapplied/server/Add-environment-variable-to-disable-server-gui.patch rename to patches/server/Add-environment-variable-to-disable-server-gui.patch diff --git a/patches/unapplied/server/Add-more-LimitedRegion-API.patch b/patches/server/Add-more-LimitedRegion-API.patch similarity index 91% rename from patches/unapplied/server/Add-more-LimitedRegion-API.patch rename to patches/server/Add-more-LimitedRegion-API.patch index 5baf7df9b9..1071bf5ead 100644 --- a/patches/unapplied/server/Add-more-LimitedRegion-API.patch +++ b/patches/server/Add-more-LimitedRegion-API.patch @@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java @@ -0,0 +0,0 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe - public void addEntityToWorld(net.minecraft.world.entity.Entity entity, CreatureSpawnEvent.SpawnReason reason) { + public void addEntityWithPassengers(net.minecraft.world.entity.Entity entity, CreatureSpawnEvent.SpawnReason reason) { this.entities.add(entity); } + -+ // Paper start ++ // Paper start - Add more LimitedRegion API + @Override + public void setBlockState(int x, int y, int z, BlockState state) { + BlockPos pos = new BlockPos(x, y, z); @@ -52,5 +52,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public int getCenterChunkZ() { + return centerChunkZ; + } -+ // Paper end ++ // Paper end - Add more LimitedRegion API } diff --git a/patches/unapplied/server/Add-option-to-fix-items-merging-through-walls.patch b/patches/server/Add-option-to-fix-items-merging-through-walls.patch similarity index 100% rename from patches/unapplied/server/Add-option-to-fix-items-merging-through-walls.patch rename to patches/server/Add-option-to-fix-items-merging-through-walls.patch diff --git a/patches/unapplied/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch b/patches/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch similarity index 100% rename from patches/unapplied/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch rename to patches/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch diff --git a/patches/unapplied/server/Added-EntityDamageItemEvent.patch b/patches/server/Added-EntityDamageItemEvent.patch similarity index 100% rename from patches/unapplied/server/Added-EntityDamageItemEvent.patch rename to patches/server/Added-EntityDamageItemEvent.patch diff --git a/patches/unapplied/server/Adds-PlayerArmSwingEvent.patch b/patches/server/Adds-PlayerArmSwingEvent.patch similarity index 100% rename from patches/unapplied/server/Adds-PlayerArmSwingEvent.patch rename to patches/server/Adds-PlayerArmSwingEvent.patch diff --git a/patches/unapplied/server/Allow-skipping-writing-of-comments-to-server.propert.patch b/patches/server/Allow-skipping-writing-of-comments-to-server.propert.patch similarity index 100% rename from patches/unapplied/server/Allow-skipping-writing-of-comments-to-server.propert.patch rename to patches/server/Allow-skipping-writing-of-comments-to-server.propert.patch diff --git a/patches/unapplied/server/Attributes-API-for-item-defaults.patch b/patches/server/Attributes-API-for-item-defaults.patch similarity index 100% rename from patches/unapplied/server/Attributes-API-for-item-defaults.patch rename to patches/server/Attributes-API-for-item-defaults.patch diff --git a/patches/unapplied/server/Config-option-for-Piglins-guarding-chests.patch b/patches/server/Config-option-for-Piglins-guarding-chests.patch similarity index 100% rename from patches/unapplied/server/Config-option-for-Piglins-guarding-chests.patch rename to patches/server/Config-option-for-Piglins-guarding-chests.patch diff --git a/patches/unapplied/server/Don-t-apply-cramming-damage-to-players.patch b/patches/server/Don-t-apply-cramming-damage-to-players.patch similarity index 100% rename from patches/unapplied/server/Don-t-apply-cramming-damage-to-players.patch rename to patches/server/Don-t-apply-cramming-damage-to-players.patch diff --git a/patches/unapplied/server/Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/Ensure-disconnect-for-book-edit-is-called-on-main.patch similarity index 100% rename from patches/unapplied/server/Ensure-disconnect-for-book-edit-is-called-on-main.patch rename to patches/server/Ensure-disconnect-for-book-edit-is-called-on-main.patch diff --git a/patches/unapplied/server/Fix-PlayerBucketEmptyEvent-result-itemstack.patch b/patches/server/Fix-PlayerBucketEmptyEvent-result-itemstack.patch similarity index 100% rename from patches/unapplied/server/Fix-PlayerBucketEmptyEvent-result-itemstack.patch rename to patches/server/Fix-PlayerBucketEmptyEvent-result-itemstack.patch diff --git a/patches/unapplied/server/Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/Fix-PlayerDropItemEvent-using-wrong-item.patch similarity index 100% rename from patches/unapplied/server/Fix-PlayerDropItemEvent-using-wrong-item.patch rename to patches/server/Fix-PlayerDropItemEvent-using-wrong-item.patch diff --git a/patches/unapplied/server/Fix-and-optimise-world-force-upgrading.patch b/patches/server/Fix-and-optimise-world-force-upgrading.patch similarity index 97% rename from patches/unapplied/server/Fix-and-optimise-world-force-upgrading.patch rename to patches/server/Fix-and-optimise-world-force-upgrading.patch index cff3045893..43e0b02128 100644 --- a/patches/unapplied/server/Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/Fix-and-optimise-world-force-upgrading.patch @@ -250,14 +250,6 @@ diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/mi index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -0,0 +0,0 @@ import java.nio.file.Path; - import java.nio.file.Paths; - import java.util.Optional; - import java.util.function.BooleanSupplier; -+import io.papermc.paper.world.ThreadedWorldUpgrader; - import joptsimple.NonOptionArgumentSpec; - import joptsimple.OptionParser; - import joptsimple.OptionSet; @@ -0,0 +0,0 @@ public class Main { return new WorldLoader.InitConfig(worldloader_d, Commands.CommandSelection.DEDICATED, serverPropertiesHandler.functionPermissionLevel); } @@ -266,7 +258,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public static void convertWorldButItWorks(net.minecraft.resources.ResourceKey dimensionType, net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess worldSession, + DataFixer dataFixer, Optional>> generatorKey, boolean removeCaches) { + int threads = Runtime.getRuntime().availableProcessors() * 3 / 8; -+ final ThreadedWorldUpgrader worldUpgrader = new ThreadedWorldUpgrader(dimensionType, worldSession.getLevelId(), worldSession.levelDirectory.path().toFile(), threads, dataFixer, generatorKey, removeCaches); ++ final io.papermc.paper.world.ThreadedWorldUpgrader worldUpgrader = new io.papermc.paper.world.ThreadedWorldUpgrader(dimensionType, worldSession.getLevelId(), worldSession.levelDirectory.path().toFile(), threads, dataFixer, generatorKey, removeCaches); + worldUpgrader.convert(); + } + // Paper end - fix and optimise world upgrading diff --git a/patches/unapplied/server/Fix-commands-from-signs-not-firing-command-events.patch b/patches/server/Fix-commands-from-signs-not-firing-command-events.patch similarity index 100% rename from patches/unapplied/server/Fix-commands-from-signs-not-firing-command-events.patch rename to patches/server/Fix-commands-from-signs-not-firing-command-events.patch diff --git a/patches/unapplied/server/Fix-dangerous-end-portal-logic.patch b/patches/server/Fix-dangerous-end-portal-logic.patch similarity index 98% rename from patches/unapplied/server/Fix-dangerous-end-portal-logic.patch rename to patches/server/Fix-dangerous-end-portal-logic.patch index ef3bdcf116..d9e7b977ed 100644 --- a/patches/unapplied/server/Fix-dangerous-end-portal-logic.patch +++ b/patches/server/Fix-dangerous-end-portal-logic.patch @@ -14,7 +14,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 // Paper end // Paper start - optimise entity tracking final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this); @@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public boolean isLegacyTrackingEntity = false; -@@ -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.processPortalCooldown(); diff --git a/patches/unapplied/server/Fix-incorrect-message-for-outdated-client.patch b/patches/server/Fix-incorrect-message-for-outdated-client.patch similarity index 100% rename from patches/unapplied/server/Fix-incorrect-message-for-outdated-client.patch rename to patches/server/Fix-incorrect-message-for-outdated-client.patch diff --git a/patches/unapplied/server/Fix-incosistency-issue-with-empty-map-items-in-CB.patch b/patches/server/Fix-incosistency-issue-with-empty-map-items-in-CB.patch similarity index 100% rename from patches/unapplied/server/Fix-incosistency-issue-with-empty-map-items-in-CB.patch rename to patches/server/Fix-incosistency-issue-with-empty-map-items-in-CB.patch diff --git a/patches/unapplied/server/Fix-invulnerable-end-crystals.patch b/patches/server/Fix-invulnerable-end-crystals.patch similarity index 100% rename from patches/unapplied/server/Fix-invulnerable-end-crystals.patch rename to patches/server/Fix-invulnerable-end-crystals.patch diff --git a/patches/unapplied/server/Fix-potions-splash-events.patch b/patches/server/Fix-potions-splash-events.patch similarity index 100% rename from patches/unapplied/server/Fix-potions-splash-events.patch rename to patches/server/Fix-potions-splash-events.patch diff --git a/patches/unapplied/server/Fix-return-value-of-Block-applyBoneMeal-always-being.patch b/patches/server/Fix-return-value-of-Block-applyBoneMeal-always-being.patch similarity index 100% rename from patches/unapplied/server/Fix-return-value-of-Block-applyBoneMeal-always-being.patch rename to patches/server/Fix-return-value-of-Block-applyBoneMeal-always-being.patch diff --git a/patches/unapplied/server/Fixes-kick-event-leave-message-not-being-sent.patch b/patches/server/Fixes-kick-event-leave-message-not-being-sent.patch similarity index 100% rename from patches/unapplied/server/Fixes-kick-event-leave-message-not-being-sent.patch rename to patches/server/Fixes-kick-event-leave-message-not-being-sent.patch diff --git a/patches/unapplied/server/Improve-boat-collision-performance.patch b/patches/server/Improve-boat-collision-performance.patch similarity index 97% rename from patches/unapplied/server/Improve-boat-collision-performance.patch rename to patches/server/Improve-boat-collision-performance.patch index de752ef2e4..025b175d01 100644 --- a/patches/unapplied/server/Improve-boat-collision-performance.patch +++ b/patches/server/Improve-boat-collision-performance.patch @@ -57,7 +57,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java -@@ -0,0 +0,0 @@ public class Boat extends Entity implements VariantHolder { +@@ -0,0 +0,0 @@ public class Boat extends VehicleEntity implements VariantHolder { this.invFriction = 0.05F; if (this.oldStatus == Boat.Status.IN_AIR && this.status != Boat.Status.IN_AIR && this.status != Boat.Status.ON_LAND) { this.waterLevel = this.getY(1.0D); diff --git a/patches/unapplied/server/Inventory-close.patch b/patches/server/Inventory-close.patch similarity index 100% rename from patches/unapplied/server/Inventory-close.patch rename to patches/server/Inventory-close.patch diff --git a/patches/unapplied/server/ItemStack-repair-check-API.patch b/patches/server/ItemStack-repair-check-API.patch similarity index 100% rename from patches/unapplied/server/ItemStack-repair-check-API.patch rename to patches/server/ItemStack-repair-check-API.patch diff --git a/patches/unapplied/server/Limit-item-frame-cursors-on-maps.patch b/patches/server/Limit-item-frame-cursors-on-maps.patch similarity index 100% rename from patches/unapplied/server/Limit-item-frame-cursors-on-maps.patch rename to patches/server/Limit-item-frame-cursors-on-maps.patch diff --git a/patches/unapplied/server/Line-Of-Sight-Changes.patch b/patches/server/Line-Of-Sight-Changes.patch similarity index 100% rename from patches/unapplied/server/Line-Of-Sight-Changes.patch rename to patches/server/Line-Of-Sight-Changes.patch diff --git a/patches/unapplied/server/Make-hoppers-respect-inventory-max-stack-size.patch b/patches/server/Make-hoppers-respect-inventory-max-stack-size.patch similarity index 100% rename from patches/unapplied/server/Make-hoppers-respect-inventory-max-stack-size.patch rename to patches/server/Make-hoppers-respect-inventory-max-stack-size.patch diff --git a/patches/unapplied/server/Make-item-validations-configurable.patch b/patches/server/Make-item-validations-configurable.patch similarity index 100% rename from patches/unapplied/server/Make-item-validations-configurable.patch rename to patches/server/Make-item-validations-configurable.patch diff --git a/patches/unapplied/server/Missing-Entity-API.patch b/patches/server/Missing-Entity-API.patch similarity index 100% rename from patches/unapplied/server/Missing-Entity-API.patch rename to patches/server/Missing-Entity-API.patch diff --git a/patches/unapplied/server/More-Enchantment-API.patch b/patches/server/More-Enchantment-API.patch similarity index 96% rename from patches/unapplied/server/More-Enchantment-API.patch rename to patches/server/More-Enchantment-API.patch index b1e5e3fce3..1d2e06d3c9 100644 --- a/patches/unapplied/server/More-Enchantment-API.patch +++ b/patches/server/More-Enchantment-API.patch @@ -16,8 +16,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public boolean isCursed() { -- return this.target instanceof BindingCurseEnchantment || this.target instanceof VanishingCurseEnchantment; -+ return this.target.isCurse(); // Paper +- return this.handle instanceof BindingCurseEnchantment || this.handle instanceof VanishingCurseEnchantment; ++ return this.handle.isCurse(); // Paper } @Override @@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } // Paper end - public net.minecraft.world.item.enchantment.Enchantment getHandle() { + @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/patches/unapplied/server/More-Lidded-Block-API.patch b/patches/server/More-Lidded-Block-API.patch similarity index 100% rename from patches/unapplied/server/More-Lidded-Block-API.patch rename to patches/server/More-Lidded-Block-API.patch diff --git a/patches/unapplied/server/Move-range-check-for-block-placing-up.patch b/patches/server/Move-range-check-for-block-placing-up.patch similarity index 100% rename from patches/unapplied/server/Move-range-check-for-block-placing-up.patch rename to patches/server/Move-range-check-for-block-placing-up.patch diff --git a/patches/unapplied/server/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/patches/server/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch similarity index 100% rename from patches/unapplied/server/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch rename to patches/server/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch diff --git a/patches/unapplied/server/Optimize-entity-tracker-passenger-checks.patch b/patches/server/Optimize-entity-tracker-passenger-checks.patch similarity index 100% rename from patches/unapplied/server/Optimize-entity-tracker-passenger-checks.patch rename to patches/server/Optimize-entity-tracker-passenger-checks.patch diff --git a/patches/unapplied/server/Optimize-indirect-passenger-iteration.patch b/patches/server/Optimize-indirect-passenger-iteration.patch similarity index 91% rename from patches/unapplied/server/Optimize-indirect-passenger-iteration.patch rename to patches/server/Optimize-indirect-passenger-iteration.patch index 280f61edfd..580d176547 100644 --- a/patches/unapplied/server/Optimize-indirect-passenger-iteration.patch +++ b/patches/server/Optimize-indirect-passenger-iteration.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 } private Stream getIndirectPassengersStream() { @@ -43,11 +43,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return () -> { return this.getIndirectPassengersStream().iterator(); }; -@@ -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 - rewrite chunk system public boolean hasExactlyOnePlayerPassenger() { + if (this.passengers.isEmpty()) { return false; } // Paper - return this.getIndirectPassengersStream().filter((entity) -> { - return entity instanceof Player; - }).count() == 1L; + return this.countPlayerPassengers() == 1; + } + diff --git a/patches/unapplied/server/Prevent-AFK-kick-while-watching-end-credits.patch b/patches/server/Prevent-AFK-kick-while-watching-end-credits.patch similarity index 100% rename from patches/unapplied/server/Prevent-AFK-kick-while-watching-end-credits.patch rename to patches/server/Prevent-AFK-kick-while-watching-end-credits.patch diff --git a/patches/unapplied/server/Rate-options-and-timings-for-sensors-and-behaviors.patch b/patches/server/Rate-options-and-timings-for-sensors-and-behaviors.patch similarity index 100% rename from patches/unapplied/server/Rate-options-and-timings-for-sensors-and-behaviors.patch rename to patches/server/Rate-options-and-timings-for-sensors-and-behaviors.patch diff --git a/patches/unapplied/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch b/patches/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch similarity index 100% rename from patches/unapplied/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch rename to patches/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch diff --git a/patches/unapplied/server/Stinger-API.patch b/patches/server/Stinger-API.patch similarity index 100% rename from patches/unapplied/server/Stinger-API.patch rename to patches/server/Stinger-API.patch diff --git a/patches/unapplied/server/Synchronize-PalettedContainer-instead-of-ThreadingDe.patch b/patches/server/Synchronize-PalettedContainer-instead-of-ThreadingDe.patch similarity index 100% rename from patches/unapplied/server/Synchronize-PalettedContainer-instead-of-ThreadingDe.patch rename to patches/server/Synchronize-PalettedContainer-instead-of-ThreadingDe.patch diff --git a/patches/unapplied/server/Use-getChunkIfLoadedImmediately-in-places.patch b/patches/server/Use-getChunkIfLoadedImmediately-in-places.patch similarity index 100% rename from patches/unapplied/server/Use-getChunkIfLoadedImmediately-in-places.patch rename to patches/server/Use-getChunkIfLoadedImmediately-in-places.patch diff --git a/patches/unapplied/server/add-per-world-spawn-limits.patch b/patches/server/add-per-world-spawn-limits.patch similarity index 100% rename from patches/unapplied/server/add-per-world-spawn-limits.patch rename to patches/server/add-per-world-spawn-limits.patch diff --git a/patches/unapplied/server/additions-to-PlayerGameModeChangeEvent.patch b/patches/server/additions-to-PlayerGameModeChangeEvent.patch similarity index 100% rename from patches/unapplied/server/additions-to-PlayerGameModeChangeEvent.patch rename to patches/server/additions-to-PlayerGameModeChangeEvent.patch