Okay for the first one I guess I am not seeing where TileEntityFurnace is coming from, which class because I suppose I will have to go back and re do some of the tutorials I have here....
the second one I basically did a mix and match real quick there, simply because I was at work when I posted these and realized that I failed to remove and replace the code in my highspeed furnace with the correct code for the basic furnace. My highspeed furnace uses fuel 4 times as fast and burns or smelts things four times as fast as well. I just didnt want anyone to complain that their furnace was working to fast and how to fix (simple really copy the furnace code)
for the render class, no I ddi not post the code for it, it is not really needed. The code that goes in here I have no idea how to explain, it was given to me from an old mod mate to help fix the inventory render of the furnace to make sure it faces front. I wont post it, because like I said I can not explain it well enough, and wont be able to answer those questions.
If you have created your own mod class and not have used mine directly....I basically used it to show where the blocks are initialized and how, which if anyone has made basic blocks before will know how to do. This is simply pointing to my folder path where my client and common proxies are, if you comment out and try to run it will crash. This needs to be there and also directed to your own client and common proxy.
Thank you for making this bro. Really helped me. Thanks
Hey no problem, this is why I made them, I once had issues as well and needed something like this and was none to be found. Glad it helped, adds a smile to my face.
would you mind quickly showing an example because i have changed a few values that i thought would shorten it but it wont work
for example changing this...
/**
* Returns an integer between 0 and the passed value representing how close the current item is to being completely
* cooked
*/
public int getCookProgressScaled(int par1)
{
return this.furnaceCookTime * par1 / 200;
}
to this....
/**
* Returns an integer between 0 and the passed value representing how close the current item is to being completely
* cooked
*/
public int getCookProgressScaled(int par1)
{
return this.furnaceCookTime * par1 / 100;
}
First you have to understand what a tile is for in the case of the furnace. It stores data, uses the data, and calculates the data for the block. I know, not a complete description, but for understanding the process of what you are trying to do, it will put it in perspective. The variables you want to change are in more than one place. I wont tell you what to change the variables to, but instead show you where the code is located in each case in the tile.
Looking at the furnace tile in the vanilla code, the places you want to change are as follows.....
public int getCookProgressScaled(int par1)
{
return this.furnaceCookTime * par1 / 200;
}
and here...
public int getBurnTimeRemainingScaled(int par1)
{
if (this.currentItemBurnTime == 0)
{
this.currentItemBurnTime = 200;
}
return this.furnaceBurnTime * par1 / this.currentItemBurnTime;
}
and also here...
if (this.isBurning() && this.canSmelt())
{
++this.furnaceCookTime;
if (this.furnaceCookTime == 200)
{
this.furnaceCookTime = 0;
this.smeltItem();
flag1 = true;
}
}
Notice the 200 in each location? Read through the tile class and try to make sense of these locations a bit before making changes. My clue I gave you above said time scaled as opposed to cook progress for the very reason I showed you the code spots here. The time scaled is where the time is actually set, but if you change it there it must be changed in the other locations as well or it will either crash or just reset to 200. Play with the numbers and see how you like it, remember to change all three though. Also as a note, if this is for a mod you plan to share, you may want to also adjust the fuel source cook times here....
if (block == Block.woodSingleSlab)
{
return 150;
}
if (block.blockMaterial == Material.wood)
{
return 300;
}
if (block == Block.field_111034_cE)
{
return 16000;
}
}
if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200;
if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200;
if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 200;
if (i == Item.stick.itemID) return 100;
if (i == Item.coal.itemID) return 1600;
if (i == Item.bucketLava.itemID) return 20000;
if (i == Block.sapling.blockID) return 100;
if (i == Item.blazeRod.itemID) return 2400;
or users may say about it being over powered, unless thats the plan.....
First you have to understand what a tile is for in the case of the furnace. It stores data, uses the data, and calculates the data for the block. I know, not a complete description, but for understanding the process of what you are trying to do, it will put it in perspective. The variables you want to change are in more than one place. I wont tell you what to change the variables to, but instead show you where the code is located in each case in the tile.
Looking at the furnace tile in the vanilla code, the places you want to change are as follows.....
public int getCookProgressScaled(int par1)
{
return this.furnaceCookTime * par1 / 200;
}
and here...
public int getBurnTimeRemainingScaled(int par1)
{
if (this.currentItemBurnTime == 0)
{
this.currentItemBurnTime = 200;
}
return this.furnaceBurnTime * par1 / this.currentItemBurnTime;
}
and also here...
if (this.isBurning() && this.canSmelt())
{
++this.furnaceCookTime;
if (this.furnaceCookTime == 200)
{
this.furnaceCookTime = 0;
this.smeltItem();
flag1 = true;
}
}
Notice the 200 in each location? Read through the tile class and try to make sense of these locations a bit before making changes. My clue I gave you above said time scaled as opposed to cook progress for the very reason I showed you the code spots here. The time scaled is where the time is actually set, but if you change it there it must be changed in the other locations as well or it will either crash or just reset to 200. Play with the numbers and see how you like it, remember to change all three though. Also as a note, if this is for a mod you plan to share, you may want to also adjust the fuel source cook times here....
if (block == Block.woodSingleSlab)
{
return 150;
}
if (block.blockMaterial == Material.wood)
{
return 300;
}
if (block == Block.field_111034_cE)
{
return 16000;
}
}
if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200;
if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200;
if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 200;
if (i == Item.stick.itemID) return 100;
if (i == Item.coal.itemID) return 1600;
if (i == Item.bucketLava.itemID) return 20000;
if (i == Block.sapling.blockID) return 100;
if (i == Item.blazeRod.itemID) return 2400;
or users may say about it being over powered, unless thats the plan.....
thank you for your patience and effort it helped me a great deal!
Hi, I need a furnace w/ 2 input but, u can get the resulte w/ u put for example, in the 1º input, u put 2 redstone, and the 2º u put 5 diamond, then, make the result, something like this:
this.addRecipe(new ItemStack(Item.redstone, 2), new ItemStack(item.diamonte, 5), new ItemStack(Result), xp);
If u can help me, pleas, reply this post. And if my inglish is bad, i know, I'm Brazilian
The Meaning of Life, the Universe, and Everything.
Join Date:
12/13/2012
Posts:
48
Minecraft:
wer_wolv
Member Details
So, how can i add Recipes for the Dual-Input-Furnance from outside? I want to have an API to add Recipes without editing the CraftingManager every time.
Hi, I need a furnace w/ 2 input but, u can get the resulte w/ u put for example, in the 1º input, u put 2 redstone, and the 2º u put 5 diamond, then, make the result, something like this: this.addRecipe(new ItemStack(Item.redstone, 2), new ItemStack(item.diamonte, 5), new ItemStack(Result), xp); If u can help me, pleas, reply this post. And if my inglish is bad, i know, I'm Brazilian
Gonna take a minute on this, not quite sure where you are having an issue.. maybe explain it without the short hand (w/ ), (1 and a little number)...got a little lost as to what you need...sorry.
So, how can i add Recipes for the Dual-Input-Furnance from outside? I want to have an API to add Recipes without editing the CraftingManager every time.
In the crafting manager where the returns are...Block.block.blockID and so on...you could have YourMod.block.blockID and so...and also to access from like a config file you could put the variable, so long as you are using an integer to represent the block or item, doesn't really matter where is comes from...
So, how can i add Recipes for the Dual-Input-Furnance from outside? I want to have an API to add Recipes without editing the CraftingManager every time.
Use a public HashMap (or one that you can access somehow) to store your recipes in, then you can add recipes to it easily with your API without editing anything. For an example, check here.
Hi, I need a furnace w/ 2 input but, u can get the resulte w/ u put for example, in the 1º input, u put 2 redstone, and the 2º u put 5 diamond, then, make the result, something like this:
this.addRecipe(new ItemStack(Item.redstone, 2), new ItemStack(item.diamonte, 5), new ItemStack(Result), xp);
If u can help me, pleas, reply this post. And if my inglish is bad, i know, I'm Brazilian
You want your recipe to require 5 diamonds at a time, using a single ItemStack, right? To do that you'll have to set up your own crafting / recipe manager, as the vanilla one only handles stack sizes of 1 at a time, so far as I know.
You could do it using HashMaps (can you tell I like these?), storing the item id + stack size + metadata required for each itemstack, as ItemStack is not natively supported as a key in the HashMap class. Vanilla FurnaceRecipes does basically this same thing, but they only store item id and metadata. Look at that class for how to do it.
Then, you'll need to adjust the 'smeltItem' method to deduct the correct number of items from the input stacks.
Hey microjunk when I create more than 1 furnace the first one I made crashes but the second one works? I can not figure out why it crashes when I right click on the first furnace?
Hey microjunk when I create more than 1 furnace the first one I made crashes but the second one works? I can not figure out why it crashes when I right click on the first furnace?
My first thought is, are you trying to use more than one GUI handler? I ask because this wont work. Forge will only let you use one, so if you could post your handler, or try to add the second furnace to the handler you will be fine...
Okay well I had a go at adding a furnace to it but I had no luck so here is my GUI Handler code
package minecraft.SimplicityOresMod.common;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
public class GuiHandlerErythiteFurnace 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 ContainerErythiteFurnace(player.inventory, (TileEntityErythiteFurnace) 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 GuiErythiteFurnace(player.inventory, (TileEntityErythiteFurnace) tile_entity);
}
return null;
}
}
Okay well I had a go at adding a furnace to it but I had no luck so here is my GUI Handler code
While I thank you for posting that I will need a bit more to go on...Basically in your second furnace you will need to make the Instance ID 1...then in your handler you just add it the same way as the first one...
While I thank you for posting that I will need a bit more to go on...Basically in your second furnace you will need to make the Instance ID 1...then in your handler you just add it the same way as the first one...
case 1: return new your furnace...
You sir are a CHAMPION!
I can not thank you enough for helping me so quickly and in a way that meant that I had to figure it out myself not just some code that I could copy and paste. Please don't stop make fabulous tutorials
I can not thank you enough for helping me so quickly and in a way that meant that I had to figure it out myself not just some code that I could copy and paste. Please don't stop make fabulous tutorials
I wish more people felt the same...I might would be inclined to make more tutorials. Thanks for the kind words, and I am glad it worked out for you.
the second one I basically did a mix and match real quick there, simply because I was at work when I posted these and realized that I failed to remove and replace the code in my highspeed furnace with the correct code for the basic furnace. My highspeed furnace uses fuel 4 times as fast and burns or smelts things four times as fast as well. I just didnt want anyone to complain that their furnace was working to fast and how to fix (simple really copy the furnace code)
for the render class, no I ddi not post the code for it, it is not really needed. The code that goes in here I have no idea how to explain, it was given to me from an old mod mate to help fix the inventory render of the furnace to make sure it faces front. I wont post it, because like I said I can not explain it well enough, and wont be able to answer those questions.
If you have created your own mod class and not have used mine directly....I basically used it to show where the blocks are initialized and how, which if anyone has made basic blocks before will know how to do. This is simply pointing to my folder path where my client and common proxies are, if you comment out and try to run it will crash. This needs to be there and also directed to your own client and common proxy.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Hey no problem, this is why I made them, I once had issues as well and needed something like this and was none to be found. Glad it helped, adds a smile to my face.
Find out how I generate....coolAlias...world structure generation and rotation tool...
That code is in the tile...item burn time...
Find out how I generate....coolAlias...world structure generation and rotation tool...
would you mind quickly showing an example because i have changed a few values that i thought would shorten it but it wont work
for example changing this...
to this....
but it doesnt work
First you have to understand what a tile is for in the case of the furnace. It stores data, uses the data, and calculates the data for the block. I know, not a complete description, but for understanding the process of what you are trying to do, it will put it in perspective. The variables you want to change are in more than one place. I wont tell you what to change the variables to, but instead show you where the code is located in each case in the tile.
Looking at the furnace tile in the vanilla code, the places you want to change are as follows.....
and here...
and also here...
Notice the 200 in each location? Read through the tile class and try to make sense of these locations a bit before making changes. My clue I gave you above said time scaled as opposed to cook progress for the very reason I showed you the code spots here. The time scaled is where the time is actually set, but if you change it there it must be changed in the other locations as well or it will either crash or just reset to 200. Play with the numbers and see how you like it, remember to change all three though. Also as a note, if this is for a mod you plan to share, you may want to also adjust the fuel source cook times here....
or users may say about it being over powered, unless thats the plan.....
Find out how I generate....coolAlias...world structure generation and rotation tool...
thank you for your patience and effort it helped me a great deal!
Find out how I generate....coolAlias...world structure generation and rotation tool...
this.addRecipe(new ItemStack(Item.redstone, 2), new ItemStack(item.diamonte, 5), new ItemStack(Result), xp);
If u can help me, pleas, reply this post. And if my inglish is bad, i know, I'm Brazilian
Gonna take a minute on this, not quite sure where you are having an issue.. maybe explain it without the short hand (w/ ), (1 and a little number)...got a little lost as to what you need...sorry.
In the crafting manager where the returns are...Block.block.blockID and so on...you could have YourMod.block.blockID and so...and also to access from like a config file you could put the variable, so long as you are using an integer to represent the block or item, doesn't really matter where is comes from...
Find out how I generate....coolAlias...world structure generation and rotation tool...
Use a public HashMap (or one that you can access somehow) to store your recipes in, then you can add recipes to it easily with your API without editing anything. For an example, check here.
You want your recipe to require 5 diamonds at a time, using a single ItemStack, right? To do that you'll have to set up your own crafting / recipe manager, as the vanilla one only handles stack sizes of 1 at a time, so far as I know.
You could do it using HashMaps (can you tell I like these?), storing the item id + stack size + metadata required for each itemstack, as ItemStack is not natively supported as a key in the HashMap class. Vanilla FurnaceRecipes does basically this same thing, but they only store item id and metadata. Look at that class for how to do it.
Then, you'll need to adjust the 'smeltItem' method to deduct the correct number of items from the input stacks.
My first thought is, are you trying to use more than one GUI handler? I ask because this wont work. Forge will only let you use one, so if you could post your handler, or try to add the second furnace to the handler you will be fine...
Find out how I generate....coolAlias...world structure generation and rotation tool...
While I thank you for posting that I will need a bit more to go on...Basically in your second furnace you will need to make the Instance ID 1...then in your handler you just add it the same way as the first one...
case 1: return new your furnace...
Find out how I generate....coolAlias...world structure generation and rotation tool...
You sir are a CHAMPION!
I can not thank you enough for helping me so quickly and in a way that meant that I had to figure it out myself not just some code that I could copy and paste. Please don't stop make fabulous tutorials
I wish more people felt the same...I might would be inclined to make more tutorials. Thanks for the kind words, and I am glad it worked out for you.
Find out how I generate....coolAlias...world structure generation and rotation tool...