Java 类net.minecraft.server.InventoryCrafting 实例源码

项目:CraftBukkit    文件:CraftInventory.java   
public InventoryType getType() {
    // Thanks to Droppers extending Dispensers, order is important.
    if (inventory instanceof InventoryCrafting) {
        return inventory.getSize() >= 9 ? InventoryType.WORKBENCH : InventoryType.CRAFTING;
    } else if (inventory instanceof PlayerInventory) {
        return InventoryType.PLAYER;
    } else if (inventory instanceof TileEntityDropper) {
        return InventoryType.DROPPER;
    } else if (inventory instanceof TileEntityDispenser) {
        return InventoryType.DISPENSER;
    } else if (inventory instanceof TileEntityFurnace) {
        return InventoryType.FURNACE;
    } else if (inventory instanceof ContainerEnchantTableInventory) {
        return InventoryType.ENCHANTING;
    } else if (inventory instanceof TileEntityBrewingStand) {
        return InventoryType.BREWING;
    } else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) {
        return ((CraftInventoryCustom.MinecraftInventory) inventory).getType();
    } else if (inventory instanceof InventoryEnderChest) {
        return InventoryType.ENDER_CHEST;
    } else if (inventory instanceof InventoryMerchant) {
        return InventoryType.MERCHANT;
    } else if (inventory instanceof TileEntityBeacon) {
        return InventoryType.BEACON;
    } else if (inventory instanceof ContainerAnvilInventory) {
        return InventoryType.ANVIL;
    } else if (inventory instanceof IHopper) {
        return InventoryType.HOPPER;
    } else {
        return InventoryType.CHEST;
    }
}
项目:CraftBukkit    文件:CraftEventFactory.java   
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);
}
项目:Craftbukkit    文件:CraftInventory.java   
public InventoryType getType() {
    // Thanks to Droppers extending Dispensers, order is important.
    if (inventory instanceof InventoryCrafting) {
        return inventory.getSize() >= 9 ? InventoryType.WORKBENCH : InventoryType.CRAFTING;
    } else if (inventory instanceof PlayerInventory) {
        return InventoryType.PLAYER;
    } else if (inventory instanceof TileEntityDropper) {
        return InventoryType.DROPPER;
    } else if (inventory instanceof TileEntityDispenser) {
        return InventoryType.DISPENSER;
    } else if (inventory instanceof TileEntityFurnace) {
        return InventoryType.FURNACE;
    } else if (this instanceof CraftInventoryEnchanting) {
       return InventoryType.ENCHANTING;
    } else if (inventory instanceof TileEntityBrewingStand) {
        return InventoryType.BREWING;
    } else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) {
        return ((CraftInventoryCustom.MinecraftInventory) inventory).getType();
    } else if (inventory instanceof InventoryEnderChest) {
        return InventoryType.ENDER_CHEST;
    } else if (inventory instanceof InventoryMerchant) {
        return InventoryType.MERCHANT;
    } else if (inventory instanceof TileEntityBeacon) {
        return InventoryType.BEACON;
    } else if (this instanceof CraftInventoryAnvil) {
       return InventoryType.ANVIL;
    } else if (inventory instanceof IHopper) {
        return InventoryType.HOPPER;
    } else {
        return InventoryType.CHEST;
    }
}
项目:Almura-Server    文件:CraftInventory.java   
public InventoryType getType() {
    // Thanks to Droppers extending Dispensers, order is important.
    if (inventory instanceof InventoryCrafting) {
        return inventory.getSize() >= 9 ? InventoryType.WORKBENCH : InventoryType.CRAFTING;
    } else if (inventory instanceof PlayerInventory) {
        return InventoryType.PLAYER;
    } else if (inventory instanceof TileEntityDropper) {
        return InventoryType.DROPPER;
    } else if (inventory instanceof TileEntityDispenser) {
        return InventoryType.DISPENSER;
    } else if (inventory instanceof TileEntityFurnace) {
        return InventoryType.FURNACE;
    } else if (inventory instanceof ContainerEnchantTableInventory) {
        return InventoryType.ENCHANTING;
    } else if (inventory instanceof TileEntityBrewingStand) {
        return InventoryType.BREWING;
    } else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) {
        return ((CraftInventoryCustom.MinecraftInventory) inventory).getType();
    } else if (inventory instanceof InventoryEnderChest) {
        return InventoryType.ENDER_CHEST;
    } else if (inventory instanceof InventoryMerchant) {
        return InventoryType.MERCHANT;
    } else if (inventory instanceof TileEntityBeacon) {
        return InventoryType.BEACON;
    } else if (inventory instanceof ContainerAnvilInventory) {
        return InventoryType.ANVIL;
    } else if (inventory instanceof IHopper) {
        return InventoryType.HOPPER;
    } else {
        return InventoryType.CHEST;
    }
}
项目:Almura-Server    文件:CraftEventFactory.java   
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);
}
项目:Tweakkit-Server    文件:CraftInventory.java   
public InventoryType getType() {
    // Thanks to Droppers extending Dispensers, order is important.
    if (inventory instanceof InventoryCrafting) {
        return inventory.getSize() >= 9 ? InventoryType.WORKBENCH : InventoryType.CRAFTING;
    } else if (inventory instanceof PlayerInventory) {
        return InventoryType.PLAYER;
    } else if (inventory instanceof TileEntityDropper) {
        return InventoryType.DROPPER;
    } else if (inventory instanceof TileEntityDispenser) {
        return InventoryType.DISPENSER;
    } else if (inventory instanceof TileEntityFurnace) {
        return InventoryType.FURNACE;
    } else if (inventory instanceof ContainerEnchantTableInventory) {
        return InventoryType.ENCHANTING;
    } else if (inventory instanceof TileEntityBrewingStand) {
        return InventoryType.BREWING;
    } else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) {
        return ((CraftInventoryCustom.MinecraftInventory) inventory).getType();
    } else if (inventory instanceof InventoryEnderChest) {
        return InventoryType.ENDER_CHEST;
    } else if (inventory instanceof InventoryMerchant) {
        return InventoryType.MERCHANT;
    } else if (inventory instanceof TileEntityBeacon) {
        return InventoryType.BEACON;
    } else if (inventory instanceof ContainerAnvilInventory) {
        return InventoryType.ANVIL;
    } else if (inventory instanceof IHopper) {
        return InventoryType.HOPPER;
    } else {
        return InventoryType.CHEST;
    }
}
项目:Tweakkit-Server    文件:CraftEventFactory.java   
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);
}
项目:SpigotSource    文件:CraftInventory.java   
public InventoryType getType() {
    // Thanks to Droppers extending Dispensers, order is important.
    if (inventory instanceof InventoryCrafting) {
        return inventory.getSize() >= 9 ? InventoryType.WORKBENCH : InventoryType.CRAFTING;
    } else if (inventory instanceof PlayerInventory) {
        return InventoryType.PLAYER;
    } else if (inventory instanceof TileEntityDropper) {
        return InventoryType.DROPPER;
    } else if (inventory instanceof TileEntityDispenser) {
        return InventoryType.DISPENSER;
    } else if (inventory instanceof TileEntityFurnace) {
        return InventoryType.FURNACE;
    } else if (this instanceof CraftInventoryEnchanting) {
       return InventoryType.ENCHANTING;
    } else if (inventory instanceof TileEntityBrewingStand) {
        return InventoryType.BREWING;
    } else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) {
        return ((CraftInventoryCustom.MinecraftInventory) inventory).getType();
    } else if (inventory instanceof InventoryEnderChest) {
        return InventoryType.ENDER_CHEST;
    } else if (inventory instanceof InventoryMerchant) {
        return InventoryType.MERCHANT;
    } else if (inventory instanceof TileEntityBeacon) {
        return InventoryType.BEACON;
    } else if (this instanceof CraftInventoryAnvil) {
       return InventoryType.ANVIL;
    } else if (inventory instanceof IHopper) {
        return InventoryType.HOPPER;
    } else {
        return InventoryType.CHEST;
    }
}
项目:Craft-city    文件:CraftInventory.java   
public InventoryType getType() {
    // Thanks to Droppers extending Dispensers, order is important.
    if (inventory instanceof InventoryCrafting) {
        return inventory.getSize() >= 9 ? InventoryType.WORKBENCH : InventoryType.CRAFTING;
    } else if (inventory instanceof PlayerInventory) {
        return InventoryType.PLAYER;
    } else if (inventory instanceof TileEntityDropper) {
        return InventoryType.DROPPER;
    } else if (inventory instanceof TileEntityDispenser) {
        return InventoryType.DISPENSER;
    } else if (inventory instanceof TileEntityFurnace) {
        return InventoryType.FURNACE;
    } else if (inventory instanceof ContainerEnchantTableInventory) {
        return InventoryType.ENCHANTING;
    } else if (inventory instanceof TileEntityBrewingStand) {
        return InventoryType.BREWING;
    } else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) {
        return ((CraftInventoryCustom.MinecraftInventory) inventory).getType();
    } else if (inventory instanceof InventoryEnderChest) {
        return InventoryType.ENDER_CHEST;
    } else if (inventory instanceof InventoryMerchant) {
        return InventoryType.MERCHANT;
    } else if (inventory instanceof TileEntityBeacon) {
        return InventoryType.BEACON;
    } else if (inventory instanceof ContainerAnvilInventory) {
        return InventoryType.ANVIL;
    } else if (inventory instanceof IHopper) {
        return InventoryType.HOPPER;
    } else {
        return InventoryType.CHEST;
    }
}
项目:Craft-city    文件:CraftEventFactory.java   
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);
}
项目:CraftBukkit    文件:CraftInventoryCrafting.java   
public CraftInventoryCrafting(InventoryCrafting inventory, IInventory resultInventory) {
    super(inventory);
    this.resultInventory = resultInventory;
}
项目:CraftBukkit    文件:CraftInventoryCrafting.java   
public Recipe getRecipe() {
    IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
    return recipe == null ? null : recipe.toBukkitRecipe();
}
项目:Craftbukkit    文件:CraftInventoryCrafting.java   
public CraftInventoryCrafting(InventoryCrafting inventory, IInventory resultInventory) {
    super(inventory);
    this.resultInventory = resultInventory;
}
项目:Craftbukkit    文件:CraftInventoryCrafting.java   
public Recipe getRecipe() {
    IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
    return recipe == null ? null : recipe.toBukkitRecipe();
}
项目:Almura-Server    文件:CraftInventoryCrafting.java   
public CraftInventoryCrafting(InventoryCrafting inventory, IInventory resultInventory) {
    super(inventory);
    this.resultInventory = resultInventory;
}
项目:Almura-Server    文件:CraftInventoryCrafting.java   
public Recipe getRecipe() {
    IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
    return recipe == null ? null : recipe.toBukkitRecipe();
}
项目:Tweakkit-Server    文件:CraftInventoryCrafting.java   
public CraftInventoryCrafting(InventoryCrafting inventory, IInventory resultInventory) {
    super(inventory);
    this.resultInventory = resultInventory;
}
项目:Tweakkit-Server    文件:CraftInventoryCrafting.java   
public Recipe getRecipe() {
    IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
    return recipe == null ? null : recipe.toBukkitRecipe();
}
项目:SpigotSource    文件:CraftInventoryCrafting.java   
public CraftInventoryCrafting(InventoryCrafting inventory, IInventory resultInventory) {
    super(inventory);
    this.resultInventory = resultInventory;
}
项目:SpigotSource    文件:CraftInventoryCrafting.java   
public Recipe getRecipe() {
    IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
    return recipe == null ? null : recipe.toBukkitRecipe();
}
项目:Craft-city    文件:CraftInventoryCrafting.java   
public CraftInventoryCrafting(InventoryCrafting inventory, IInventory resultInventory) {
    super(inventory);
    this.resultInventory = resultInventory;
}
项目:Craft-city    文件:CraftInventoryCrafting.java   
public Recipe getRecipe() {
    IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
    return recipe == null ? null : recipe.toBukkitRecipe();
}