Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 35 lines 769 B view raw
1package org.bukkit.event.player; 2 3import org.bukkit.entity.Player; 4 5/** 6 * Fired when a player changes their currently held item 7 */ 8public class PlayerItemHeldEvent extends PlayerEvent { 9 private int previous; 10 private int current; 11 12 public PlayerItemHeldEvent(final Player player, final int previous, final int current) { 13 super(Type.PLAYER_ITEM_HELD, player); 14 this.previous = previous; 15 this.current = current; 16 } 17 18 /** 19 * Gets the previous held slot index 20 * 21 * @return Previous slot index 22 */ 23 public int getPreviousSlot() { 24 return previous; 25 } 26 27 /** 28 * Gets the new held slot index 29 * 30 * @return New slot index 31 */ 32 public int getNewSlot() { 33 return current; 34 } 35}