mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 00:42:05 +01:00
Add BlockDispenseArmorEvent
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
parent
1141cf85fe
commit
0c68176c25
1 changed files with 37 additions and 0 deletions
|
@ -0,0 +1,37 @@
|
|||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.Warning;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
/**
|
||||
* Called when an equippable item is dispensed from a block and equipped on a
|
||||
* nearby entity.
|
||||
* <p>
|
||||
* If a Block Dispense Armor event is cancelled, the equipment will not be
|
||||
* equipped on the target entity.
|
||||
*
|
||||
* @deprecated draft API
|
||||
*/
|
||||
@Deprecated
|
||||
@Warning(false)
|
||||
public class BlockDispenseArmorEvent extends BlockDispenseEvent {
|
||||
|
||||
private final LivingEntity target;
|
||||
|
||||
public BlockDispenseArmorEvent(Block block, ItemStack dispensed, LivingEntity target) {
|
||||
super(block, dispensed, new Vector(0, 0, 0));
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the living entity on which the armor was dispensed.
|
||||
*
|
||||
* @return the target entity
|
||||
*/
|
||||
public LivingEntity getTargetEntity() {
|
||||
return target;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue