more cleanup and resource pack api fixes

This commit is contained in:
Jake Potrebic
2023-12-08 15:13:02 -08:00
parent b21ac86cac
commit 93dcf918f8
15 changed files with 321 additions and 163 deletions

View File

@@ -3755,10 +3755,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
+ // Paper start
+ // TODO UUID API
+ // Paper start - adventure
+ @Override
+ public void setResourcePack(String url, byte[] hashBytes, net.kyori.adventure.text.Component prompt, boolean force) {
+ public void setResourcePack(final UUID uuid, final String url, final byte[] hashBytes, final net.kyori.adventure.text.Component prompt, final boolean force) {
+ Preconditions.checkArgument(uuid != null, "Resource pack UUID cannot be null");
+ Preconditions.checkArgument(url != null, "Resource pack URL cannot be null");
+ final String hash;
+ if (hashBytes != null) {
@@ -3767,9 +3767,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } else {
+ hash = "";
+ }
+ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(UUID.randomUUID(), url, hash, force, io.papermc.paper.adventure.PaperAdventure.asVanilla(prompt)));
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket(Optional.empty()));
+ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(uuid, url, hash, force, io.papermc.paper.adventure.PaperAdventure.asVanilla(prompt)));
+ }
+ // Paper end
+ // Paper end - adventure
+
public void addChannel(String channel) {
Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);