mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-21 05:44:33 +00:00
SPIGOT-6411: The PlayerEditBookEvent is not called when the player edits a book in the off-hand.
This commit is contained in:
parent
be0e945812
commit
721c4966be
1 changed files with 1 additions and 1 deletions
|
@ -1273,7 +1273,7 @@ public class CraftEventFactory {
|
|||
}
|
||||
|
||||
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);
|
||||
PlayerEditBookEvent editBookEvent = new PlayerEditBookEvent(player.getBukkitEntity(), (itemInHandIndex >= 0 && itemInHandIndex <= 8) ? itemInHandIndex : -1, (BookMeta) CraftItemStack.getItemMeta(itemInHand), (BookMeta) CraftItemStack.getItemMeta(newBookItem), newBookItem.getItem() == Items.WRITTEN_BOOK);
|
||||
player.world.getServer().getPluginManager().callEvent(editBookEvent);
|
||||
|
||||
// If they've got the same item in their hand, it'll need to be updated.
|
||||
|
|
Loading…
Add table
Reference in a new issue