From 0773a7aff5452fb659e52fabe8b968ec0b89882e Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:29:18 -0700 Subject: [PATCH] compile fixes --- patches/server/Adventure.patch | 21 ++++++++----------- .../server/Implement-regenerateChunk.patch | 14 +++++++------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 6168a70cb..1459623dd 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -4279,7 +4279,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + hash = ""; + } + this.getHandle().connection.send(new ClientboundResourcePackPopPacket(Optional.empty())); -+ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(uuid, url, hash, force, io.papermc.paper.adventure.PaperAdventure.asVanilla(prompt))); ++ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(uuid, url, hash, force, Optional.ofNullable(prompt).map(io.papermc.paper.adventure.PaperAdventure::asVanilla))); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) @@ -4439,9 +4439,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private void adventure$sendPlayerListHeaderAndFooter() { + final ServerGamePacketListenerImpl connection = this.getHandle().connection; + if (connection == null) return; -+ final ClientboundTabListPacket packet = new ClientboundTabListPacket(null, null); -+ packet.adventure$header = (this.playerListHeader == null) ? net.kyori.adventure.text.Component.empty() : this.playerListHeader; -+ packet.adventure$footer = (this.playerListFooter == null) ? net.kyori.adventure.text.Component.empty() : this.playerListFooter; ++ final ClientboundTabListPacket packet = new ClientboundTabListPacket( ++ io.papermc.paper.adventure.PaperAdventure.asVanilla((this.playerListHeader == null) ? net.kyori.adventure.text.Component.empty() : this.playerListHeader), ++ io.papermc.paper.adventure.PaperAdventure.asVanilla((this.playerListFooter == null) ? net.kyori.adventure.text.Component.empty() : this.playerListFooter) ++ ); + connection.send(packet); + } + @@ -4452,11 +4453,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (times != null) { + connection.send(new ClientboundSetTitlesAnimationPacket(ticks(times.fadeIn()), ticks(times.stay()), ticks(times.fadeOut()))); + } -+ final ClientboundSetSubtitleTextPacket sp = new ClientboundSetSubtitleTextPacket((net.minecraft.network.chat.Component) null); -+ sp.adventure$text = title.subtitle(); ++ final ClientboundSetSubtitleTextPacket sp = new ClientboundSetSubtitleTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla(title.subtitle())); + connection.send(sp); -+ final ClientboundSetTitleTextPacket tp = new ClientboundSetTitleTextPacket((net.minecraft.network.chat.Component) null); -+ tp.adventure$text = title.title(); ++ final ClientboundSetTitleTextPacket tp = new ClientboundSetTitleTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla(title.title())); + connection.send(tp); + } + @@ -4465,12 +4464,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + java.util.Objects.requireNonNull(part, "part"); + java.util.Objects.requireNonNull(value, "value"); + if (part == net.kyori.adventure.title.TitlePart.TITLE) { -+ final ClientboundSetTitleTextPacket tp = new ClientboundSetTitleTextPacket((net.minecraft.network.chat.Component) null); -+ tp.adventure$text = (net.kyori.adventure.text.Component) value; ++ final ClientboundSetTitleTextPacket tp = new ClientboundSetTitleTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla((net.kyori.adventure.text.Component)value)); + this.getHandle().connection.send(tp); + } else if (part == net.kyori.adventure.title.TitlePart.SUBTITLE) { -+ final ClientboundSetSubtitleTextPacket sp = new ClientboundSetSubtitleTextPacket((net.minecraft.network.chat.Component) null); -+ sp.adventure$text = (net.kyori.adventure.text.Component) value; ++ final ClientboundSetSubtitleTextPacket sp = new ClientboundSetSubtitleTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla((net.kyori.adventure.text.Component)value)); + this.getHandle().connection.send(sp); + } else if (part == net.kyori.adventure.title.TitlePart.TIMES) { + final net.kyori.adventure.title.Title.Times times = (net.kyori.adventure.title.Title.Times) value; diff --git a/patches/server/Implement-regenerateChunk.patch b/patches/server/Implement-regenerateChunk.patch index b24cc35f6..d232835be 100644 --- a/patches/server/Implement-regenerateChunk.patch +++ b/patches/server/Implement-regenerateChunk.patch @@ -50,12 +50,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + -+ final java.util.concurrent.CompletableFuture> future = chunkStatus.generate( ++ final java.util.concurrent.CompletableFuture future = chunkStatus.generate( ++ new net.minecraft.world.level.chunk.status.WorldGenContext( ++ serverLevel, ++ serverChunkCache.getGenerator(), ++ serverLevel.getStructureManager(), ++ serverChunkCache.getLightEngine() ++ ), + Runnable::run, -+ serverLevel, -+ serverChunkCache.getGenerator(), -+ serverLevel.getStructureManager(), -+ serverChunkCache.getLightEngine(), + chunk -> { + throw new UnsupportedOperationException("Not creating full chunks here"); + }, @@ -63,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + ); + serverChunkCache.mainThreadProcessor.managedBlock(future::isDone); + if (chunkStatus == ChunkStatus.NOISE) { -+ future.join().left().ifPresent(chunk -> net.minecraft.world.level.levelgen.Heightmap.primeHeightmaps(chunk, ChunkStatus.POST_FEATURES)); ++ net.minecraft.world.level.levelgen.Heightmap.primeHeightmaps(future.join(), ChunkStatus.POST_FEATURES); + } }