compile fixes

This commit is contained in:
Jason Penilla 2024-04-24 22:29:18 -07:00
parent c3eb1935c1
commit 0773a7aff5
2 changed files with 17 additions and 18 deletions

View File

@ -4279,7 +4279,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ hash = ""; + hash = "";
+ } + }
+ this.getHandle().connection.send(new ClientboundResourcePackPopPacket(Optional.empty())); + 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"}) + @SuppressWarnings({"unchecked", "rawtypes"})
@ -4439,9 +4439,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private void adventure$sendPlayerListHeaderAndFooter() { + private void adventure$sendPlayerListHeaderAndFooter() {
+ final ServerGamePacketListenerImpl connection = this.getHandle().connection; + final ServerGamePacketListenerImpl connection = this.getHandle().connection;
+ if (connection == null) return; + if (connection == null) return;
+ final ClientboundTabListPacket packet = new ClientboundTabListPacket(null, null); + final ClientboundTabListPacket packet = new ClientboundTabListPacket(
+ packet.adventure$header = (this.playerListHeader == null) ? net.kyori.adventure.text.Component.empty() : this.playerListHeader; + io.papermc.paper.adventure.PaperAdventure.asVanilla((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; + io.papermc.paper.adventure.PaperAdventure.asVanilla((this.playerListFooter == null) ? net.kyori.adventure.text.Component.empty() : this.playerListFooter)
+ );
+ connection.send(packet); + connection.send(packet);
+ } + }
+ +
@ -4452,11 +4453,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (times != null) { + if (times != null) {
+ connection.send(new ClientboundSetTitlesAnimationPacket(ticks(times.fadeIn()), ticks(times.stay()), ticks(times.fadeOut()))); + connection.send(new ClientboundSetTitlesAnimationPacket(ticks(times.fadeIn()), ticks(times.stay()), ticks(times.fadeOut())));
+ } + }
+ final ClientboundSetSubtitleTextPacket sp = new ClientboundSetSubtitleTextPacket((net.minecraft.network.chat.Component) null); + final ClientboundSetSubtitleTextPacket sp = new ClientboundSetSubtitleTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla(title.subtitle()));
+ sp.adventure$text = title.subtitle();
+ connection.send(sp); + connection.send(sp);
+ final ClientboundSetTitleTextPacket tp = new ClientboundSetTitleTextPacket((net.minecraft.network.chat.Component) null); + final ClientboundSetTitleTextPacket tp = new ClientboundSetTitleTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla(title.title()));
+ tp.adventure$text = title.title();
+ connection.send(tp); + connection.send(tp);
+ } + }
+ +
@ -4465,12 +4464,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ java.util.Objects.requireNonNull(part, "part"); + java.util.Objects.requireNonNull(part, "part");
+ java.util.Objects.requireNonNull(value, "value"); + java.util.Objects.requireNonNull(value, "value");
+ if (part == net.kyori.adventure.title.TitlePart.TITLE) { + if (part == net.kyori.adventure.title.TitlePart.TITLE) {
+ final ClientboundSetTitleTextPacket tp = new ClientboundSetTitleTextPacket((net.minecraft.network.chat.Component) null); + final ClientboundSetTitleTextPacket tp = new ClientboundSetTitleTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla((net.kyori.adventure.text.Component)value));
+ tp.adventure$text = (net.kyori.adventure.text.Component) value;
+ this.getHandle().connection.send(tp); + this.getHandle().connection.send(tp);
+ } else if (part == net.kyori.adventure.title.TitlePart.SUBTITLE) { + } else if (part == net.kyori.adventure.title.TitlePart.SUBTITLE) {
+ final ClientboundSetSubtitleTextPacket sp = new ClientboundSetSubtitleTextPacket((net.minecraft.network.chat.Component) null); + final ClientboundSetSubtitleTextPacket sp = new ClientboundSetSubtitleTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla((net.kyori.adventure.text.Component)value));
+ sp.adventure$text = (net.kyori.adventure.text.Component) value;
+ this.getHandle().connection.send(sp); + this.getHandle().connection.send(sp);
+ } else if (part == net.kyori.adventure.title.TitlePart.TIMES) { + } else if (part == net.kyori.adventure.title.TitlePart.TIMES) {
+ final net.kyori.adventure.title.Title.Times times = (net.kyori.adventure.title.Title.Times) value; + final net.kyori.adventure.title.Title.Times times = (net.kyori.adventure.title.Title.Times) value;

View File

@ -50,12 +50,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ } + }
+ +
+ final java.util.concurrent.CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> future = chunkStatus.generate( + final java.util.concurrent.CompletableFuture<ChunkAccess> future = chunkStatus.generate(
+ new net.minecraft.world.level.chunk.status.WorldGenContext(
+ serverLevel,
+ serverChunkCache.getGenerator(),
+ serverLevel.getStructureManager(),
+ serverChunkCache.getLightEngine()
+ ),
+ Runnable::run, + Runnable::run,
+ serverLevel,
+ serverChunkCache.getGenerator(),
+ serverLevel.getStructureManager(),
+ serverChunkCache.getLightEngine(),
+ chunk -> { + chunk -> {
+ throw new UnsupportedOperationException("Not creating full chunks here"); + throw new UnsupportedOperationException("Not creating full chunks here");
+ }, + },
@ -63,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ ); + );
+ serverChunkCache.mainThreadProcessor.managedBlock(future::isDone); + serverChunkCache.mainThreadProcessor.managedBlock(future::isDone);
+ if (chunkStatus == ChunkStatus.NOISE) { + 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);
+ } + }
} }