geforkt von Mirrors/Paper
Added ItemDespawnEvent
By: Feildmaster <admin@feildmaster.com>
Dieser Commit ist enthalten in:
Ursprung
544b0a05ae
Commit
40f4710726
@ -600,6 +600,12 @@ public abstract class Event implements Serializable {
|
|||||||
* @see org.bukkit.event.world.TreeGrowEvent
|
* @see org.bukkit.event.world.TreeGrowEvent
|
||||||
*/
|
*/
|
||||||
STRUCTURE_GROW(Category.WORLD),
|
STRUCTURE_GROW(Category.WORLD),
|
||||||
|
/**
|
||||||
|
* Called when an item despawns from a world
|
||||||
|
*
|
||||||
|
* @see org.bukkit.event.entity.ItemDespawnEvent
|
||||||
|
*/
|
||||||
|
ITEM_DESPAWN (Category.WORLD),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ENTITY EVENTS
|
* ENTITY EVENTS
|
||||||
|
@ -162,4 +162,11 @@ public class EntityListener implements Listener {
|
|||||||
* @param event Relevant event details
|
* @param event Relevant event details
|
||||||
*/
|
*/
|
||||||
public void onSlimeSplit(SlimeSplitEvent event) {}
|
public void onSlimeSplit(SlimeSplitEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an item despawns from a world
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
|
public void onItemDespawn(ItemDespawnEvent event) {}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package org.bukkit.event.entity;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
public class ItemDespawnEvent extends EntityEvent implements Cancellable {
|
||||||
|
private boolean canceled;
|
||||||
|
private Location location;
|
||||||
|
|
||||||
|
public ItemDespawnEvent(Entity spawnee, Location loc) {
|
||||||
|
super(Type.ITEM_DESPAWN, spawnee);
|
||||||
|
location = loc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return canceled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCancelled(boolean cancel) {
|
||||||
|
canceled = cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the location at which the item is despawning.
|
||||||
|
*
|
||||||
|
* @return The location at which the item is despawning
|
||||||
|
*/
|
||||||
|
public Location getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
}
|
@ -840,6 +840,13 @@ public class JavaPluginLoader implements PluginLoader {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
case ITEM_DESPAWN:
|
||||||
|
return new EventExecutor() {
|
||||||
|
public void execute(Listener listener, Event event) {
|
||||||
|
((EntityListener) listener).onItemDespawn((ItemDespawnEvent) event);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Vehicle Events
|
// Vehicle Events
|
||||||
case VEHICLE_CREATE:
|
case VEHICLE_CREATE:
|
||||||
return new EventExecutor() {
|
return new EventExecutor() {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren