mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-05 16:49:39 +00:00
Replaced TrialSpawnerDispenseLootEvent and VaultDispenseLootEvent in favour of more abstract BlockDispenseLootEvent
This commit is contained in:
parent
c06178ff92
commit
3d62c6bb95
2 changed files with 0 additions and 142 deletions
|
@ -1,64 +0,0 @@
|
||||||
package org.bukkit.event.block;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.event.Cancellable;
|
|
||||||
import org.bukkit.event.HandlerList;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when a {@link org.bukkit.block.data.type.TrialSpawner} ejects its reward loot.
|
|
||||||
* <br>
|
|
||||||
* Not to be confused with {@link org.bukkit.event.block.VaultDispenseLootEvent}.
|
|
||||||
*/
|
|
||||||
public class TrialSpawnerDispenseLootEvent extends BlockEvent implements Cancellable {
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
|
||||||
private boolean cancelled;
|
|
||||||
private List<ItemStack> itemRewards;
|
|
||||||
|
|
||||||
public TrialSpawnerDispenseLootEvent(@NotNull Block theBlock, @NotNull List<ItemStack> itemRewards) {
|
|
||||||
super(theBlock);
|
|
||||||
this.itemRewards = itemRewards;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the loot that will be dispensed.
|
|
||||||
* @return the loot that will be dispensed
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
public List<ItemStack> getItemRewards() {
|
|
||||||
return itemRewards;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the loot that will be dispensed.
|
|
||||||
* @param itemRewards new loot to dispense
|
|
||||||
*/
|
|
||||||
public void setItemRewards(@Nullable List<ItemStack> itemRewards) {
|
|
||||||
this.itemRewards = itemRewards == null ? new ArrayList<>() : itemRewards;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCancelled() {
|
|
||||||
return cancelled;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setCancelled(boolean cancelled) {
|
|
||||||
this.cancelled = cancelled;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
public HandlerList getHandlers() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,78 +0,0 @@
|
||||||
package org.bukkit.event.block;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.Cancellable;
|
|
||||||
import org.bukkit.event.HandlerList;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when a vault in a trial chamber dispenses its loot.
|
|
||||||
* Not to be confused with {@link TrialSpawnerDispenseLootEvent}.
|
|
||||||
*/
|
|
||||||
public class VaultDispenseLootEvent extends BlockEvent implements Cancellable {
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
|
||||||
private final Player player;
|
|
||||||
private boolean cancelled;
|
|
||||||
private List<ItemStack> dispensedLoot;
|
|
||||||
|
|
||||||
public VaultDispenseLootEvent(@NotNull Player player, @NotNull Block theBlock, @NotNull List<ItemStack> dispensedLoot) {
|
|
||||||
super(theBlock);
|
|
||||||
this.player = player;
|
|
||||||
this.block = theBlock;
|
|
||||||
this.dispensedLoot = dispensedLoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the player who unlocked the vault.
|
|
||||||
*
|
|
||||||
* @return the player who unlocked the vault
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
public Player getPlayer() {
|
|
||||||
return player;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the loot that will be dispensed.
|
|
||||||
*
|
|
||||||
* @return the loot that will be dispensed
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
public List<ItemStack> getDispensedLoot() {
|
|
||||||
return dispensedLoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the loot that will be dispensed.
|
|
||||||
* @param dispensedLoot new loot to dispense
|
|
||||||
*/
|
|
||||||
public void setDispensedLoot(@Nullable List<ItemStack> dispensedLoot) {
|
|
||||||
this.dispensedLoot = dispensedLoot == null ? new ArrayList<>() : dispensedLoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCancelled() {
|
|
||||||
return cancelled;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setCancelled(boolean cancelled) {
|
|
||||||
this.cancelled = cancelled;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
public HandlerList getHandlers() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue