geforkt von Mirrors/Paper
SPIGOT-5950: Add PrepareSmithingEvent event
By: jameslfc19 <jameslfc19@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
4e44fa11b3
Commit
0fac9ae437
@ -0,0 +1,53 @@
|
||||
package org.bukkit.event.inventory;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.SmithingInventory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Called when an item is put in a slot for upgrade by a Smithing Table.
|
||||
*/
|
||||
public class PrepareSmithingEvent extends InventoryEvent {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private ItemStack result;
|
||||
|
||||
public PrepareSmithingEvent(@NotNull InventoryView inventory, @Nullable ItemStack result) {
|
||||
super(inventory);
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SmithingInventory getInventory() {
|
||||
return (SmithingInventory) super.getInventory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get result item, may be null.
|
||||
*
|
||||
* @return result item
|
||||
*/
|
||||
@Nullable
|
||||
public ItemStack getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(@Nullable ItemStack result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren