Reverting the Drop API for now, we need to re-evalute this as it is causing too many issues and blocking releases.
This reverts commit 2d17b0c24e2de982c09ad6050a95db0fac70c3ad.
This commit is contained in:
parent
7f5c03101e
commit
f520069aa6
@ -1,12 +1,9 @@
|
|||||||
package org.bukkit.event.block;
|
package org.bukkit.event.block;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a block is broken by a player.
|
* Called when a block is broken by a player.
|
||||||
@ -22,13 +19,11 @@ public class BlockBreakEvent extends BlockEvent implements Cancellable {
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private final Player player;
|
private final Player player;
|
||||||
private boolean cancel;
|
private boolean cancel;
|
||||||
private List<ItemStack> drops;
|
|
||||||
|
|
||||||
public BlockBreakEvent(final Block theBlock, final Player player, List<ItemStack> drops) {
|
public BlockBreakEvent(final Block theBlock, final Player player) {
|
||||||
super(theBlock);
|
super(theBlock);
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.cancel = false;
|
this.cancel = false;
|
||||||
this.drops = drops;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,16 +35,6 @@ public class BlockBreakEvent extends BlockEvent implements Cancellable {
|
|||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a list of items that should drop from this block. Modifying this list will modify the items drop.
|
|
||||||
* If the block is a container, the contents of the container will not be included in this list. You can
|
|
||||||
* get the contents of the container by casting the block's state.
|
|
||||||
* @return A list of drops
|
|
||||||
*/
|
|
||||||
public List<ItemStack> getDrops() {
|
|
||||||
return drops;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancel;
|
return cancel;
|
||||||
}
|
}
|
||||||
|
@ -53,8 +53,7 @@ public class EntityDeathEvent extends EntityEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all the items which will drop when the entity dies. Modifying this list will
|
* Gets all the items which will drop when the entity dies
|
||||||
* modify what's actually dropped.
|
|
||||||
*
|
*
|
||||||
* @return Items to drop when the entity dies
|
* @return Items to drop when the entity dies
|
||||||
*/
|
*/
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package org.bukkit.event.painting;
|
package org.bukkit.event.painting;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Painting;
|
import org.bukkit.entity.Painting;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered when a painting is removed by an entity
|
* Triggered when a painting is removed by an entity
|
||||||
@ -12,8 +9,8 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
|
public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
|
||||||
private final Entity remover;
|
private final Entity remover;
|
||||||
|
|
||||||
public PaintingBreakByEntityEvent(final Painting painting, final Entity remover, List<ItemStack> drops) {
|
public PaintingBreakByEntityEvent(final Painting painting, final Entity remover) {
|
||||||
super(painting, RemoveCause.ENTITY, drops);
|
super(painting, RemoveCause.ENTITY);
|
||||||
this.remover = remover;
|
this.remover = remover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
package org.bukkit.event.painting;
|
package org.bukkit.event.painting;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Painting;
|
import org.bukkit.entity.Painting;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered when a painting is removed
|
* Triggered when a painting is removed
|
||||||
@ -14,12 +11,10 @@ public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private final RemoveCause cause;
|
private final RemoveCause cause;
|
||||||
private List<ItemStack> drops;
|
|
||||||
|
|
||||||
public PaintingBreakEvent(final Painting painting, final RemoveCause cause, List<ItemStack> drops) {
|
public PaintingBreakEvent(final Painting painting, final RemoveCause cause) {
|
||||||
super(painting);
|
super(painting);
|
||||||
this.cause = cause;
|
this.cause = cause;
|
||||||
this.drops = drops;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,14 +34,6 @@ public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
|
|||||||
this.cancelled = cancel;
|
this.cancelled = cancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the list of items to be dropped. Modifying this list will modify what's actually dropped.
|
|
||||||
* @return A list of drops
|
|
||||||
*/
|
|
||||||
public List<ItemStack> getDrops() {
|
|
||||||
return drops;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enum to specify the cause of the removal
|
* An enum to specify the cause of the removal
|
||||||
*/
|
*/
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
package org.bukkit.event.player;
|
package org.bukkit.event.player;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a player shears an entity
|
* Called when a player shears an entity
|
||||||
@ -15,13 +12,11 @@ public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable {
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private boolean cancel;
|
private boolean cancel;
|
||||||
private final Entity what;
|
private final Entity what;
|
||||||
private final List<ItemStack> items;
|
|
||||||
|
|
||||||
public PlayerShearEntityEvent(final Player who, final Entity what, final List<ItemStack> drops) {
|
public PlayerShearEntityEvent(final Player who, final Entity what) {
|
||||||
super(who);
|
super(who);
|
||||||
this.cancel = false;
|
this.cancel = false;
|
||||||
this.what = what;
|
this.what = what;
|
||||||
this.items = drops;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
@ -41,15 +36,6 @@ public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable {
|
|||||||
return what;
|
return what;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the items that will drop as a result of the shearing. To change the
|
|
||||||
* items dropped, change the contents of this list.
|
|
||||||
* @return The list of items.
|
|
||||||
*/
|
|
||||||
public List<ItemStack> getDrops() {
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
package org.bukkit.event.vehicle;
|
package org.bukkit.event.vehicle;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Vehicle;
|
import org.bukkit.entity.Vehicle;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raised when a vehicle is destroyed, which could be caused by either a player
|
* Raised when a vehicle is destroyed, which could be caused by either a player
|
||||||
@ -17,12 +14,10 @@ public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private final Entity attacker;
|
private final Entity attacker;
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private List<ItemStack> drops;
|
|
||||||
|
|
||||||
public VehicleDestroyEvent(final Vehicle vehicle, final Entity attacker, List<ItemStack> drops) {
|
public VehicleDestroyEvent(final Vehicle vehicle, final Entity attacker) {
|
||||||
super(vehicle);
|
super(vehicle);
|
||||||
this.attacker = attacker;
|
this.attacker = attacker;
|
||||||
this.drops = drops;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,14 +45,4 @@ public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
|
|||||||
public static HandlerList getHandlerList() {
|
public static HandlerList getHandlerList() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a list of drops that this vehicle should drop when broken. Changes to this list will
|
|
||||||
* affect what is actually dropped. This list does not include the contents of the inventory
|
|
||||||
* if this is a storage minecart; if that's needed, it can be fetched by casting.
|
|
||||||
* @return A list of drops
|
|
||||||
*/
|
|
||||||
public List<ItemStack> getDrops() {
|
|
||||||
return drops;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user