1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-11 01:59:14 +01:00

Cleaning up PlayerDropItemEvent

By: James Logsdon <dwarf@girsbrain.org>
This commit is contained in:
Bukkit/Spigot 2011-02-11 16:49:47 -05:00
parent 33c6be20bd
commit 7bbba13655

View file

@ -1,9 +1,9 @@
package org.bukkit.event.player;
import org.bukkit.entity.ItemDrop;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
/**
* Thrown when a player drops an item from their inventory
@ -12,8 +12,8 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
private final ItemDrop drop;
private boolean cancel = false;
public PlayerDropItemEvent(final Type type, final Player player, final ItemDrop drop) {
super(type, player);
public PlayerDropItemEvent(final Player player, final ItemDrop drop) {
super(Event.Type.PLAYER_DROP_ITEM, player);
this.drop = drop;
}
@ -30,6 +30,10 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
* Gets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*
* If an item drop event is cancelled, the item will not be dropped and it
* will be added back to the players inventory.
* This will not fire an event.
*
* @return true if this event is cancelled
*/
public boolean isCancelled() {
@ -40,6 +44,10 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
* Sets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*
* If an item drop event is cancelled, the item will not be dropped and it
* will be added back to the players inventory.
* This will not fire an event.
*
* @param cancel true if you wish to cancel this event
*/
public void setCancelled(boolean cancel) {