From a596ff6bdb7a4e202a514ab97759c1f52b671bb3 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 29 Oct 2018 13:02:56 +0000 Subject: [PATCH] Fix resource pack api (Fixes #1634) --- .../Add-String-based-Action-Bar-API.patch | 2 +- .../Complete-resource-pack-API.patch | 5 ++++- ...e-attack-cooldown-methods-for-Player.patch | 2 +- .../Player.setPlayerProfile-API.patch | 2 +- .../Add-PlayerUseUnknownEntityEvent.patch | 2 +- ...ke-parrots-stay-on-shoulders-despite.patch | 4 ++-- .../Complete-resource-pack-API.patch | 19 ++++++++++++++++++- .../Fix-AIOOBE-in-inventory-handling.patch | 2 +- ...-allowed-colored-signs-to-be-created.patch | 2 +- .../InventoryCloseEvent-Reason-API.patch | 16 ++++++++-------- ...nilla-per-world-scoreboard-coloring-.patch | 4 ++-- .../Properly-fix-item-duplication-bug.patch | 4 ++-- ...nventory-when-cancelling-PlayerInter.patch | 2 +- .../handle-PacketPlayInKeepAlive-async.patch | 2 +- 14 files changed, 44 insertions(+), 24 deletions(-) diff --git a/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch b/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch index 5cef1b7a03..a734a35e04 100644 --- a/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch +++ b/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add String based Action Bar API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d810286d3..993537141 100644 +index 972adf9cb..1d703e7c6 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline diff --git a/Spigot-API-Patches/Complete-resource-pack-API.patch b/Spigot-API-Patches/Complete-resource-pack-API.patch index abc57332e7..3f6d755ed8 100644 --- a/Spigot-API-Patches/Complete-resource-pack-API.patch +++ b/Spigot-API-Patches/Complete-resource-pack-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index f22f6a881..d810286d3 100644 +index f22f6a881..972adf9cb 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline @@ -63,7 +63,10 @@ index f22f6a881..d810286d3 100644 + /** + * @return the most recent resource pack hash received from the player, + * or null if no hash has ever been received from this player. ++ * ++ * @deprecated This is no longer sent from the client and will always be null + */ ++ @Deprecated + String getResourcePackHash(); + + /** diff --git a/Spigot-API-Patches/Expose-attack-cooldown-methods-for-Player.patch b/Spigot-API-Patches/Expose-attack-cooldown-methods-for-Player.patch index a6c92bbfad..67151ddaa2 100644 --- a/Spigot-API-Patches/Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-API-Patches/Expose-attack-cooldown-methods-for-Player.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 6da68835d..ae2b9752b 100644 +index 571a88e62..ba5096ca5 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline diff --git a/Spigot-API-Patches/Player.setPlayerProfile-API.patch b/Spigot-API-Patches/Player.setPlayerProfile-API.patch index cd99e52fa1..80e610980d 100644 --- a/Spigot-API-Patches/Player.setPlayerProfile-API.patch +++ b/Spigot-API-Patches/Player.setPlayerProfile-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index fd359fe0b..4020cee58 100644 +index 495bac991..ec37e3e35 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ package org.bukkit.entity; diff --git a/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch b/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch index dfc4a1abd6..7aa4154255 100644 --- a/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch @@ -18,7 +18,7 @@ index a4b98c81f5..53d38ea40f 100644 private Vec3D c; private EnumHand d; diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 7362b73b20..4df7b4a249 100644 +index e79ab51d29..085fa8cd49 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/Spigot-Server-Patches/Add-option-to-make-parrots-stay-on-shoulders-despite.patch index 3471e9bdc7..0ab98e0a03 100644 --- a/Spigot-Server-Patches/Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/Spigot-Server-Patches/Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -26,7 +26,7 @@ index 02d99aec43..3507997fc3 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index ad9e7f7b54..0f00eecead 100644 +index 09d2cd5716..b7a55b4d64 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -39,7 +39,7 @@ index ad9e7f7b54..0f00eecead 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 5f1d9cd40e..f34613fb25 100644 +index 7ed26f6bf0..3289ba3ffd 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/Complete-resource-pack-API.patch b/Spigot-Server-Patches/Complete-resource-pack-API.patch index 6b6f52743e..ee9de0967b 100644 --- a/Spigot-Server-Patches/Complete-resource-pack-API.patch +++ b/Spigot-Server-Patches/Complete-resource-pack-API.patch @@ -4,8 +4,25 @@ Date: Sat, 4 Apr 2015 23:17:52 -0400 Subject: [PATCH] Complete resource pack API +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index f2e7762d30..e79ab51d29 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + // CraftBukkit start + public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) { + PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer()); +- this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()])); ++ // Paper start ++ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()]; ++ player.getBukkitEntity().setResourcePackStatus(packStatus); ++ this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), packStatus)); ++ // Paper end + } + // CraftBukkit end + diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 15a99220ca..33bbda62f2 100644 +index 49ea29eecc..031b30e3e3 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 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch b/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch index 8c12ee2403..ce9d1d8970 100644 --- a/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch +++ b/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix AIOOBE in inventory handling diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 1dce60f8cc..aad33272f0 100644 +index 51fe740482..931dc0e8ca 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch index 042fc2abda..f55d4e67ca 100644 --- a/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch +++ b/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index d44ac990b4..da32ed7a01 100644 +index 3c9948a2d6..5bbd09aa77 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch index b30c4d90b3..12b3bf2a93 100644 --- a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 44f37f50a7..864691f873 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -29,7 +29,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 09064fa05d..125b8ef340 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -56,7 +56,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 this.activeContainer = this.defaultContainer; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 77bdb1db77..8901ea8e46 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -110,7 +110,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 this.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 5bbd09aa77..fc4c1e1bf5 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -123,7 +123,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 this.player.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index f97b5b8af0..813f6d1fd3 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -136,7 +136,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 7070917547..c9cbf69798 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -155,7 +155,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public boolean isBlocking() { return getHandle().isBlocking(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 5443000bdf..a0c0c96a28 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 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -168,7 +168,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index c11cc55154..138c61f56e 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch index 9aaa849137..f257a20d6e 100644 --- a/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ b/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -19,7 +19,7 @@ index 6fe3c0ea8a..cf523a3e48 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 7275c4d21a..83de2d63a5 100644 +index e44d8372d8..4c5dc39e3a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -31,7 +31,7 @@ index 7275c4d21a..83de2d63a5 100644 public ScoreboardTeamBase be() { if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 4df7b4a249..ba690d5bd0 100644 +index 085fa8cd49..66de10ada5 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch index 49735008e8..b065913862 100644 --- a/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e3ac9eb7d5..3644fde3bb 100644 +index 49cf680b8e..77bdb1db77 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -19,7 +19,7 @@ index e3ac9eb7d5..3644fde3bb 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 552f1355ce..dc1f4f4e11 100644 +index 0993f60e20..d7469cc547 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/Refresh-player-inventory-when-cancelling-PlayerInter.patch b/Spigot-Server-Patches/Refresh-player-inventory-when-cancelling-PlayerInter.patch index 8f56fe5d79..af6bb50ebe 100644 --- a/Spigot-Server-Patches/Refresh-player-inventory-when-cancelling-PlayerInter.patch +++ b/Spigot-Server-Patches/Refresh-player-inventory-when-cancelling-PlayerInter.patch @@ -16,7 +16,7 @@ Refresh the player inventory when PlayerInteractEntityEvent is cancelled to avoid this problem. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 9819bc0576..05b5e23bf3 100644 +index fc4c1e1bf5..f7c6ead3ae 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch b/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch index e40f4bb852..4523b5e398 100644 --- a/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch +++ b/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch @@ -15,7 +15,7 @@ also adding some additional logging in order to help work out what is causing random disconnections for clients. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index c12487b024..35a98bde1c 100644 +index b54da4eb79..bd2693536d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {