This is going to be a simple explanation of how a furnace is made. This will be from the vanilla source plus a gui handler (I do not use proxy to extend the handler). So on with the code, this will be little explanation as I am not sure what or why for a lot of this, considering I had to piece this together from about 3 different tutorials to get it to work....
This has been revised for all those copy/pasters, you know who you are. The aim of this is to help you understand how the furnace works and have a better chance at success making one for your mod.
BlockFurnace
public class BlockFurnace extends BlockContainer
{
private Random furnaceRand = new Random();
private final boolean isActive;
private static boolean keepFurnaceInventory = false;
protected BlockFurnace(int par1, boolean par2)
{
super(par1, Material.rock);
this.isActive = par2;
this.blockIndexInTexture = 45;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.stoneOvenIdle.blockID;
}
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
super.onBlockAdded(par1World, par2, par3, par4);
this.setDefaultDirection(par1World, par2, par3, par4);
}
private void setDefaultDirection(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
int var5 = par1World.getBlockId(par2, par3, par4 - 1);
int var6 = par1World.getBlockId(par2, par3, par4 + 1);
int var7 = par1World.getBlockId(par2 - 1, par3, par4);
int var8 = par1World.getBlockId(par2 + 1, par3, par4);
byte var9 = 3;
if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6])
{
var9 = 3;
}
if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5])
{
var9 = 2;
}
if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8])
{
var9 = 5;
}
if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7])
{
var9 = 4;
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, var9);
}
}
@SideOnly(Side.CLIENT)
public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
if (par5 == 1)
{
return this.blockIndexInTexture + 17;
}
else if (par5 == 0)
{
return this.blockIndexInTexture + 17;
}
else
{
int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
return par5 != var6 ? this.blockIndexInTexture : (this.isActive ? this.blockIndexInTexture + 16 : this.blockIndexInTexture - 1);
}
}
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (this.isActive)
{
int var6 = par1World.getBlockMetadata(par2, par3, par4);
float var7 = (float)par2 + 0.5F;
float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F;
float var9 = (float)par4 + 0.5F;
float var10 = 0.52F;
float var11 = par5Random.nextFloat() * 0.6F - 0.3F;
if (var6 == 4)
{
par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
}
else if (var6 == 5)
{
par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
}
else if (var6 == 2)
{
par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D);
}
else if (var6 == 3)
{
par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D);
}
}
}
public int getBlockTextureFromSide(int par1)
{
return par1 == 1 ? this.blockIndexInTexture + 17 : (par1 == 0 ? this.blockIndexInTexture + 17 : (par1 == 3 ? this.blockIndexInTexture - 1 : this.blockIndexInTexture));
}
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par1World.isRemote)
{
return true;
}
else
{
TileEntityFurnace var10 = (TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4);
if (var10 != null)
{
par5EntityPlayer.displayGUIFurnace(var10);
}
return true;
}
}
public static void updateFurnaceBlockState(boolean par0, World par1World, int par2, int par3, int par4)
{
int var5 = par1World.getBlockMetadata(par2, par3, par4);
TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4);
keepFurnaceInventory = true;
if (par0)
{
par1World.setBlockWithNotify(par2, par3, par4, Block.stoneOvenActive.blockID);
}
else
{
par1World.setBlockWithNotify(par2, par3, par4, Block.stoneOvenIdle.blockID);
}
keepFurnaceInventory = false;
par1World.setBlockMetadataWithNotify(par2, par3, par4, var5);
if (var6 != null)
{
var6.validate();
par1World.setBlockTileEntity(par2, par3, par4, var6);
}
}
public TileEntity createNewTileEntity(World par1World)
{
return new TileEntityFurnace();
}
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if (var6 == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2);
}
if (var6 == 1)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 5);
}
if (var6 == 2)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3);
}
if (var6 == 3)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
}
}
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
{
if (!keepFurnaceInventory)
{
TileEntityFurnace var7 = (TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4);
if (var7 != null)
{
for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8)
{
ItemStack var9 = var7.getStackInSlot(var8);
if (var9 != null)
{
float var10 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;
float var11 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;
float var12 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;
while (var9.stackSize > 0)
{
int var13 = this.furnaceRand.nextInt(21) + 10;
if (var13 > var9.stackSize)
{
var13 = var9.stackSize;
}
var9.stackSize -= var13;
EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage()));
if (var9.hasTagCompound())
{
var14.func_92014_d().setTagCompound((NBTTagCompound)var9.getTagCompound().copy());
}
float var15 = 0.05F;
var14.motionX = (double)((float)this.furnaceRand.nextGaussian() * var15);
var14.motionY = (double)((float)this.furnaceRand.nextGaussian() * var15 + 0.2F);
var14.motionZ = (double)((float)this.furnaceRand.nextGaussian() * var15);
par1World.spawnEntityInWorld(var14);
}
}
}
}
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
}
}
Change this to the name of your custom furnace
public class BlockYourFurnace extends BlockContainer
{
private Random furnaceRand = new Random();
private final boolean isActive;
private static boolean keepFurnaceInventory = false;
protected BlockYourFurnace(int par1, boolean par2)
{
super(par1, Material.rock);
this.isActive = par2;
this.blockIndexInTexture = 45;
}
Change the onBlockActivated method to this
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par1World.isRemote)
{
return true;
}
else if (!par5EntityPlayer.isSneaking())
{
TileEntityYourFurnace var10 = (TileEntityYourFurnace) par1World.getBlockTileEntity(par2, par3, par4);
if (var10 != null)
{
par5EntityPlayer.openGui(YourMod.instance, 0, par1World, par2, par3, par4);
}
return true;
}
else
{
return false;
}
}
Be sure to change any reference of the tile entity to your tile entity as follows
public TileEntity createNewTileEntity(World par1World)
{
return new TileEntityYourFurnace();
}
And Here Too
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
{
if (!keepFurnaceInventory)
{
TileEntityYourFurnace var7 = (TileEntityYourFurnace)par1World.getBlockTileEntity(par2, par3, par4);
if (var7 != null)
{
public class GuiYourFurnace extends GuiContainer
{
private TileEntityYourFurnace furnaceInventory;
public GuiYourFurnace(InventoryPlayer par1InventoryPlayer, TileEntityYourFurnace par2TileEntityYourFurnace)
{
super(new ContainerYourFurnace(par1InventoryPlayer, par2TileEntityYourFurnace));
this.furnaceInventory = par2TileEntityYourFurnace;
}
GuiFurnace should reflect your mod GuiYourFurnace, TileEntityFurnace to TileEntityYourFurnace and the ContainerFurnace to ContainerYourFurnace...Also dont forget to change the texture path in the render to your texture path
In the method "public ItemStack transferStackInSlot" at line 107 change lines 126 to 141 to look like this
else if (par2 != 1 && par2 != 0)
{
if (YourRecipes.smelting().getSmeltingResult(var5) != null)
{
if (!this.mergeItemStack(var5, 0, 1, false))
{
return null;
}
}
else if (TileEntityYourFurnace.isItemFuel(var5))
{
if (!this.mergeItemStack(var5, 1, 2, false))
{
return null;
}
}
In the SlotFurnace we have this
public class SlotFurnace extends Slot
{
private EntityPlayer thePlayer;
private int field_75228_b;
public SlotFurnace(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, int par5)
{
super(par2IInventory, par3, par4, par5);
this.thePlayer = par1EntityPlayer;
}
public boolean isItemValid(ItemStack par1ItemStack)
{
return false;
}
public ItemStack decrStackSize(int par1)
{
if (this.getHasStack())
{
this.field_75228_b += Math.min(par1, this.getStack().stackSize);
}
return super.decrStackSize(par1);
}
public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack)
{
this.onCrafting(par2ItemStack);
super.onPickupFromSlot(par1EntityPlayer, par2ItemStack);
}
protected void onCrafting(ItemStack par1ItemStack, int par2)
{
this.field_75228_b += par2;
this.onCrafting(par1ItemStack);
}
protected void onCrafting(ItemStack par1ItemStack)
{
par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_B);
if (!this.thePlayer.worldObj.isRemote)
{
int var2 = this.field_75228_b;
float var3 = FurnaceRecipes.smelting().getExperience(par1ItemStack);
int var4;
if (var3 == 0.0F)
{
var2 = 0;
}
else if (var3 < 1.0F)
{
var4 = MathHelper.floor_float((float)var2 * var3);
if (var4 < MathHelper.ceiling_float_int((float)var2 * var3) && (float)Math.random() < (float)var2 * var3 - (float)var4)
{
++var4;
}
var2 = var4;
}
while (var2 > 0)
{
var4 = EntityXPOrb.getXPSplit(var2);
var2 -= var4;
this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, var4));
}
}
this.field_75228_b = 0;
GameRegistry.onItemSmelted(thePlayer, par1ItemStack);
if (par1ItemStack.itemID == Item.ingotIron.itemID)
{
this.thePlayer.addStat(AchievementList.acquireIron, 1);
}
if (par1ItemStack.itemID == Item.fishCooked.itemID)
{
this.thePlayer.addStat(AchievementList.cookFish, 1);
}
}
}
First we need to change the top section to this
public class SlotYourFurnace extends Slot
{
private EntityPlayer thePlayer;
private int field_75228_b;
public SlotYourFurnace(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, int par5)
{
super(par2IInventory, par3, par4, par5);
this.thePlayer = par1EntityPlayer;
}
At line 65 we have this
protected void onCrafting(ItemStack par1ItemStack)
{
par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_B);
if (!this.thePlayer.worldObj.isRemote)
{
int var2 = this.field_75228_b;
float var3 = FurnaceRecipes.smelting().getExperience(par1ItemStack);
int var4;
Change FurnaceRecipes to YourRecipes...
Now for the FurnaceRecipes
public class FurnaceRecipes
{
private static final FurnaceRecipes smeltingBase = new FurnaceRecipes();
private Map smeltingList = new HashMap();
private Map experienceList = new HashMap();
private HashMap<List<Integer>, ItemStack> metaSmeltingList = new HashMap<List<Integer>, ItemStack>();
private HashMap<List<Integer>, Float> metaExperience = new HashMap<List<Integer>, Float>();
public static final FurnaceRecipes smelting()
{
return smeltingBase;
}
private FurnaceRecipes()
{
this.addSmelting(Block.oreIron.blockID, new ItemStack(Item.ingotIron), 0.7F);
this.addSmelting(Block.oreGold.blockID, new ItemStack(Item.ingotGold), 1.0F);
this.addSmelting(Block.oreDiamond.blockID, new ItemStack(Item.diamond), 1.0F);
this.addSmelting(Block.sand.blockID, new ItemStack(Block.glass), 0.1F);
this.addSmelting(Item.porkRaw.itemID, new ItemStack(Item.porkCooked), 0.35F);
this.addSmelting(Item.beefRaw.itemID, new ItemStack(Item.beefCooked), 0.35F);
this.addSmelting(Item.chickenRaw.itemID, new ItemStack(Item.chickenCooked), 0.35F);
this.addSmelting(Item.fishRaw.itemID, new ItemStack(Item.fishCooked), 0.35F);
this.addSmelting(Block.cobblestone.blockID, new ItemStack(Block.stone), 0.1F);
this.addSmelting(Item.clay.itemID, new ItemStack(Item.brick), 0.3F);
this.addSmelting(Block.cactus.blockID, new ItemStack(Item.dyePowder, 1, 2), 0.2F);
this.addSmelting(Block.wood.blockID, new ItemStack(Item.coal, 1, 1), 0.15F);
this.addSmelting(Block.oreEmerald.blockID, new ItemStack(Item.emerald), 1.0F);
this.addSmelting(Item.potato.itemID, new ItemStack(Item.bakedPotato), 0.35F);
this.addSmelting(Block.oreCoal.blockID, new ItemStack(Item.coal), 0.1F);
this.addSmelting(Block.oreRedstone.blockID, new ItemStack(Item.redstone), 0.7F);
this.addSmelting(Block.oreLapis.blockID, new ItemStack(Item.dyePowder, 1, 4), 0.2F);
}
public void addSmelting(int par1, ItemStack par2ItemStack, float par3)
{
this.smeltingList.put(Integer.valueOf(par1), par2ItemStack);
this.experienceList.put(Integer.valueOf(par2ItemStack.itemID), Float.valueOf(par3));
}
@Deprecated
public ItemStack getSmeltingResult(int par1)
{
return (ItemStack)this.smeltingList.get(Integer.valueOf(par1));
}
public Map getSmeltingList()
{
return this.smeltingList;
}
@Deprecated //In favor of ItemStack sensitive version
public float getExperience(int par1)
{
return this.experienceList.containsKey(Integer.valueOf(par1)) ? ((Float)this.experienceList.get(Integer.valueOf(par1))).floatValue() : 0.0F;
}
public void addSmelting(int itemID, int metadata, ItemStack itemstack, float experience)
{
metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack);
metaExperience.put(Arrays.asList(itemID, metadata), experience);
}
public ItemStack getSmeltingResult(ItemStack item)
{
if (item == null)
{
return null;
}
ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage()));
if (ret != null)
{
return ret;
}
return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID));
}
public float getExperience(ItemStack item)
{
if (item == null || item.getItem() == null)
{
return 0;
}
float ret = item.getItem().getSmeltingExperience(item);
if (ret < 0 && metaExperience.containsKey(Arrays.asList(item.itemID, item.getItemDamage())))
{
ret = metaExperience.get(Arrays.asList(item.itemID, item.getItemDamage()));
}
if (ret < 0 && experienceList.containsKey(item.itemID))
{
ret = ((Float)experienceList.get(item.itemID)).floatValue();
}
return (ret < 0 ? 0 : ret);
}
}
Now for the changes, they mostly take place at the top and are references to FurnaceRecipes
public class YourRecipes
{
private static final YourRecipes smeltingBase = new YourRecipes();
private Map smeltingList = new HashMap();
private Map experienceList = new HashMap();
private HashMap<List<Integer>, ItemStack> metaSmeltingList = new HashMap<List<Integer>, ItemStack>();
private HashMap<List<Integer>, Float> metaExperience = new HashMap<List<Integer>, Float>();
public static final YourRecipes smelting()
{
return smeltingBase;
}
private YourRecipes()
{
And that should do it for the Recipes class
Now we look at the very lengthy TileEntityFurnace class
public class TileEntityFurnace extends TileEntity implements IInventory, ISidedInventory
{
private ItemStack[] furnaceItemStacks = new ItemStack[3];
public int furnaceBurnTime = 0;
public int currentItemBurnTime = 0;
public int furnaceCookTime = 0;
public int getSizeInventory()
{
return this.furnaceItemStacks.length;
}
public ItemStack getStackInSlot(int par1)
{
return this.furnaceItemStacks[par1];
}
public ItemStack decrStackSize(int par1, int par2)
{
if (this.furnaceItemStacks[par1] != null)
{
ItemStack var3;
if (this.furnaceItemStacks[par1].stackSize <= par2)
{
var3 = this.furnaceItemStacks[par1];
this.furnaceItemStacks[par1] = null;
return var3;
}
else
{
var3 = this.furnaceItemStacks[par1].splitStack(par2);
if (this.furnaceItemStacks[par1].stackSize == 0)
{
this.furnaceItemStacks[par1] = null;
}
return var3;
}
}
else
{
return null;
}
}
public ItemStack getStackInSlotOnClosing(int par1)
{
if (this.furnaceItemStacks[par1] != null)
{
ItemStack var2 = this.furnaceItemStacks[par1];
this.furnaceItemStacks[par1] = null;
return var2;
}
else
{
return null;
}
}
public void setInventorySlotContents(int par1, ItemStack par2ItemStack)
{
this.furnaceItemStacks[par1] = par2ItemStack;
if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit())
{
par2ItemStack.stackSize = this.getInventoryStackLimit();
}
}
public String getInvName()
{
return "container.furnace";
}
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readFromNBT(par1NBTTagCompound);
NBTTagList var2 = par1NBTTagCompound.getTagList("Items");
this.furnaceItemStacks = new ItemStack[this.getSizeInventory()];
for (int var3 = 0; var3 < var2.tagCount(); ++var3)
{
NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
byte var5 = var4.getByte("Slot");
if (var5 >= 0 && var5 < this.furnaceItemStacks.length)
{
this.furnaceItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4);
}
}
this.furnaceBurnTime = par1NBTTagCompound.getShort("BurnTime");
this.furnaceCookTime = par1NBTTagCompound.getShort("CookTime");
this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks[1]);
}
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setShort("BurnTime", (short)this.furnaceBurnTime);
par1NBTTagCompound.setShort("CookTime", (short)this.furnaceCookTime);
NBTTagList var2 = new NBTTagList();
for (int var3 = 0; var3 < this.furnaceItemStacks.length; ++var3)
{
if (this.furnaceItemStacks[var3] != null)
{
NBTTagCompound var4 = new NBTTagCompound();
var4.setByte("Slot", (byte)var3);
this.furnaceItemStacks[var3].writeToNBT(var4);
var2.appendTag(var4);
}
}
par1NBTTagCompound.setTag("Items", var2);
}
public int getInventoryStackLimit()
{
return 64;
}
@SideOnly(Side.CLIENT)
public int getCookProgressScaled(int par1)
{
return this.furnaceCookTime * par1 / 200;
}
@SideOnly(Side.CLIENT)
public int getBurnTimeRemainingScaled(int par1)
{
if (this.currentItemBurnTime == 0)
{
this.currentItemBurnTime = 200;
}
return this.furnaceBurnTime * par1 / this.currentItemBurnTime;
}
public boolean isBurning()
{
return this.furnaceBurnTime > 0;
}
public void updateEntity()
{
boolean var1 = this.furnaceBurnTime > 0;
boolean var2 = false;
if (this.furnaceBurnTime > 0)
{
--this.furnaceBurnTime;
}
if (!this.worldObj.isRemote)
{
if (this.furnaceBurnTime == 0 && this.canSmelt())
{
this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]);
if (this.furnaceBurnTime > 0)
{
var2 = true;
if (this.furnaceItemStacks[1] != null)
{
--this.furnaceItemStacks[1].stackSize;
if (this.furnaceItemStacks[1].stackSize == 0)
{
this.furnaceItemStacks[1] = this.furnaceItemStacks[1].getItem().getContainerItemStack(furnaceItemStacks[1]);
}
}
}
}
if (this.isBurning() && this.canSmelt())
{
++this.furnaceCookTime;
if (this.furnaceCookTime == 200)
{
this.furnaceCookTime = 0;
this.smeltItem();
var2 = true;
}
}
else
{
this.furnaceCookTime = 0;
}
if (var1 != this.furnaceBurnTime > 0)
{
var2 = true;
BlockFurnace.updateFurnaceBlockState(this.furnaceBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
}
}
if (var2)
{
this.onInventoryChanged();
}
}
private boolean canSmelt()
{
if (this.furnaceItemStacks[0] == null)
{
return false;
}
else
{
ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
if (var1 == null) return false;
if (this.furnaceItemStacks[2] == null) return true;
if (!this.furnaceItemStacks[2].isItemEqual(var1)) return false;
int result = furnaceItemStacks[2].stackSize + var1.stackSize;
return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize());
}
}
public void smeltItem()
{
if (this.canSmelt())
{
ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
if (this.furnaceItemStacks[2] == null)
{
this.furnaceItemStacks[2] = var1.copy();
}
else if (this.furnaceItemStacks[2].isItemEqual(var1))
{
furnaceItemStacks[2].stackSize += var1.stackSize;
}
--this.furnaceItemStacks[0].stackSize;
if (this.furnaceItemStacks[0].stackSize <= 0)
{
this.furnaceItemStacks[0] = null;
}
}
}
public static int getItemBurnTime(ItemStack par0ItemStack)
{
if (par0ItemStack == null)
{
return 0;
}
else
{
int var1 = par0ItemStack.getItem().itemID;
Item var2 = par0ItemStack.getItem();
if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[var1] != null)
{
Block var3 = Block.blocksList[var1];
if (var3 == Block.woodSingleSlab)
{
return 150;
}
if (var3.blockMaterial == Material.wood)
{
return 300;
}
}
if (var2 instanceof ItemTool && ((ItemTool) var2).getToolMaterialName().equals("WOOD")) return 200;
if (var2 instanceof ItemSword && ((ItemSword) var2).func_77825_f().equals("WOOD")) return 200;
if (var2 instanceof ItemHoe && ((ItemHoe) var2).func_77842_f().equals("WOOD")) return 200;
if (var1 == Item.stick.itemID) return 100;
if (var1 == Item.coal.itemID) return 1600;
if (var1 == Item.bucketLava.itemID) return 20000;
if (var1 == Block.sapling.blockID) return 100;
if (var1 == Item.blazeRod.itemID) return 2400;
return GameRegistry.getFuelValue(par0ItemStack);
}
}
public static boolean isItemFuel(ItemStack par0ItemStack)
{
return getItemBurnTime(par0ItemStack) > 0;
}
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer)
{
return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
}
public void openChest() {}
public void closeChest() {}
@Override
public int getStartInventorySide(ForgeDirection side)
{
if (side == ForgeDirection.DOWN) return 1;
if (side == ForgeDirection.UP) return 0;
return 2;
}
@Override
public int getSizeInventorySide(ForgeDirection side)
{
return 1;
}
}
First off there really are not that many changes here, but first change this section here to YourTile
public class TileEntityYourFurnace extends
And at line 126
public String getInvName()
{
return "container.yourfurnace";
}
At line 279 you have this bit here
BlockFurnace.updateFurnaceBlockState
Be sure to reference your BlockYourFurnace
At lines 300 and 316 Change FurnaceRecipes to YourRecipes
At line 340..This section contains the fuel data, you can change this to reflect your fuel items
Now we are going to need a handler if we want this to work, and it should look like this...
public class GuiHandler implements IGuiHandler
{
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tile_entity = world.getBlockTileEntity(x, y, z);
switch(id)
{
case 0: return new ContainerYourFurnace(player.inventory, (TileEntityYourFurnace) tile_entity);
}
return null;
}
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tile_entity = world.getBlockTileEntity(x, y, z);
switch(id)
{
case 0: return new GuiYourFurnace(player.inventory, (TileEntityYourFurnace) tile_entity);
}
return null;
}
}
Notice the case 0... this is your GUI ID reference, remember this from the BlockYourFurnace...YouMod.instance, 0 <<< GUI ID
Setting up you GUIHandler like this will allow you to add more than one gui to your mod by simply adding another case point. This was give to me by jcm2606...
Your Mod File should look like this
@Mod(modid = "YouMod", name = "YouMod", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class YouMod
{
@Instance("YouMod")//<<<Must be the same as your modid
public static YouMod instance;
private GuiHandler guiHandler = new GuiHandler();
//furnace
public static Block yourFurnaceIdle;
public static Block yourFurnaceActive;
@SidedProxy(clientSide = "your.mod.client.ClientProxy", serverSide = "your.mod.common.CommonProxy")
public static CommonProxy proxy;
@cpw.mods.fml.common.Mod.PreInit
public void PreInit(FMLPreInitializationEvent event)
{
}
@Init
public void load(FMLInitializationEvent event)
{
//Furnaces
yourFurnaceIdle = new BlockYourFurnace(150, false).setHardness(3.5F).setStepSound(Block.soundStoneFootstep).setBlockName("extruder").setRequiresSelfNotify().setCreativeTab(CreativeTabs.tabMisc);
yourFurnaceActive = new BlockYourFurnace(151, true).setHardness(3.5F).setStepSound(Block.soundStoneFootstep).setBlockName("extruder").setRequiresSelfNotify();
//RegFurnace
GameRegistry.registerBlock(yourFurnaceIdle, "yourFurnaceIdle");
GameRegistry.registerBlock(yourFurnaceActive, "yourFurnaceActive");
LanguageRegistry.addName(yourFurnaceIdle, "YourFurnace Idle");
GameRegistry.addRecipe(new ItemStack(extruderIdle, 1), new Object[] {"BBB", "BBB", "BBB", Character.valueOf('B'), this.blackIngot});
YourFurnaceRecipes.smelting().addSmelting(this.blackOre.blockID, new ItemStack(this.blackIngot), 0.1F);//Add recipes this way or in the recipe class
NetworkRegistry.instance().registerGuiHandler(this, guiHandler);
GameRegistry.registerTileEntity(TileEntityYourFurnace.class,"tileEntityYourFurnace");
proxy.registerRenderThings();
}
@cpw.mods.fml.common.Mod.PostInit
public void PostInit(FMLPostInitializationEvent event)
{
}
}
If this has helped you at all....Please hit the little green arrow over here>>>>>>>
This tutorial would not have been possible without the help of jcm2606
This has been revised Please dont just copy and paste, it will not work. Please follow instructions and this will work just fine, it is directly from my mod...
This is the BlockWorkBench class
public class BlockWorkbench extends Block
{
protected BlockWorkbench(int par1)
{
super(par1, Material.wood);
this.blockIndexInTexture = 59;
this.setCreativeTab(CreativeTabs.tabDecorations);
}
public int getBlockTextureFromSide(int par1)
{
return par1 == 1 ? this.blockIndexInTexture - 16 : (par1 == 0 ? Block.planks.getBlockTextureFromSide(0) : (par1 != 2 && par1 != 4 ? this.blockIndexInTexture : this.blockIndexInTexture + 1));
}
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par1World.isRemote)
{
return true;
}
else
{
par5EntityPlayer.displayGUIWorkbench(par2, par3, par4);
return true;
}
}
}
Change the onBlockActivated method to this...
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(Trees.instance, 1, var1, var2, var3, var4);
return true;
}
else
{
return false;
}
}
This is the GUICrafting Class
public class GuiCrafting extends GuiContainer
{
public GuiCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
{
super(new ContainerWorkbench(par1InventoryPlayer, par2World, par3, par4, par5));
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
this.fontRenderer.drawString(StatCollector.translateToLocal("container.crafting"), 28, 6, 4210752);
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture("/gui/crafting.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(var4);
int var5 = (this.width - this.xSize) / 2;
int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
}
}
Change this...
public GuiCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
{
super(new ContainerWorkbench(par1InventoryPlayer, par2World, par3, par4, par5));
}
To this...
public GuiYourCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
{
super(new ContainerYourWorkBench(par1InventoryPlayer, par2World, par3, par4, par5));
}
class RecipeSorter implements Comparator
{
final CraftingManager craftingManager;
RecipeSorter(CraftingManager par1CraftingManager)
{
this.craftingManager = par1CraftingManager;
}
To this...
class YourRecipeSorter implements Comparator
{
final YourCraftingManager yourcraftingManager;
YourRecipeSorter(YourCraftingManager par1YourCraftingManager)
{
this.yourcraftingManager = par1YourCraftingManager;
}
This is the CraftingManager Class
public class CraftingManager
{
private static final CraftingManager instance = new CraftingManager();
private List recipes = new ArrayList();
public static final CraftingManager getInstance()
{
return instance;
}
private CraftingManager()
{
//Most of the content was deleted to save space for tutorial purposes//
//However this is the general gist of it and where the recipes go//
(new RecipesTools()).addRecipes(this);
(new RecipesWeapons()).addRecipes(this);
(new RecipesIngots()).addRecipes(this);
(new RecipesFood()).addRecipes(this);
(new RecipesCrafting()).addRecipes(this);
(new RecipesArmor()).addRecipes(this);
(new RecipesDyes()).addRecipes(this);
this.recipes.add(new RecipesArmorDyes());
this.recipes.add(new RecipesMapCloning());
this.recipes.add(new RecipesMapExtending());
this.recipes.add(new RecipeFireworks());
this.func_92051_a(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.func_92051_a(new ItemStack(Block.fence, 2), new Object[] {"###", "###", '#', Item.stick});
this.func_92051_a(new ItemStack(Block.cobblestoneWall, 6, 0), new Object[] {"###", "###", '#', Block.cobblestone});
this.func_92051_a(new ItemStack(Block.cobblestoneWall, 6, 1), new Object[] {"###", "###", '#', Block.cobblestoneMossy});
this.func_92051_a(new ItemStack(Block.enchantmentTable, 1), new Object[] {" B ", "D#D", "###", '#', Block.obsidian, 'B', Item.book, 'D', Item.diamond});
this.func_92051_a(new ItemStack(Block.anvil, 1), new Object[] {"III", " i ", "iii", 'I', Block.blockSteel, '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)});
Collections.sort(this.recipes, new RecipeSorter(this));
System.out.println(this.recipes.size() + " recipes");
}
public ShapedRecipes func_92051_a(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;
}
}
ShapedRecipes var17 = new ShapedRecipes(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 recipy!");
}
var3.add(new ItemStack((Block)var7));
}
}
this.recipes.add(new ShapelessRecipes(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;
}
}
Change this....
public class CraftingManager
{
private static final CraftingManager instance = new CraftingManager();
private List recipes = new ArrayList();
public static final CraftingManager getInstance()
{
return instance;
}
private CraftingManager()
{
To this...
public class YourCraftingManager
{
private static final YourCraftingManager instance = new YourCraftingManager();
private List recipes = new ArrayList();
public static final YourCraftingManager getInstance()
{
return instance;
}
private YourCraftingManager()
{
This is the vanilla SlotCrafting Class
public class SlotCrafting extends Slot
{
private final IInventory craftMatrix;
private EntityPlayer thePlayer;
private int amountCrafted;
public SlotCrafting(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);
}
protected void onCrafting(ItemStack par1ItemStack)
{
par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
this.amountCrafted = 0;
if (par1ItemStack.itemID == Block.workbench.blockID)
{
this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
}
else if (par1ItemStack.itemID == Item.pickaxeWood.itemID)
{
this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
}
else if (par1ItemStack.itemID == Block.stoneOvenIdle.blockID)
{
this.thePlayer.addStat(AchievementList.buildFurnace, 1);
}
else if (par1ItemStack.itemID == Item.hoeWood.itemID)
{
this.thePlayer.addStat(AchievementList.buildHoe, 1);
}
else if (par1ItemStack.itemID == Item.bread.itemID)
{
this.thePlayer.addStat(AchievementList.makeBread, 1);
}
else if (par1ItemStack.itemID == Item.cake.itemID)
{
this.thePlayer.addStat(AchievementList.bakeCake, 1);
}
else if (par1ItemStack.itemID == Item.pickaxeStone.itemID)
{
this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
}
else if (par1ItemStack.itemID == Item.swordWood.itemID)
{
this.thePlayer.addStat(AchievementList.buildSword, 1);
}
else if (par1ItemStack.itemID == Block.enchantmentTable.blockID)
{
this.thePlayer.addStat(AchievementList.enchantments, 1);
}
else if (par1ItemStack.itemID == Block.bookShelf.blockID)
{
this.thePlayer.addStat(AchievementList.bookcase, 1);
}
}
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);
}
}
}
}
}
}
}
Change this...
public class SlotCrafting extends Slot
{
private final IInventory craftMatrix;
private EntityPlayer thePlayer;
private int amountCrafted;
public SlotCrafting(EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6)
{
super(par3IInventory, par4, par5, par6);
this.thePlayer = par1EntityPlayer;
this.craftMatrix = par2IInventory;
}
To this...
public class SlotYourCrafting extends Slot
{
private final IInventory craftMatrix;
private EntityPlayer thePlayer;
private int amountCrafted;
public SlotYourCrafting(EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6)
{
super(par3IInventory, par4, par5, par6);
this.thePlayer = par1EntityPlayer;
this.craftMatrix = par2IInventory;
}
This is the ContainerWorkbench Class
public class ContainerWorkbench extends Container
{
public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
public IInventory craftResult = new InventoryCraftResult();
private World worldObj;
private int posX;
private int posY;
private int posZ;
public ContainerWorkbench(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 SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35));
int var6;
int var7;
for (var6 = 0; var6 < 3; ++var6)
{
for (var7 = 0; var7 < 3; ++var7)
{
this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18));
}
}
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));
}
}
for (var6 = 0; var6 < 9; ++var6)
{
this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142));
}
this.onCraftMatrixChanged(this.craftMatrix);
}
public void onCraftMatrixChanged(IInventory par1IInventory)
{
this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
}
public void onCraftGuiClosed(EntityPlayer par1EntityPlayer)
{
super.onCraftGuiClosed(par1EntityPlayer);
if (!this.worldObj.isRemote)
{
for (int var2 = 0; var2 < 9; ++var2)
{
ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2);
if (var3 != null)
{
par1EntityPlayer.dropPlayerItem(var3);
}
}
}
}
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{
return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
}
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;
}
}
Change this...
public class ContainerWorkbench extends Container
{
public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
public IInventory craftResult = new InventoryCraftResult();
private World worldObj;
private int posX;
private int posY;
private int posZ;
public ContainerWorkbench(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 SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35));
int var6;
int var7;
To this...
public class YourContainer extends Container
{
public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
public IInventory craftResult = new InventoryCraftResult();
private World worldObj;
private int posX;
private int posY;
private int posZ;
public YourContainer(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 SlotYourCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35));
int var6;
int var7;
And change this too or the gui will not stay open...
Your mod file, if following the above tutorial will now look like this...
@Mod(modid = "YouMod", name = "YouMod", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class YouMod
{
@Instance("YouMod")//<<<Must be the same as your modid
public static YouMod instance;
private GuiHandler guiHandler = new GuiHandler();
//furnace
public static Block yourFurnaceIdle;
public static Block yourFurnaceActive;
//YourBench
public static Block yourBench;
@SidedProxy(clientSide = "your.mod.client.ClientProxy", serverSide = "your.mod.common.CommonProxy")
public static CommonProxy proxy;
@cpw.mods.fml.common.Mod.PreInit
public void PreInit(FMLPreInitializationEvent event)
{
}
@Init
public void load(FMLInitializationEvent event)
{
//Furnaces
yourFurnaceIdle = new BlockYourFurnace(150, false).setHardness(3.5F).setStepSound(Block.soundStoneFootstep).setBlockName("extruder").setRequiresSelfNotify().setCreativeTab(CreativeTabs.tabMisc);
yourFurnaceActive = new BlockYourFurnace(151, true).setHardness(3.5F).setStepSound(Block.soundStoneFootstep).setBlockName("extruder").setRequiresSelfNotify();
//Bench
yourBench = new BlockYourBench(188, 1).setHardness(2.5F).setStepSound(Block.soundWoodFootstep).setBlockName("Smiths Bench");
//Notice the '1' after the block id, this is reference to the gui
//RegFurnace
GameRegistry.registerBlock(yourFurnaceIdle, "yourFurnaceIdle");
GameRegistry.registerBlock(yourFurnaceActive, "yourFurnaceActive");
LanguageRegistry.addName(yourFurnaceIdle, "YourFurnace Idle");
//RegBench
GameRegistry.registerBlock(yourBench, "yourBench");
LanguageRegistry.addName(yourBench, "Your Bench");
GameRegistry.addRecipe(new ItemStack(extruderIdle, 1), new Object[] {"BBB", "BBB", "BBB", Character.valueOf('B'), this.blackIngot});
YourFurnaceRecipes.smelting().addSmelting(this.blackOre.blockID, new ItemStack(this.blackIngot), 0.1F);//Add recipes this way or in the recipe class
NetworkRegistry.instance().registerGuiHandler(this, guiHandler);
GameRegistry.registerTileEntity(TileEntityYourFurnace.class,"tileEntityYourFurnace");
proxy.registerRenderThings();
}
@cpw.mods.fml.common.Mod.PostInit
public void PostInit(FMLPostInitializationEvent event)
{
}
}
And the Gui Handler will now look like this
public class GuiHandler implements IGuiHandler
{
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tile_entity = world.getBlockTileEntity(x, y, z);
switch(id)
{
case 0: return new ContainerYourFurnace(player.inventory, (TileEntityYourFurnace) tile_entity);
case 1: return id == 1 && world.getBlockId(x, y, z) == YourMod.yourBench.blockID ? new ContainerYourBench(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)
{
TileEntity tile_entity = world.getBlockTileEntity(x, y, z);
switch(id)
{
case 0: return new GuiYourFurnace(player.inventory, (TileEntityYourFurnace) tile_entity);
case 1: return id == 1 && world.getBlockId(x, y, z) == YourMod.yourBench.blockID ? new GuiYourCrafting(player.inventory, world, x, y, z) : null;
}
return null;
}
}
Adding recipes to your block can also be done in the mod class like this
YourBench.getInstance().addRecipe(new ItemStack(Block.planks, 2, 0), new Object[]{"S S", 'D', Block.dirt});
yep, Sorry it took a little longer than expected, I should have some later to add some explanations of the code, I am actually on my way out the door here in a few moments. Was actually hoping that curse finally listened to all the complaints and removed the damn box at the bottom that nothing seems able to block without disabling feature of the forum, but alas no such luck....ITS STILL THERE.....
Brilliant tutorial help'd me a lot, just a few things, How do you speed a furnace up, so it's quicker than normal furnaces? and, How do you make the furnace only use certain fuel and not standard furnace fuel?
Thank you.
Rollback Post to RevisionRollBack
I take in all suggestions and comments on my mods, even if I don't reply I have logged it somewhere.
Every time I try to open it, it says: 2013-01-09 17:49:28 [WARNING] [ForgeModLoader] A mod tried to open a gui on the server without being a NetworkMod
Ok I fixed that problem, but now when I right click the furnace while it is smelting I get this error:
java.lang.ClassCastException: legendcraft.common.TileAreriaCollector cannot be cast to net.minecraft.tileentity.TileEntityFurnace
at net.minecraft.block.BlockFurnace.onBlockActivated(BlockFurnace.java:175)
at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:411)
at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:578)
at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:80)
at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:136)
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:57)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:108)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:599)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:123)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:497)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
--- END ERROR REPORT 1f38e18c ----------
Thank you!, not sure if we can make suggestions but a chest with metadata or regular chest would be cool
Was going to make a chest, after I get my crafting table fixed...you can make suggestions, just not something that has been done a few times already. And if its something thats been done I will provide link for the tutorial...
Every time I try to open it, it says: 2013-01-09 17:49:28 [WARNING] [ForgeModLoader] A mod tried to open a gui on the server without being a NetworkMod
Glad to see you got this part fixed, as for the crash report, let me finish the tutorial with comments later and I will get to checking it out later tonight when my son goes to bed...
1.) one is when i place the coal in and then the iron ore it shoots everything out except 1 piece of coal. Not sure if i messed something up there or not.
2.) when I right click while smelting is crashes the game with this error
---- Minecraft Crash Report ----
// This doesn't make any sense!
java.lang.ClassCastException: nico.mods.nicocraft.tileentity.TileFusionChamber cannot be cast to net.minecraft.tileentity.TileEntityFurnace
at net.minecraft.block.BlockFurnace.onBlockActivated(BlockFurnace.java:175)
at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:411)
at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:578)
at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:80)
at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:136)
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:57)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:108)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:702)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:598)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:123)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:497)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows XP (x86) version 5.1
Java Version: 1.7.0_09, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 889554360 bytes (848 MB) / 1067057152 bytes (1017 MB) up to 1067057152 bytes (1017 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 4312 (241472 bytes; 0 MB) allocated, 4138 (231728 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63
FML: MCP v7.25 FML v4.6.17.515 Minecraft Forge 6.5.0.489 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
NicoCraft [NicoCraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1350 (75600 bytes; 0 MB) allocated, 1030 (57680 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['Player497'/291, l='New World', x=53.49, y=66.00, z=312.39]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'forge,fml'
3.) When I try and break it while smelting it gives me a similar crash
---- Minecraft Crash Report ----
// I let you down. Sorry
java.lang.ClassCastException: nico.mods.nicocraft.tileentity.TileFusionChamber cannot be cast to net.minecraft.tileentity.TileEntityFurnace
at net.minecraft.block.BlockFurnace.breakBlock(BlockFurnace.java:257)
at net.minecraft.world.chunk.Chunk.setBlockIDWithMetadata(Chunk.java:721)
at net.minecraft.world.chunk.Chunk.setBlockID(Chunk.java:663)
at net.minecraft.world.World.setBlock(World.java:591)
at net.minecraft.world.World.setBlockWithNotify(World.java:700)
at net.minecraft.block.Block.removeBlockByPlayer(Block.java:1529)
at net.minecraft.item.ItemInWorldManager.removeBlock(ItemInWorldManager.java:274)
at net.minecraft.item.ItemInWorldManager.tryHarvestBlock(ItemInWorldManager.java:307)
at net.minecraft.item.ItemInWorldManager.onBlockClicked(ItemInWorldManager.java:170)
at net.minecraft.network.NetServerHandler.handleBlockDig(NetServerHandler.java:509)
at net.minecraft.network.packet.Packet14BlockDig.processPacket(Packet14BlockDig.java:67)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:80)
at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:136)
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:57)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:108)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:702)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:598)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:123)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:497)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows XP (x86) version 5.1
Java Version: 1.7.0_09, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 897861656 bytes (856 MB) / 1067057152 bytes (1017 MB) up to 1067057152 bytes (1017 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 4400 (246400 bytes; 0 MB) allocated, 4201 (235256 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63
FML: MCP v7.25 FML v4.6.17.515 Minecraft Forge 6.5.0.489 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
NicoCraft [NicoCraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1219 (68264 bytes; 0 MB) allocated, 1177 (65912 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['Player868'/285, l='New World', x=54.83, y=66.00, z=313.00]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'forge,fml'
Other wise it works great lol, anyways sorry to be a pest.
Also I am running Minecraft 1.4.6 with forge .489 and Im assuming that the public void detectAndSendChanges is my problem and was changed in the container class for 1.4.7
Well, dont right click while smelting, or break while smelting it wont crash, I guess I still have a few bugs to fix, also for all please dont use it as is, change the names of the blocks and container and all, good tip would be to follow along and use the vanilla source and call the furnace what you want and leave all info as is other than calling the slot and container. Also in the class where it defines fuel source, change coal to what ever you want fuel source to be, or add fuel sources to that code. I will try to work out the bugs soon, I am still trying to finish a mod. This is part of that mod and just wanted to share for those interested. I am also making a crafting block, and a chest for the mod, as well as biome decorator, world type with more than one biome and and several other goodies....As I learn those things I will post them here for all to share. Please be patient as I work out the bugs, and if you have any fixes for this post them here for others to learn as well....
Well, dont right click while smelting, or break while smelting it wont crash, I guess I still have a few bugs to fix, also for all please dont use it as is, change the names of the blocks and container and all, good tip would be to follow along and use the vanilla source and call the furnace what you want and leave all info as is other than calling the slot and container. Also in the class where it defines fuel source, change coal to what ever you want fuel source to be, or add fuel sources to that code. I will try to work out the bugs soon, I am still trying to finish a mod. This is part of that mod and just wanted to share for those interested. I am also making a crafting block, and a chest for the mod, as well as biome decorator, world type with more than one biome and and several other goodies....As I learn those things I will post them here for all to share. Please be patient as I work out the bugs, and if you have any fixes for this post them here for others to learn as well....
Well, dont right click while smelting, or break while smelting it wont crash, I guess I still have a few bugs to fix, also for all please dont use it as is, change the names of the blocks and container and all, good tip would be to follow along and use the vanilla source and call the furnace what you want and leave all info as is other than calling the slot and container. Also in the class where it defines fuel source, change coal to what ever you want fuel source to be, or add fuel sources to that code. I will try to work out the bugs soon, I am still trying to finish a mod. This is part of that mod and just wanted to share for those interested. I am also making a crafting block, and a chest for the mod, as well as biome decorator, world type with more than one biome and and several other goodies....As I learn those things I will post them here for all to share. Please be patient as I work out the bugs, and if you have any fixes for this post them here for others to learn as well....
I fixed all the problems so it is now working very smoothly for me ! How do I make it cook items faster then other furnaces does anyone know??
As I will be very busy this weekend with work two 8 hour days, and two 14 hour days, would you mind sharing what you did to fix your issues so that others with similar issues can benefit from your experience. Also the fuel is handles in the tile entity near the bottom of the code. Just change the fuel to whatever you want, and you can also change the speed and rate. If you get confused on how this works, check wuppy's tutorials at custom fuel and you will see what the numbers are for...
I actually don't know what made it work but I copied the TileEntityFurnace class and then replaced every Furnace with my furnace name. It worked after that..
.Can you link me to wuppy's custom fuels? I can't seem to find it...
Link to the chest tutorial....link
Furnace Forge 1.4.7
This is going to be a simple explanation of how a furnace is made. This will be from the vanilla source plus a gui handler (I do not use proxy to extend the handler). So on with the code, this will be little explanation as I am not sure what or why for a lot of this, considering I had to piece this together from about 3 different tutorials to get it to work....
This has been revised for all those copy/pasters, you know who you are. The aim of this is to help you understand how the furnace works and have a better chance at success making one for your mod.
BlockFurnace
Change this to the name of your custom furnace
Change the onBlockActivated method to this
Be sure to change any reference of the tile entity to your tile entity as follows
And Here Too
And that should do it for the block
And Now The Gui Furnace
Change this to fit your custom furnace code
GuiFurnace should reflect your mod GuiYourFurnace, TileEntityFurnace to TileEntityYourFurnace and the ContainerFurnace to ContainerYourFurnace...Also dont forget to change the texture path in the render to your texture path
Now for the ContainerFurnace
First lets change the top area to this..
In the method "public ItemStack transferStackInSlot" at line 107 change lines 126 to 141 to look like this
In the SlotFurnace we have this
First we need to change the top section to this
At line 65 we have this
Change FurnaceRecipes to YourRecipes...
Now for the FurnaceRecipes
Now for the changes, they mostly take place at the top and are references to FurnaceRecipes
And that should do it for the Recipes class
Now we look at the very lengthy TileEntityFurnace class
First off there really are not that many changes here, but first change this section here to YourTile
And at line 126
At line 279 you have this bit here
Be sure to reference your BlockYourFurnace
At lines 300 and 316 Change FurnaceRecipes to YourRecipes
At line 340..This section contains the fuel data, you can change this to reflect your fuel items
Now we are going to need a handler if we want this to work, and it should look like this...
Notice the case 0... this is your GUI ID reference, remember this from the BlockYourFurnace...YouMod.instance, 0 <<< GUI ID
Setting up you GUIHandler like this will allow you to add more than one gui to your mod by simply adding another case point. This was give to me by jcm2606...
Your Mod File should look like this
If this has helped you at all....Please hit the little green arrow over here>>>>>>>
Find out how I generate....coolAlias...world structure generation and rotation tool...
Though, you don't need the first spoiler covering the whole thing.
This tutorial would not have been possible without the help of jcm2606
This has been revised Please dont just copy and paste, it will not work. Please follow instructions and this will work just fine, it is directly from my mod...
This is the BlockWorkBench class
Change the onBlockActivated method to this...
This is the GUICrafting Class
Change this...
To this...
And change the path
To your texture path, though I would use the same texture
This is the RecipeSorter Class
Change this....
To this...
This is the CraftingManager Class
Change this....
To this...
This is the vanilla SlotCrafting Class
Change this...
To this...
This is the ContainerWorkbench Class
Change this...
To this...
And change this too or the gui will not stay open...
To this...
Your mod file, if following the above tutorial will now look like this...
And the Gui Handler will now look like this
Adding recipes to your block can also be done in the mod class like this
Find out how I generate....coolAlias...world structure generation and rotation tool...
Make high-quality models in the Techne. And do the model in Blender.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Thank you.
java.lang.ClassCastException: legendcraft.common.TileAreriaCollector cannot be cast to net.minecraft.tileentity.TileEntityFurnace
at net.minecraft.block.BlockFurnace.onBlockActivated(BlockFurnace.java:175)
at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:411)
at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:578)
at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:80)
at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:136)
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:57)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:108)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:599)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:123)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:497)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
--- END ERROR REPORT 1f38e18c ----------
Was going to make a chest, after I get my crafting table fixed...you can make suggestions, just not something that has been done a few times already. And if its something thats been done I will provide link for the tutorial...
Glad to see you got this part fixed, as for the crash report, let me finish the tutorial with comments later and I will get to checking it out later tonight when my son goes to bed...
Find out how I generate....coolAlias...world structure generation and rotation tool...
1.) one is when i place the coal in and then the iron ore it shoots everything out except 1 piece of coal. Not sure if i messed something up there or not.
2.) when I right click while smelting is crashes the game with this error
// This doesn't make any sense!
Time: 1/9/13 7:58 PM
Description: Ticking memory connection
java.lang.ClassCastException: nico.mods.nicocraft.tileentity.TileFusionChamber cannot be cast to net.minecraft.tileentity.TileEntityFurnace
at net.minecraft.block.BlockFurnace.onBlockActivated(BlockFurnace.java:175)
at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:411)
at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:578)
at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:80)
at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:136)
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:57)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:108)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:702)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:598)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:123)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:497)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows XP (x86) version 5.1
Java Version: 1.7.0_09, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 889554360 bytes (848 MB) / 1067057152 bytes (1017 MB) up to 1067057152 bytes (1017 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 4312 (241472 bytes; 0 MB) allocated, 4138 (231728 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63
FML: MCP v7.25 FML v4.6.17.515 Minecraft Forge 6.5.0.489 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
NicoCraft [NicoCraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1350 (75600 bytes; 0 MB) allocated, 1030 (57680 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['Player497'/291, l='New World', x=53.49, y=66.00, z=312.39]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'forge,fml'
3.) When I try and break it while smelting it gives me a similar crash
// I let you down. Sorry
Time: 1/9/13 7:59 PM
Description: Ticking memory connection
java.lang.ClassCastException: nico.mods.nicocraft.tileentity.TileFusionChamber cannot be cast to net.minecraft.tileentity.TileEntityFurnace
at net.minecraft.block.BlockFurnace.breakBlock(BlockFurnace.java:257)
at net.minecraft.world.chunk.Chunk.setBlockIDWithMetadata(Chunk.java:721)
at net.minecraft.world.chunk.Chunk.setBlockID(Chunk.java:663)
at net.minecraft.world.World.setBlock(World.java:591)
at net.minecraft.world.World.setBlockWithNotify(World.java:700)
at net.minecraft.block.Block.removeBlockByPlayer(Block.java:1529)
at net.minecraft.item.ItemInWorldManager.removeBlock(ItemInWorldManager.java:274)
at net.minecraft.item.ItemInWorldManager.tryHarvestBlock(ItemInWorldManager.java:307)
at net.minecraft.item.ItemInWorldManager.onBlockClicked(ItemInWorldManager.java:170)
at net.minecraft.network.NetServerHandler.handleBlockDig(NetServerHandler.java:509)
at net.minecraft.network.packet.Packet14BlockDig.processPacket(Packet14BlockDig.java:67)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:80)
at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:136)
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:57)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:108)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:702)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:598)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:123)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:497)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows XP (x86) version 5.1
Java Version: 1.7.0_09, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 897861656 bytes (856 MB) / 1067057152 bytes (1017 MB) up to 1067057152 bytes (1017 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 4400 (246400 bytes; 0 MB) allocated, 4201 (235256 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63
FML: MCP v7.25 FML v4.6.17.515 Minecraft Forge 6.5.0.489 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
NicoCraft [NicoCraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1219 (68264 bytes; 0 MB) allocated, 1177 (65912 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['Player868'/285, l='New World', x=54.83, y=66.00, z=313.00]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'forge,fml'
Other wise it works great lol, anyways sorry to be a pest.
Also I am running Minecraft 1.4.6 with forge .489 and Im assuming that the public void detectAndSendChanges is my problem and was changed in the container class for 1.4.7
Thanks Micro
Find out how I generate....coolAlias...world structure generation and rotation tool...
micro please add me on skype D: i need your help
As I will be very busy this weekend with work two 8 hour days, and two 14 hour days, would you mind sharing what you did to fix your issues so that others with similar issues can benefit from your experience. Also the fuel is handles in the tile entity near the bottom of the code. Just change the fuel to whatever you want, and you can also change the speed and rate. If you get confused on how this works, check wuppy's tutorials at custom fuel and you will see what the numbers are for...
Find out how I generate....coolAlias...world structure generation and rotation tool...
.Can you link me to wuppy's custom fuels? I can't seem to find it...