aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0067-Complete-resource-pack-API.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-06-13 10:30:39 -0700
committerJake Potrebic <[email protected]>2024-06-13 10:30:39 -0700
commit2055809b1e491fac60d298e7ea045c0cf4871fcb (patch)
tree38d12610c21e313bfc876ddec3a7d4a968f4055e /patches/server/0067-Complete-resource-pack-API.patch
parent8a37f93925f5a0274745f81bb6d4ee8473551abf (diff)
downloadPaper-2055809b1e491fac60d298e7ea045c0cf4871fcb.tar.gz
Paper-2055809b1e491fac60d298e7ea045c0cf4871fcb.zip
117
Diffstat (limited to 'patches/server/0067-Complete-resource-pack-API.patch')
-rw-r--r--patches/server/0067-Complete-resource-pack-API.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/patches/server/0067-Complete-resource-pack-API.patch b/patches/server/0067-Complete-resource-pack-API.patch
new file mode 100644
index 0000000000..3e377d04c1
--- /dev/null
+++ b/patches/server/0067-Complete-resource-pack-API.patch
@@ -0,0 +1,49 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jedediah Smith <[email protected]>
+Date: Sat, 4 Apr 2015 23:17:52 -0400
+Subject: [PATCH] Complete resource pack API
+
+
+diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+index 94008b8a1f2dafdb9efa1fec6096d3eb632b9a5e..d2061ea6f670edd33be2460eef0b489e88857690 100644
+--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+@@ -202,7 +202,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+ callback.packEventReceived(packet.id(), net.kyori.adventure.resource.ResourcePackStatus.valueOf(packet.action().name()), this.getCraftPlayer());
+ }
+ // Paper end
+- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packet.id(), PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()])); // CraftBukkit
++ // Paper start - store last pack status
++ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()];
++ player.getBukkitEntity().resourcePackStatus = packStatus;
++ this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packet.id(), packStatus)); // CraftBukkit
++ // Paper end - store last pack status
+
+ }
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+index ecb17cffbec7d2630602b265660f7b9b3f317906..409607c68a1205094ae82e5384e8c13654e492da 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+@@ -208,6 +208,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+ private double healthScale = 20;
+ private CraftWorldBorder clientWorldBorder = null;
+ private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener();
++ public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API
+
+ public CraftPlayer(CraftServer server, ServerPlayer entity) {
+ super(server, entity);
+@@ -2093,6 +2094,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+ }
+ // Paper end - adventure
+
++ // Paper start - more resource pack API
++ @Override
++ public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status getResourcePackStatus() {
++ return this.resourcePackStatus;
++ }
++ // Paper end - more resource pack API
++
+ @Override
+ public void removeResourcePack(UUID id) {
+ Preconditions.checkArgument(id != null, "Resource pack id cannot be null");