Search in sources :

Example 1 with CraftInventoryCrafting

use of org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventoryCrafting in project Mohist by MohistMC.

the class CraftEventFactory method callPreCraftEvent.

public static ItemStack callPreCraftEvent(Container matrix, Container resultInventory, ItemStack result, InventoryView lastCraftView, boolean isRepair) {
    CraftInventoryCrafting inventory = new CraftInventoryCrafting(matrix, resultInventory);
    inventory.setResult(CraftItemStack.asCraftMirror(result));
    PrepareItemCraftEvent event = new PrepareItemCraftEvent(inventory, lastCraftView, isRepair);
    Bukkit.getPluginManager().callEvent(event);
    org.bukkit.inventory.ItemStack bitem = event.getInventory().getResult();
    return CraftItemStack.asNMSCopy(bitem);
}
Also used : CraftInventoryCrafting(org.bukkit.craftbukkit.v1_18_R2.inventory.CraftInventoryCrafting) PrepareItemCraftEvent(org.bukkit.event.inventory.PrepareItemCraftEvent)

Example 2 with CraftInventoryCrafting

use of org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventoryCrafting in project Magma by magmafoundation.

the class CraftEventFactory method callPreCraftEvent.

public static ItemStack callPreCraftEvent(InventoryCrafting matrix, ItemStack result, InventoryView lastCraftView, boolean isRepair) {
    CraftInventoryCrafting inventory = new CraftInventoryCrafting(matrix, matrix.resultInventory);
    inventory.setResult(CraftItemStack.asCraftMirror(result));
    PrepareItemCraftEvent event = new PrepareItemCraftEvent(inventory, lastCraftView, isRepair);
    Bukkit.getPluginManager().callEvent(event);
    org.bukkit.inventory.ItemStack bitem = event.getInventory().getResult();
    return CraftItemStack.asNMSCopy(bitem);
}
Also used : CraftInventoryCrafting(org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventoryCrafting) PrepareItemCraftEvent(org.bukkit.event.inventory.PrepareItemCraftEvent)

Example 3 with CraftInventoryCrafting

use of org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventoryCrafting in project Magma-1.16.x by magmafoundation.

the class CraftEventFactory method callPreCraftEvent.

public static ItemStack callPreCraftEvent(IInventory matrix, IInventory resultInventory, ItemStack result, InventoryView lastCraftView, boolean isRepair) {
    CraftInventoryCrafting inventory = new CraftInventoryCrafting(matrix, resultInventory);
    inventory.setResult(CraftItemStack.asCraftMirror(result));
    PrepareItemCraftEvent event = new PrepareItemCraftEvent(inventory, lastCraftView, isRepair);
    Bukkit.getPluginManager().callEvent(event);
    org.bukkit.inventory.ItemStack bitem = event.getInventory().getResult();
    return CraftItemStack.asNMSCopy(bitem);
}
Also used : CraftInventoryCrafting(org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventoryCrafting) PrepareItemCraftEvent(org.bukkit.event.inventory.PrepareItemCraftEvent)

Example 4 with CraftInventoryCrafting

use of org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventoryCrafting in project LoliServer by Loli-Server.

the class CraftEventFactory method callPreCraftEvent.

public static ItemStack callPreCraftEvent(IInventory matrix, IInventory resultInventory, ItemStack result, InventoryView lastCraftView, boolean isRepair) {
    CraftInventoryCrafting inventory = new CraftInventoryCrafting(matrix, resultInventory);
    inventory.setResult(CraftItemStack.asCraftMirror(result));
    PrepareItemCraftEvent event = new PrepareItemCraftEvent(inventory, lastCraftView, isRepair);
    Bukkit.getPluginManager().callEvent(event);
    org.bukkit.inventory.ItemStack bitem = event.getInventory().getResult();
    return CraftItemStack.asNMSCopy(bitem);
}
Also used : CraftInventoryCrafting(org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventoryCrafting) PrepareItemCraftEvent(org.bukkit.event.inventory.PrepareItemCraftEvent)

Aggregations

PrepareItemCraftEvent (org.bukkit.event.inventory.PrepareItemCraftEvent)4 CraftInventoryCrafting (org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventoryCrafting)2 CraftInventoryCrafting (org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventoryCrafting)1 CraftInventoryCrafting (org.bukkit.craftbukkit.v1_18_R2.inventory.CraftInventoryCrafting)1