mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-09-18 21:45:12 +00:00
Add PrepareAnvilEvent.
This commit is contained in:
parent
a5be7e19c2
commit
530d175f2b
1 changed files with 47 additions and 0 deletions
|
@ -0,0 +1,47 @@
|
|||
package org.bukkit.event.inventory;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.inventory.AnvilInventory;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
* Called when an item is put in a slot for repair by an anvil.
|
||||
*/
|
||||
public class PrepareAnvilEvent extends InventoryEvent {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private ItemStack result;
|
||||
|
||||
public PrepareAnvilEvent(InventoryView inventory, ItemStack result) {
|
||||
super(inventory);
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnvilInventory getInventory() {
|
||||
return (AnvilInventory) super.getInventory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get result item, may be null.
|
||||
*
|
||||
* @return result item
|
||||
*/
|
||||
public ItemStack getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ItemStack result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue