From 7bd0fbea6c2e28657a886bb2055212ff503083bb Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 6 Dec 2023 20:46:49 +0100 Subject: [PATCH] Drop old packs in setResourcePack --- patches/server/Complete-resource-pack-API.patch | 9 +++++++++ patches/server/Rewrite-dataconverter-system.patch | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/patches/server/Complete-resource-pack-API.patch b/patches/server/Complete-resource-pack-API.patch index 49b0f2a0aa..c49351501c 100644 --- a/patches/server/Complete-resource-pack-API.patch +++ b/patches/server/Complete-resource-pack-API.patch @@ -25,6 +25,14 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -0,0 +0,0 @@ import net.minecraft.network.chat.Component; + import net.minecraft.network.chat.PlayerChatMessage; + import net.minecraft.network.protocol.Packet; + import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket; ++import net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket; + import net.minecraft.network.protocol.common.ClientboundResourcePackPushPacket; + import net.minecraft.network.protocol.common.custom.CustomPacketPayload; + import net.minecraft.network.protocol.game.ClientboundBlockDestructionPacket; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private double healthScale = 20; private CraftWorldBorder clientWorldBorder = null; @@ -58,6 +66,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + net.minecraft.network.chat.Component promptComponent = resourcePackPrompt != null ? + io.papermc.paper.adventure.PaperAdventure.asVanilla(resourcePackPrompt) : + null; ++ this.getHandle().connection.send(new ClientboundResourcePackPopPacket(Optional.empty())); + this.getHandle().connection.send(new ClientboundResourcePackPushPacket(UUID.randomUUID(), url, hash, required, promptComponent)); + } + diff --git a/patches/server/Rewrite-dataconverter-system.patch b/patches/server/Rewrite-dataconverter-system.patch index ada692326a..824bf4c745 100644 --- a/patches/server/Rewrite-dataconverter-system.patch +++ b/patches/server/Rewrite-dataconverter-system.patch @@ -24899,14 +24899,6 @@ diff --git a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java +++ b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java -@@ -0,0 +0,0 @@ import com.mojang.datafixers.DataFixer; - import com.mojang.logging.LogUtils; - import com.mojang.serialization.DataResult; - import com.mojang.serialization.Dynamic; -+import com.mojang.serialization.DynamicOps; - import com.mojang.serialization.Lifecycle; - import java.io.BufferedOutputStream; - import java.io.BufferedReader; @@ -0,0 +0,0 @@ public class LevelStorageSource { static Dynamic readLevelDataTagFixed(Path path, DataFixer dataFixer) throws IOException { CompoundTag nbttagcompound = LevelStorageSource.readLevelDataTagRaw(path);