From 41acf2c27957771d88fad386bc1f4b89069379d0 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 20 Jun 2021 21:25:59 +0200 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5904) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 70d24eb8 SPIGOT-6587: Update documentation/error of drop chance API CraftBukkit Changes: 470050ad SPIGOT-6587: Update documentation/error of drop chance API 1c39efa3 Fix Inventory#getViewers on the player inventory not returning the player first time their inventory is opened d161627d Fix PrepareItemCraftEvent#isRepair aa1fae73 SPIGOT-6586: EntityChangeBlockEvent for falling block does not cancel properly 8a04072e SPIGOT-6583: Throwing eggs doesn't make sounds Spigot Changes: f773da84 Remove redundant patch cd367234 Rebuild patches --- patches/server/Add-API-for-quit-reason.patch | 4 ++-- .../server/Add-PlayerInitialSpawnEvent.patch | 6 ++--- patches/server/Adventure.patch | 24 +++++++++---------- patches/server/Expose-world-spawn-angle.patch | 2 +- ...g-Broken-behavior-of-PlayerJoinEvent.patch | 4 ++-- ...wn-acting-as-a-bed-respawn-from-the-.patch | 2 +- ...-allowed-colored-signs-to-be-created.patch | 2 +- .../InventoryCloseEvent-Reason-API.patch | 2 +- .../Limit-Client-Sign-length-more.patch | 2 +- ...Load-Chunks-for-Login-Asynchronously.patch | 8 +++---- .../server/PlayerLaunchProjectileEvent.patch | 2 +- .../server/ProfileWhitelistVerifyEvent.patch | 2 +- ...d-RespawnFlags-to-PlayerRespawnEvent.patch | 2 +- ...t-set-drop-chance-to-EntityEquipment.patch | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 17 files changed, 35 insertions(+), 35 deletions(-) diff --git a/patches/server/Add-API-for-quit-reason.patch b/patches/server/Add-API-for-quit-reason.patch index ac7f491acb..3bcccc3c97 100644 --- a/patches/server/Add-API-for-quit-reason.patch +++ b/patches/server/Add-API-for-quit-reason.patch @@ -56,8 +56,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper } -- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(this.cserver.getPlayer(entityplayer), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); -+ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(this.cserver.getPlayer(entityplayer), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName())), entityplayer.quitReason); // Paper - quit reason +- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); ++ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName())), entityplayer.quitReason); // Paper - quit reason if (entityplayer.didPlayerJoinEvent) this.cserver.getPluginManager().callEvent(playerQuitEvent); // Paper - if we disconnected before join ever fired, don't fire quit entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); diff --git a/patches/server/Add-PlayerInitialSpawnEvent.patch b/patches/server/Add-PlayerInitialSpawnEvent.patch index 64786e0d05..0355dabd20 100644 --- a/patches/server/Add-PlayerInitialSpawnEvent.patch +++ b/patches/server/Add-PlayerInitialSpawnEvent.patch @@ -15,9 +15,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class PlayerList { // Spigot start - spawn location event - Player bukkitPlayer = player.getBukkitEntity(); -- org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new org.spigotmc.event.player.PlayerSpawnLocationEvent(bukkitPlayer, bukkitPlayer.getLocation()); -+ org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(bukkitPlayer, bukkitPlayer.getLocation()); // Paper use our duplicate event + Player spawnPlayer = player.getBukkitEntity(); +- org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new org.spigotmc.event.player.PlayerSpawnLocationEvent(spawnPlayer, spawnPlayer.getLocation()); ++ org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(spawnPlayer, spawnPlayer.getLocation()); // Paper use our duplicate event this.cserver.getPluginManager().callEvent(ev); Location loc = ev.getSpawnLocation(); diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index bf72bfedc5..3e394a2c6c 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -1306,7 +1306,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - String leaveMessage = ChatFormatting.YELLOW + this.player.getScoreboardName() + " left the game."; + net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, this.player.getBukkitEntity().displayName()); // Paper - Adventure -- PlayerKickEvent event = new PlayerKickEvent(this.cserver.getPlayer(this.player), s, leaveMessage); +- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), s, leaveMessage); + PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage); // Paper - Adventure if (this.cserver.getServer().isRunning()) { @@ -1356,7 +1356,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - // CraftBukkit start + // CraftBukkit start // Paper start - Adventure - Player player = this.cserver.getPlayer(this.player); + Player player = this.player.getBukkitEntity(); int x = packetplayinupdatesign.getPos().getX(); int y = packetplayinupdatesign.getPos().getY(); int z = packetplayinupdatesign.getPos().getZ(); @@ -1374,7 +1374,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + lines.add(net.kyori.adventure.text.Component.text(list.get(i).getRaw())); } } - SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.cserver.getPlayer(this.player), lines); + SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines); this.cserver.getPluginManager().callEvent(event); if (!event.isCancelled()) { @@ -1467,11 +1467,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot()); this.players.add(player); @@ -0,0 +0,0 @@ public abstract class PlayerList { - // this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{entityplayer})); // CraftBukkit - replaced with loop below + // Ensure that player inventory is populated with its viewer + player.containerMenu.transferTo(player.containerMenu, bukkitPlayer); - // CraftBukkit start -- PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(this.cserver.getPlayer(player), joinMessage); -+ PlayerJoinEvent playerJoinEvent = new org.bukkit.event.player.PlayerJoinEvent(this.cserver.getPlayer(player), PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure +- PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, joinMessage); ++ PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure this.cserver.getPluginManager().callEvent(playerJoinEvent); if (!player.connection.connection.isConnected()) { @@ -1504,8 +1504,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 entityplayer.closeContainer(); } -- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(this.cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getScoreboardName() + " left the game"); -+ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(this.cserver.getPlayer(entityplayer), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); +- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), "\u00A7e" + entityplayer.getScoreboardName() + " left the game"); ++ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); @@ -1522,8 +1522,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // return chatmessage; -- if (!gameprofilebanentry.hasExpired()) event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(chatmessage)); // Spigot -+ if (!gameprofilebanentry.hasExpired()) event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Spigot // Paper - Adventure +- event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(chatmessage)); ++ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure } else if (!this.isWhiteListed(gameprofile)) { chatmessage = new TranslatableComponent("multiplayer.disconnect.not_whitelisted"); - event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot @@ -1615,7 +1615,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end } - public Player getPlayer(final ServerPlayer entity) { + @Override @@ -0,0 +0,0 @@ public final class CraftServer implements Server { return this.configuration.getInt("settings.spawn-radius", -1); } diff --git a/patches/server/Expose-world-spawn-angle.patch b/patches/server/Expose-world-spawn-angle.patch index 79abd2ae4b..8e487f56e0 100644 --- a/patches/server/Expose-world-spawn-angle.patch +++ b/patches/server/Expose-world-spawn-angle.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + location = new Location(worldserver1.getWorld(), (double) ((float) blockposition.getX() + 0.5F), (double) ((float) blockposition.getY() + 0.1F), (double) ((float) blockposition.getZ() + 0.5F), worldserver1.levelData.getSpawnAngle(), 0.0F); // Paper - use world spawn angle } - Player respawnPlayer = this.cserver.getPlayer(entityplayer1); + Player respawnPlayer = entityplayer1.getBukkitEntity(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/patches/server/Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/patches/server/Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch index a5a6926557..82c1ee921e 100644 --- a/patches/server/Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch +++ b/patches/server/Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch @@ -66,8 +66,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + mountSavedVehicle(player, worldserver1, nbttagcompound); + // Paper end // CraftBukkit start - PlayerJoinEvent playerJoinEvent = new org.bukkit.event.player.PlayerJoinEvent(this.cserver.getPlayer(player), PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure - this.cserver.getPluginManager().callEvent(playerJoinEvent); + CraftPlayer bukkitPlayer = player.getBukkitEntity(); + @@ -0,0 +0,0 @@ public abstract class PlayerList { player.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, new ServerPlayer[] { entityplayer1})); } diff --git a/patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch b/patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch index bf294523a7..af779aad9e 100644 --- a/patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch +++ b/patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch @@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class PlayerList { } - Player respawnPlayer = this.cserver.getPlayer(entityplayer1); + Player respawnPlayer = entityplayer1.getBukkitEntity(); - PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !flag2, flag2); + PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn); // Paper - Fix anchor respawn acting as a bed respawn from the end portal this.cserver.getPluginManager().callEvent(respawnEvent); diff --git a/patches/server/Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/patches/server/Fix-exploit-that-allowed-colored-signs-to-be-created.patch index 22843cfba5..57721de6b4 100644 --- a/patches/server/Fix-exploit-that-allowed-colored-signs-to-be-created.patch +++ b/patches/server/Fix-exploit-that-allowed-colored-signs-to-be-created.patch @@ -19,4 +19,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + lines.add(net.kyori.adventure.text.Component.text(SharedConstants.filterText(list.get(i).getRaw()))); } } - SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.cserver.getPlayer(this.player), lines); + SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines); diff --git a/patches/server/InventoryCloseEvent-Reason-API.patch b/patches/server/InventoryCloseEvent-Reason-API.patch index 10f05a18e5..374c9154ca 100644 --- a/patches/server/InventoryCloseEvent-Reason-API.patch +++ b/patches/server/InventoryCloseEvent-Reason-API.patch @@ -125,7 +125,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper } - PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(this.cserver.getPlayer(entityplayer), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); + PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/patches/server/Limit-Client-Sign-length-more.patch b/patches/server/Limit-Client-Sign-length-more.patch index b5b9082341..c7512751c9 100644 --- a/patches/server/Limit-Client-Sign-length-more.patch +++ b/patches/server/Limit-Client-Sign-length-more.patch @@ -55,4 +55,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + lines.add(net.kyori.adventure.text.Component.text(SharedConstants.filterText(currentLine.getRaw()))); } } - SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.cserver.getPlayer(this.player), lines); + SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines); diff --git a/patches/server/Load-Chunks-for-Login-Asynchronously.patch b/patches/server/Load-Chunks-for-Login-Asynchronously.patch index 32e0f78469..636f8a6802 100644 --- a/patches/server/Load-Chunks-for-Login-Asynchronously.patch +++ b/patches/server/Load-Chunks-for-Login-Asynchronously.patch @@ -113,8 +113,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final UserWhiteList whitelist; + private final Map pendingPlayers = Maps.newHashMap(); // Paper // CraftBukkit start - // private final Map o; - // private final Map p; + // private final Map stats; + // private final Map advancements; @@ -0,0 +0,0 @@ public abstract class PlayerList { } @@ -200,14 +200,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class PlayerList { } - PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(this.cserver.getPlayer(entityplayer), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); + PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); - this.cserver.getPluginManager().callEvent(playerQuitEvent); + if (entityplayer.didPlayerJoinEvent) this.cserver.getPluginManager().callEvent(playerQuitEvent); // Paper - if we disconnected before join ever fired, don't fire quit entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); if (server.isSameThread()) entityplayer.doTick(); // SPIGOT-924 // Paper - don't tick during emergency shutdowns (Watchdog) @@ -0,0 +0,0 @@ public abstract class PlayerList { - // this.p.remove(uuid); + // this.advancements.remove(uuid); // CraftBukkit end } + // Paper start diff --git a/patches/server/PlayerLaunchProjectileEvent.patch b/patches/server/PlayerLaunchProjectileEvent.patch index 79bdf3f2f2..68efa2aeda 100644 --- a/patches/server/PlayerLaunchProjectileEvent.patch +++ b/patches/server/PlayerLaunchProjectileEvent.patch @@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - // CraftBukkit end + // Paper end } - // world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)); // CraftBukkit - from above + world.playSound((Player) null, user.getX(), user.getY(), user.getZ(), SoundEvents.EGG_THROW, SoundSource.PLAYERS, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)); + /* // Paper start - moved up user.awardStat(Stats.ITEM_USED.get(this)); diff --git a/patches/server/ProfileWhitelistVerifyEvent.patch b/patches/server/ProfileWhitelistVerifyEvent.patch index 9fece971c0..523b33e6b7 100644 --- a/patches/server/ProfileWhitelistVerifyEvent.patch +++ b/patches/server/ProfileWhitelistVerifyEvent.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class PlayerList { // return chatmessage; - if (!gameprofilebanentry.hasExpired()) event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Spigot // Paper - Adventure + event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure - } else if (!this.isWhiteListed(gameprofile)) { - chatmessage = new TranslatableComponent("multiplayer.disconnect.not_whitelisted"); - event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, PaperAdventure.LEGACY_SECTION_UXRC.deserialize(org.spigotmc.SpigotConfig.whitelistMessage)); // Spigot // Paper - Adventure diff --git a/patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch index 34ea6c0ada..91ac7038ed 100644 --- a/patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch +++ b/patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch @@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class PlayerList { } - Player respawnPlayer = this.cserver.getPlayer(entityplayer1); + Player respawnPlayer = entityplayer1.getBukkitEntity(); - PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn); // Paper - Fix anchor respawn acting as a bed respawn from the end portal + PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn, com.google.common.collect.ImmutableSet.builder().add(respawnFlags)); // Paper - Fix anchor respawn acting as a bed respawn from the end portal this.cserver.getPluginManager().callEvent(respawnEvent); diff --git a/patches/server/add-get-set-drop-chance-to-EntityEquipment.patch b/patches/server/add-get-set-drop-chance-to-EntityEquipment.patch index a3b38854b9..e6265936a2 100644 --- a/patches/server/add-get-set-drop-chance-to-EntityEquipment.patch +++ b/patches/server/add-get-set-drop-chance-to-EntityEquipment.patch @@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end private void setDropChance(net.minecraft.world.entity.EquipmentSlot slot, float chance) { - if (slot == net.minecraft.world.entity.EquipmentSlot.MAINHAND || slot == net.minecraft.world.entity.EquipmentSlot.OFFHAND) { + Preconditions.checkArgument(this.entity.getHandle() instanceof Mob, "Cannot set drop chance for non-Mob entity"); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java diff --git a/work/Bukkit b/work/Bukkit index 2dbec58427..70d24eb89a 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 2dbec584278268fc46bfb5520fd18bde18d33308 +Subproject commit 70d24eb89a9eb677f3bb53907d4a0b05e55fafeb diff --git a/work/CraftBukkit b/work/CraftBukkit index 68d403188a..470050ad1e 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 68d403188aacb73c8c9d64c16e9d72e6514b0bac +Subproject commit 470050ad1e8944e0fcd8c966043705c2b006c3a8 diff --git a/work/Spigot b/work/Spigot index 101ebb63b2..f773da845c 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 101ebb63b2531abf0ac868af41d57322d05931fa +Subproject commit f773da845ca2da21064a4025b6ad12178da0ed7c