Is there a way to make it so that there can only be one fuel for my furnace I have changed the tile entity class to only use my mods fuel but if I used another mod with my mod that added fuel would it work with my mod? I don't want this to happen because it would make my furnace over powered so is there a way to make it not accept another mods fuel or does it already do that?
Yes...in the area for the is valid fuel source...dont have the code in front of me (at work now) but where it has the burn speed and time for the wood and lavabucket and all, you can change it to only your fuel by adding an if statement. If its not your fuel it should return zero. So they may be able to put any fuel source in there but it should not smelt...
Yes...in the area for the is valid fuel source...dont have the code in front of me (at work now) but where it has the burn speed and time for the wood and lavabucket and all, you can change it to only your fuel by adding an if statement. If its not your fuel it should return zero. So they may be able to put any fuel source in there but it should not smelt...
Thanks I think I may have got it I just added the ingot to test and when its above the second line it smelts but when its below it doesn't smelt. So does this code look right to you or have I written it out wrong.
if (i == SimplicityOresModMain.SulphurDust.itemID) return 1440;
if (i != SimplicityOresModMain.SulphurDust.itemID) return 0;
if (i == SimplicityOresModMain.CopalIngot.itemID) return 1440;
This is the final product.
if (i != SimplicityOresModMain.SulphurDust.itemID) return 0;
if (i == SimplicityOresModMain.SulphurDust.itemID) return 1440;
Stupid me, I forgot the code was in the first post....duh....
this is the method here...
public static int getItemBurnTime(ItemStack par0ItemStack)
{
if (par0ItemStack == null)
{
return 0;
}
else
{
int i = par0ItemStack.getItem().itemID;
Item item = par0ItemStack.getItem();
if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[i] != null)
{
Block block = Block.blocksList[i];
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;
return GameRegistry.getFuelValue(par0ItemStack);
}
}
/**
* Return true if item is a fuel source (getItemBurnTime() > 0).
*/
public static boolean isItemFuel(ItemStack par0ItemStack)
{
return getItemBurnTime(par0ItemStack) > 0;
}
What you have will work, but after re-reading you post above, you said you want to use only your fuel source as well as if using another mod that adds fuel, then that as well...is that right?
If so, I would set it up like this...(this is just an explanation I am kind of tired at the moment so I hope its clear enough for now)
Items and blocks use ID's and you can set up a config file that will grab the item or block id then get the int from the config in your item burn time method.
Example
if mod a uses 7500 as the id for the fuel source, you can change the ID in your config to that and then like this
if (i == SimplicityOresModMain.modA) return 1440;
And in your mod class you would have
public static int modA;
and then in the config modA would be the variable or ID of what ever you wanted to add...set it up as a dummy just to have it working until you add the ID from the other mod. Im not sure if that is clear enough but I know it will work I have done it in the two input furnace. If you dont have a config I can help with that later after I get home, but there are a few tutorials on it too...The only thing is you will have to make sure the mod you are using in addition to yours doesnt use the shifted index with items as it can be a pain to get the ID.
Stupid me, I forgot the code was in the first post....duh....
this is the method here...
public static int getItemBurnTime(ItemStack par0ItemStack)
{
if (par0ItemStack == null)
{
return 0;
}
else
{
int i = par0ItemStack.getItem().itemID;
Item item = par0ItemStack.getItem();
if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[i] != null)
{
Block block = Block.blocksList[i];
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;
return GameRegistry.getFuelValue(par0ItemStack);
}
}
/**
* Return true if item is a fuel source (getItemBurnTime() > 0).
*/
public static boolean isItemFuel(ItemStack par0ItemStack)
{
return getItemBurnTime(par0ItemStack) > 0;
}
What you have will work, but after re-reading you post above, you said you want to use only your fuel source as well as if using another mod that adds fuel, then that as well...is that right?
If so, I would set it up like this...(this is just an explanation I am kind of tired at the moment so I hope its clear enough for now)
Items and blocks use ID's and you can set up a config file that will grab the item or block id then get the int from the config in your item burn time method.
Example
if mod a uses 7500 as the id for the fuel source, you can change the ID in your config to that and then like this
if (i == SimplicityOresModMain.modA) return 1440;
And in your mod class you would have
public static int modA;
and then in the config modA would be the variable or ID of what ever you wanted to add...set it up as a dummy just to have it working until you add the ID from the other mod. Im not sure if that is clear enough but I know it will work I have done it in the two input furnace. If you dont have a config I can help with that later after I get home, but there are a few tutorials on it too...The only thing is you will have to make sure the mod you are using in addition to yours doesnt use the shifted index with items as it can be a pain to get the ID.
Please if your to tired I can wait, but I think how I have it is okay because I don't want other mods fuels used my furnace at all I just want my fuel in it. So I think I understand what your saying and I think that isn't what I need i think...
As long as no other fuels work apart from mine I am happy
Any way thanks a bunch for taking time out of your work to help me I really appreciate it.
Please if your to tired I can wait, but I think how I have it is okay because I don't want other mods fuels used my furnace at all I just want my fuel in it. So I think I understand what your saying and I think that isn't what I need i think...
As long as no other fuels work apart from mine I am happy
Any way thanks a bunch for taking time out of your work to help me I really appreciate it.
Okay I see what you mean....yes what you have will work then. I was over thinking and didnt mean to confuse you any more than you already needed to be...There may be another way as well...I will look when I get some rest after work. But I think there may be a better way to write the if statement to ensure you only use what you want. I will post it if I find it...other wise good job, that will work too.
Do you know how to make the furnace render properly in your inventory? The front doesn't face me when its in my inventory it just shows the side texture not the front texture. P.S I read back and found someone said the same thing but the answer meant you had to edit base classes but I can't do that.
Well, back a few other pages I gave the answer but I dont want to look for it, so I will post it again...I didnt write this code. It was written by a team member of mine from the fossil revival mod. This is my exact code and I do use it still so if you have issues with it, delete the imports and look through the errors and import one at a time...
Render class
package bcblocks.highspeed.loco;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import bcblocks.highspeed.HighSpeed;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderHighSpeed implements ISimpleBlockRenderingHandler
{
public static final RenderHighSpeed INSTANCE = new RenderHighSpeed();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
int meta=3;
if(block.blockID == HighSpeed.highSpeedFurnaceActive.blockID)meta=1;
Tessellator tessellator = Tessellator.instance;
block.setBlockBoundsForItemRender();
renderer.setRenderBoundsFromBlock(block);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
int direction = renderer.blockAccess.getBlockMetadata(x, y, z) & 3;
if(direction>0)
renderer.uvRotateTop = direction-1;
else
renderer.uvRotateTop = 3;
boolean flag = renderer.renderStandardBlock(block, x, y, z);
renderer.uvRotateTop = 0;
return flag;
}
@Override
public boolean shouldRender3DInInventory()
{
return true;
}
@Override
public int getRenderId()
{
return 2105;
}
}
notice at the bottom the render ID 2105....I have tried to use other numbers, some work so long as they are above 2100. For some reason below that it doesnt seem to work, no idea why....
in the mod class you want to register the class like this, and also where you register your tile entity....
Well, back a few other pages I gave the answer but I dont want to look for it, so I will post it again...I didnt write this code. It was written by a team member of mine from the fossil revival mod. This is my exact code and I do use it still so if you have issues with it, delete the imports and look through the errors and import one at a time...
Render class
package bcblocks.highspeed.loco;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import bcblocks.highspeed.HighSpeed;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderHighSpeed implements ISimpleBlockRenderingHandler
{
public static final RenderHighSpeed INSTANCE = new RenderHighSpeed();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
int meta=3;
if(block.blockID == HighSpeed.highSpeedFurnaceActive.blockID)meta=1;
Tessellator tessellator = Tessellator.instance;
block.setBlockBoundsForItemRender();
renderer.setRenderBoundsFromBlock(block);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
int direction = renderer.blockAccess.getBlockMetadata(x, y, z) & 3;
if(direction>0)
renderer.uvRotateTop = direction-1;
else
renderer.uvRotateTop = 3;
boolean flag = renderer.renderStandardBlock(block, x, y, z);
renderer.uvRotateTop = 0;
return flag;
}
@Override
public boolean shouldRender3DInInventory()
{
return true;
}
@Override
public int getRenderId()
{
return 2105;
}
}
notice at the bottom the render ID 2105....I have tried to use other numbers, some work so long as they are above 2100. For some reason below that it doesnt seem to work, no idea why....
in the mod class you want to register the class like this, and also where you register your tile entity....
remove the @Override for one....just read through the code I have posted and you will see how I did it...then try it out. as for other mods recipes into your own block, just recreate the recipes in your block, if it uses custom items, for that I can not help you as it is something I have not done myself, sorry
As Mazetar stated above you need to understand first what you are trying to do. Based on your last comment in the dev section you seem to be pretty new to this. It would be my suggestion to first understand how basic things work first up to and including blocks and items. Also try making the basic furnace first, read through my first post on this thread for the basic furnace and look at it and read it several times. Then follow along in your workspace creating a basic furnace. At that point you will have an understanding of how the furnace works and can start trying to manipulating it to your desire. You will see all the methods that require an @Override and the ones that dont. When you override a method you should also understand why its being overridden as well. If you make an attempt at it and have issues post the code here for all classes related to the issue and we can help from that point, as posting just the method you have an issue with may not actually be where the issue is actually occurring.
As Mazetar stated above you need to understand first what you are trying to do. Based on your last comment in the dev section you seem to be pretty new to this. It would be my suggestion to first understand how basic things work first up to and including blocks and items. Also try making the basic furnace first, read through my first post on this thread for the basic furnace and look at it and read it several times. Then follow along in your workspace creating a basic furnace. At that point you will have an understanding of how the furnace works and can start trying to manipulating it to your desire. You will see all the methods that require an @Override and the ones that dont. When you override a method you should also understand why its being overridden as well. If you make an attempt at it and have issues post the code here for all classes related to the issue and we can help from that point, as posting just the method you have an issue with may not actually be where the issue is actually occurring.
Well, yeah, I haven't really made a furnace before very recently. I'm also pretty skeptical on how the new 'Icon' system works.
The original furnace is actually coded a bit differently from yours, with the ISidedInventory (also that looks different from 1.4.7) not null and some other aspects different.
Rollback Post to RevisionRollBack
Check out SpaceAge, a new futuristic themed mod on GitHub: Link
Well, yeah, I haven't really made a furnace before very recently. I'm also pretty skeptical on how the new 'Icon' system works.
The original furnace is actually coded a bit differently from yours, with the ISidedInventory (also that looks different from 1.4.7) not null and some other aspects different.
Yes, much has changed in the tile entity and a few other changes in the block (mostly the icon stuff), the container, and also the GUI. Just follow along with my guide on the first page and if you get stuck post code and I will help...
Yes, much has changed in the tile entity and a few other changes in the block (mostly the icon stuff), the container, and also the GUI. Just follow along with my guide on the first page and if you get stuck post code and I will help...
OK, I removed the @Override on one of them and it still gives me an error. By the way I am actually making the basic furnace.
Rollback Post to RevisionRollBack
Check out SpaceAge, a new futuristic themed mod on GitHub: Link
OK, I removed the @Override on one of them and it still gives me an error. By the way I am actually making the basic furnace.
What is the error, and also could you post the code you have, because as I said above its easier to help if you post the code....simply saying still getting an error all the time doesnt help us help you...
Is there a way to make it so that there can only be one fuel for my furnace I have changed the tile entity class to only use my mods fuel but if I used another mod with my mod that added fuel would it work with my mod? I don't want this to happen because it would make my furnace over powered so is there a way to make it not accept another mods fuel or does it already do that?
Find out how I generate....coolAlias...world structure generation and rotation tool...
Thanks I think I may have got it I just added the ingot to test and when its above the second line it smelts but when its below it doesn't smelt. So does this code look right to you or have I written it out wrong.
This is the final product.
this is the method here...
What you have will work, but after re-reading you post above, you said you want to use only your fuel source as well as if using another mod that adds fuel, then that as well...is that right?
If so, I would set it up like this...(this is just an explanation I am kind of tired at the moment so I hope its clear enough for now)
Items and blocks use ID's and you can set up a config file that will grab the item or block id then get the int from the config in your item burn time method.
Example
if mod a uses 7500 as the id for the fuel source, you can change the ID in your config to that and then like this
And in your mod class you would have
and then in the config modA would be the variable or ID of what ever you wanted to add...set it up as a dummy just to have it working until you add the ID from the other mod. Im not sure if that is clear enough but I know it will work I have done it in the two input furnace. If you dont have a config I can help with that later after I get home, but there are a few tutorials on it too...The only thing is you will have to make sure the mod you are using in addition to yours doesnt use the shifted index with items as it can be a pain to get the ID.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Please if your to tired I can wait, but I think how I have it is okay because I don't want other mods fuels used my furnace at all I just want my fuel in it. So I think I understand what your saying and I think that isn't what I need i think...
As long as no other fuels work apart from mine I am happy
Any way thanks a bunch for taking time out of your work to help me I really appreciate it.
Okay I see what you mean....yes what you have will work then. I was over thinking and didnt mean to confuse you any more than you already needed to be...There may be another way as well...I will look when I get some rest after work. But I think there may be a better way to write the if statement to ensure you only use what you want. I will post it if I find it...other wise good job, that will work too.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Render class
notice at the bottom the render ID 2105....I have tried to use other numbers, some work so long as they are above 2100. For some reason below that it doesnt seem to work, no idea why....
in the mod class you want to register the class like this, and also where you register your tile entity....
Then in the block class where you have the method get render id...use the new render ID
Find out how I generate....coolAlias...world structure generation and rotation tool...
I cant find the get render id part in my block furnace?
Easy enough, looking at the furnace block class there is one there....looks just like this...
Find out how I generate....coolAlias...world structure generation and rotation tool...
No problem...its how we learn...
Find out how I generate....coolAlias...world structure generation and rotation tool...
There were two of those and Eclipse keeps giving me an error.
Also how would I implement IC2's macerator recipes into my Block? I want my block to function as a sort of coal powered macerator.
Find out how I generate....coolAlias...world structure generation and rotation tool...
1. Get the IC2 API from their forums.
2. Read trough ALL relevant parts of it (yes it's a lot to read)
3. Understand how it's meant to be used based on what you read in 2.
4. If you don't understand a concept or something, then google it and study it.
5. Once you understand how it works, then create a plan for how to best implement it into your mod.
As Mazetar stated above you need to understand first what you are trying to do. Based on your last comment in the dev section you seem to be pretty new to this. It would be my suggestion to first understand how basic things work first up to and including blocks and items. Also try making the basic furnace first, read through my first post on this thread for the basic furnace and look at it and read it several times. Then follow along in your workspace creating a basic furnace. At that point you will have an understanding of how the furnace works and can start trying to manipulating it to your desire. You will see all the methods that require an @Override and the ones that dont. When you override a method you should also understand why its being overridden as well. If you make an attempt at it and have issues post the code here for all classes related to the issue and we can help from that point, as posting just the method you have an issue with may not actually be where the issue is actually occurring.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Well, yeah, I haven't really made a furnace before very recently. I'm also pretty skeptical on how the new 'Icon' system works.
The original furnace is actually coded a bit differently from yours, with the ISidedInventory (also that looks different from 1.4.7) not null and some other aspects different.
Yes, much has changed in the tile entity and a few other changes in the block (mostly the icon stuff), the container, and also the GUI. Just follow along with my guide on the first page and if you get stuck post code and I will help...
Find out how I generate....coolAlias...world structure generation and rotation tool...
OK, I removed the @Override on one of them and it still gives me an error. By the way I am actually making the basic furnace.
What is the error, and also could you post the code you have, because as I said above its easier to help if you post the code....simply saying still getting an error all the time doesnt help us help you...
Find out how I generate....coolAlias...world structure generation and rotation tool...