use of org.bukkit.entity.minecart.HopperMinecart in project Minigames by AddstarMC.
the class RecorderData method cartkMoveItem.
@EventHandler(ignoreCancelled = true)
private void cartkMoveItem(InventoryMoveItemEvent event) {
if (!hasRegenArea() || !minigame.hasPlayers())
return;
Location loc = null;
if (event.getInitiator().getHolder() instanceof HopperMinecart) {
loc = ((HopperMinecart) event.getInitiator().getHolder()).getLocation().clone();
if (blockInRegenArea(loc))
addEntity((Entity) event.getInitiator().getHolder(), null, false);
}
loc = null;
if (event.getDestination().getHolder() instanceof HopperMinecart) {
loc = ((HopperMinecart) event.getDestination().getHolder()).getLocation().clone();
if (blockInRegenArea(loc))
addEntity((Entity) event.getInitiator().getHolder(), null, false);
}
}
Aggregations