diff --git a/patches/unapplied/server/Add-API-for-quit-reason.patch b/patches/server/Add-API-for-quit-reason.patch similarity index 76% rename from patches/unapplied/server/Add-API-for-quit-reason.patch rename to patches/server/Add-API-for-quit-reason.patch index e24fc825bb..661ca6d00f 100644 --- a/patches/unapplied/server/Add-API-for-quit-reason.patch +++ b/patches/server/Add-API-for-quit-reason.patch @@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (player != null) player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.ERRONEOUS_STATE; // Paper if (flag) { Connection.LOGGER.debug("Failed to sent packet", throwable); - ConnectionProtocol enumprotocol = this.getCurrentProtocol(); + if (this.getSending() == PacketFlow.CLIENTBOUND) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -34,14 +34,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper + public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event - private final java.util.concurrent.atomic.AtomicReference viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1)); - public io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader; -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java + public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { + super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); +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/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure +--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + final Component ichatbasecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()); // Paper - Adventure // CraftBukkit end + this.player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.KICKED; // Paper @@ -56,8 +56,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper } -- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : PaperAdventure.asAdventure(entityplayer.getDisplayName()))); // Paper - Adventure -+ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.quitReason); // Paper - Adventure & quit reason +- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName()))); // Paper - Adventure ++ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.quitReason); // Paper - Adventure & quit reason this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); diff --git a/patches/unapplied/server/Add-BellRingEvent.patch b/patches/server/Add-BellRingEvent.patch similarity index 100% rename from patches/unapplied/server/Add-BellRingEvent.patch rename to patches/server/Add-BellRingEvent.patch diff --git a/patches/unapplied/server/Add-Destroy-Speed-API.patch b/patches/server/Add-Destroy-Speed-API.patch similarity index 100% rename from patches/unapplied/server/Add-Destroy-Speed-API.patch rename to patches/server/Add-Destroy-Speed-API.patch diff --git a/patches/unapplied/server/Add-EntityLoadCrossbowEvent.patch b/patches/server/Add-EntityLoadCrossbowEvent.patch similarity index 100% rename from patches/unapplied/server/Add-EntityLoadCrossbowEvent.patch rename to patches/server/Add-EntityLoadCrossbowEvent.patch diff --git a/patches/unapplied/server/Add-LivingEntity-clearActiveItem.patch b/patches/server/Add-LivingEntity-clearActiveItem.patch similarity index 100% rename from patches/unapplied/server/Add-LivingEntity-clearActiveItem.patch rename to patches/server/Add-LivingEntity-clearActiveItem.patch diff --git a/patches/unapplied/server/Add-OBSTRUCTED-reason-to-BedEnterResult.patch b/patches/server/Add-OBSTRUCTED-reason-to-BedEnterResult.patch similarity index 100% rename from patches/unapplied/server/Add-OBSTRUCTED-reason-to-BedEnterResult.patch rename to patches/server/Add-OBSTRUCTED-reason-to-BedEnterResult.patch diff --git a/patches/unapplied/server/Add-PlayerItemCooldownEvent.patch b/patches/server/Add-PlayerItemCooldownEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerItemCooldownEvent.patch rename to patches/server/Add-PlayerItemCooldownEvent.patch diff --git a/patches/unapplied/server/Add-PlayerShearBlockEvent.patch b/patches/server/Add-PlayerShearBlockEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerShearBlockEvent.patch rename to patches/server/Add-PlayerShearBlockEvent.patch diff --git a/patches/unapplied/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch b/patches/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch rename to patches/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch diff --git a/patches/unapplied/server/Add-PrepareResultEvent.patch b/patches/server/Add-PrepareResultEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PrepareResultEvent.patch rename to patches/server/Add-PrepareResultEvent.patch diff --git a/patches/unapplied/server/Add-Wandering-Trader-spawn-rate-config-options.patch b/patches/server/Add-Wandering-Trader-spawn-rate-config-options.patch similarity index 100% rename from patches/unapplied/server/Add-Wandering-Trader-spawn-rate-config-options.patch rename to patches/server/Add-Wandering-Trader-spawn-rate-config-options.patch diff --git a/patches/unapplied/server/Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/Add-additional-open-container-api-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/server/Add-additional-open-container-api-to-HumanEntity.patch rename to patches/server/Add-additional-open-container-api-to-HumanEntity.patch diff --git a/patches/unapplied/server/Add-getOfflinePlayerIfCached-String.patch b/patches/server/Add-getOfflinePlayerIfCached-String.patch similarity index 100% rename from patches/unapplied/server/Add-getOfflinePlayerIfCached-String.patch rename to patches/server/Add-getOfflinePlayerIfCached-String.patch diff --git a/patches/unapplied/server/Add-ignore-discounts-API.patch b/patches/server/Add-ignore-discounts-API.patch similarity index 100% rename from patches/unapplied/server/Add-ignore-discounts-API.patch rename to patches/server/Add-ignore-discounts-API.patch diff --git a/patches/unapplied/server/Add-methods-to-get-translation-keys.patch b/patches/server/Add-methods-to-get-translation-keys.patch similarity index 100% rename from patches/unapplied/server/Add-methods-to-get-translation-keys.patch rename to patches/server/Add-methods-to-get-translation-keys.patch diff --git a/patches/unapplied/server/Add-moon-phase-API.patch b/patches/server/Add-moon-phase-API.patch similarity index 100% rename from patches/unapplied/server/Add-moon-phase-API.patch rename to patches/server/Add-moon-phase-API.patch diff --git a/patches/unapplied/server/Add-more-Evoker-API.patch b/patches/server/Add-more-Evoker-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Evoker-API.patch rename to patches/server/Add-more-Evoker-API.patch diff --git a/patches/unapplied/server/Add-playPickupItemAnimation-to-LivingEntity.patch b/patches/server/Add-playPickupItemAnimation-to-LivingEntity.patch similarity index 100% rename from patches/unapplied/server/Add-playPickupItemAnimation-to-LivingEntity.patch rename to patches/server/Add-playPickupItemAnimation-to-LivingEntity.patch diff --git a/patches/unapplied/server/Add-zombie-targets-turtle-egg-config.patch b/patches/server/Add-zombie-targets-turtle-egg-config.patch similarity index 100% rename from patches/unapplied/server/Add-zombie-targets-turtle-egg-config.patch rename to patches/server/Add-zombie-targets-turtle-egg-config.patch diff --git a/patches/unapplied/server/Added-ServerResourcesReloadedEvent.patch b/patches/server/Added-ServerResourcesReloadedEvent.patch similarity index 100% rename from patches/unapplied/server/Added-ServerResourcesReloadedEvent.patch rename to patches/server/Added-ServerResourcesReloadedEvent.patch diff --git a/patches/unapplied/server/Added-WorldGameRuleChangeEvent.patch b/patches/server/Added-WorldGameRuleChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Added-WorldGameRuleChangeEvent.patch rename to patches/server/Added-WorldGameRuleChangeEvent.patch diff --git a/patches/unapplied/server/Added-missing-default-perms-for-commands.patch b/patches/server/Added-missing-default-perms-for-commands.patch similarity index 100% rename from patches/unapplied/server/Added-missing-default-perms-for-commands.patch rename to patches/server/Added-missing-default-perms-for-commands.patch diff --git a/patches/unapplied/server/Additional-Block-Material-API-s.patch b/patches/server/Additional-Block-Material-API-s.patch similarity index 100% rename from patches/unapplied/server/Additional-Block-Material-API-s.patch rename to patches/server/Additional-Block-Material-API-s.patch diff --git a/patches/unapplied/server/Allow-disabling-mob-spawner-spawn-egg-transformation.patch b/patches/server/Allow-disabling-mob-spawner-spawn-egg-transformation.patch similarity index 100% rename from patches/unapplied/server/Allow-disabling-mob-spawner-spawn-egg-transformation.patch rename to patches/server/Allow-disabling-mob-spawner-spawn-egg-transformation.patch diff --git a/patches/unapplied/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch similarity index 100% rename from patches/unapplied/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch rename to patches/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch diff --git a/patches/unapplied/server/Beacon-API-custom-effect-ranges.patch b/patches/server/Beacon-API-custom-effect-ranges.patch similarity index 98% rename from patches/unapplied/server/Beacon-API-custom-effect-ranges.patch rename to patches/server/Beacon-API-custom-effect-ranges.patch index 35eaac4b81..70d0b56122 100644 --- a/patches/unapplied/server/Beacon-API-custom-effect-ranges.patch +++ b/patches/server/Beacon-API-custom-effect-ranges.patch @@ -33,8 +33,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - public BeaconBlockEntity(BlockPos pos, BlockState state) { - super(BlockEntityType.BEACON, pos, state); + @Nullable + static MobEffect filterEffect(@Nullable MobEffect effect) { @@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } diff --git a/patches/unapplied/server/Brand-support.patch b/patches/server/Brand-support.patch similarity index 52% rename from patches/unapplied/server/Brand-support.patch rename to patches/server/Brand-support.patch index e2c9f10f00..2b7e7b43bb 100644 --- a/patches/unapplied/server/Brand-support.patch +++ b/patches/server/Brand-support.patch @@ -4,34 +4,25 @@ Date: Sat, 11 Apr 2020 13:10:58 +0200 Subject: [PATCH] Brand support -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + private int latency; + private volatile boolean suspendFlushingOnServerThread = false; private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit - private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper ++ private @Nullable String clientBrandName = null; // Paper - Brand name ++ protected static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support -+ private String clientBrandName = null; // Paper - Brand name -+ - public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { - this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH); - this.lastSeenMessages = new LastSeenMessagesValidator(20); -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register"); - private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister"); - -+ private static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support -+ - @Override - public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit + this.server = minecraftserver; +@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack try { - byte[] data = new byte[packet.data.readableBytes()]; - packet.data.readBytes(data); + byte[] data = new byte[payload.readableBytes()]; + payload.readBytes(data); + // Paper start - Brand support -+ if (packet.identifier.equals(MINECRAFT_BRAND)) { ++ if (identifier.equals(MINECRAFT_BRAND)) { + try { + this.clientBrandName = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.copiedBuffer(data)).readUtf(256); + } catch (StringIndexOutOfBoundsException ex) { @@ -39,16 +30,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + // Paper end - this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); + this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), identifier.toString(), data); } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } + // Paper start - brand support ++ @Nullable + public String getClientBrandName() { -+ return clientBrandName; ++ return this.clientBrandName; + } + // Paper end + diff --git a/patches/unapplied/server/Buffer-joins-to-world.patch b/patches/server/Buffer-joins-to-world.patch similarity index 99% rename from patches/unapplied/server/Buffer-joins-to-world.patch rename to patches/server/Buffer-joins-to-world.patch index 6e51274d45..186dce05a4 100644 --- a/patches/unapplied/server/Buffer-joins-to-world.patch +++ b/patches/server/Buffer-joins-to-world.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -0,0 +0,0 @@ public class Connection extends SimpleChannelInboundHandler> { + } } - // Paper end + private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper + private static int joinAttemptsThisTick; // Paper diff --git a/patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch similarity index 100% rename from patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch rename to patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch diff --git a/patches/unapplied/server/Cache-block-data-strings.patch b/patches/server/Cache-block-data-strings.patch similarity index 100% rename from patches/unapplied/server/Cache-block-data-strings.patch rename to patches/server/Cache-block-data-strings.patch diff --git a/patches/unapplied/server/Cache-burn-durations.patch b/patches/server/Cache-burn-durations.patch similarity index 100% rename from patches/unapplied/server/Cache-burn-durations.patch rename to patches/server/Cache-burn-durations.patch diff --git a/patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/Climbing-should-not-bypass-cramming-gamerule.patch similarity index 100% rename from patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch rename to patches/server/Climbing-should-not-bypass-cramming-gamerule.patch diff --git a/patches/unapplied/server/Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/Create-HoverEvent-from-ItemStack-Entity.patch similarity index 100% rename from patches/unapplied/server/Create-HoverEvent-from-ItemStack-Entity.patch rename to patches/server/Create-HoverEvent-from-ItemStack-Entity.patch diff --git a/patches/unapplied/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch b/patches/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch similarity index 98% rename from patches/unapplied/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch rename to patches/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch index 5ac05622bf..e1305c75d9 100644 --- a/patches/unapplied/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch +++ b/patches/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch @@ -21,4 +21,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end } // CraftBukkit end - } + ++j; diff --git a/patches/unapplied/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch similarity index 100% rename from patches/unapplied/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch rename to patches/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch diff --git a/patches/unapplied/server/Don-t-require-FACING-data.patch b/patches/server/Don-t-require-FACING-data.patch similarity index 82% rename from patches/unapplied/server/Don-t-require-FACING-data.patch rename to patches/server/Don-t-require-FACING-data.patch index 8bac4849da..c1e6f9f969 100644 --- a/patches/unapplied/server/Don-t-require-FACING-data.patch +++ b/patches/server/Don-t-require-FACING-data.patch @@ -20,17 +20,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public final ItemStack dispense(BlockSource pointer, ItemStack stack) { -+ enumdirection = pointer.getBlockState().getValue(DispenserBlock.FACING); // Paper - cache facing direction ++ enumdirection = pointer.state().getValue(DispenserBlock.FACING); // Paper - cache facing direction ItemStack itemstack1 = this.execute(pointer, stack); this.playSound(pointer); -- this.playAnimation(pointer, (Direction) pointer.getBlockState().getValue(DispenserBlock.FACING)); +- this.playAnimation(pointer, (Direction) pointer.state().getValue(DispenserBlock.FACING)); + this.playAnimation(pointer, enumdirection); // Paper - cache facing direction return itemstack1; } protected ItemStack execute(BlockSource pointer, ItemStack stack) { -- Direction enumdirection = (Direction) pointer.getBlockState().getValue(DispenserBlock.FACING); +- Direction enumdirection = (Direction) pointer.state().getValue(DispenserBlock.FACING); + // Paper - cached enum direction Position iposition = DispenserBlock.getDispensePosition(pointer); ItemStack itemstack1 = stack.split(1); diff --git a/patches/unapplied/server/Eigencraft-redstone-implementation.patch b/patches/server/Eigencraft-redstone-implementation.patch similarity index 100% rename from patches/unapplied/server/Eigencraft-redstone-implementation.patch rename to patches/server/Eigencraft-redstone-implementation.patch diff --git a/patches/unapplied/server/Entity-isTicking.patch b/patches/server/Entity-isTicking.patch similarity index 100% rename from patches/unapplied/server/Entity-isTicking.patch rename to patches/server/Entity-isTicking.patch diff --git a/patches/unapplied/server/Expose-LivingEntity-hurt-direction.patch b/patches/server/Expose-LivingEntity-hurt-direction.patch similarity index 100% rename from patches/unapplied/server/Expose-LivingEntity-hurt-direction.patch rename to patches/server/Expose-LivingEntity-hurt-direction.patch diff --git a/patches/unapplied/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 100% rename from patches/unapplied/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch diff --git a/patches/unapplied/server/Expose-world-spawn-angle.patch b/patches/server/Expose-world-spawn-angle.patch similarity index 100% rename from patches/unapplied/server/Expose-world-spawn-angle.patch rename to patches/server/Expose-world-spawn-angle.patch diff --git a/patches/unapplied/server/Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch similarity index 100% rename from patches/unapplied/server/Extend-block-drop-capture-to-capture-all-items-added.patch rename to patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch diff --git a/patches/unapplied/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch similarity index 81% rename from patches/unapplied/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch rename to patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch index a16096fe52..32f76886e9 100644 --- a/patches/unapplied/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch +++ b/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch @@ -15,11 +15,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.level.storage.loot.LootContext; - public abstract class SimpleCriterionTrigger implements CriterionTrigger { + public abstract class SimpleCriterionTrigger implements CriterionTrigger { - private final Map>> players = Maps.newIdentityHashMap(); -+ //private final Map>> players = Maps.newIdentityHashMap(); // Paper - moved into AdvancementDataPlayer to fix memory leak -+ -+ public SimpleCriterionTrigger() {} ++ // private final Map>> players = Maps.newIdentityHashMap(); // Paper - moved into AdvancementDataPlayer to fix memory leak @Override public final void addPlayerListener(PlayerAdvancements manager, CriterionTrigger.Listener conditions) { @@ -41,7 +39,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -@@ -0,0 +0,0 @@ public abstract class SimpleCriterionTrigger predicate, DeserializationContext predicateDeserializer); +@@ -0,0 +0,0 @@ public abstract class SimpleCriterionTrigger predicate) { PlayerAdvancements playerAdvancements = player.getAdvancements(); @@ -64,10 +62,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java @@ -0,0 +0,0 @@ public class PlayerAdvancements { - @Nullable - private Advancement lastSelectedTab; + private AdvancementHolder lastSelectedTab; private boolean isFirstPacket = true; -+ public final Map> criterionData = new java.util.IdentityHashMap<>(); // Paper - fix advancement data player leakage + private final Codec codec; ++ public final Map, Set>> criterionData = new java.util.IdentityHashMap<>(); // Paper - fix advancement data player leakage public PlayerAdvancements(DataFixer dataFixer, PlayerList playerManager, ServerAdvancementManager advancementLoader, Path filePath, ServerPlayer owner) { - this.dataFixer = dataFixer; + this.playerList = playerManager; diff --git a/patches/unapplied/server/Fix-Concurrency-issue-in-ShufflingList.patch b/patches/server/Fix-Concurrency-issue-in-ShufflingList.patch similarity index 100% rename from patches/unapplied/server/Fix-Concurrency-issue-in-ShufflingList.patch rename to patches/server/Fix-Concurrency-issue-in-ShufflingList.patch diff --git a/patches/unapplied/server/Fix-CraftSound-backwards-compatibility.patch b/patches/server/Fix-CraftSound-backwards-compatibility.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftSound-backwards-compatibility.patch rename to patches/server/Fix-CraftSound-backwards-compatibility.patch diff --git a/patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch similarity index 96% rename from patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch rename to patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index cc5dee0d2a..b1fa039fd8 100644 --- a/patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -12,7 +12,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return; } @@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.lastGoodX = this.awaitingPositionFromClient.x; this.lastGoodY = this.awaitingPositionFromClient.y; this.lastGoodZ = this.awaitingPositionFromClient.z; -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // CraftBukkit end this.awaitingTeleportTime = this.tickCount; diff --git a/patches/unapplied/server/Fix-Not-a-string-Map-Conversion-spam.patch b/patches/server/Fix-Not-a-string-Map-Conversion-spam.patch similarity index 100% rename from patches/unapplied/server/Fix-Not-a-string-Map-Conversion-spam.patch rename to patches/server/Fix-Not-a-string-Map-Conversion-spam.patch diff --git a/patches/unapplied/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch similarity index 100% rename from patches/unapplied/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch rename to patches/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch diff --git a/patches/unapplied/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch similarity index 100% rename from patches/unapplied/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch rename to patches/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch diff --git a/patches/unapplied/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch similarity index 100% rename from patches/unapplied/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch rename to patches/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch diff --git a/patches/unapplied/server/Fix-SPIGOT-5989.patch b/patches/server/Fix-SPIGOT-5989.patch similarity index 100% rename from patches/unapplied/server/Fix-SPIGOT-5989.patch rename to patches/server/Fix-SPIGOT-5989.patch diff --git a/patches/unapplied/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch similarity index 100% rename from patches/unapplied/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch rename to patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch diff --git a/patches/unapplied/server/Fix-arrows-never-despawning-MC-125757.patch b/patches/server/Fix-arrows-never-despawning-MC-125757.patch similarity index 100% rename from patches/unapplied/server/Fix-arrows-never-despawning-MC-125757.patch rename to patches/server/Fix-arrows-never-despawning-MC-125757.patch diff --git a/patches/unapplied/server/Fix-client-lag-on-advancement-loading.patch b/patches/server/Fix-client-lag-on-advancement-loading.patch similarity index 100% rename from patches/unapplied/server/Fix-client-lag-on-advancement-loading.patch rename to patches/server/Fix-client-lag-on-advancement-loading.patch diff --git a/patches/unapplied/server/Fix-curing-zombie-villager-discount-exploit.patch b/patches/server/Fix-curing-zombie-villager-discount-exploit.patch similarity index 100% rename from patches/unapplied/server/Fix-curing-zombie-villager-discount-exploit.patch rename to patches/server/Fix-curing-zombie-villager-discount-exploit.patch diff --git a/patches/unapplied/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch similarity index 100% rename from patches/unapplied/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch rename to patches/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch diff --git a/patches/unapplied/server/Fix-for-large-move-vectors-crashing-server.patch b/patches/server/Fix-for-large-move-vectors-crashing-server.patch similarity index 92% rename from patches/unapplied/server/Fix-for-large-move-vectors-crashing-server.patch rename to patches/server/Fix-for-large-move-vectors-crashing-server.patch index 5121634e7d..e362c6358d 100644 --- a/patches/unapplied/server/Fix-for-large-move-vectors-crashing-server.patch +++ b/patches/server/Fix-for-large-move-vectors-crashing-server.patch @@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (entity != this.player && entity.getControllingPassenger() == this.player && entity == this.lastVehicle) { ServerLevel worldserver = this.player.serverLevel(); @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 double d3 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX()); final double toX = d3; // Paper - OBFHELPER double d4 = ServerGamePacketListenerImpl.clampVertical(packet.getY()); final double toY = d4; // Paper - OBFHELPER double d5 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ()); final double toZ = d5; // Paper - OBFHELPER -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d7 = d4 - this.vehicleFirstGoodY; double d8 = d5 - this.vehicleFirstGoodZ; double d9 = entity.getDeltaMovement().lengthSqr(); @@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start - handle custom speeds and skipped ticks this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick; -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl boolean flag = worldserver.noCollision(entity, entity.getBoundingBox().deflate(0.0625D)); @@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 boolean flag1 = entity.verticalCollisionBelow; if (entity instanceof LivingEntity) { -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d7 = d1 - this.firstGoodY; double d8 = d2 - this.firstGoodZ; double d9 = this.player.getDeltaMovement().lengthSqr(); @@ -77,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.player.isSleeping()) { if (d10 > 1.0D) { -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl AABB axisalignedbb = this.player.getBoundingBox(); diff --git a/patches/unapplied/server/Fix-harming-potion-dupe.patch b/patches/server/Fix-harming-potion-dupe.patch similarity index 100% rename from patches/unapplied/server/Fix-harming-potion-dupe.patch rename to patches/server/Fix-harming-potion-dupe.patch diff --git a/patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch b/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch similarity index 89% rename from patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch rename to patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch index 9b19ff5264..8a08d3233a 100644 --- a/patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch +++ b/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch @@ -11,16 +11,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL } // CraftBukkit end - if (packet.getProtocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { + if (packet.protocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { - MutableComponent ichatmutablecomponent; + Component ichatmutablecomponent; // Paper - Fix hex colors not working in some kick messages - if (packet.getProtocolVersion() < 754) { + if (packet.protocolVersion() < 754) { - ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot -+ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages ++ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages } else { - ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot -+ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages ++ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages } this.connection.send(new ClientboundLoginDisconnectPacket(ichatmutablecomponent)); diff --git a/patches/unapplied/server/Fix-interact-event-not-being-called-sometimes.patch b/patches/server/Fix-interact-event-not-being-called-sometimes.patch similarity index 95% rename from patches/unapplied/server/Fix-interact-event-not-being-called-sometimes.patch rename to patches/server/Fix-interact-event-not-being-called-sometimes.patch index 11b2ddd28b..0382d3bd21 100644 --- a/patches/unapplied/server/Fix-interact-event-not-being-called-sometimes.patch +++ b/patches/server/Fix-interact-event-not-being-called-sometimes.patch @@ -14,7 +14,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl MutableComponent ichatmutablecomponent = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED); this.player.sendSystemMessage(ichatmutablecomponent, true); @@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.player.swing(enumhand, true); } } -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d3 = player.gameMode.getGameModeForPlayer() == GameType.CREATIVE ? 5.0D : 4.5D; // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time // SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities diff --git a/patches/unapplied/server/Fix-item-locations-dropped-from-campfires.patch b/patches/server/Fix-item-locations-dropped-from-campfires.patch similarity index 100% rename from patches/unapplied/server/Fix-item-locations-dropped-from-campfires.patch rename to patches/server/Fix-item-locations-dropped-from-campfires.patch diff --git a/patches/unapplied/server/Fix-nerfed-slime-when-splitting.patch b/patches/server/Fix-nerfed-slime-when-splitting.patch similarity index 100% rename from patches/unapplied/server/Fix-nerfed-slime-when-splitting.patch rename to patches/server/Fix-nerfed-slime-when-splitting.patch diff --git a/patches/unapplied/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch b/patches/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch similarity index 100% rename from patches/unapplied/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch rename to patches/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch diff --git a/patches/unapplied/server/Fix-some-rails-connecting-improperly.patch b/patches/server/Fix-some-rails-connecting-improperly.patch similarity index 100% rename from patches/unapplied/server/Fix-some-rails-connecting-improperly.patch rename to patches/server/Fix-some-rails-connecting-improperly.patch diff --git a/patches/unapplied/server/Fixed-TileEntityBell-memory-leak.patch b/patches/server/Fixed-TileEntityBell-memory-leak.patch similarity index 100% rename from patches/unapplied/server/Fixed-TileEntityBell-memory-leak.patch rename to patches/server/Fixed-TileEntityBell-memory-leak.patch diff --git a/patches/unapplied/server/Implement-API-to-get-Material-from-Boats-and-Minecar.patch b/patches/server/Implement-API-to-get-Material-from-Boats-and-Minecar.patch similarity index 100% rename from patches/unapplied/server/Implement-API-to-get-Material-from-Boats-and-Minecar.patch rename to patches/server/Implement-API-to-get-Material-from-Boats-and-Minecar.patch diff --git a/patches/unapplied/server/Implement-PlayerFlowerPotManipulateEvent.patch b/patches/server/Implement-PlayerFlowerPotManipulateEvent.patch similarity index 100% rename from patches/unapplied/server/Implement-PlayerFlowerPotManipulateEvent.patch rename to patches/server/Implement-PlayerFlowerPotManipulateEvent.patch diff --git a/patches/unapplied/server/Implement-TargetHitEvent.patch b/patches/server/Implement-TargetHitEvent.patch similarity index 100% rename from patches/unapplied/server/Implement-TargetHitEvent.patch rename to patches/server/Implement-TargetHitEvent.patch diff --git a/patches/unapplied/server/Item-no-age-no-player-pickup.patch b/patches/server/Item-no-age-no-player-pickup.patch similarity index 100% rename from patches/unapplied/server/Item-no-age-no-player-pickup.patch rename to patches/server/Item-no-age-no-player-pickup.patch diff --git a/patches/unapplied/server/Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/Lazily-track-plugin-scoreboards-by-default.patch similarity index 100% rename from patches/unapplied/server/Lazily-track-plugin-scoreboards-by-default.patch rename to patches/server/Lazily-track-plugin-scoreboards-by-default.patch diff --git a/patches/unapplied/server/Limit-recipe-packets.patch b/patches/server/Limit-recipe-packets.patch similarity index 90% rename from patches/unapplied/server/Limit-recipe-packets.patch rename to patches/server/Limit-recipe-packets.patch index e470651e13..6fe675c285 100644 --- a/patches/unapplied/server/Limit-recipe-packets.patch +++ b/patches/server/Limit-recipe-packets.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // CraftBukkit start - multithreaded fields private final AtomicInteger chatSpamTickCount = new AtomicInteger(); private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end private int dropSpamTickCount; private double firstGoodX; -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // CraftBukkit start for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/unapplied/server/MC-4-Fix-item-position-desync.patch b/patches/server/MC-4-Fix-item-position-desync.patch similarity index 95% rename from patches/unapplied/server/MC-4-Fix-item-position-desync.patch rename to patches/server/MC-4-Fix-item-position-desync.patch index 03813c29b8..68b1547082 100644 --- a/patches/unapplied/server/MC-4-Fix-item-position-desync.patch +++ b/patches/server/MC-4-Fix-item-position-desync.patch @@ -32,9 +32,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- 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 { - return; - } - // Paper end - rewrite chunk system + } + public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) { + // Paper end + // Paper start - fix MC-4 + if (this instanceof ItemEntity) { + if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.fixEntityPositionDesync) { diff --git a/patches/unapplied/server/More-lightning-API.patch b/patches/server/More-lightning-API.patch similarity index 100% rename from patches/unapplied/server/More-lightning-API.patch rename to patches/server/More-lightning-API.patch diff --git a/patches/unapplied/server/Optimise-getType-calls.patch b/patches/server/Optimise-getType-calls.patch similarity index 100% rename from patches/unapplied/server/Optimise-getType-calls.patch rename to patches/server/Optimise-getType-calls.patch diff --git a/patches/unapplied/server/Optimize-Dynamic-get-Missing-Keys.patch b/patches/server/Optimize-Dynamic-get-Missing-Keys.patch similarity index 100% rename from patches/unapplied/server/Optimize-Dynamic-get-Missing-Keys.patch rename to patches/server/Optimize-Dynamic-get-Missing-Keys.patch diff --git a/patches/unapplied/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch similarity index 99% rename from patches/unapplied/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch rename to patches/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch index 2cfd1213a6..98105a3370 100644 --- a/patches/unapplied/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch +++ b/patches/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch @@ -102,7 +102,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - return this.reconstructPath(target.getBestNode(), positions.get(target), false); - }).min(Comparator.comparingDouble(Path::getDistToTarget).thenComparingInt(Path::getNodeCount)); - profiler.pop(); -- return !optional.isPresent() ? null : optional.get(); +- return optional.isEmpty() ? null : optional.get(); + // Paper start - remove streams - and optimize collection + Path best = null; + boolean entryListIsEmpty = entryList.isEmpty(); diff --git a/patches/server/Player-Chunk-Load-Unload-Events.patch b/patches/server/Player-Chunk-Load-Unload-Events.patch new file mode 100644 index 0000000000..b4693fb687 --- /dev/null +++ b/patches/server/Player-Chunk-Load-Unload-Events.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: ysl3000 +Date: Mon, 5 Oct 2020 21:25:16 +0200 +Subject: [PATCH] Player Chunk Load/Unload Events + + +diff --git a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java ++++ b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java +@@ -0,0 +0,0 @@ public class PlayerChunkSender { + public void dropChunk(ServerPlayer player, ChunkPos pos) { + if (!this.pendingChunks.remove(pos.toLong()) && player.isAlive()) { + player.connection.send(new ClientboundForgetLevelChunkPacket(pos)); ++ // Paper start ++ if(io.papermc.paper.event.packet.PlayerChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0){ ++ new io.papermc.paper.event.packet.PlayerChunkUnloadEvent(player.getBukkitEntity().getWorld().getChunkAt(pos.longKey), player.getBukkitEntity()).callEvent(); ++ } ++ // Paper end + } + + } +@@ -0,0 +0,0 @@ public class PlayerChunkSender { + + private static void sendChunk(ServerGamePacketListenerImpl handler, ServerLevel world, LevelChunk chunk) { + handler.send(new ClientboundLevelChunkWithLightPacket(chunk, world.getLightEngine(), (BitSet)null, (BitSet)null)); ++ // Paper start ++ if(io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0){ ++ new io.papermc.paper.event.packet.PlayerChunkLoadEvent(new org.bukkit.craftbukkit.CraftChunk(chunk), handler.getPlayer().getBukkitEntity()).callEvent(); ++ } ++ // Paper end + ChunkPos chunkPos = chunk.getPos(); + DebugPackets.sendPoiPacketsForChunk(world, chunkPos); + } diff --git a/patches/unapplied/server/Player-elytra-boost-API.patch b/patches/server/Player-elytra-boost-API.patch similarity index 100% rename from patches/unapplied/server/Player-elytra-boost-API.patch rename to patches/server/Player-elytra-boost-API.patch diff --git a/patches/unapplied/server/PortalCreateEvent-needs-to-know-its-entity.patch b/patches/server/PortalCreateEvent-needs-to-know-its-entity.patch similarity index 100% rename from patches/unapplied/server/PortalCreateEvent-needs-to-know-its-entity.patch rename to patches/server/PortalCreateEvent-needs-to-know-its-entity.patch diff --git a/patches/unapplied/server/Prevent-headless-pistons-from-being-created.patch b/patches/server/Prevent-headless-pistons-from-being-created.patch similarity index 100% rename from patches/unapplied/server/Prevent-headless-pistons-from-being-created.patch rename to patches/server/Prevent-headless-pistons-from-being-created.patch diff --git a/patches/unapplied/server/Reduce-blockpos-allocation-from-pathfinding.patch b/patches/server/Reduce-blockpos-allocation-from-pathfinding.patch similarity index 100% rename from patches/unapplied/server/Reduce-blockpos-allocation-from-pathfinding.patch rename to patches/server/Reduce-blockpos-allocation-from-pathfinding.patch diff --git a/patches/unapplied/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch b/patches/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch similarity index 100% rename from patches/unapplied/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch rename to patches/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch diff --git a/patches/unapplied/server/Retain-block-place-order-when-capturing-blockstates.patch b/patches/server/Retain-block-place-order-when-capturing-blockstates.patch similarity index 100% rename from patches/unapplied/server/Retain-block-place-order-when-capturing-blockstates.patch rename to patches/server/Retain-block-place-order-when-capturing-blockstates.patch diff --git a/patches/unapplied/server/Significantly-improve-performance-of-the-end-generat.patch b/patches/server/Significantly-improve-performance-of-the-end-generat.patch similarity index 100% rename from patches/unapplied/server/Significantly-improve-performance-of-the-end-generat.patch rename to patches/server/Significantly-improve-performance-of-the-end-generat.patch diff --git a/patches/unapplied/server/Spawn-player-in-correct-world-on-login.patch b/patches/server/Spawn-player-in-correct-world-on-login.patch similarity index 100% rename from patches/unapplied/server/Spawn-player-in-correct-world-on-login.patch rename to patches/server/Spawn-player-in-correct-world-on-login.patch diff --git a/patches/unapplied/server/Thread-Safe-Vanilla-Command-permission-checking.patch b/patches/server/Thread-Safe-Vanilla-Command-permission-checking.patch similarity index 100% rename from patches/unapplied/server/Thread-Safe-Vanilla-Command-permission-checking.patch rename to patches/server/Thread-Safe-Vanilla-Command-permission-checking.patch diff --git a/patches/unapplied/server/Toggle-for-removing-existing-dragon.patch b/patches/server/Toggle-for-removing-existing-dragon.patch similarity index 100% rename from patches/unapplied/server/Toggle-for-removing-existing-dragon.patch rename to patches/server/Toggle-for-removing-existing-dragon.patch diff --git a/patches/unapplied/server/Update-itemstack-legacy-name-and-lore.patch b/patches/server/Update-itemstack-legacy-name-and-lore.patch similarity index 100% rename from patches/unapplied/server/Update-itemstack-legacy-name-and-lore.patch rename to patches/server/Update-itemstack-legacy-name-and-lore.patch diff --git a/patches/unapplied/server/Villager-resetOffers.patch b/patches/server/Villager-resetOffers.patch similarity index 100% rename from patches/unapplied/server/Villager-resetOffers.patch rename to patches/server/Villager-resetOffers.patch diff --git a/patches/unapplied/server/Zombie-API-breaking-doors.patch b/patches/server/Zombie-API-breaking-doors.patch similarity index 100% rename from patches/unapplied/server/Zombie-API-breaking-doors.patch rename to patches/server/Zombie-API-breaking-doors.patch diff --git a/patches/unapplied/server/Player-Chunk-Load-Unload-Events.patch b/patches/unapplied/server/Player-Chunk-Load-Unload-Events.patch deleted file mode 100644 index bb7f35fb37..0000000000 --- a/patches/unapplied/server/Player-Chunk-Load-Unload-Events.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: ysl3000 -Date: Mon, 5 Oct 2020 21:25:16 +0200 -Subject: [PATCH] Player Chunk Load/Unload Events - - -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayer.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { - - public void trackChunk(ChunkPos chunkPos, Packet chunkDataPacket) { - this.connection.send(chunkDataPacket); -+ // Paper start -+ if(io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0){ -+ new io.papermc.paper.event.packet.PlayerChunkLoadEvent(this.getBukkitEntity().getWorld().getChunkAt(chunkPos.longKey), this.getBukkitEntity()).callEvent(); -+ } -+ // Paper end - } - - public void untrackChunk(ChunkPos chunkPos) { - if (this.isAlive()) { - this.connection.send(new ClientboundForgetLevelChunkPacket(chunkPos.x, chunkPos.z)); -+ // Paper start -+ if(io.papermc.paper.event.packet.PlayerChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0){ -+ new io.papermc.paper.event.packet.PlayerChunkUnloadEvent(this.getBukkitEntity().getWorld().getChunkAt(chunkPos.longKey), this.getBukkitEntity()).callEvent(); -+ } -+ // Paper end - } - - } diff --git a/patches/unapplied/server/Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/unapplied/skipped/Do-not-let-the-server-load-chunks-from-newer-version.patch similarity index 100% rename from patches/unapplied/server/Do-not-let-the-server-load-chunks-from-newer-version.patch rename to patches/unapplied/skipped/Do-not-let-the-server-load-chunks-from-newer-version.patch diff --git a/patches/unapplied/server/Optimize-NetworkManager-Exception-Handling.patch b/patches/unapplied/skipped/Optimize-NetworkManager-Exception-Handling.patch similarity index 100% rename from patches/unapplied/server/Optimize-NetworkManager-Exception-Handling.patch rename to patches/unapplied/skipped/Optimize-NetworkManager-Exception-Handling.patch