Update to Minecraft 1.16.4

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2020-11-03 07:00:00 +11:00
parent 964cc7554a
commit 6450eb0ab7
34 changed files with 374 additions and 330 deletions

View File

@@ -1279,9 +1279,7 @@ public class CraftEventFactory {
human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity());
}
public static ItemStack handleEditBookEvent(EntityPlayer player, EnumItemSlot slot, ItemStack itemInHand, ItemStack newBookItem) {
int itemInHandIndex = (slot == EnumItemSlot.MAINHAND) ? player.inventory.itemInHandIndex : -1;
public static ItemStack handleEditBookEvent(EntityPlayer player, int itemInHandIndex, ItemStack itemInHand, ItemStack newBookItem) {
PlayerEditBookEvent editBookEvent = new PlayerEditBookEvent(player.getBukkitEntity(), itemInHandIndex, (BookMeta) CraftItemStack.getItemMeta(itemInHand), (BookMeta) CraftItemStack.getItemMeta(newBookItem), newBookItem.getItem() == Items.WRITTEN_BOOK);
player.world.getServer().getPluginManager().callEvent(editBookEvent);