EDIT:
I re-did the tutorial and now only have this error:
Description Resource Path Location Type
oreTutorial cannot be resolved or is not a field mod_TutorialOre.java /Client/src/net/minecraft/src line 18 Java Problem
I'm getting black screen on minecraft on start up with my mod and modloader in it my MinecraftCrash.bat
say's
any idea why every thing else works fine it recompiles and turns into class'es fine
heres my code
package net.minecraft.src;
import java.util.Random;
public class mod_MinecraftMore extends BaseMod
{
public static final Block densedirt = new BlockDensedirt(97, 0).setHardness(3F).setResistance(4.0F).setBlockName("densedirt");
public static final Block claydirt = new BlockClaydirt(98, 0).setHardness(2F).setResistance(2.0F).setBlockName("claydirt");
public static final Block lightdirt = new BlockLightdirt(99, 0).setHardness(1F).setBlockName("lightdirt");
public static final Block copperore = new BlockCopperOre(100, 0).setHardness(3F).setResistance(3.0F).setBlockName("copperore");
public static final Block platinumore = new BlockPlatinumOre(101, 0).setHardness(3F).setResistance(3.0F).setBlockName("platinumore");
public static final Block titaniumore = new BlockTitaniumOre(102, 0).setHardness(3F).setResistance(5.0F).setBlockName("titaniumore");
public static final Block tinore = new BlockTinOre(103, 0).setHardness(3F).setResistance(5.0F).setBlockName("tinore");
public static final Block unknownore = new BlockUnknownOre(104, 0).setHardness(3F).setResistance(5.0F).setBlockName("unknownore");
public static final Block graphiteore = new BlockGraphiteOre(105, 0).setHardness(3F).setResistance(5.0F).setBlockName("graphiteore");
public static final Block copperbricks = new BlockCopperBricks(106, 0).setHardness(2F).setResistance(10F).setBlockName("copperbricks");
public static final Block ironbricks = new BlockIronBricks(107, 0).setHardness(2F).setResistance(10F).setBlockName("ironbricks");
public static final Block goldbricks = new BlockGoldBricks(108, 0).setHardness(2F).setResistance(10F).setBlockName("goldbricks");
public static final Block redstonebricks = new BlockRedstoneBricks(109, 0).setHardness(2F).setResistance(10F).setBlockName("redstonebricks");
public static final Block coalbricks = new BlockCoalBricks(110, 0).setHardness(2F).setResistance(10F).setBlockName("coalbricks");
public static final Item platinumball = new Item(10000).setItemName("platinumball");
public static final Item copperbar = new Item(10001).setItemName("copperbar");
public static final Item titaniumbar = new Item(10002).setItemName("titaniumbar");
public static final Item tinbar = new Item(10003).setItemName("tinbar");
public static Item titaniumboots = (new ItemArmor(10004, 3, ModLoader.AddArmor("titanium"), 3).setItemName("titaniumboots"));
public static Item titaniumleggings = (new ItemArmor(10005, 3, ModLoader.AddArmor("titanium"), 2).setItemName("titaniumleggings"));
public static Item titaniumchestplate = (new ItemArmor(10006, 3, ModLoader.AddArmor("titanium"), 1).setItemName("titaniumchestplate"));
public static Item titaniumhelmet = (new ItemArmor(10007, 3, ModLoader.AddArmor("titanium"), 0).setItemName("titaniumhelmet"));
ModLoader.AddSmelting(mod_MinecraftMore.copperore.blockID, new ItemStack(mod_MinecraftMore.copperbar, 2));
ModLoader.AddSmelting(mod_MinecraftMore.titaniumore.blockID, new ItemStack(mod_MinecraftMore.titaniumbar, 1));
ModLoader.AddSmelting(mod_MinecraftMore.tinore.blockID, new ItemStack(mod_MinecraftMore.tinbar, 1));
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.claydirt.blockID, 16)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 6; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(40);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.platinumore.blockID, 3)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 3; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(30);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.titaniumore.blockID, 10)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 18; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(60);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.copperore.blockID, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 17; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(60);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.tinore.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 16; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.unknownore.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 5; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(Block.blockGold.blockID, 1)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 6; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(Block.blockSteel.blockID, 2)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.unknownore.blockID, 7)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
EDIT:
I re-did the tutorial and now only have this error:
Description Resource Path Location Type
oreTutorial cannot be resolved or is not a field mod_TutorialOre.java /Client/src/net/minecraft/src line 18 Java Problem
I'm getting black screen on minecraft on start up with my mod and modloader in it my MinecraftCrash.bat
say's
any idea why every thing else works fine it recompiles and turns into class'es fine
heres my code
package net.minecraft.src;
import java.util.Random;
public class mod_MinecraftMore extends BaseMod
{
public static final Block densedirt = new BlockDensedirt(97, 0).setHardness(3F).setResistance(4.0F).setBlockName("densedirt");
public static final Block claydirt = new BlockClaydirt(98, 0).setHardness(2F).setResistance(2.0F).setBlockName("claydirt");
public static final Block lightdirt = new BlockLightdirt(99, 0).setHardness(1F).setBlockName("lightdirt");
public static final Block copperore = new BlockCopperOre(100, 0).setHardness(3F).setResistance(3.0F).setBlockName("copperore");
public static final Block platinumore = new BlockPlatinumOre(101, 0).setHardness(3F).setResistance(3.0F).setBlockName("platinumore");
public static final Block titaniumore = new BlockTitaniumOre(102, 0).setHardness(3F).setResistance(5.0F).setBlockName("titaniumore");
public static final Block tinore = new BlockTinOre(103, 0).setHardness(3F).setResistance(5.0F).setBlockName("tinore");
public static final Block unknownore = new BlockUnknownOre(104, 0).setHardness(3F).setResistance(5.0F).setBlockName("unknownore");
public static final Block graphiteore = new BlockGraphiteOre(105, 0).setHardness(3F).setResistance(5.0F).setBlockName("graphiteore");
public static final Block copperbricks = new BlockCopperBricks(106, 0).setHardness(2F).setResistance(10F).setBlockName("copperbricks");
public static final Block ironbricks = new BlockIronBricks(107, 0).setHardness(2F).setResistance(10F).setBlockName("ironbricks");
public static final Block goldbricks = new BlockGoldBricks(108, 0).setHardness(2F).setResistance(10F).setBlockName("goldbricks");
public static final Block redstonebricks = new BlockRedstoneBricks(109, 0).setHardness(2F).setResistance(10F).setBlockName("redstonebricks");
public static final Block coalbricks = new BlockCoalBricks(110, 0).setHardness(2F).setResistance(10F).setBlockName("coalbricks");
public static final Item platinumball = new Item(10000).setItemName("platinumball");
public static final Item copperbar = new Item(10001).setItemName("copperbar");
public static final Item titaniumbar = new Item(10002).setItemName("titaniumbar");
public static final Item tinbar = new Item(10003).setItemName("tinbar");
public static Item titaniumboots = (new ItemArmor(10004, 3, ModLoader.AddArmor("titanium"), 3).setItemName("titaniumboots"));
public static Item titaniumleggings = (new ItemArmor(10005, 3, ModLoader.AddArmor("titanium"), 2).setItemName("titaniumleggings"));
public static Item titaniumchestplate = (new ItemArmor(10006, 3, ModLoader.AddArmor("titanium"), 1).setItemName("titaniumchestplate"));
public static Item titaniumhelmet = (new ItemArmor(10007, 3, ModLoader.AddArmor("titanium"), 0).setItemName("titaniumhelmet"));
ModLoader.AddSmelting(mod_MinecraftMore.copperore.blockID, new ItemStack(mod_MinecraftMore.copperbar, 2));
ModLoader.AddSmelting(mod_MinecraftMore.titaniumore.blockID, new ItemStack(mod_MinecraftMore.titaniumbar, 1));
ModLoader.AddSmelting(mod_MinecraftMore.tinore.blockID, new ItemStack(mod_MinecraftMore.tinbar, 1));
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.claydirt.blockID, 16)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 6; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(40);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.platinumore.blockID, 3)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 3; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(30);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.titaniumore.blockID, 10)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 18; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(60);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.copperore.blockID, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 17; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(60);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.tinore.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 16; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.unknownore.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 5; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(Block.blockGold.blockID, 1)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 6; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(Block.blockSteel.blockID, 2)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.unknownore.blockID, 7)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
}
Also i edited itempickaxe and itemspade
The ModLoader.AddArmor() function is very buggy. It has this strange quirk where you can't edit any of the tool classes and use it at the same time. I got around that problem using ScotTools API.
I'm making a mod.
I've made the ore, and the item it drops, everything works perfectly.
But when I try to add a new item: Custom torches (made out of the item the ore drops), Minecraft crashes.
I get no errors in Eclipse, but Minecraft crashes on run.
Here's the error report:
Mods loaded: 1
ModLoader Beta 1.7.3
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
If you wish to report this, please copy this entire text and email it to [email protected].
Please include a description of what you did when the error occured.
--- BEGIN ERROR REPORT e9df3db --------
Generated 02/08/11 8:34 PM
Minecraft: Minecraft Beta 1.7.3
OS: Windows Vista (x86) version 6.0
Java: 1.6.0_26, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce 6150SE nForce 430/PCI/SSE2/3DNOW! version 2.1.2, NVIDIA Corporation
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:224)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1022)
at net.minecraft.src.ModLoader.init(ModLoader.java:687)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:121)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:65)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:158)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:138)
at net.minecraft.client.Minecraft.run(Minecraft.java:435)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 4569
at net.minecraft.src.Block.<init>(Block.java:46)
at net.minecraft.src.Block.<init>(Block.java:75)
at net.minecraft.src.BlockChamprosiumTorch.<init>(BlockChamprosiumTorch.java:18)
at net.minecraft.src.mod_Champite.<clinit>(mod_Champite.java:10)
... 15 more
--- END ERROR REPORT acc922ed ----------
And here's my code: http://pastebin.com/fiyFmQSH
Note: BlockChamprosiumTorch.java has the same code as BlockTorch.java (with BlockTorch changed to BlockChamprosiumTorch ofc)
I'm making a mod.
I've made the ore, and the item it drops, everything works perfectly.
But when I try to add a new item: Custom torches (made out of the item the ore drops), Minecraft crashes.
I get no errors in Eclipse, but Minecraft crashes on run.
Here's the error report:
Mods loaded: 1
ModLoader Beta 1.7.3
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
If you wish to report this, please copy this entire text and email it to [email protected].
Please include a description of what you did when the error occured.
--- BEGIN ERROR REPORT e9df3db --------
Generated 02/08/11 8:34 PM
Minecraft: Minecraft Beta 1.7.3
OS: Windows Vista (x86) version 6.0
Java: 1.6.0_26, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce 6150SE nForce 430/PCI/SSE2/3DNOW! version 2.1.2, NVIDIA Corporation
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:224)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1022)
at net.minecraft.src.ModLoader.init(ModLoader.java:687)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:121)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:65)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:158)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:138)
at net.minecraft.client.Minecraft.run(Minecraft.java:435)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 4569
at net.minecraft.src.Block.<init>(Block.java:46)
at net.minecraft.src.Block.<init>(Block.java:75)
at net.minecraft.src.BlockChamprosiumTorch.<init>(BlockChamprosiumTorch.java:18)
at net.minecraft.src.mod_Champite.<clinit>(mod_Champite.java:10)
... 15 more
--- END ERROR REPORT acc922ed ----------
And here's my code: http://pastebin.com/fiyFmQSH
Note: BlockChamprosiumTorch.java has the same code as BlockTorch.java (with BlockTorch changed to BlockChamprosiumTorch ofc)
Your torch's blockID is too high. It must be under 256.
Tysm.
Also, how can I get the torch to have the same texture as an item that the block has? Cause' it just drops a weird grey block.
I got around that by making an item, then making the crafting recipe give you the item, and the block drops the item. If you need, you can download my mod and look in the src for the smoldium torch.
I got around that by making an item, then making the crafting recipe give you the item, and the block drops the item. If you need, you can download my mod and look in the src for the smoldium torch.
Alright, thanks.
EDIT:
Worked, thanks a ton. I can now get started with the rest of my mod. :smile.gif:
Hey, Chewy. Can you please make a tutorial on how to make plants/flowers?
Plants and flowers are just blocks. Their generation is almost exactly the same as the ore generation, except for the class it uses. It uses WorldGenFlower instead of WorldGenMinable.
And remember if you don't know how to do something look at the existing code. If you can read the code and make a mod without the ModLoader (or with, whatever's easier) then you have figured it out.
For flower generation look in ChunkProviderGenerate.java. I'm waiting to write small tutorials like that at the end, just to get basic modding down first.
I re-did the tutorial and now only have this error:
mod_TutorialOre.java code:
http://pastebin.com/HipuKwau
say's
any idea why every thing else works fine it recompiles and turns into class'es fine
heres my code
package net.minecraft.src;
import java.util.Random;
public class mod_MinecraftMore extends BaseMod
{
public static final Block densedirt = new BlockDensedirt(97, 0).setHardness(3F).setResistance(4.0F).setBlockName("densedirt");
public static final Block claydirt = new BlockClaydirt(98, 0).setHardness(2F).setResistance(2.0F).setBlockName("claydirt");
public static final Block lightdirt = new BlockLightdirt(99, 0).setHardness(1F).setBlockName("lightdirt");
public static final Block copperore = new BlockCopperOre(100, 0).setHardness(3F).setResistance(3.0F).setBlockName("copperore");
public static final Block platinumore = new BlockPlatinumOre(101, 0).setHardness(3F).setResistance(3.0F).setBlockName("platinumore");
public static final Block titaniumore = new BlockTitaniumOre(102, 0).setHardness(3F).setResistance(5.0F).setBlockName("titaniumore");
public static final Block tinore = new BlockTinOre(103, 0).setHardness(3F).setResistance(5.0F).setBlockName("tinore");
public static final Block unknownore = new BlockUnknownOre(104, 0).setHardness(3F).setResistance(5.0F).setBlockName("unknownore");
public static final Block graphiteore = new BlockGraphiteOre(105, 0).setHardness(3F).setResistance(5.0F).setBlockName("graphiteore");
public static final Block copperbricks = new BlockCopperBricks(106, 0).setHardness(2F).setResistance(10F).setBlockName("copperbricks");
public static final Block ironbricks = new BlockIronBricks(107, 0).setHardness(2F).setResistance(10F).setBlockName("ironbricks");
public static final Block goldbricks = new BlockGoldBricks(108, 0).setHardness(2F).setResistance(10F).setBlockName("goldbricks");
public static final Block redstonebricks = new BlockRedstoneBricks(109, 0).setHardness(2F).setResistance(10F).setBlockName("redstonebricks");
public static final Block coalbricks = new BlockCoalBricks(110, 0).setHardness(2F).setResistance(10F).setBlockName("coalbricks");
public static final Item platinumball = new Item(10000).setItemName("platinumball");
public static final Item copperbar = new Item(10001).setItemName("copperbar");
public static final Item titaniumbar = new Item(10002).setItemName("titaniumbar");
public static final Item tinbar = new Item(10003).setItemName("tinbar");
public static Item titaniumboots = (new ItemArmor(10004, 3, ModLoader.AddArmor("titanium"), 3).setItemName("titaniumboots"));
public static Item titaniumleggings = (new ItemArmor(10005, 3, ModLoader.AddArmor("titanium"), 2).setItemName("titaniumleggings"));
public static Item titaniumchestplate = (new ItemArmor(10006, 3, ModLoader.AddArmor("titanium"), 1).setItemName("titaniumchestplate"));
public static Item titaniumhelmet = (new ItemArmor(10007, 3, ModLoader.AddArmor("titanium"), 0).setItemName("titaniumhelmet"));
public String Version()
{
return "1.7.3";
}
public mod_MinecraftMore ()
{
densedirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png" ,"/MinecraftMore/Densedirt.png");
claydirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/Claydirt.png");
lightdirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/Lightdirt.png");
copperore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/CopperOre.png");
platinumore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/PlatinumOre.png");
titaniumore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/TitaniumOre.png");
tinore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/TinOre.png");
unknownore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/UnknownOre.png");
graphiteore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/GraphiteOre.png");
copperbricks.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/CopperBricks.png");
ironbricks.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/IronBricks.png");
goldbricks.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/GoldBricks.png");
redstonebricks.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/RedstoneBricks.png");
coalbricks.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MinecraftMore/CoalBricks.png");
platinumball.iconIndex = ModLoader.addOverride("/gui/items.png", "/MinecraftMore/PlatinumBall.png");
copperbar.iconIndex = ModLoader.addOverride("/gui/items.png", "/MinecraftMore/CopperBar.png");
titaniumbar.iconIndex = ModLoader.addOverride("/gui/items.png", "/MinecraftMore/TitaniumBar.png");
tinbar.iconIndex = ModLoader.addOverride("/gui/items.png", "/MinecraftMore/TinBar.png");
titaniumboots.iconIndex = ModLoader.addOverride("/gui/items.png", "/MinecraftMore/TitaniumBoots.png");
titaniumleggings.iconIndex = ModLoader.addOverride("/gui/items.png", "/MinecraftMore/TitaniumLeggings.png");
titaniumchestplate.iconIndex = ModLoader.addOverride("/gui/items.png", "/MinecraftMore/TitaniumChestplate.png");
titaniumhelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/MinecraftMore/TitaniumHelmet.png");
ModLoader.RegisterBlock(densedirt);
ModLoader.RegisterBlock(claydirt);
ModLoader.RegisterBlock(lightdirt);
ModLoader.RegisterBlock(copperore);
ModLoader.RegisterBlock(platinumore);
ModLoader.RegisterBlock(titaniumore);
ModLoader.RegisterBlock(tinore);
ModLoader.RegisterBlock(unknownore);
ModLoader.RegisterBlock(graphiteore);
ModLoader.RegisterBlock(copperbricks);
ModLoader.RegisterBlock(ironbricks);
ModLoader.RegisterBlock(goldbricks);
ModLoader.RegisterBlock(redstonebricks);
ModLoader.RegisterBlock(coalbricks);
ModLoader.AddName(densedirt, "Dense Dirt");
ModLoader.AddName(claydirt, "Clay Dirt");
ModLoader.AddName(lightdirt, "Light Dirt");
ModLoader.AddName(copperore, "Copper Ore");
ModLoader.AddName(platinumore, "Platinum Ore");
ModLoader.AddName(titaniumore, "Titanium Ore");
ModLoader.AddName(tinore, "Tin Ore");
ModLoader.AddName(unknownore, "Unknown Ore");
ModLoader.AddName(graphiteore, "Graphite Ore");
ModLoader.AddName(copperbricks, "Copper Bricks");
ModLoader.AddName(ironbricks, "Iron Bricks");
ModLoader.AddName(goldbricks, "Gold Bricks");
ModLoader.AddName(redstonebricks, "Redstone Bricks");
ModLoader.AddName(coalbricks, "Coal Bricks");
ModLoader.AddName(platinumball, "Platinum Ball");
ModLoader.AddName(copperbar, "Copper Bar");
ModLoader.AddName(titaniumbar, "Titanium Bar");
ModLoader.AddName(tinbar, "Tin Bar");
ModLoader.AddName(titaniumboots, "Titanium Boots");
ModLoader.AddName(titaniumleggings, "Titanium Leggings");
ModLoader.AddName(titaniumchestplate, "Titanium Chest Plate");
ModLoader.AddName(titaniumhelmet, "Titanium Helmet");
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.densedirt, 1),
new Object[] {"XX", "XX", Character.valueOf('X'), Block.dirt,});
ModLoader.AddRecipe(new ItemStack(Item.clay, 3),
new Object[] {"X", Character.valueOf('X'), mod_MinecraftMore.claydirt,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.lightdirt, 1),
new Object[] {"XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), Item.lightStoneDust,});
ModLoader.AddRecipe(new ItemStack(Block.dirt, 4),
new Object[] {"X", Character.valueOf('X'), mod_MinecraftMore.densedirt,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.titaniumboots, 1),
new Object[] {"X X", "X X", Character.valueOf('X'), mod_MinecraftMore.titaniumbar,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.titaniumleggings, 1),
new Object[] {"XXX", "X X", "X X", Character.valueOf('X'), mod_MinecraftMore.titaniumbar,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.titaniumchestplate, 1),
new Object[] {"X X", "XXX", "XXX", Character.valueOf('X'), mod_MinecraftMore.titaniumbar,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.titaniumhelmet, 1),
new Object[] {"XXX", "X X", Character.valueOf('X'), mod_MinecraftMore.titaniumbar,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.copperbricks, 4),
new Object[] {"XX", "XO", Character.valueOf('X'), mod_MinecraftMore.copperbar, Character.valueOf('O'), Item.clay,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.ironbricks, 4),
new Object[] {"XX", "XO", Character.valueOf('X'), Item.ingotIron, Character.valueOf('O'), Item.clay,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.goldbricks, 8),
new Object[] {"XX", "XO", Character.valueOf('X'), Item.ingotGold, Character.valueOf('O'), Item.clay,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.redstonebricks, 4),
new Object[] {"X", "O", "X", Character.valueOf('X'), Item.redstone, Character.valueOf('O'), Block.brick,});
ModLoader.AddRecipe(new ItemStack(mod_MinecraftMore.coalbricks, 4),
new Object[] {"X", "O", Character.valueOf('X'), Item.coal, Character.valueOf('O'), Block.brick,});
ModLoader.AddSmelting(mod_MinecraftMore.copperore.blockID, new ItemStack(mod_MinecraftMore.copperbar, 2));
ModLoader.AddSmelting(mod_MinecraftMore.titaniumore.blockID, new ItemStack(mod_MinecraftMore.titaniumbar, 1));
ModLoader.AddSmelting(mod_MinecraftMore.tinore.blockID, new ItemStack(mod_MinecraftMore.tinbar, 1));
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.claydirt.blockID, 16)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 6; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(40);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.platinumore.blockID, 3)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 3; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(30);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.titaniumore.blockID, 10)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 18; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(60);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.copperore.blockID, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 17; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(60);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.tinore.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 16; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.unknownore.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 5; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(Block.blockGold.blockID, 1)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 6; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(Block.blockSteel.blockID, 2)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_MinecraftMore.unknownore.blockID, 7)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
}
Also i edited itempickaxe and itemspade
On line 18 instead of calling Block.oreTutorial call mod_TutorialOre.oreTutorial.
The ModLoader.AddArmor() function is very buggy. It has this strange quirk where you can't edit any of the tool classes and use it at the same time. I got around that problem using ScotTools API.
I've made the ore, and the item it drops, everything works perfectly.
But when I try to add a new item: Custom torches (made out of the item the ore drops), Minecraft crashes.
I get no errors in Eclipse, but Minecraft crashes on run.
Here's the error report:
And here's my code:
http://pastebin.com/fiyFmQSH
Note: BlockChamprosiumTorch.java has the same code as BlockTorch.java (with BlockTorch changed to BlockChamprosiumTorch ofc)
Your torch's blockID is too high. It must be under 256.
Tysm.
Also, how can I get the torch to have the same texture as an item that the block has? Cause' it just drops a weird grey block.
I got around that by making an item, then making the crafting recipe give you the item, and the block drops the item. If you need, you can download my mod and look in the src for the smoldium torch.
Alright, thanks.
EDIT:
Worked, thanks a ton. I can now get started with the rest of my mod. :smile.gif:
I haven't looked into it yet, but the Javadoc is available on Risugami's thread.
I have honestly never made a mob, so I'll have to make one before I post a tutorial :tongue.gif:
But as soon as I get one done I will post a tutorial.
That link shows how to correctly download JDK and add user variables. This will help a lot of people.
And also, can anyone show me how to make a mod that will disable names on multiplayer?
Thanks
Plants and flowers are just blocks. Their generation is almost exactly the same as the ore generation, except for the class it uses. It uses WorldGenFlower instead of WorldGenMinable.
And remember if you don't know how to do something look at the existing code. If you can read the code and make a mod without the ModLoader (or with, whatever's easier) then you have figured it out.
For flower generation look in ChunkProviderGenerate.java. I'm waiting to write small tutorials like that at the end, just to get basic modding down first.