How do I use a modded block for a recipe? Noob question, I know, but I attempted a guess at it from loooking at various java files and I still failed:
Focusing on the stair block, because that's the only issue. I took it out and it ran perfectly fine.
package net.minecraft.src;
public class mod_ObsidianTiles extends BaseMod
{
//Public State Finals for Blocks
public static final Block DiamondTile = new BlockDiamondTile(190, 0).setBlockName("DiamondTile").setHardness(15F).setResistance(1000F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep);
public static final Block RectangleTile = new BlockRectangleTile(191, 0).setBlockName("RectangleTile").setHardness(15F).setResistance(1000F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep);
public static final Block SquareTile = new BlockSquareTile(192, 0).setBlockName("SquareTile").setHardness(15F).setResistance(1000F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep);
//Public State Finals for Stairs
public static final Block DiamondStair= new BlockDiamondStairStairs(193, 0).setBlockName("stairsDiamondStair").setHardness(15F).setResistance(1000F);
public void load()
{
//Blocks
DiamondTile.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Textures/DiamondTile.png");
ModLoader.registerBlock(DiamondTile);
ModLoader.addName(DiamondTile, "Obsidian Tile");
ModLoader.addRecipe(new ItemStack(DiamondTile, 4), new Object [] {"#", Character.valueOf('#'), Block.obsidian});
RectangleTile.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Textures/RectangleTile.png");
ModLoader.registerBlock(RectangleTile);
ModLoader.addName(RectangleTile, "Obsidian Tile");
ModLoader.addRecipe(new ItemStack(RectangleTile, 8), new Object [] {"##", Character.valueOf('#'), Block.obsidian});
SquareTile.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Textures/SquareTile.png");
ModLoader.registerBlock(SquareTile);
ModLoader.addName(SquareTile, "Obsidian Tile");
ModLoader.addRecipe(new ItemStack(SquareTile, 12), new Object [] {"##", "##", Character.valueOf('#'), Block.obsidian});
//Stairs
DiamondStair.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Textures/DiamondTile.png");
ModLoader.registerBlock(DiamondStair);
ModLoader.addName(DiamondStair, "Obsidian Stair");
ModLoader.addRecipe(new ItemStack(DiamondStair, 6), new Object [] {"# ", "## ", "###", Character.valueOf('#'), mod_ObsidianTiles.DiamondTile});
}
public String getVersion()
{
return "1.3.2";
}
}
Is there a crash or error report? The code looks fine at first glance.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Is there a crash or error report? The code looks fine at first glance.
--- BEGIN ERROR REPORT af9767c6 --------
Generated 9/30/12 8:57 PM
- Minecraft Version: 1.3.1
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 997390624 bytes (951 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.1
mod_ObsidianTiles 1.3.2
java.lang.StringIndexOutOfBoundsException: String index out of range: 8
at java.lang.String.charAt(Unknown Source)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:185)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:482)
at net.minecraft.src.mod_ObsidianTiles.load(mod_ObsidianTiles.java:44)
at net.minecraft.src.ModLoader.init(ModLoader.java:927)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:161)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 4abef7ea ----------
When will the forge tutorials be finished and posted, I'm just wondering?
I don't have time for any tutorials. I can't give a time on when I will get tutorials done, someone will hold me to it; something which I don't want to happen.
--- BEGIN ERROR REPORT af9767c6 --------
Generated 9/30/12 8:57 PM
- Minecraft Version: 1.3.1
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 997390624 bytes (951 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.1
mod_ObsidianTiles 1.3.2
java.lang.StringIndexOutOfBoundsException: String index out of range: 8
at java.lang.String.charAt(Unknown Source)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:185)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:482)
at net.minecraft.src.mod_ObsidianTiles.load(mod_ObsidianTiles.java:44)
at net.minecraft.src.ModLoader.init(ModLoader.java:927)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:161)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 4abef7ea ----------
You need to add an additional space in the first row of the crafting matrix.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Thank you both of you, I also realised for some reason that half-slabs cannot derive from modded block textures. You have to create two separate copies and name them individually, for both the single and the full slab (2 stacked).
Could you make a tutorial on how to make a block that will turn into something when you place it like the instant structures mod?
It is very unlikely that TechGuy will make a tutorial, but, it you want to do something like that, look at the structure generation tutorial, and then look at the ender dragons class (because it generates a "structure" when it dies, so, a 'on demand' structure)
java.lang.Exception: No registry for this texture: texture1.png
at net.minecraft.src.ModLoader.getUniqueSpriteIndex(ModLoader.java:773)
at net.minecraft.src.ModLoader.addOverride(ModLoader.java:457)
at net.minecraft.src.mod_Batmod.load(mod_Batmod.java:9)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
I haven't changed anything from your tutorial except the texture paths and the name of the items. I even copy-pasted. The game works fine with other texture paths to different images.
So Im getting this error when making my multi-textured blocks. I have made and added the textures to minecraft but I get to errors about the variables.
package net.minecraft.src;
import java.util.Random;
public class mod_NetherCraft extends BaseMod
{
public static final Block NetherLog = new BlockNetherLog(183,0)
.setStepSound(Block.soundWoodFootstep).setBlockName("NetherLog").setHardness(2.0F)
.setLightValue(0.250F);
public static int NetherLogBottom = ModLoader.addOverride("/terrain.png",
"/textures/NetherLogBottom.png");
public static int NetherLogTop = ModLoader.addOverride("/terrain.png",
"/textures/NetherLogTop.png");
public static int NetherLogSides = ModLoader.addOverride("/terrain.png",
"/textures/NetherLogSides.png");
public void load()
{
NetherLog.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/NetherLog.png");
ModLoader.registerBlock(NetherLog);
ModLoader.addName(NetherLog, "Nether Log");
BlockNetherLog
package net.minecraft.src;
public class BlockNetherLog extends Block
{
public BlockNetherLog(int i, int j)
{
super(i, j, Material.wood);
}
public int getBlockTextureFromSideAndMetadata (int i, int j)
{
return getBlockTextureFromSide(i);
}
public int GetBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_NetherCraft.NetherLogBottom.png;
}
if (i == 1)
{
return mod_NetherCraft.NetherLogTop.png;
}
else
{
return mod_NetherCraft.NetherLogSides;
}
}
}
Just trying to make a block and item. The 9 of said item make the block. However, neither will show up on creative, but it isn't crashing. Is there anything wrong with my code?
package net.minecraft.src;
public class mod_Reiatsu extends BaseMod
{
public static final Item Reiatsu = new ItemReiatsu(5000).setItemName("Reiatsu");
public static final Block ReiatsuBlock = new BlockReiatsuBlock(137,0).setBlockName("Reiatsu Block").setHardness(5F).setResistance(30F).setLightValue(8F).setCreativeTab(CreativeTabs.tabBlock);
public void load ()
{
Reiatsu.iconIndex = ModLoader.addOverride("/gui/items/png", "/mods/reiatsu.png");
ModLoader.addName(Reiatsu, "Reiatsu");
ReiatsuBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/reiatsu_block.png");
ModLoader.registerBlock(ReiatsuBlock);
ModLoader.addName(ReiatsuBlock, "Reiatsu Block");
ModLoader.addRecipe(new ItemStack(ReiatsuBlock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), Item.Reiatsu});
}
public String getVersion()
{
return "1.3.2";
}
}
Focusing on the stair block, because that's the only issue. I took it out and it ran perfectly fine.
package net.minecraft.src; public class mod_ObsidianTiles extends BaseMod { //Public State Finals for Blocks public static final Block DiamondTile = new BlockDiamondTile(190, 0).setBlockName("DiamondTile").setHardness(15F).setResistance(1000F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep); public static final Block RectangleTile = new BlockRectangleTile(191, 0).setBlockName("RectangleTile").setHardness(15F).setResistance(1000F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep); public static final Block SquareTile = new BlockSquareTile(192, 0).setBlockName("SquareTile").setHardness(15F).setResistance(1000F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep); //Public State Finals for Stairs public static final Block DiamondStair= new BlockDiamondStairStairs(193, 0).setBlockName("stairsDiamondStair").setHardness(15F).setResistance(1000F); public void load() { //Blocks DiamondTile.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Textures/DiamondTile.png"); ModLoader.registerBlock(DiamondTile); ModLoader.addName(DiamondTile, "Obsidian Tile"); ModLoader.addRecipe(new ItemStack(DiamondTile, 4), new Object [] {"#", Character.valueOf('#'), Block.obsidian}); RectangleTile.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Textures/RectangleTile.png"); ModLoader.registerBlock(RectangleTile); ModLoader.addName(RectangleTile, "Obsidian Tile"); ModLoader.addRecipe(new ItemStack(RectangleTile, 8), new Object [] {"##", Character.valueOf('#'), Block.obsidian}); SquareTile.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Textures/SquareTile.png"); ModLoader.registerBlock(SquareTile); ModLoader.addName(SquareTile, "Obsidian Tile"); ModLoader.addRecipe(new ItemStack(SquareTile, 12), new Object [] {"##", "##", Character.valueOf('#'), Block.obsidian}); //Stairs DiamondStair.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Textures/DiamondTile.png"); ModLoader.registerBlock(DiamondStair); ModLoader.addName(DiamondStair, "Obsidian Stair"); ModLoader.addRecipe(new ItemStack(DiamondStair, 6), new Object [] {"# ", "## ", "###", Character.valueOf('#'), mod_ObsidianTiles.DiamondTile}); } public String getVersion() { return "1.3.2"; } }Is there a crash or error report? The code looks fine at first glance.
together they are powerful beyond imagination."
I don't have time for any tutorials. I can't give a time on when I will get tutorials done, someone will hold me to it; something which I don't want to happen.
You need to add an additional space in the first row of the crafting matrix.
together they are powerful beyond imagination."
thanks but that just messes up the torch texture and the torch icon
nerver mind this what would iron be then in this
I see that this recipe would return the bucket of water when you smelt it. How do you do that with a crafting recipe?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIt is very unlikely that TechGuy will make a tutorial, but, it you want to do something like that, look at the structure generation tutorial, and then look at the ender dragons class (because it generates a "structure" when it dies, so, a 'on demand' structure)
I haven't changed anything from your tutorial except the texture paths and the name of the items. I even copy-pasted. The game works fine with other texture paths to different images.
Error:
http://prntscr.com/gwc4g
Code:
mod_***
package net.minecraft.src; import java.util.Random; public class mod_NetherCraft extends BaseMod { public static final Block NetherLog = new BlockNetherLog(183,0) .setStepSound(Block.soundWoodFootstep).setBlockName("NetherLog").setHardness(2.0F) .setLightValue(0.250F); public static int NetherLogBottom = ModLoader.addOverride("/terrain.png", "/textures/NetherLogBottom.png"); public static int NetherLogTop = ModLoader.addOverride("/terrain.png", "/textures/NetherLogTop.png"); public static int NetherLogSides = ModLoader.addOverride("/terrain.png", "/textures/NetherLogSides.png"); public void load() { NetherLog.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/NetherLog.png"); ModLoader.registerBlock(NetherLog); ModLoader.addName(NetherLog, "Nether Log");BlockNetherLog
package net.minecraft.src; public class BlockNetherLog extends Block { public BlockNetherLog(int i, int j) { super(i, j, Material.wood); } public int getBlockTextureFromSideAndMetadata (int i, int j) { return getBlockTextureFromSide(i); } public int GetBlockTextureFromSide(int i) { if (i == 0) { return mod_NetherCraft.NetherLogBottom.png; } if (i == 1) { return mod_NetherCraft.NetherLogTop.png; } else { return mod_NetherCraft.NetherLogSides; } } }Thanks
Oh yeah duh Thanks
package net.minecraft.src; public class mod_Reiatsu extends BaseMod { public static final Item Reiatsu = new ItemReiatsu(5000).setItemName("Reiatsu"); public static final Block ReiatsuBlock = new BlockReiatsuBlock(137,0).setBlockName("Reiatsu Block").setHardness(5F).setResistance(30F).setLightValue(8F).setCreativeTab(CreativeTabs.tabBlock); public void load () { Reiatsu.iconIndex = ModLoader.addOverride("/gui/items/png", "/mods/reiatsu.png"); ModLoader.addName(Reiatsu, "Reiatsu"); ReiatsuBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/reiatsu_block.png"); ModLoader.registerBlock(ReiatsuBlock); ModLoader.addName(ReiatsuBlock, "Reiatsu Block"); ModLoader.addRecipe(new ItemStack(ReiatsuBlock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), Item.Reiatsu}); } public String getVersion() { return "1.3.2"; } }Bleach Mod