go to your main mod class, (the one with your init, preinit, ect) and add this right below where it says this:
public class YOURCLASS{
and add this:
@Instance("MODID")
public static YOURCLASS instance;
The instance will let you open up GUI's
And now add this into your preinit method:
NetworkRegistry.instance().registerGuiHandler(YOURCLASS.instance, new GuiHandler());
Hover your mouse over "new GuiHander()" and click "create class"
Now you have made the class, add this into your GuiHandler.java
public class GuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
switch(id)
{
case 1: return id == 1 && world.getBlockId(x, y, z) == MOD.BigCrafting.blockID ? new ContainerBigCrafting(player.inventory, world, x, y, z) : null;
}
return null;
}
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
switch(id)
{
case 1: return id == 1 && world.getBlockId(x, y, z) == MOD.BigCrafting.blockID ? new GuiBigCrafting(player.inventory, world, x, y, z) : null;
}
return null;
}
}
And with that, you will get a fair few errors... Thats because we havent made those classes yet!
Okay, lets make the block, Make a normal block:
public static final Block BigCrafting = new BiggerCraftingTable(2000).setUnlocalizedName("Craft");
Add this code in it!:
public class BiggerCraftingTable extends Block{
@SideOnly(Side.CLIENT)
private Icon workbenchIconTop;
@SideOnly(Side.CLIENT)
private Icon workbenchIconFront;
public BiggerCraftingTable(int par1)
{
super(par1, Material.wood);
}
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2)
{
return par1 == 1 ? this.workbenchIconTop : (par1 == 0 ? Block.planks.getBlockTextureFromSide(par1) : (par1 != 2 && par1 != 4 ? this.blockIcon : this.workbenchIconFront));
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon("MODID:YOURSIDETEXTURE");
this.workbenchIconTop = par1IconRegister.registerIcon("MODID:YOURTOPTEXTURE");
this.workbenchIconFront = par1IconRegister.registerIcon("MODID:YOURFRONTTEXTURE");
}
public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer player, int var6, float var7, float var8, float var9)
{
if (!player.isSneaking())
{
player.openGui(YOURMOD.instance, 1, var1, var2, var3, var4);
return true;
}
else
{
return false;
}
}
}
After that, lets make the GUI!
public class GuiBigCrafting extends GuiContainer
{
public GuiBigCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
{
super(new ContainerBigCrafting(par1InventoryPlayer, par2World, par3, par4, par5));
}
public static String GuiTexturePrefix = "MODID" + ":" + "textures/gui/";
public static ResourceLocation BigCrafting = new ResourceLocation(GuiTexturePrefix + "BigCraftingTable.png");
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
this.fontRenderer.drawString("Big Crafting Table", 40 + 5, - 10 - 10, 4210752);
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 50 + 14, this.ySize - 96 - 10 - 19, 4210752);
}
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
this.mc.getTextureManager().bindTexture(BigCrafting);
this.ySize = 231;
this.xSize = 176;
int var5 = (this.width - this.xSize) / 2;
int var6 = (this.height - this.ySize) / 2;
int var7;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
}
Now to make the container!:
public class ContainerBigCrafting extends Container
{
public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 5);
public IInventory craftResult = new InventoryCraftResult();
private World worldObj;
private int posX;
private int posY;
private int posZ;
public ContainerBigCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
{
this.worldObj = par2World;
this.posX = par3;
this.posY = par4;
this.posZ = par5;
this.addSlotToContainer(new SlotBigCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124 + 8, 35 + 1));
int var6;
int var7;
for (var6 = 0; var6 < 5; ++var6)
{
for (var7 = 0; var7 < 3; ++var7)
{
this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18 - 17));
}
}
for (var6 = 0; var6 < 3; ++var6)
{
for (var7 = 0; var7 < 9; ++var7)
{
this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 8 + var7 * 18 , 84 + var6 * 18 + 33));
}
}
for (var6 = 0; var6 < 9; ++var6)
{
this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18 , 142 + 10 + 23));
}
this.onCraftMatrixChanged(this.craftMatrix);
}
public void onCraftMatrixChanged(IInventory par1IInventory)
{
this.craftResult.setInventorySlotContents(0, CraftingBigManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
}
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{
return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != MOD.BigCrafting.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
}
public void onContainerClosed(EntityPlayer par1EntityPlayer)
{
super.onContainerClosed(par1EntityPlayer);
if (!this.worldObj.isRemote)
{
for (int i = 0; i < 15; ++i)
{
ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);
if (itemstack != null)
{
par1EntityPlayer.dropPlayerItem(itemstack);
}
}
}
}
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
{
ItemStack var3 = null;
Slot var4 = (Slot)this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 == 0)
{
if (!this.mergeItemStack(var5, 10, 46, true))
{
return null;
}
var4.onSlotChange(var5, var3);
}
else if (par2 >= 10 && par2 < 37)
{
if (!this.mergeItemStack(var5, 37, 46, false))
{
return null;
}
}
else if (par2 >= 37 && par2 < 46)
{
if (!this.mergeItemStack(var5, 10, 37, false))
{
return null;
}
}
else if (!this.mergeItemStack(var5, 10, 46, false))
{
return null;
}
if (var5.stackSize == 0)
{
var4.putStack((ItemStack)null);
}
else
{
var4.onSlotChanged();
}
if (var5.stackSize == var3.stackSize)
{
return null;
}
var4.onPickupFromSlot(par1EntityPlayer, var5);
}
return var3;
}
public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot)
{
return par2Slot.inventory != this.craftResult && super.func_94530_a(par1ItemStack, par2Slot);
}
}
Slot:
package com.MixedCraft.gui.slot;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import cpw.mods.fml.common.registry.GameRegistry;
public class SlotBigCrafting extends Slot
{
private final IInventory craftMatrix;
private EntityPlayer thePlayer;
private int amountCrafted;
public SlotBigCrafting(EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6)
{
super(par3IInventory, par4, par5, par6);
this.thePlayer = par1EntityPlayer;
this.craftMatrix = par2IInventory;
}
public boolean isItemValid(ItemStack par1ItemStack)
{
return false;
}
public ItemStack decrStackSize(int par1)
{
if (this.getHasStack())
{
this.amountCrafted += Math.min(par1, this.getStack().stackSize);
}
return super.decrStackSize(par1);
}
protected void onCrafting(ItemStack par1ItemStack, int par2)
{
this.amountCrafted += par2;
this.onCrafting(par1ItemStack);
}
public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack)
{
GameRegistry.onItemCrafted(par1EntityPlayer, par2ItemStack, craftMatrix);
this.onCrafting(par2ItemStack);
for (int var3 = 0; var3 < this.craftMatrix.getSizeInventory(); ++var3)
{
ItemStack var4 = this.craftMatrix.getStackInSlot(var3);
if (var4 != null)
{
this.craftMatrix.decrStackSize(var3, 1);
if (var4.getItem().hasContainerItem())
{
ItemStack var5 = var4.getItem().getContainerItemStack(var4);
if (var5.isItemStackDamageable() && var5.getItemDamage() > var5.getMaxDamage())
{
MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, var5));
var5 = null;
}
if (var5 != null && (!var4.getItem().doesContainerItemLeaveCraftingGrid(var4) || !this.thePlayer.inventory.addItemStackToInventory(var5)))
{
if (this.craftMatrix.getStackInSlot(var3) == null)
{
this.craftMatrix.setInventorySlotContents(var3, var5);
}
else
{
this.thePlayer.dropPlayerItem(var5);
}
}
}
}
}
}
}
CraftingBigManager:
public class CraftingBigManager
{
private static final CraftingBigManager instance = new CraftingBigManager();
private List recipes = new ArrayList();
public static final CraftingBigManager getInstance()
{
return instance;
}
private CraftingBigManager()
{
this.addShapedRecipe(new ItemStack(Item.paper, 3), new Object[] {"###", '#', Item.reed});
this.addShapelessRecipe(new ItemStack(Item.book, 1), new Object[] {Item.paper, Item.paper, Item.paper, Item.leather});
this.addShapelessRecipe(new ItemStack(Item.writableBook, 1), new Object[] {Item.book, new ItemStack(Item.dyePowder, 1, 0), Item.feather});
this.addShapedRecipe(new ItemStack(Block.fence, 2), new Object[] {"###", "###", '#', Item.stick});
this.addShapedRecipe(new ItemStack(Block.cobblestoneWall, 6, 0), new Object[] {"###", "###", '#', Block.cobblestone});
this.addShapedRecipe(new ItemStack(Block.cobblestoneWall, 6, 1), new Object[] {"###", "###", '#', Block.cobblestoneMossy});
this.addShapedRecipe(new ItemStack(Block.netherFence, 6), new Object[] {"###", "###", '#', Block.netherBrick});
this.addShapedRecipe(new ItemStack(Block.fenceGate, 1), new Object[] {"#W#", "#W#", '#', Item.stick, 'W', Block.planks});
this.addShapedRecipe(new ItemStack(Block.jukebox, 1), new Object[] {"###", "#X#", "###", '#', Block.planks, 'X', Item.diamond});
this.addShapedRecipe(new ItemStack(Item.leash, 2), new Object[] {"~~ ", "~O ", " ~", '~', Item.silk, 'O', Item.slimeBall});
this.addShapedRecipe(new ItemStack(Block.music, 1), new Object[] {"###", "#X#", "###", '#', Block.planks, 'X', Item.redstone});
this.addShapedRecipe(new ItemStack(Block.bookShelf, 1), new Object[] {"###", "XXX", "###", '#', Block.planks, 'X', Item.book});
this.addShapedRecipe(new ItemStack(Block.blockSnow, 1), new Object[] {"##", "##", '#', Item.snowball});
this.addShapedRecipe(new ItemStack(Block.snow, 6), new Object[] {"###", '#', Block.blockSnow});
this.addShapedRecipe(new ItemStack(Block.blockClay, 1), new Object[] {"##", "##", '#', Item.clay});
this.addShapedRecipe(new ItemStack(Block.brick, 1), new Object[] {"##", "##", '#', Item.brick});
this.addShapedRecipe(new ItemStack(Block.glowStone, 1), new Object[] {"##", "##", '#', Item.glowstone});
this.addShapedRecipe(new ItemStack(Block.blockNetherQuartz, 1), new Object[] {"##", "##", '#', Item.netherQuartz});
this.addShapedRecipe(new ItemStack(Block.cloth, 1), new Object[] {"##", "##", '#', Item.silk});
this.addShapedRecipe(new ItemStack(Block.tnt, 1), new Object[] {"X#X", "#X#", "X#X", 'X', Item.gunpowder, '#', Block.sand});
this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 3), new Object[] {"###", '#', Block.cobblestone});
this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 0), new Object[] {"###", '#', Block.stone});
this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 1), new Object[] {"###", '#', Block.sandStone});
this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 4), new Object[] {"###", '#', Block.brick});
this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 5), new Object[] {"###", '#', Block.stoneBrick});
this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 6), new Object[] {"###", '#', Block.netherBrick});
this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 7), new Object[] {"###", '#', Block.blockNetherQuartz});
this.addShapedRecipe(new ItemStack(Block.woodSingleSlab, 6, 0), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 0)});
this.addShapedRecipe(new ItemStack(Block.woodSingleSlab, 6, 2), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 2)});
this.addShapedRecipe(new ItemStack(Block.woodSingleSlab, 6, 1), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 1)});
this.addShapedRecipe(new ItemStack(Block.woodSingleSlab, 6, 3), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 3)});
this.addShapedRecipe(new ItemStack(Block.ladder, 3), new Object[] {"# #", "###", "# #", '#', Item.stick});
this.addShapedRecipe(new ItemStack(Item.doorWood, 1), new Object[] {"##", "##", "##", '#', Block.planks});
this.addShapedRecipe(new ItemStack(Block.trapdoor, 2), new Object[] {"###", "###", '#', Block.planks});
this.addShapedRecipe(new ItemStack(Item.doorIron, 1), new Object[] {"##", "##", "##", '#', Item.ingotIron});
this.addShapedRecipe(new ItemStack(Item.sign, 3), new Object[] {"###", "###", " X ", '#', Block.planks, 'X', Item.stick});
this.addShapedRecipe(new ItemStack(Item.cake, 1), new Object[] {"AAA", "BEB", "CCC", 'A', Item.bucketMilk, 'B', Item.sugar, 'C', Item.wheat, 'E', Item.egg});
this.addShapedRecipe(new ItemStack(Item.sugar, 1), new Object[] {"#", '#', Item.reed});
this.addShapedRecipe(new ItemStack(Block.planks, 4, 0), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 0)});
this.addShapedRecipe(new ItemStack(Block.planks, 4, 1), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 1)});
this.addShapedRecipe(new ItemStack(Block.planks, 4, 2), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 2)});
this.addShapedRecipe(new ItemStack(Block.planks, 4, 3), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 3)});
this.addShapedRecipe(new ItemStack(Item.stick, 4), new Object[] {"#", "#", '#', Block.planks});
this.addShapedRecipe(new ItemStack(Block.torchWood, 4), new Object[] {"X", "#", 'X', Item.coal, '#', Item.stick});
this.addShapedRecipe(new ItemStack(Block.torchWood, 4), new Object[] {"X", "#", 'X', new ItemStack(Item.coal, 1, 1), '#', Item.stick});
this.addShapedRecipe(new ItemStack(Item.bowlEmpty, 4), new Object[] {"# #", " # ", '#', Block.planks});
this.addShapedRecipe(new ItemStack(Item.glassBottle, 3), new Object[] {"# #", " # ", '#', Block.glass});
this.addShapedRecipe(new ItemStack(Block.rail, 16), new Object[] {"X X", "X#X", "X X", 'X', Item.ingotIron, '#', Item.stick});
this.addShapedRecipe(new ItemStack(Block.railPowered, 6), new Object[] {"X X", "X#X", "XRX", 'X', Item.ingotGold, 'R', Item.redstone, '#', Item.stick});
this.addShapedRecipe(new ItemStack(Block.railActivator, 6), new Object[] {"XSX", "X#X", "XSX", 'X', Item.ingotIron, '#', Block.torchRedstoneActive, 'S', Item.stick});
this.addShapedRecipe(new ItemStack(Block.railDetector, 6), new Object[] {"X X", "X#X", "XRX", 'X', Item.ingotIron, 'R', Item.redstone, '#', Block.pressurePlateStone});
this.addShapedRecipe(new ItemStack(Item.minecartEmpty, 1), new Object[] {"# #", "###", '#', Item.ingotIron});
this.addShapedRecipe(new ItemStack(Item.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Item.ingotIron});
this.addShapedRecipe(new ItemStack(Item.brewingStand, 1), new Object[] {" B ", "###", '#', Block.cobblestone, 'B', Item.blazeRod});
this.addShapedRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[] {"A", "B", 'A', Block.pumpkin, 'B', Block.torchWood});
this.addShapedRecipe(new ItemStack(Item.minecartCrate, 1), new Object[] {"A", "B", 'A', Block.chest, 'B', Item.minecartEmpty});
this.addShapedRecipe(new ItemStack(Item.minecartPowered, 1), new Object[] {"A", "B", 'A', Block.furnaceIdle, 'B', Item.minecartEmpty});
this.addShapedRecipe(new ItemStack(Item.minecartTnt, 1), new Object[] {"A", "B", 'A', Block.tnt, 'B', Item.minecartEmpty});
this.addShapedRecipe(new ItemStack(Item.minecartHopper, 1), new Object[] {"A", "B", 'A', Block.hopperBlock, 'B', Item.minecartEmpty});
this.addShapedRecipe(new ItemStack(Item.boat, 1), new Object[] {"# #", "###", '#', Block.planks});
this.addShapedRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[] {"# #", " # ", '#', Item.ingotIron});
this.addShapedRecipe(new ItemStack(Item.flowerPot, 1), new Object[] {"# #", " # ", '#', Item.brick});
this.addShapedRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[] {"A ", " B", 'A', Item.ingotIron, 'B', Item.flint});
this.addShapedRecipe(new ItemStack(Item.bread, 1), new Object[] {"###", '#', Item.wheat});
this.addShapedRecipe(new ItemStack(Block.stairsWoodOak, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 0)});
this.addShapedRecipe(new ItemStack(Block.stairsWoodBirch, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 2)});
this.addShapedRecipe(new ItemStack(Block.stairsWoodSpruce, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 1)});
this.addShapedRecipe(new ItemStack(Block.stairsWoodJungle, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 3)});
this.addShapedRecipe(new ItemStack(Item.fishingRod, 1), new Object[] {" #", " #X", "# X", '#', Item.stick, 'X', Item.silk});
this.addShapedRecipe(new ItemStack(Item.carrotOnAStick, 1), new Object[] {"# ", " X", '#', Item.fishingRod, 'X', Item.carrot}).func_92100_c();
this.addShapedRecipe(new ItemStack(Block.stairsCobblestone, 4), new Object[] {"# ", "## ", "###", '#', Block.cobblestone});
this.addShapedRecipe(new ItemStack(Block.stairsBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.brick});
this.addShapedRecipe(new ItemStack(Block.stairsStoneBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.stoneBrick});
this.addShapedRecipe(new ItemStack(Block.stairsNetherBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.netherBrick});
this.addShapedRecipe(new ItemStack(Block.stairsSandStone, 4), new Object[] {"# ", "## ", "###", '#', Block.sandStone});
this.addShapedRecipe(new ItemStack(Block.stairsNetherQuartz, 4), new Object[] {"# ", "## ", "###", '#', Block.blockNetherQuartz});
this.addShapedRecipe(new ItemStack(Item.painting, 1), new Object[] {"###", "#X#", "###", '#', Item.stick, 'X', Block.cloth});
this.addShapedRecipe(new ItemStack(Item.itemFrame, 1), new Object[] {"###", "#X#", "###", '#', Item.stick, 'X', Item.leather});
this.addShapedRecipe(new ItemStack(Item.appleGold, 1, 0), new Object[] {"###", "#X#", "###", '#', Item.ingotGold, 'X', Item.appleRed});
this.addShapedRecipe(new ItemStack(Item.appleGold, 1, 1), new Object[] {"###", "#X#", "###", '#', Block.blockGold, 'X', Item.appleRed});
this.addShapedRecipe(new ItemStack(Item.goldenCarrot, 1, 0), new Object[] {"###", "#X#", "###", '#', Item.goldNugget, 'X', Item.carrot});
this.addShapedRecipe(new ItemStack(Item.speckledMelon, 1), new Object[] {"###", "#X#", "###", '#', Item.goldNugget, 'X', Item.melon});
this.addShapedRecipe(new ItemStack(Block.lever, 1), new Object[] {"X", "#", '#', Block.cobblestone, 'X', Item.stick});
this.addShapedRecipe(new ItemStack(Block.tripWireSource, 2), new Object[] {"I", "S", "#", '#', Block.planks, 'S', Item.stick, 'I', Item.ingotIron});
this.addShapedRecipe(new ItemStack(Block.torchRedstoneActive, 1), new Object[] {"X", "#", '#', Item.stick, 'X', Item.redstone});
this.addShapedRecipe(new ItemStack(Item.redstoneRepeater, 1), new Object[] {"#X#", "III", '#', Block.torchRedstoneActive, 'X', Item.redstone, 'I', Block.stone});
this.addShapedRecipe(new ItemStack(Item.comparator, 1), new Object[] {" # ", "#X#", "III", '#', Block.torchRedstoneActive, 'X', Item.netherQuartz, 'I', Block.stone});
this.addShapedRecipe(new ItemStack(Item.pocketSundial, 1), new Object[] {" # ", "#X#", " # ", '#', Item.ingotGold, 'X', Item.redstone});
this.addShapedRecipe(new ItemStack(Item.compass, 1), new Object[] {" # ", "#X#", " # ", '#', Item.ingotIron, 'X', Item.redstone});
this.addShapedRecipe(new ItemStack(Item.emptyMap, 1), new Object[] {"###", "#X#", "###", '#', Item.paper, 'X', Item.compass});
this.addShapedRecipe(new ItemStack(Block.stoneButton, 1), new Object[] {"#", '#', Block.stone});
this.addShapedRecipe(new ItemStack(Block.woodenButton, 1), new Object[] {"#", '#', Block.planks});
this.addShapedRecipe(new ItemStack(Block.pressurePlateStone, 1), new Object[] {"##", '#', Block.stone});
this.addShapedRecipe(new ItemStack(Block.pressurePlatePlanks, 1), new Object[] {"##", '#', Block.planks});
this.addShapedRecipe(new ItemStack(Block.pressurePlateIron, 1), new Object[] {"##", '#', Item.ingotIron});
this.addShapedRecipe(new ItemStack(Block.pressurePlateGold, 1), new Object[] {"##", '#', Item.ingotGold});
this.addShapedRecipe(new ItemStack(Block.dispenser, 1), new Object[] {"###", "#X#", "#R#", '#', Block.cobblestone, 'X', Item.bow, 'R', Item.redstone});
this.addShapedRecipe(new ItemStack(Block.dropper, 1), new Object[] {"###", "# #", "#R#", '#', Block.cobblestone, 'R', Item.redstone});
this.addShapedRecipe(new ItemStack(Block.pistonBase, 1), new Object[] {"TTT", "#X#", "#R#", '#', Block.cobblestone, 'X', Item.ingotIron, 'R', Item.redstone, 'T', Block.planks});
this.addShapedRecipe(new ItemStack(Block.pistonStickyBase, 1), new Object[] {"S", "P", 'S', Item.slimeBall, 'P', Block.pistonBase});
this.addShapedRecipe(new ItemStack(Item.bed, 1), new Object[] {"###", "XXX", '#', Block.cloth, 'X', Block.planks});
this.addShapedRecipe(new ItemStack(Block.enchantmentTable, 1), new Object[] {" B ", "D#D", "###", '#', Block.obsidian, 'B', Item.book, 'D', Item.diamond});
this.addShapedRecipe(new ItemStack(Block.anvil, 1), new Object[] {"III", " i ", "iii", 'I', Block.blockIron, 'i', Item.ingotIron});
this.addShapelessRecipe(new ItemStack(Item.eyeOfEnder, 1), new Object[] {Item.enderPearl, Item.blazePowder});
this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[] {Item.gunpowder, Item.blazePowder, Item.coal});
this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[] {Item.gunpowder, Item.blazePowder, new ItemStack(Item.coal, 1, 1)});
this.addShapedRecipe(new ItemStack(Block.daylightSensor), new Object[] {"GGG", "QQQ", "WWW", 'G', Block.glass, 'Q', Item.netherQuartz, 'W', Block.woodSingleSlab});
this.addShapedRecipe(new ItemStack(Block.hopperBlock), new Object[] {"I I", "ICI", " I ", 'I', Item.ingotIron, 'C', Block.chest});
Collections.sort(this.recipes, new RecipeSorterBig(this));
System.out.println(this.recipes.size() + " recipes");
}
public BigShapedRecipes addShapedRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj)
{
String var3 = "";
int var4 = 0;
int var5 = 0;
int var6 = 0;
if (par2ArrayOfObj[var4] instanceof String[])
{
String[] var7 = (String[])((String[])par2ArrayOfObj[var4++]);
for (int var8 = 0; var8 < var7.length; ++var8)
{
String var9 = var7[var8];
++var6;
var5 = var9.length();
var3 = var3 + var9;
}
}
else
{
while (par2ArrayOfObj[var4] instanceof String)
{
String var11 = (String)par2ArrayOfObj[var4++];
++var6;
var5 = var11.length();
var3 = var3 + var11;
}
}
HashMap var12;
for (var12 = new HashMap(); var4 < par2ArrayOfObj.length; var4 += 2)
{
Character var13 = (Character)par2ArrayOfObj[var4];
ItemStack var14 = null;
if (par2ArrayOfObj[var4 + 1] instanceof Item)
{
var14 = new ItemStack((Item)par2ArrayOfObj[var4 + 1]);
}
else if (par2ArrayOfObj[var4 + 1] instanceof Block)
{
var14 = new ItemStack((Block)par2ArrayOfObj[var4 + 1], 1, -1);
}
else if (par2ArrayOfObj[var4 + 1] instanceof ItemStack)
{
var14 = (ItemStack)par2ArrayOfObj[var4 + 1];
}
var12.put(var13, var14);
}
ItemStack[] var15 = new ItemStack[var5 * var6];
for (int var16 = 0; var16 < var5 * var6; ++var16)
{
char var10 = var3.charAt(var16);
if (var12.containsKey(Character.valueOf(var10)))
{
var15[var16] = ((ItemStack)var12.get(Character.valueOf(var10))).copy();
}
else
{
var15[var16] = null;
}
}
BigShapedRecipes var17 = new BigShapedRecipes(var5, var6, var15, par1ItemStack);
this.recipes.add(var17);
return var17;
}
public void addShapelessRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj)
{
ArrayList var3 = new ArrayList();
Object[] var4 = par2ArrayOfObj;
int var5 = par2ArrayOfObj.length;
for (int var6 = 0; var6 < var5; ++var6)
{
Object var7 = var4[var6];
if (var7 instanceof ItemStack)
{
var3.add(((ItemStack)var7).copy());
}
else if (var7 instanceof Item)
{
var3.add(new ItemStack((Item)var7));
}
else
{
if (!(var7 instanceof Block))
{
throw new RuntimeException("Invalid shapeless recipe!");
}
var3.add(new ItemStack((Block)var7));
}
}
this.recipes.add(new BigShapelessRecipes(par1ItemStack, var3));
}
public ItemStack findMatchingRecipe(InventoryCrafting par1InventoryCrafting, World par2World)
{
int var3 = 0;
ItemStack var4 = null;
ItemStack var5 = null;
int var6;
for (var6 = 0; var6 < par1InventoryCrafting.getSizeInventory(); ++var6)
{
ItemStack var7 = par1InventoryCrafting.getStackInSlot(var6);
if (var7 != null)
{
if (var3 == 0)
{
var4 = var7;
}
if (var3 == 1)
{
var5 = var7;
}
++var3;
}
}
if (var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isRepairable())
{
Item var11 = Item.itemsList[var4.itemID];
int var13 = var11.getMaxDamage() - var4.getItemDamageForDisplay();
int var8 = var11.getMaxDamage() - var5.getItemDamageForDisplay();
int var9 = var13 + var8 + var11.getMaxDamage() * 5 / 100;
int var10 = var11.getMaxDamage() - var9;
if (var10 < 0)
{
var10 = 0;
}
return new ItemStack(var4.itemID, 1, var10);
}
else
{
for (var6 = 0; var6 < this.recipes.size(); ++var6)
{
IRecipe var12 = (IRecipe)this.recipes.get(var6);
if (var12.matches(par1InventoryCrafting, par2World))
{
return var12.getCraftingResult(par1InventoryCrafting);
}
}
return null;
}
}
public List getRecipeList()
{
return this.recipes;
}
Big Shaped/Shapeless Recipe
public class BigShapelessRecipes implements IRecipe
{
/** Is the ItemStack that you get when craft the recipe. */
private final ItemStack recipeOutput;
/** Is a List of ItemStack that composes the recipe. */
public final List recipeItems;
public BigShapelessRecipes(ItemStack par1ItemStack, List par2List)
{
this.recipeOutput = par1ItemStack;
this.recipeItems = par2List;
}
public ItemStack getRecipeOutput()
{
return this.recipeOutput;
}
/**
* Used to check if a recipe matches current crafting inventory
*/
public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World)
{
ArrayList arraylist = new ArrayList(this.recipeItems);
for (int i = 0; i < 5; ++i)
{
for (int j = 0; j < 3; ++j)
{
ItemStack itemstack = par1InventoryCrafting.getStackInRowAndColumn(j, i);
if (itemstack != null)
{
boolean flag = false;
Iterator iterator = arraylist.iterator();
while (iterator.hasNext())
{
ItemStack itemstack1 = (ItemStack)iterator.next();
if (itemstack.itemID == itemstack1.itemID && (itemstack1.getItemDamage() == 32767 || itemstack.getItemDamage() == itemstack1.getItemDamage()))
{
flag = true;
arraylist.remove(itemstack1);
break;
}
}
if (!flag)
{
return false;
}
}
}
}
return arraylist.isEmpty();
}
/**
* Returns an Item that is the result of this recipe
*/
public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting)
{
return this.recipeOutput.copy();
}
/**
* Returns the size of the recipe area
*/
public int getRecipeSize()
{
return this.recipeItems.size();
}
}
public class BigShapedRecipes implements IRecipe
{
/** How many horizontal slots this recipe is wide. */
public final int recipeWidth;
/** How many vertical slots this recipe uses. */
public final int recipeHeight;
/** Is a array of ItemStack that composes the recipe. */
public final ItemStack[] recipeItems;
/** Is the ItemStack that you get when craft the recipe. */
private ItemStack recipeOutput;
/** Is the itemID of the output item that you get when craft the recipe. */
public final int recipeOutputItemID;
private boolean field_92101_f;
public BigShapedRecipes(int par1, int par2, ItemStack[] par3ArrayOfItemStack, ItemStack par4ItemStack)
{
this.recipeOutputItemID = par4ItemStack.itemID;
this.recipeWidth = par1;
this.recipeHeight = par2;
this.recipeItems = par3ArrayOfItemStack;
this.recipeOutput = par4ItemStack;
}
public ItemStack getRecipeOutput()
{
return this.recipeOutput;
}
/**
* Used to check if a recipe matches current crafting inventory
*/
public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World)
{
for (int i = 0; i <= 3 - this.recipeWidth; ++i)
{
for (int j = 0; j <= 5 - this.recipeHeight; ++j)
{
if (this.checkMatch(par1InventoryCrafting, i, j, true))
{
return true;
}
if (this.checkMatch(par1InventoryCrafting, i, j, false))
{
return true;
}
}
}
return false;
}
/**
* Checks if the region of a crafting inventory is match for the recipe.
*/
private boolean checkMatch(InventoryCrafting par1InventoryCrafting, int par2, int par3, boolean par4)
{
for (int k = 0; k < 3; ++k)
{
for (int l = 0; l < 5; ++l)
{
int i1 = k - par2;
int j1 = l - par3;
ItemStack itemstack = null;
if (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight)
{
if (par4)
{
itemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth];
}
else
{
itemstack = this.recipeItems[i1 + j1 * this.recipeWidth];
}
}
ItemStack itemstack1 = par1InventoryCrafting.getStackInRowAndColumn(k, l);
if (itemstack1 != null || itemstack != null)
{
if (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null)
{
return false;
}
if (itemstack.itemID != itemstack1.itemID)
{
return false;
}
if (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack1.getItemDamage())
{
return false;
}
}
}
}
return true;
}
/**
* Returns an Item that is the result of this recipe
*/
public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting)
{
ItemStack itemstack = this.getRecipeOutput().copy();
if (this.field_92101_f)
{
for (int i = 0; i < par1InventoryCrafting.getSizeInventory(); ++i)
{
ItemStack itemstack1 = par1InventoryCrafting.getStackInSlot(i);
if (itemstack1 != null && itemstack1.hasTagCompound())
{
itemstack.setTagCompound((NBTTagCompound)itemstack1.stackTagCompound.copy());
}
}
}
return itemstack;
}
/**
* Returns the size of the recipe area
*/
public int getRecipeSize()
{
return this.recipeWidth * this.recipeHeight;
}
public BigShapedRecipes func_92100_c()
{
this.field_92101_f = true;
return this;
}
}
Recipe sorter:
public class RecipeSorterBig implements Comparator{
final CraftingBigManager BigCraftingManager;
RecipeSorterBig(CraftingBigManager par1BigCraftingManager)
{
this.BigCraftingManager = par1BigCraftingManager;
}
public int compareRecipes(IRecipe par1IRecipe, IRecipe par2IRecipe)
{
return par1IRecipe instanceof BigShapelessRecipes && par2IRecipe instanceof BigShapedRecipes ? 1 : (par2IRecipe instanceof BigShapelessRecipes && par1IRecipe instanceof BigShapedRecipes ? -1 : (par2IRecipe.getRecipeSize() < par1IRecipe.getRecipeSize() ? -1 : (par2IRecipe.getRecipeSize() > par1IRecipe.getRecipeSize() ? 1 : 0)));
}
public int compare(Object par1Obj, Object par2Obj)
{
return this.compareRecipes((IRecipe)par1Obj, (IRecipe)par2Obj);
}
}
And now to add a recipe: All you have to do is register it like a normal recipe! but with this code:
CraftingBigManager.getInstance().addShapedRecipe(new ItemStack(Item.bow, 1), new Object[] {" II", "I S", "I S", "I S", " II", 'I', Item.stick, 'S', Item.silk});
CraftingBigManager.getInstance().addShapelessRecipe(new ItemStack(Item.diamond, 9), new Object[] {Block.blockDiamond});
I think thats basically it Any questions? Feel free to ask!
Hey Dude can you help me here !
i have a problem when i right click the Big Crafting table its not crashing but it says this !
2013-10-21 18:40:12 [WARNING] [ForgeModLoader] A mod tried to open a gui on the server without being a NetworkMod
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
switch(id)
{
case 1: return id == 1 && world.getBlockId(x, y, z) == MOD.BigCrafting.blockID ? new ContainerBigCrafting(player.inventory, world, x, y, z) : null;
}
return null;
}
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
switch(id)
{
case 1: return id == 1 && world.getBlockId(x, y, z) == MOD.BigCrafting.blockID ? new GuiBigCrafting(player.inventory, world, x, y, z) : null;
}
return null;
}
}
can you help me how to make it 3x3 and one more slot below the 3x3
depending on your skill level, you will need to make a custom slot, or at least add an extra slot and create a custom crafting manager and most likely custom inventory classes as well....there are several mods that do this, and a few of them even have github repos to look at....
My game keeps crashing when i right click the block i think it has something to do var 15 and var 3 in the crafting handler but i'm really confused
Heres my crash error: By the way this happens when i try to right click the block
---- Minecraft Crash Report ----
// Don't do that.
java.lang.ExceptionInInitializerError
at mod.timeolord.aa.AAMContainer.onCraftMatrixChanged(AAMContainer.java:58)
at mod.timeolord.aa.AAMContainer.<init>(AAMContainer.java:53)
at mod.timeolord.aa.AAMGui.<init>(AAMGui.java:14)
at mod.timeolord.aa.GuiHandler.getClientGuiElement(GuiHandler.java:24)
at cpw.mods.fml.common.network.NetworkRegistry.openLocalGui(NetworkRegistry.java:328)
at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:357)
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2480)
at mod.timeolord.blocks.AtomicAssemblerMachine.onBlockActivated(AtomicAssemblerMachine.java:49)
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:371)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1390)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1868)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:910)
at net.minecraft.client.Minecraft.run(Minecraft.java:838)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 8
at java.lang.String.charAt(String.java:658)
at mod.timeolord.aa.AAMCraftingManager.addShapedRecipe(AAMCraftingManager.java:199)
at mod.timeolord.aa.AAMCraftingManager.<init>(AAMCraftingManager.java:92)
at mod.timeolord.aa.AAMCraftingManager.<clinit>(AAMCraftingManager.java:17)
... 20 more
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at mod.timeolord.aa.AAMContainer.onCraftMatrixChanged(AAMContainer.java:58)
at mod.timeolord.aa.AAMContainer.<init>(AAMContainer.java:53)
at mod.timeolord.aa.AAMGui.<init>(AAMGui.java:14)
at mod.timeolord.aa.GuiHandler.getClientGuiElement(GuiHandler.java:24)
at cpw.mods.fml.common.network.NetworkRegistry.openLocalGui(NetworkRegistry.java:328)
at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:357)
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2480)
at mod.timeolord.blocks.AtomicAssemblerMachine.onBlockActivated(AtomicAssemblerMachine.java:49)
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:371)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1390)
Now lets go to a 5x3 crafting table!
P.S, for the gui i will be using this texture:
https://www.dropbox....aftingTable.png
go to your main mod class, (the one with your init, preinit, ect) and add this right below where it says this:
public class YOURCLASS{and add this:
@Instance("MODID") public static YOURCLASS instance;The instance will let you open up GUI's
And now add this into your preinit method:
Hover your mouse over "new GuiHander()" and click "create class"
Now you have made the class, add this into your GuiHandler.java
public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { switch(id) { case 1: return id == 1 && world.getBlockId(x, y, z) == MOD.BigCrafting.blockID ? new ContainerBigCrafting(player.inventory, world, x, y, z) : null; } return null; } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { switch(id) { case 1: return id == 1 && world.getBlockId(x, y, z) == MOD.BigCrafting.blockID ? new GuiBigCrafting(player.inventory, world, x, y, z) : null; } return null; } }And with that, you will get a fair few errors... Thats because we havent made those classes yet!
Okay, lets make the block, Make a normal block:
public static final Block BigCrafting = new BiggerCraftingTable(2000).setUnlocalizedName("Craft");Add this code in it!:
public class BiggerCraftingTable extends Block{ @SideOnly(Side.CLIENT) private Icon workbenchIconTop; @SideOnly(Side.CLIENT) private Icon workbenchIconFront; public BiggerCraftingTable(int par1) { super(par1, Material.wood); } @SideOnly(Side.CLIENT) public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.workbenchIconTop : (par1 == 0 ? Block.planks.getBlockTextureFromSide(par1) : (par1 != 2 && par1 != 4 ? this.blockIcon : this.workbenchIconFront)); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("MODID:YOURSIDETEXTURE"); this.workbenchIconTop = par1IconRegister.registerIcon("MODID:YOURTOPTEXTURE"); this.workbenchIconFront = par1IconRegister.registerIcon("MODID:YOURFRONTTEXTURE"); } public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer player, int var6, float var7, float var8, float var9) { if (!player.isSneaking()) { player.openGui(YOURMOD.instance, 1, var1, var2, var3, var4); return true; } else { return false; } } }After that, lets make the GUI!
public class GuiBigCrafting extends GuiContainer { public GuiBigCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { super(new ContainerBigCrafting(par1InventoryPlayer, par2World, par3, par4, par5)); } public static String GuiTexturePrefix = "MODID" + ":" + "textures/gui/"; public static ResourceLocation BigCrafting = new ResourceLocation(GuiTexturePrefix + "BigCraftingTable.png"); protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.fontRenderer.drawString("Big Crafting Table", 40 + 5, - 10 - 10, 4210752); this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 50 + 14, this.ySize - 96 - 10 - 19, 4210752); } protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { this.mc.getTextureManager().bindTexture(BigCrafting); this.ySize = 231; this.xSize = 176; int var5 = (this.width - this.xSize) / 2; int var6 = (this.height - this.ySize) / 2; int var7; this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); }Now to make the container!:
public class ContainerBigCrafting extends Container { public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 5); public IInventory craftResult = new InventoryCraftResult(); private World worldObj; private int posX; private int posY; private int posZ; public ContainerBigCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { this.worldObj = par2World; this.posX = par3; this.posY = par4; this.posZ = par5; this.addSlotToContainer(new SlotBigCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124 + 8, 35 + 1)); int var6; int var7; for (var6 = 0; var6 < 5; ++var6) { for (var7 = 0; var7 < 3; ++var7) { this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18 - 17)); } } for (var6 = 0; var6 < 3; ++var6) { for (var7 = 0; var7 < 9; ++var7) { this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 8 + var7 * 18 , 84 + var6 * 18 + 33)); } } for (var6 = 0; var6 < 9; ++var6) { this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18 , 142 + 10 + 23)); } this.onCraftMatrixChanged(this.craftMatrix); } public void onCraftMatrixChanged(IInventory par1IInventory) { this.craftResult.setInventorySlotContents(0, CraftingBigManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } public boolean canInteractWith(EntityPlayer par1EntityPlayer) { return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != MOD.BigCrafting.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; } public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed(par1EntityPlayer); if (!this.worldObj.isRemote) { for (int i = 0; i < 15; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != null) { par1EntityPlayer.dropPlayerItem(itemstack); } } } } public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { ItemStack var3 = null; Slot var4 = (Slot)this.inventorySlots.get(par2); if (var4 != null && var4.getHasStack()) { ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (par2 == 0) { if (!this.mergeItemStack(var5, 10, 46, true)) { return null; } var4.onSlotChange(var5, var3); } else if (par2 >= 10 && par2 < 37) { if (!this.mergeItemStack(var5, 37, 46, false)) { return null; } } else if (par2 >= 37 && par2 < 46) { if (!this.mergeItemStack(var5, 10, 37, false)) { return null; } } else if (!this.mergeItemStack(var5, 10, 46, false)) { return null; } if (var5.stackSize == 0) { var4.putStack((ItemStack)null); } else { var4.onSlotChanged(); } if (var5.stackSize == var3.stackSize) { return null; } var4.onPickupFromSlot(par1EntityPlayer, var5); } return var3; } public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { return par2Slot.inventory != this.craftResult && super.func_94530_a(par1ItemStack, par2Slot); } }Slot:
package com.MixedCraft.gui.slot; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.AchievementList; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; import cpw.mods.fml.common.registry.GameRegistry; public class SlotBigCrafting extends Slot { private final IInventory craftMatrix; private EntityPlayer thePlayer; private int amountCrafted; public SlotBigCrafting(EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6) { super(par3IInventory, par4, par5, par6); this.thePlayer = par1EntityPlayer; this.craftMatrix = par2IInventory; } public boolean isItemValid(ItemStack par1ItemStack) { return false; } public ItemStack decrStackSize(int par1) { if (this.getHasStack()) { this.amountCrafted += Math.min(par1, this.getStack().stackSize); } return super.decrStackSize(par1); } protected void onCrafting(ItemStack par1ItemStack, int par2) { this.amountCrafted += par2; this.onCrafting(par1ItemStack); } public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { GameRegistry.onItemCrafted(par1EntityPlayer, par2ItemStack, craftMatrix); this.onCrafting(par2ItemStack); for (int var3 = 0; var3 < this.craftMatrix.getSizeInventory(); ++var3) { ItemStack var4 = this.craftMatrix.getStackInSlot(var3); if (var4 != null) { this.craftMatrix.decrStackSize(var3, 1); if (var4.getItem().hasContainerItem()) { ItemStack var5 = var4.getItem().getContainerItemStack(var4); if (var5.isItemStackDamageable() && var5.getItemDamage() > var5.getMaxDamage()) { MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, var5)); var5 = null; } if (var5 != null && (!var4.getItem().doesContainerItemLeaveCraftingGrid(var4) || !this.thePlayer.inventory.addItemStackToInventory(var5))) { if (this.craftMatrix.getStackInSlot(var3) == null) { this.craftMatrix.setInventorySlotContents(var3, var5); } else { this.thePlayer.dropPlayerItem(var5); } } } } } } }CraftingBigManager:
public class CraftingBigManager { private static final CraftingBigManager instance = new CraftingBigManager(); private List recipes = new ArrayList(); public static final CraftingBigManager getInstance() { return instance; } private CraftingBigManager() { this.addShapedRecipe(new ItemStack(Item.paper, 3), new Object[] {"###", '#', Item.reed}); this.addShapelessRecipe(new ItemStack(Item.book, 1), new Object[] {Item.paper, Item.paper, Item.paper, Item.leather}); this.addShapelessRecipe(new ItemStack(Item.writableBook, 1), new Object[] {Item.book, new ItemStack(Item.dyePowder, 1, 0), Item.feather}); this.addShapedRecipe(new ItemStack(Block.fence, 2), new Object[] {"###", "###", '#', Item.stick}); this.addShapedRecipe(new ItemStack(Block.cobblestoneWall, 6, 0), new Object[] {"###", "###", '#', Block.cobblestone}); this.addShapedRecipe(new ItemStack(Block.cobblestoneWall, 6, 1), new Object[] {"###", "###", '#', Block.cobblestoneMossy}); this.addShapedRecipe(new ItemStack(Block.netherFence, 6), new Object[] {"###", "###", '#', Block.netherBrick}); this.addShapedRecipe(new ItemStack(Block.fenceGate, 1), new Object[] {"#W#", "#W#", '#', Item.stick, 'W', Block.planks}); this.addShapedRecipe(new ItemStack(Block.jukebox, 1), new Object[] {"###", "#X#", "###", '#', Block.planks, 'X', Item.diamond}); this.addShapedRecipe(new ItemStack(Item.leash, 2), new Object[] {"~~ ", "~O ", " ~", '~', Item.silk, 'O', Item.slimeBall}); this.addShapedRecipe(new ItemStack(Block.music, 1), new Object[] {"###", "#X#", "###", '#', Block.planks, 'X', Item.redstone}); this.addShapedRecipe(new ItemStack(Block.bookShelf, 1), new Object[] {"###", "XXX", "###", '#', Block.planks, 'X', Item.book}); this.addShapedRecipe(new ItemStack(Block.blockSnow, 1), new Object[] {"##", "##", '#', Item.snowball}); this.addShapedRecipe(new ItemStack(Block.snow, 6), new Object[] {"###", '#', Block.blockSnow}); this.addShapedRecipe(new ItemStack(Block.blockClay, 1), new Object[] {"##", "##", '#', Item.clay}); this.addShapedRecipe(new ItemStack(Block.brick, 1), new Object[] {"##", "##", '#', Item.brick}); this.addShapedRecipe(new ItemStack(Block.glowStone, 1), new Object[] {"##", "##", '#', Item.glowstone}); this.addShapedRecipe(new ItemStack(Block.blockNetherQuartz, 1), new Object[] {"##", "##", '#', Item.netherQuartz}); this.addShapedRecipe(new ItemStack(Block.cloth, 1), new Object[] {"##", "##", '#', Item.silk}); this.addShapedRecipe(new ItemStack(Block.tnt, 1), new Object[] {"X#X", "#X#", "X#X", 'X', Item.gunpowder, '#', Block.sand}); this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 3), new Object[] {"###", '#', Block.cobblestone}); this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 0), new Object[] {"###", '#', Block.stone}); this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 1), new Object[] {"###", '#', Block.sandStone}); this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 4), new Object[] {"###", '#', Block.brick}); this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 5), new Object[] {"###", '#', Block.stoneBrick}); this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 6), new Object[] {"###", '#', Block.netherBrick}); this.addShapedRecipe(new ItemStack(Block.stoneSingleSlab, 6, 7), new Object[] {"###", '#', Block.blockNetherQuartz}); this.addShapedRecipe(new ItemStack(Block.woodSingleSlab, 6, 0), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 0)}); this.addShapedRecipe(new ItemStack(Block.woodSingleSlab, 6, 2), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 2)}); this.addShapedRecipe(new ItemStack(Block.woodSingleSlab, 6, 1), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 1)}); this.addShapedRecipe(new ItemStack(Block.woodSingleSlab, 6, 3), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 3)}); this.addShapedRecipe(new ItemStack(Block.ladder, 3), new Object[] {"# #", "###", "# #", '#', Item.stick}); this.addShapedRecipe(new ItemStack(Item.doorWood, 1), new Object[] {"##", "##", "##", '#', Block.planks}); this.addShapedRecipe(new ItemStack(Block.trapdoor, 2), new Object[] {"###", "###", '#', Block.planks}); this.addShapedRecipe(new ItemStack(Item.doorIron, 1), new Object[] {"##", "##", "##", '#', Item.ingotIron}); this.addShapedRecipe(new ItemStack(Item.sign, 3), new Object[] {"###", "###", " X ", '#', Block.planks, 'X', Item.stick}); this.addShapedRecipe(new ItemStack(Item.cake, 1), new Object[] {"AAA", "BEB", "CCC", 'A', Item.bucketMilk, 'B', Item.sugar, 'C', Item.wheat, 'E', Item.egg}); this.addShapedRecipe(new ItemStack(Item.sugar, 1), new Object[] {"#", '#', Item.reed}); this.addShapedRecipe(new ItemStack(Block.planks, 4, 0), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 0)}); this.addShapedRecipe(new ItemStack(Block.planks, 4, 1), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 1)}); this.addShapedRecipe(new ItemStack(Block.planks, 4, 2), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 2)}); this.addShapedRecipe(new ItemStack(Block.planks, 4, 3), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 3)}); this.addShapedRecipe(new ItemStack(Item.stick, 4), new Object[] {"#", "#", '#', Block.planks}); this.addShapedRecipe(new ItemStack(Block.torchWood, 4), new Object[] {"X", "#", 'X', Item.coal, '#', Item.stick}); this.addShapedRecipe(new ItemStack(Block.torchWood, 4), new Object[] {"X", "#", 'X', new ItemStack(Item.coal, 1, 1), '#', Item.stick}); this.addShapedRecipe(new ItemStack(Item.bowlEmpty, 4), new Object[] {"# #", " # ", '#', Block.planks}); this.addShapedRecipe(new ItemStack(Item.glassBottle, 3), new Object[] {"# #", " # ", '#', Block.glass}); this.addShapedRecipe(new ItemStack(Block.rail, 16), new Object[] {"X X", "X#X", "X X", 'X', Item.ingotIron, '#', Item.stick}); this.addShapedRecipe(new ItemStack(Block.railPowered, 6), new Object[] {"X X", "X#X", "XRX", 'X', Item.ingotGold, 'R', Item.redstone, '#', Item.stick}); this.addShapedRecipe(new ItemStack(Block.railActivator, 6), new Object[] {"XSX", "X#X", "XSX", 'X', Item.ingotIron, '#', Block.torchRedstoneActive, 'S', Item.stick}); this.addShapedRecipe(new ItemStack(Block.railDetector, 6), new Object[] {"X X", "X#X", "XRX", 'X', Item.ingotIron, 'R', Item.redstone, '#', Block.pressurePlateStone}); this.addShapedRecipe(new ItemStack(Item.minecartEmpty, 1), new Object[] {"# #", "###", '#', Item.ingotIron}); this.addShapedRecipe(new ItemStack(Item.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Item.ingotIron}); this.addShapedRecipe(new ItemStack(Item.brewingStand, 1), new Object[] {" B ", "###", '#', Block.cobblestone, 'B', Item.blazeRod}); this.addShapedRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[] {"A", "B", 'A', Block.pumpkin, 'B', Block.torchWood}); this.addShapedRecipe(new ItemStack(Item.minecartCrate, 1), new Object[] {"A", "B", 'A', Block.chest, 'B', Item.minecartEmpty}); this.addShapedRecipe(new ItemStack(Item.minecartPowered, 1), new Object[] {"A", "B", 'A', Block.furnaceIdle, 'B', Item.minecartEmpty}); this.addShapedRecipe(new ItemStack(Item.minecartTnt, 1), new Object[] {"A", "B", 'A', Block.tnt, 'B', Item.minecartEmpty}); this.addShapedRecipe(new ItemStack(Item.minecartHopper, 1), new Object[] {"A", "B", 'A', Block.hopperBlock, 'B', Item.minecartEmpty}); this.addShapedRecipe(new ItemStack(Item.boat, 1), new Object[] {"# #", "###", '#', Block.planks}); this.addShapedRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[] {"# #", " # ", '#', Item.ingotIron}); this.addShapedRecipe(new ItemStack(Item.flowerPot, 1), new Object[] {"# #", " # ", '#', Item.brick}); this.addShapedRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[] {"A ", " B", 'A', Item.ingotIron, 'B', Item.flint}); this.addShapedRecipe(new ItemStack(Item.bread, 1), new Object[] {"###", '#', Item.wheat}); this.addShapedRecipe(new ItemStack(Block.stairsWoodOak, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 0)}); this.addShapedRecipe(new ItemStack(Block.stairsWoodBirch, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 2)}); this.addShapedRecipe(new ItemStack(Block.stairsWoodSpruce, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 1)}); this.addShapedRecipe(new ItemStack(Block.stairsWoodJungle, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 3)}); this.addShapedRecipe(new ItemStack(Item.fishingRod, 1), new Object[] {" #", " #X", "# X", '#', Item.stick, 'X', Item.silk}); this.addShapedRecipe(new ItemStack(Item.carrotOnAStick, 1), new Object[] {"# ", " X", '#', Item.fishingRod, 'X', Item.carrot}).func_92100_c(); this.addShapedRecipe(new ItemStack(Block.stairsCobblestone, 4), new Object[] {"# ", "## ", "###", '#', Block.cobblestone}); this.addShapedRecipe(new ItemStack(Block.stairsBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.brick}); this.addShapedRecipe(new ItemStack(Block.stairsStoneBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.stoneBrick}); this.addShapedRecipe(new ItemStack(Block.stairsNetherBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.netherBrick}); this.addShapedRecipe(new ItemStack(Block.stairsSandStone, 4), new Object[] {"# ", "## ", "###", '#', Block.sandStone}); this.addShapedRecipe(new ItemStack(Block.stairsNetherQuartz, 4), new Object[] {"# ", "## ", "###", '#', Block.blockNetherQuartz}); this.addShapedRecipe(new ItemStack(Item.painting, 1), new Object[] {"###", "#X#", "###", '#', Item.stick, 'X', Block.cloth}); this.addShapedRecipe(new ItemStack(Item.itemFrame, 1), new Object[] {"###", "#X#", "###", '#', Item.stick, 'X', Item.leather}); this.addShapedRecipe(new ItemStack(Item.appleGold, 1, 0), new Object[] {"###", "#X#", "###", '#', Item.ingotGold, 'X', Item.appleRed}); this.addShapedRecipe(new ItemStack(Item.appleGold, 1, 1), new Object[] {"###", "#X#", "###", '#', Block.blockGold, 'X', Item.appleRed}); this.addShapedRecipe(new ItemStack(Item.goldenCarrot, 1, 0), new Object[] {"###", "#X#", "###", '#', Item.goldNugget, 'X', Item.carrot}); this.addShapedRecipe(new ItemStack(Item.speckledMelon, 1), new Object[] {"###", "#X#", "###", '#', Item.goldNugget, 'X', Item.melon}); this.addShapedRecipe(new ItemStack(Block.lever, 1), new Object[] {"X", "#", '#', Block.cobblestone, 'X', Item.stick}); this.addShapedRecipe(new ItemStack(Block.tripWireSource, 2), new Object[] {"I", "S", "#", '#', Block.planks, 'S', Item.stick, 'I', Item.ingotIron}); this.addShapedRecipe(new ItemStack(Block.torchRedstoneActive, 1), new Object[] {"X", "#", '#', Item.stick, 'X', Item.redstone}); this.addShapedRecipe(new ItemStack(Item.redstoneRepeater, 1), new Object[] {"#X#", "III", '#', Block.torchRedstoneActive, 'X', Item.redstone, 'I', Block.stone}); this.addShapedRecipe(new ItemStack(Item.comparator, 1), new Object[] {" # ", "#X#", "III", '#', Block.torchRedstoneActive, 'X', Item.netherQuartz, 'I', Block.stone}); this.addShapedRecipe(new ItemStack(Item.pocketSundial, 1), new Object[] {" # ", "#X#", " # ", '#', Item.ingotGold, 'X', Item.redstone}); this.addShapedRecipe(new ItemStack(Item.compass, 1), new Object[] {" # ", "#X#", " # ", '#', Item.ingotIron, 'X', Item.redstone}); this.addShapedRecipe(new ItemStack(Item.emptyMap, 1), new Object[] {"###", "#X#", "###", '#', Item.paper, 'X', Item.compass}); this.addShapedRecipe(new ItemStack(Block.stoneButton, 1), new Object[] {"#", '#', Block.stone}); this.addShapedRecipe(new ItemStack(Block.woodenButton, 1), new Object[] {"#", '#', Block.planks}); this.addShapedRecipe(new ItemStack(Block.pressurePlateStone, 1), new Object[] {"##", '#', Block.stone}); this.addShapedRecipe(new ItemStack(Block.pressurePlatePlanks, 1), new Object[] {"##", '#', Block.planks}); this.addShapedRecipe(new ItemStack(Block.pressurePlateIron, 1), new Object[] {"##", '#', Item.ingotIron}); this.addShapedRecipe(new ItemStack(Block.pressurePlateGold, 1), new Object[] {"##", '#', Item.ingotGold}); this.addShapedRecipe(new ItemStack(Block.dispenser, 1), new Object[] {"###", "#X#", "#R#", '#', Block.cobblestone, 'X', Item.bow, 'R', Item.redstone}); this.addShapedRecipe(new ItemStack(Block.dropper, 1), new Object[] {"###", "# #", "#R#", '#', Block.cobblestone, 'R', Item.redstone}); this.addShapedRecipe(new ItemStack(Block.pistonBase, 1), new Object[] {"TTT", "#X#", "#R#", '#', Block.cobblestone, 'X', Item.ingotIron, 'R', Item.redstone, 'T', Block.planks}); this.addShapedRecipe(new ItemStack(Block.pistonStickyBase, 1), new Object[] {"S", "P", 'S', Item.slimeBall, 'P', Block.pistonBase}); this.addShapedRecipe(new ItemStack(Item.bed, 1), new Object[] {"###", "XXX", '#', Block.cloth, 'X', Block.planks}); this.addShapedRecipe(new ItemStack(Block.enchantmentTable, 1), new Object[] {" B ", "D#D", "###", '#', Block.obsidian, 'B', Item.book, 'D', Item.diamond}); this.addShapedRecipe(new ItemStack(Block.anvil, 1), new Object[] {"III", " i ", "iii", 'I', Block.blockIron, 'i', Item.ingotIron}); this.addShapelessRecipe(new ItemStack(Item.eyeOfEnder, 1), new Object[] {Item.enderPearl, Item.blazePowder}); this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[] {Item.gunpowder, Item.blazePowder, Item.coal}); this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[] {Item.gunpowder, Item.blazePowder, new ItemStack(Item.coal, 1, 1)}); this.addShapedRecipe(new ItemStack(Block.daylightSensor), new Object[] {"GGG", "QQQ", "WWW", 'G', Block.glass, 'Q', Item.netherQuartz, 'W', Block.woodSingleSlab}); this.addShapedRecipe(new ItemStack(Block.hopperBlock), new Object[] {"I I", "ICI", " I ", 'I', Item.ingotIron, 'C', Block.chest}); Collections.sort(this.recipes, new RecipeSorterBig(this)); System.out.println(this.recipes.size() + " recipes"); } public BigShapedRecipes addShapedRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) { String var3 = ""; int var4 = 0; int var5 = 0; int var6 = 0; if (par2ArrayOfObj[var4] instanceof String[]) { String[] var7 = (String[])((String[])par2ArrayOfObj[var4++]); for (int var8 = 0; var8 < var7.length; ++var8) { String var9 = var7[var8]; ++var6; var5 = var9.length(); var3 = var3 + var9; } } else { while (par2ArrayOfObj[var4] instanceof String) { String var11 = (String)par2ArrayOfObj[var4++]; ++var6; var5 = var11.length(); var3 = var3 + var11; } } HashMap var12; for (var12 = new HashMap(); var4 < par2ArrayOfObj.length; var4 += 2) { Character var13 = (Character)par2ArrayOfObj[var4]; ItemStack var14 = null; if (par2ArrayOfObj[var4 + 1] instanceof Item) { var14 = new ItemStack((Item)par2ArrayOfObj[var4 + 1]); } else if (par2ArrayOfObj[var4 + 1] instanceof Block) { var14 = new ItemStack((Block)par2ArrayOfObj[var4 + 1], 1, -1); } else if (par2ArrayOfObj[var4 + 1] instanceof ItemStack) { var14 = (ItemStack)par2ArrayOfObj[var4 + 1]; } var12.put(var13, var14); } ItemStack[] var15 = new ItemStack[var5 * var6]; for (int var16 = 0; var16 < var5 * var6; ++var16) { char var10 = var3.charAt(var16); if (var12.containsKey(Character.valueOf(var10))) { var15[var16] = ((ItemStack)var12.get(Character.valueOf(var10))).copy(); } else { var15[var16] = null; } } BigShapedRecipes var17 = new BigShapedRecipes(var5, var6, var15, par1ItemStack); this.recipes.add(var17); return var17; } public void addShapelessRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) { ArrayList var3 = new ArrayList(); Object[] var4 = par2ArrayOfObj; int var5 = par2ArrayOfObj.length; for (int var6 = 0; var6 < var5; ++var6) { Object var7 = var4[var6]; if (var7 instanceof ItemStack) { var3.add(((ItemStack)var7).copy()); } else if (var7 instanceof Item) { var3.add(new ItemStack((Item)var7)); } else { if (!(var7 instanceof Block)) { throw new RuntimeException("Invalid shapeless recipe!"); } var3.add(new ItemStack((Block)var7)); } } this.recipes.add(new BigShapelessRecipes(par1ItemStack, var3)); } public ItemStack findMatchingRecipe(InventoryCrafting par1InventoryCrafting, World par2World) { int var3 = 0; ItemStack var4 = null; ItemStack var5 = null; int var6; for (var6 = 0; var6 < par1InventoryCrafting.getSizeInventory(); ++var6) { ItemStack var7 = par1InventoryCrafting.getStackInSlot(var6); if (var7 != null) { if (var3 == 0) { var4 = var7; } if (var3 == 1) { var5 = var7; } ++var3; } } if (var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isRepairable()) { Item var11 = Item.itemsList[var4.itemID]; int var13 = var11.getMaxDamage() - var4.getItemDamageForDisplay(); int var8 = var11.getMaxDamage() - var5.getItemDamageForDisplay(); int var9 = var13 + var8 + var11.getMaxDamage() * 5 / 100; int var10 = var11.getMaxDamage() - var9; if (var10 < 0) { var10 = 0; } return new ItemStack(var4.itemID, 1, var10); } else { for (var6 = 0; var6 < this.recipes.size(); ++var6) { IRecipe var12 = (IRecipe)this.recipes.get(var6); if (var12.matches(par1InventoryCrafting, par2World)) { return var12.getCraftingResult(par1InventoryCrafting); } } return null; } } public List getRecipeList() { return this.recipes; }Big Shaped/Shapeless Recipe
public class BigShapelessRecipes implements IRecipe { /** Is the ItemStack that you get when craft the recipe. */ private final ItemStack recipeOutput; /** Is a List of ItemStack that composes the recipe. */ public final List recipeItems; public BigShapelessRecipes(ItemStack par1ItemStack, List par2List) { this.recipeOutput = par1ItemStack; this.recipeItems = par2List; } public ItemStack getRecipeOutput() { return this.recipeOutput; } /** * Used to check if a recipe matches current crafting inventory */ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { ArrayList arraylist = new ArrayList(this.recipeItems); for (int i = 0; i < 5; ++i) { for (int j = 0; j < 3; ++j) { ItemStack itemstack = par1InventoryCrafting.getStackInRowAndColumn(j, i); if (itemstack != null) { boolean flag = false; Iterator iterator = arraylist.iterator(); while (iterator.hasNext()) { ItemStack itemstack1 = (ItemStack)iterator.next(); if (itemstack.itemID == itemstack1.itemID && (itemstack1.getItemDamage() == 32767 || itemstack.getItemDamage() == itemstack1.getItemDamage())) { flag = true; arraylist.remove(itemstack1); break; } } if (!flag) { return false; } } } } return arraylist.isEmpty(); } /** * Returns an Item that is the result of this recipe */ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { return this.recipeOutput.copy(); } /** * Returns the size of the recipe area */ public int getRecipeSize() { return this.recipeItems.size(); } }public class BigShapedRecipes implements IRecipe { /** How many horizontal slots this recipe is wide. */ public final int recipeWidth; /** How many vertical slots this recipe uses. */ public final int recipeHeight; /** Is a array of ItemStack that composes the recipe. */ public final ItemStack[] recipeItems; /** Is the ItemStack that you get when craft the recipe. */ private ItemStack recipeOutput; /** Is the itemID of the output item that you get when craft the recipe. */ public final int recipeOutputItemID; private boolean field_92101_f; public BigShapedRecipes(int par1, int par2, ItemStack[] par3ArrayOfItemStack, ItemStack par4ItemStack) { this.recipeOutputItemID = par4ItemStack.itemID; this.recipeWidth = par1; this.recipeHeight = par2; this.recipeItems = par3ArrayOfItemStack; this.recipeOutput = par4ItemStack; } public ItemStack getRecipeOutput() { return this.recipeOutput; } /** * Used to check if a recipe matches current crafting inventory */ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { for (int i = 0; i <= 3 - this.recipeWidth; ++i) { for (int j = 0; j <= 5 - this.recipeHeight; ++j) { if (this.checkMatch(par1InventoryCrafting, i, j, true)) { return true; } if (this.checkMatch(par1InventoryCrafting, i, j, false)) { return true; } } } return false; } /** * Checks if the region of a crafting inventory is match for the recipe. */ private boolean checkMatch(InventoryCrafting par1InventoryCrafting, int par2, int par3, boolean par4) { for (int k = 0; k < 3; ++k) { for (int l = 0; l < 5; ++l) { int i1 = k - par2; int j1 = l - par3; ItemStack itemstack = null; if (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight) { if (par4) { itemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth]; } else { itemstack = this.recipeItems[i1 + j1 * this.recipeWidth]; } } ItemStack itemstack1 = par1InventoryCrafting.getStackInRowAndColumn(k, l); if (itemstack1 != null || itemstack != null) { if (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) { return false; } if (itemstack.itemID != itemstack1.itemID) { return false; } if (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack1.getItemDamage()) { return false; } } } } return true; } /** * Returns an Item that is the result of this recipe */ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { ItemStack itemstack = this.getRecipeOutput().copy(); if (this.field_92101_f) { for (int i = 0; i < par1InventoryCrafting.getSizeInventory(); ++i) { ItemStack itemstack1 = par1InventoryCrafting.getStackInSlot(i); if (itemstack1 != null && itemstack1.hasTagCompound()) { itemstack.setTagCompound((NBTTagCompound)itemstack1.stackTagCompound.copy()); } } } return itemstack; } /** * Returns the size of the recipe area */ public int getRecipeSize() { return this.recipeWidth * this.recipeHeight; } public BigShapedRecipes func_92100_c() { this.field_92101_f = true; return this; } }Recipe sorter:
public class RecipeSorterBig implements Comparator{ final CraftingBigManager BigCraftingManager; RecipeSorterBig(CraftingBigManager par1BigCraftingManager) { this.BigCraftingManager = par1BigCraftingManager; } public int compareRecipes(IRecipe par1IRecipe, IRecipe par2IRecipe) { return par1IRecipe instanceof BigShapelessRecipes && par2IRecipe instanceof BigShapedRecipes ? 1 : (par2IRecipe instanceof BigShapelessRecipes && par1IRecipe instanceof BigShapedRecipes ? -1 : (par2IRecipe.getRecipeSize() < par1IRecipe.getRecipeSize() ? -1 : (par2IRecipe.getRecipeSize() > par1IRecipe.getRecipeSize() ? 1 : 0))); } public int compare(Object par1Obj, Object par2Obj) { return this.compareRecipes((IRecipe)par1Obj, (IRecipe)par2Obj); } }And now to add a recipe: All you have to do is register it like a normal recipe! but with this code:
CraftingBigManager.getInstance().addShapedRecipe(new ItemStack(Item.bow, 1), new Object[] {" II", "I S", "I S", "I S", " II", 'I', Item.stick, 'S', Item.silk});CraftingBigManager.getInstance().addShapelessRecipe(new ItemStack(Item.diamond, 9), new Object[] {Block.blockDiamond});I think thats basically it
Im also taking requests!
i have a problem when i right click the Big Crafting table its not crashing but it says this !
2013-10-21 18:40:12 [WARNING] [ForgeModLoader] A mod tried to open a gui on the server without being a NetworkMod
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { switch(id) { case 1: return id == 1 && world.getBlockId(x, y, z) == MOD.BigCrafting.blockID ? new ContainerBigCrafting(player.inventory, world, x, y, z) : null; } return null; } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { switch(id) { case 1: return id == 1 && world.getBlockId(x, y, z) == MOD.BigCrafting.blockID ? new GuiBigCrafting(player.inventory, world, x, y, z) : null; } return null; } }I get an error over amp? Heeeelp
i guess remove && and replace it with &&
---- Minecraft Crash Report ---- // Quite honestly, I wouldn't worry myself about that. Time: 12/2/13 4:52 PM Description: Unexpected error java.lang.ExceptionInInitializerError at Vanilla_Project.ContainerBigCrafting.onCraftMatrixChanged(ContainerBigCrafting.java:58) at Vanilla_Project.ContainerBigCrafting.<init>(ContainerBigCrafting.java:53) at Vanilla_Project.GuiBigCraftingTable.<init>(GuiBigCraftingTable.java:14) at Vanilla_Project.GuiHandler.getClientGuiElement(GuiHandler.java:24) at cpw.mods.fml.common.network.NetworkRegistry.openLocalGui(NetworkRegistry.java:328) at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:356) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2480) at Vanilla_Project.BiggerCraftingTable.onBlockActivated(BiggerCraftingTable.java:44) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:371) at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1389) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1867) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:909) at net.minecraft.client.Minecraft.run(Minecraft.java:837) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 8 at java.lang.String.charAt(Unknown Source) at Vanilla_Project.CraftingBigManager.addShapedRecipe(CraftingBigManager.java:199) at Vanilla_Project.CraftingBigManager.<init>(CraftingBigManager.java:92) at Vanilla_Project.CraftingBigManager.<clinit>(CraftingBigManager.java:17) ... 20 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at Vanilla_Project.ContainerBigCrafting.onCraftMatrixChanged(ContainerBigCrafting.java:58) at Vanilla_Project.ContainerBigCrafting.<init>(ContainerBigCrafting.java:53) at Vanilla_Project.GuiBigCraftingTable.<init>(GuiBigCraftingTable.java:14) at Vanilla_Project.GuiHandler.getClientGuiElement(GuiHandler.java:24) at cpw.mods.fml.common.network.NetworkRegistry.openLocalGui(NetworkRegistry.java:328) at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:356) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2480) at Vanilla_Project.BiggerCraftingTable.onBlockActivated(BiggerCraftingTable.java:44) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:371) at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1389) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Player924'/357, l='MpServer', x=48.30, y=70.62, z=242.82]] Chunk stats: MultiplayerChunkCache: 220 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: World: (52,64,248), Chunk: (at 4,4,8 in 3,15; contains blocks 48,0,240 to 63,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 4140 game time, 4140 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 68 total; [EntityItem['item.tile.flower'/137, l='MpServer', x=39.00, y=63.13, z=241.66], EntityItem['item.item.seeds'/136, l='MpServer', x=38.69, y=67.13, z=236.44], EntityItem['item.item.seeds'/139, l='MpServer', x=36.09, y=66.13, z=241.78], EntityChicken['Chicken'/272, l='MpServer', x=126.69, y=68.00, z=242.31], EntityItem['item.tile.flower'/138, l='MpServer', x=36.38, y=66.13, z=243.72], EntityBat['Bat'/141, l='MpServer', x=33.42, y=33.49, z=314.35], EntitySheep['Sheep'/140, l='MpServer', x=32.47, y=64.00, z=248.19], EntitySheep['Sheep'/128, l='MpServer', x=18.47, y=66.00, z=321.28], EntitySquid['Squid'/135, l='MpServer', x=48.29, y=60.25, z=193.14], EntitySquid['Squid'/134, l='MpServer', x=42.88, y=58.02, z=193.67], EntitySquid['Squid'/186, l='MpServer', x=71.29, y=59.41, z=208.59], EntitySquid['Squid'/187, l='MpServer', x=64.77, y=58.36, z=207.35], EntityBat['Bat'/184, l='MpServer', x=73.45, y=37.79, z=196.25], EntitySquid['Squid'/185, l='MpServer', x=71.51, y=58.98, z=207.51], EntitySheep['Sheep'/188, l='MpServer', x=79.72, y=65.00, z=265.03], EntityItem['item.item.seeds'/189, l='MpServer', x=74.22, y=63.13, z=299.09], EntitySheep['Sheep'/205, l='MpServer', x=83.50, y=69.00, z=248.34], EntitySheep['Sheep'/204, l='MpServer', x=90.19, y=68.00, z=252.41], EntityChicken['Chicken'/207, l='MpServer', x=93.56, y=67.00, z=260.53], EntitySheep['Sheep'/206, l='MpServer', x=82.53, y=66.00, z=257.03], EntityChicken['Chicken'/203, l='MpServer', x=80.59, y=69.00, z=249.47], EntityChicken['Chicken'/202, l='MpServer', x=90.19, y=67.00, z=255.19], EntityWolf['Wolf'/79, l='MpServer', x=-22.53, y=75.00, z=186.78], EntityBat['Bat'/220, l='MpServer', x=109.06, y=30.84, z=181.40], EntitySheep['Sheep'/221, l='MpServer', x=109.19, y=63.00, z=178.66], EntitySheep['Sheep'/222, l='MpServer', x=106.19, y=71.00, z=256.63], EntitySheep['Sheep'/223, l='MpServer', x=106.56, y=69.00, z=265.34], EntitySheep['Sheep'/81, l='MpServer', x=-29.38, y=67.00, z=310.19], EntityWolf['Wolf'/80, l='MpServer', x=-26.34, y=82.00, z=190.84], EntitySheep['Sheep'/83, l='MpServer', x=-29.75, y=72.00, z=322.50], EntityBat['Bat'/219, l='MpServer', x=95.20, y=64.77, z=167.51], EntityWolf['Wolf'/93, l='MpServer', x=-2.56, y=71.00, z=175.16], EntityItem['item.item.seeds'/212, l='MpServer', x=90.91, y=63.13, z=291.94], EntityWolf['Wolf'/95, l='MpServer', x=-10.38, y=75.00, z=187.38], EntityChicken['Chicken'/94, l='MpServer', x=-8.44, y=71.00, z=163.44], EntitySheep['Sheep'/208, l='MpServer', x=94.91, y=68.00, z=256.91], EntitySheep['Sheep'/209, l='MpServer', x=93.59, y=67.00, z=258.63], EntitySheep['Sheep'/210, l='MpServer', x=92.56, y=66.00, z=269.09], EntityChicken['Chicken'/211, l='MpServer', x=83.09, y=66.00, z=261.28], EntityItem['item.tile.sapling.oak'/100, l='MpServer', x=-11.13, y=78.13, z=297.13], EntityItem['item.tile.sapling.oak'/98, l='MpServer', x=-5.72, y=78.13, z=297.47], EntityItem['item.tile.sapling.oak'/99, l='MpServer', x=-8.81, y=79.13, z=297.88], EntitySheep['Sheep'/96, l='MpServer', x=-9.60, y=63.00, z=244.13], EntitySheep['Sheep'/97, l='MpServer', x=-2.38, y=68.00, z=246.53], EntitySheep['Sheep'/110, l='MpServer', x=1.53, y=68.00, z=244.50], EntityBat['Bat'/111, l='MpServer', x=0.50, y=41.10, z=262.75], EntitySheep['Sheep'/108, l='MpServer', x=13.31, y=69.00, z=253.53], EntitySheep['Sheep'/229, l='MpServer', x=108.22, y=66.00, z=317.88], EntityItem['item.item.seeds'/228, l='MpServer', x=98.88, y=63.13, z=293.56], EntitySheep['Sheep'/109, l='MpServer', x=12.91, y=69.00, z=249.16], EntityItem['item.item.seeds'/227, l='MpServer', x=99.53, y=63.13, z=291.69], EntitySheep['Sheep'/226, l='MpServer', x=102.84, y=64.00, z=282.75], EntitySheep['Sheep'/107, l='MpServer', x=12.09, y=68.00, z=246.03], EntitySheep['Sheep'/225, l='MpServer', x=106.97, y=67.00, z=270.97], EntitySheep['Sheep'/224, l='MpServer', x=102.97, y=70.00, z=258.03], EntityClientPlayerMP['Player924'/357, l='MpServer', x=48.30, y=70.62, z=242.82], EntityItem['item.tile.mushroom'/113, l='MpServer', x=12.72, y=61.13, z=275.44], EntityBat['Bat'/112, l='MpServer', x=16.50, y=22.11, z=278.48], EntityBat['Bat'/246, l='MpServer', x=123.90, y=16.65, z=203.99], EntityBat['Bat'/127, l='MpServer', x=31.75, y=15.83, z=320.47], EntitySheep['Sheep'/126, l='MpServer', x=26.94, y=71.00, z=255.13], EntityBat['Bat'/247, l='MpServer', x=126.25, y=59.10, z=208.25], EntityBat['Bat'/125, l='MpServer', x=20.54, y=28.53, z=182.34], EntityBat['Bat'/244, l='MpServer', x=119.75, y=18.10, z=202.75], EntityBat['Bat'/245, l='MpServer', x=120.31, y=17.10, z=203.03], EntityBat['Bat'/242, l='MpServer', x=119.75, y=39.10, z=177.25], EntityBat['Bat'/243, l='MpServer', x=114.25, y=56.78, z=180.96], EntitySheep['Sheep'/240, l='MpServer', x=119.03, y=73.00, z=172.06]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:440) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2311) at net.minecraft.client.Minecraft.run(Minecraft.java:862) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) -- System Details -- Details: Minecraft Version: 1.6.4 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_40, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 769703600 bytes (734 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 15494 (867664 bytes; 0 MB) allocated, 2 (112 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 12, tcache: 0, allocated: 1, tallocated: 63 FML: MCP v8.11 FML v6.4.20.916 Minecraft Forge 9.11.1.916 4 mods loaded, 4 mods active mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{6.4.20.916} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{9.11.1.916} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Vanilla Project{1.0} [Vanilla Project] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.6 LWJGL: 2.9.0 OpenGL: ATI Radeon HD 5700 Series GL version 4.2.12217 Compatibility Profile Context 12.104.0.0, ATI Technologies Inc. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Pack: Default Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 4877 (273112 bytes; 0 MB) allocated, 15 (840 bytes; 0 MB) used-
View User Profile
-
View Posts
-
Send Message
Curse PremiumHello!
depending on your skill level, you will need to make a custom slot, or at least add an extra slot and create a custom crafting manager and most likely custom inventory classes as well....there are several mods that do this, and a few of them even have github repos to look at....
Find out how I generate....coolAlias...world structure generation and rotation tool...
I feel like there should be more to this report that may help...
Find out how I generate....coolAlias...world structure generation and rotation tool...
Heres my crash error: By the way this happens when i try to right click the block
---- Minecraft Crash Report ----
// Don't do that.
Time: 19/12/13 9:25 PM
Description: Unexpected error
java.lang.ExceptionInInitializerError
at mod.timeolord.aa.AAMContainer.onCraftMatrixChanged(AAMContainer.java:58)
at mod.timeolord.aa.AAMContainer.<init>(AAMContainer.java:53)
at mod.timeolord.aa.AAMGui.<init>(AAMGui.java:14)
at mod.timeolord.aa.GuiHandler.getClientGuiElement(GuiHandler.java:24)
at cpw.mods.fml.common.network.NetworkRegistry.openLocalGui(NetworkRegistry.java:328)
at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:357)
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2480)
at mod.timeolord.blocks.AtomicAssemblerMachine.onBlockActivated(AtomicAssemblerMachine.java:49)
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:371)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1390)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1868)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:910)
at net.minecraft.client.Minecraft.run(Minecraft.java:838)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 8
at java.lang.String.charAt(String.java:658)
at mod.timeolord.aa.AAMCraftingManager.addShapedRecipe(AAMCraftingManager.java:199)
at mod.timeolord.aa.AAMCraftingManager.<init>(AAMCraftingManager.java:92)
at mod.timeolord.aa.AAMCraftingManager.<clinit>(AAMCraftingManager.java:17)
... 20 more
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at mod.timeolord.aa.AAMContainer.onCraftMatrixChanged(AAMContainer.java:58)
at mod.timeolord.aa.AAMContainer.<init>(AAMContainer.java:53)
at mod.timeolord.aa.AAMGui.<init>(AAMGui.java:14)
at mod.timeolord.aa.GuiHandler.getClientGuiElement(GuiHandler.java:24)
at cpw.mods.fml.common.network.NetworkRegistry.openLocalGui(NetworkRegistry.java:328)
at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:357)
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2480)
at mod.timeolord.blocks.AtomicAssemblerMachine.onBlockActivated(AtomicAssemblerMachine.java:49)
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:371)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1390)
-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player551'/324, l='MpServer', x=70.33, y=65.25, z=277.03]]
Chunk stats: MultiplayerChunkCache: 441
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options:
Level spawn location: World: (40,64,256), Chunk: (at 8,4,0 in 2,16; contains blocks 32,0,256 to 47,255,271), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 13212 game time, 13212 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 99 total; [EntitySkeleton['Skeleton'/266, l='MpServer', x=132.50, y=14.00, z=334.50], EntityZombie['Zombie'/267, l='MpServer', x=133.50, y=14.00, z=330.50], EntitySheep['Sheep'/264, l='MpServer', x=133.47, y=64.00, z=258.66], EntitySkeleton['Skeleton'/265, l='MpServer', x=141.22, y=14.00, z=329.66], EntityZombie['Zombie'/268, l='MpServer', x=131.50, y=14.00, z=329.50], EntityClientPlayerMP['Player551'/324, l='MpServer', x=70.33, y=65.25, z=277.03], EntityBat['Bat'/326, l='MpServer', x=98.27, y=27.46, z=336.04], EntitySheep['Sheep'/92, l='MpServer', x=-4.30, y=63.00, z=303.63], EntitySheep['Sheep'/89, l='MpServer', x=-4.91, y=70.00, z=203.97], EntitySheep['Sheep'/88, l='MpServer', x=-9.41, y=70.00, z=199.78], EntitySheep['Sheep'/90, l='MpServer', x=-9.34, y=66.00, z=272.53], EntityCreeper['Creeper'/102, l='MpServer', x=0.63, y=17.00, z=201.00], EntityBat['Bat'/110, l='MpServer', x=-3.54, y=49.55, z=277.38], EntityZombie['Zombie'/111, l='MpServer', x=3.88, y=24.00, z=314.47], EntityZombie['Zombie'/108, l='MpServer', x=14.84, y=30.00, z=233.22], EntityBat['Bat'/109, l='MpServer', x=0.47, y=12.10, z=255.16], EntitySheep['Sheep'/106, l='MpServer', x=5.69, y=70.00, z=200.50], EntityCreeper['Creeper'/107, l='MpServer', x=7.97, y=33.00, z=213.50], EntityZombie['Zombie'/119, l='MpServer', x=30.50, y=41.00, z=204.94], EntitySheep['Sheep'/127, l='MpServer', x=21.81, y=65.00, z=278.31], EntitySkeleton['Skeleton'/126, l='MpServer', x=24.63, y=13.00, z=272.31], EntitySheep['Sheep'/125, l='MpServer', x=29.16, y=67.00, z=258.31], EntityZombie['Zombie'/124, l='MpServer', x=19.59, y=21.00, z=257.96], EntityBat['Bat'/123, l='MpServer', x=29.94, y=12.00, z=250.29], EntityCreeper['Creeper'/122, l='MpServer', x=31.44, y=36.00, z=224.97], EntityZombie['Zombie'/121, l='MpServer', x=28.31, y=16.00, z=224.47], EntityBat['Bat'/120, l='MpServer', x=23.75, y=19.10, z=232.75], EntitySkeleton['Skeleton'/137, l='MpServer', x=46.56, y=20.00, z=217.91], EntitySheep['Sheep'/136, l='MpServer', x=45.13, y=69.00, z=200.22], EntityCreeper['Creeper'/139, l='MpServer', x=36.53, y=50.00, z=214.47], EntityCreeper['Creeper'/138, l='MpServer', x=46.41, y=43.00, z=220.41], EntityBat['Bat'/141, l='MpServer', x=37.28, y=36.10, z=232.50], EntityBat['Bat'/140, l='MpServer', x=45.50, y=15.10, z=237.47], EntityItem['item.tile.dirt'/143, l='MpServer', x=47.28, y=63.13, z=262.22], EntityItem['item.tile.dirt'/142, l='MpServer', x=36.38, y=64.13, z=253.06], EntitySheep['Sheep'/152, l='MpServer', x=39.78, y=64.00, z=280.67], EntitySheep['Sheep'/153, l='MpServer', x=36.94, y=63.00, z=294.94], EntityCreeper['Creeper'/154, l='MpServer', x=48.00, y=26.00, z=330.59], EntityItem['item.tile.dirt'/144, l='MpServer', x=37.84, y=59.13, z=259.13], EntityItem['item.tile.dirt'/145, l='MpServer', x=36.13, y=62.13, z=259.88], EntitySheep['Sheep'/146, l='MpServer', x=42.85, y=63.00, z=263.04], EntityItem['item.tile.dirt'/147, l='MpServer', x=35.13, y=64.13, z=258.16], EntityItem['item.item.seeds'/148, l='MpServer', x=37.16, y=66.13, z=264.59], EntityItem['item.tile.dirt'/149, l='MpServer', x=35.13, y=65.13, z=262.44], EntityItem['item.tile.dirt'/150, l='MpServer', x=34.13, y=64.13, z=256.88], EntitySheep['Sheep'/151, l='MpServer', x=40.88, y=65.00, z=265.13], EntitySheep['Sheep'/171, l='MpServer', x=51.25, y=64.00, z=265.31], EntityItem['item.tile.dirt'/170, l='MpServer', x=50.41, y=64.13, z=262.56], EntityItem['item.tile.dirt'/169, l='MpServer', x=49.59, y=63.13, z=258.66], EntityItem['item.tile.dirt'/168, l='MpServer', x=48.81, y=63.13, z=262.19], EntitySkeleton['Skeleton'/175, l='MpServer', x=48.44, y=49.00, z=355.84], EntityCreeper['Creeper'/174, l='MpServer', x=48.38, y=24.00, z=343.00], EntitySquid['Squid'/173, l='MpServer', x=63.52, y=61.00, z=314.57], EntitySquid['Squid'/172, l='MpServer', x=52.47, y=61.00, z=314.47], EntityItem['item.tile.dirt'/167, l='MpServer', x=49.81, y=63.13, z=260.88], EntityItem['item.tile.dirt'/166, l='MpServer', x=49.88, y=63.13, z=255.31], EntityBat['Bat'/165, l='MpServer', x=50.75, y=20.65, z=235.25], EntitySheep['Sheep'/186, l='MpServer', x=73.61, y=65.53, z=246.41], EntityZombie['Zombie'/187, l='MpServer', x=74.09, y=16.00, z=284.50], EntityZombie['Zombie'/184, l='MpServer', x=77.16, y=20.00, z=248.63], EntityCreeper['Creeper'/185, l='MpServer', x=76.47, y=19.00, z=246.34], EntitySheep['Sheep'/190, l='MpServer', x=68.44, y=63.00, z=281.78], EntitySheep['Sheep'/191, l='MpServer', x=71.50, y=60.00, z=279.47], EntityZombie['Zombie'/188, l='MpServer', x=74.97, y=17.00, z=284.47], EntityZombie['Zombie'/189, l='MpServer', x=77.69, y=18.00, z=283.94], EntityCreeper['Creeper'/182, l='MpServer', x=77.50, y=42.00, z=221.50], EntityCreeper['Creeper'/183, l='MpServer', x=70.63, y=18.00, z=247.31], EntityBat['Bat'/205, l='MpServer', x=91.25, y=34.10, z=206.25], EntityZombie['Zombie'/207, l='MpServer', x=95.84, y=24.00, z=210.72], EntityBat['Bat'/206, l='MpServer', x=91.49, y=27.84, z=216.80], EntityZombie['Zombie'/192, l='MpServer', x=77.31, y=27.98, z=322.31], EntitySkeleton['Skeleton'/221, l='MpServer', x=82.47, y=53.00, z=356.59], EntitySheep['Sheep'/222, l='MpServer', x=94.81, y=63.00, z=356.16], EntitySkeleton['Skeleton'/216, l='MpServer', x=83.25, y=54.00, z=333.38], EntitySkeleton['Skeleton'/217, l='MpServer', x=92.13, y=49.00, z=338.88], EntitySpider['Spider'/218, l='MpServer', x=93.00, y=54.00, z=350.25], EntitySpider['Spider'/219, l='MpServer', x=83.53, y=56.00, z=338.72], EntitySheep['Sheep'/212, l='MpServer', x=83.13, y=63.00, z=294.78], EntityZombie['Zombie'/213, l='MpServer', x=92.63, y=47.88, z=315.31], EntityZombie['Zombie'/214, l='MpServer', x=93.59, y=47.00, z=316.16], EntityZombie['Zombie'/215, l='MpServer', x=85.59, y=44.00, z=329.09], EntityCreeper['Creeper'/208, l='MpServer', x=80.53, y=41.47, z=219.47], EntityZombie['Zombie'/209, l='MpServer', x=82.84, y=22.00, z=252.41], EntityZombie['Zombie'/210, l='MpServer', x=86.95, y=12.00, z=276.52], EntitySheep['Sheep'/211, l='MpServer', x=93.66, y=64.00, z=275.44], EntityZombie['Zombie'/234, l='MpServer', x=103.06, y=48.00, z=322.66], EntitySheep['Sheep'/233, l='MpServer', x=101.44, y=67.00, z=244.34], EntityBat['Bat'/232, l='MpServer', x=93.75, y=26.00, z=237.50], EntityZombie['Zombie'/231, l='MpServer', x=104.56, y=30.00, z=210.97], EntitySheep['Sheep'/252, l='MpServer', x=116.47, y=63.00, z=353.59], EntitySheep['Sheep'/251, l='MpServer', x=117.50, y=63.00, z=358.06], EntitySheep['Sheep'/248, l='MpServer', x=121.97, y=63.00, z=346.13], EntityWolf['Wolf'/249, l='MpServer', x=129.04, y=64.00, z=345.63], EntityItem['item.tile.cloth.white'/246, l='MpServer', x=114.66, y=63.13, z=295.66], EntityWolf['Wolf'/247, l='MpServer', x=122.84, y=63.00, z=306.96], EntityItem['item.tile.cloth.white'/244, l='MpServer', x=119.47, y=64.13, z=273.09], EntityItem['item.tile.cloth.white'/245, l='MpServer', x=125.41, y=63.13, z=297.81], EntitySheep['Sheep'/242, l='MpServer', x=113.16, y=65.00, z=258.78], EntityWolf['Wolf'/243, l='MpServer', x=117.59, y=64.00, z=273.91]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:440)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2312)
at net.minecraft.client.Minecraft.run(Minecraft.java:863)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
-- System Details --
Details:
Minecraft Version: 1.6.4
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 869854784 bytes (829 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 15592 (873152 bytes; 0 MB) allocated, 2 (112 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63
FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 4 mods loaded, 4 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
AA{0.0.1} [Atomic Assembler] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Launched Version: UnknownFMLProfile
LWJGL: 2.9.0
OpenGL: GeForce GTX 560 Ti/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Pack: Default
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 3458 (193648 bytes; 0 MB) allocated, 18 (1008 bytes; 0 MB) used