use of org.bukkit.event.player.PlayerHarvestBlockEvent in project Mohist by MohistMC.
the class CraftEventFactory method callPlayerHarvestBlockEvent.
/**
* Player Harvest Block Event
*/
public static PlayerHarvestBlockEvent callPlayerHarvestBlockEvent(Level world, BlockPos blockposition, net.minecraft.world.entity.player.Player who, List<ItemStack> itemsToHarvest) {
List<org.bukkit.inventory.ItemStack> bukkitItemsToHarvest = new ArrayList<>(itemsToHarvest.stream().map(CraftItemStack::asBukkitCopy).collect(Collectors.toList()));
Player player = (Player) who.getBukkitEntity();
PlayerHarvestBlockEvent playerHarvestBlockEvent = new PlayerHarvestBlockEvent(player, CraftBlock.at(world, blockposition), bukkitItemsToHarvest);
Bukkit.getPluginManager().callEvent(playerHarvestBlockEvent);
return playerHarvestBlockEvent;
}
use of org.bukkit.event.player.PlayerHarvestBlockEvent in project Magma-1.16.x by magmafoundation.
the class CraftEventFactory method callPlayerHarvestBlockEvent.
/**
* Player Harvest Block Event
*/
public static PlayerHarvestBlockEvent callPlayerHarvestBlockEvent(World world, BlockPos blockposition, PlayerEntity who, List<ItemStack> itemsToHarvest) {
List<org.bukkit.inventory.ItemStack> bukkitItemsToHarvest = new ArrayList<>(itemsToHarvest.stream().map(CraftItemStack::asBukkitCopy).collect(Collectors.toList()));
Player player = (Player) who.getBukkitEntity();
PlayerHarvestBlockEvent playerHarvestBlockEvent = new PlayerHarvestBlockEvent(player, CraftBlock.at(world, blockposition), bukkitItemsToHarvest);
Bukkit.getPluginManager().callEvent(playerHarvestBlockEvent);
return playerHarvestBlockEvent;
}
use of org.bukkit.event.player.PlayerHarvestBlockEvent in project LoliServer by Loli-Server.
the class CraftEventFactory method callPlayerHarvestBlockEvent.
/**
* Player Harvest Block Event
*/
public static PlayerHarvestBlockEvent callPlayerHarvestBlockEvent(World world, BlockPos blockPos, PlayerEntity who, List<ItemStack> itemsToHarvest) {
List<org.bukkit.inventory.ItemStack> bukkitItemsToHarvest = new ArrayList<>(itemsToHarvest.stream().map(CraftItemStack::asBukkitCopy).collect(Collectors.toList()));
Player player = (Player) who.getBukkitEntity();
PlayerHarvestBlockEvent playerHarvestBlockEvent = new PlayerHarvestBlockEvent(player, CraftBlock.at(world, blockPos), bukkitItemsToHarvest);
Bukkit.getPluginManager().callEvent(playerHarvestBlockEvent);
return playerHarvestBlockEvent;
}
Aggregations