mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
Add ItemMergeEvent
By: Morphan1 <morphanone@gmail.com>
This commit is contained in:
parent
96445e1e09
commit
00bc2e04a5
1 changed files with 50 additions and 0 deletions
|
@ -0,0 +1,50 @@
|
||||||
|
package org.bukkit.event.entity;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
public class ItemMergeEvent extends EntityEvent implements Cancellable {
|
||||||
|
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
private boolean cancelled;
|
||||||
|
private final Item target;
|
||||||
|
|
||||||
|
public ItemMergeEvent(Item item, Item target) {
|
||||||
|
super(item);
|
||||||
|
this.target = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancelled) {
|
||||||
|
this.cancelled = cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getEntity() {
|
||||||
|
return (Item) entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Item entity the main Item is being merged into.
|
||||||
|
*
|
||||||
|
* @return The Item being merged with
|
||||||
|
*/
|
||||||
|
public Item getTarget() {
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue