Awesome information in here, but one quick question: do entity bounding boxes rotate with their entities, or is there some complex code required to make that happen?
Hi, anyone know how to have just one file with textures and one file with items like Items.png and terrain.png in vanilla Minecraft?
I just answered this question on the last page.
You need to use Minecraft Forge. I don't have tutorials on these yet but I will eventually. There are plenty of tutorials on it around already. I suggest using Methuselah's tutorials.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
ModLoader.getMinecraftInstance().theWorld.createExplosion(/*all the code from above - positioning and strength*/);
The bounding box should rotate with the entity.
I just answered this question on the last page.
Thanks, but now I think onUpdate() is not being called, because I tried to make it display a chat message when onUpdate() is called and in game I run around with this item and nothing is happening... currently I have:
public void onUpdate(EntityPlayer player) {/*rest of code*/}
Hello TechGuy, this tutorial looks really helpful, but i was wondering, how would i make a new 'furnace' type block? Which tutorial would i follow?
Thanks,
Bo
There is no tutorial on creating a new furnace. You just need to use the code from the current furnace. I don't think there are any updated tutorials on these forums for a new furnace but I'm not 100% sure.
Thanks, but now I think onUpdate() is not being called, because I tried to make it display a chat message when onUpdate() is called and in game I run around with this item and nothing is happening... currently I have:
public void onUpdate(EntityPlayer player) {/*rest of code*/}
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
There is no tutorial on creating a new furnace. You just need to use the code from the current furnace. I don't think there are any updated tutorials on these forums for a new furnace but I'm not 100% sure.
Remove the EntityPlayer parameter from it.
public void onUpdate() {/*code*/}
if I do that I get bunches of errors saying player could not be resolved. also If I change player to EntityPlayer I get errors about making a static referance to a non-static feild, can you please see my code and tell me what to fix:
if I do that I get bunches of errors saying player could not be resolved. also If I change player to EntityPlayer I get errors about making a static referance to a non-static feild, can you please see my code and tell me what to fix:
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Nope. Axis Aligned Bounding boxes don't rotate. They grow and shrink to fit sometimes, but they never rotate.
Any ideas on where to start research with Oriented Bounding Boxes?
I saw your post in Mod Development. If you use the setSize method in the entity's constructor then it will rotate but if you use something else it probably won't rotate.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Techguy you should update the begining of your tutorial, beacuse you have to have the bin folder resource folder, and minecraft_server.jar(not sure about this). Only then will it decompile properly
Techguy you should update the begining of your tutorial, beacuse you have to have the bin folder resource folder, and minecraft_server.jar(not sure about this). Only then will it decompile properly
It decompiles fine with only the bin folder. You don't need the server jar unless you are making a server mod. I don't include it in my starting tutorial because I am not teaching how to make SMP compatible mods.
I've created an item "Ice Crystal", I made a texture to it but in-game it looks like leather helmet. Why?
It has been working but suddenly it changed to leather helmet texture... In my previous items it is working perfectly.
mod_IceCrystalDrop.java
package net.minecraft.src;
public class mod_IceCrystalDrop extends BaseMod
{
public static final Item IceCrystalDrop = new ItemIceCrystal(5001).setItemName("IceCrystal");
public void load()
{
IceCrystalDrop.iconIndex = ModLoader.addOverride("/gui/items.png", "/IceCrystal.png");
ModLoader.addName(IceCrystalDrop, "Ice Crystal");
}
public String getVersion()
{
return "1.2.5";
}
}
ItemIceCrystal.java
package net.minecraft.src;
public class ItemIceCrystal extends Item
{
public ItemIceCrystal(int i)
{
super(i);
maxStackSize = 64;
}
}
That normally means that the icon index hasn't been set. It looks fine to me at the moment so I don't know what the problem is.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Everything loads fine till I make a new map to gen the ores then it crashes with this.
java.lang.NullPointerException
at ack.a(SourceFile:408)
at ack.a(SourceFile:349)
at xd.d(SourceFile:392)
at eh.a(SourceFile:57)
at mod_colorless.generateSurface(mod_colorless.java:88)
at ModLoader.populateChunk(ModLoader.java:1217)
at ko.a(ko.java:125)
at ack.a(SourceFile:733)
at ko.c(ko.java:67)
at ko.b(ko.java:75)
at xd.d(SourceFile:359)
at xd.a(SourceFile:301)
at net.minecraft.client.Minecraft.e(SourceFile:1916)
at net.minecraft.client.Minecraft.a(SourceFile:1824)
at net.minecraft.client.Minecraft.a(SourceFile:1788)
at net.minecraft.client.Minecraft.a(SourceFile:1676)
at mw.c(SourceFile:171)
at iz.a(SourceFile:220)
at if.a(SourceFile:150)
at mw.a(SourceFile:192)
at lr.b(SourceFile:734)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.x(SourceFile:752)
at net.minecraft.client.Minecraft.run(SourceFile:671)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 9a69b243 ----------
My Code
package net.minecraft.src;
import java.util.Random;
public class mod_colorless extends BaseMod
{
public static int TinBlock = ModLoader.addOverride("/terrain.png","dock/block/tin.png");
public static int CopperBlock = ModLoader.addOverride("/terrain.png","dock/block/copper.png");
public static int SilverBlock = ModLoader.addOverride("/terrain.png","dock/block/silver.png");
public static int PlatinumBlock = ModLoader.addOverride("/terrain.png","dock/block/platinum.png");
public static int SapphireBlock = ModLoader.addOverride("/terrain.png","dock/block/sapphire.png");
public static int RubyBlock = ModLoader.addOverride("/terrain.png","dock/block/ruby.png");
public static int TopazBlock = ModLoader.addOverride("/terrain.png","dock/block/topaz.png");
public static int AmethystBlock = ModLoader.addOverride("/terrain.png","dock/block/amethyst.png");
public static int MythrilBlock = ModLoader.addOverride("/terrain.png","dock/block/mythril.png");
public static int AdmantiumBlock = ModLoader.addOverride("/terrain.png","dock/block/admantium.png");
public static int TitaniumBlock = ModLoader.addOverride("/terrain.png","dock/block/titanium.png");
public static int MoonstoneBlock = ModLoader.addOverride("/terrain.png","dock/block/moonstone.png");
public static int TigerseyeBlock = ModLoader.addOverride("/terrain.png","dock/block/tigerseye.png");
public static int CobaltBlock = ModLoader.addOverride("/terrain.png","dock/block/cobalt.png");
public static int TinOre = ModLoader.addOverride("/terrain.png","dock/block/tinore.png");
public static int CopperOre = ModLoader.addOverride("/terrain.png","dock/block/copperore.png");
public static int SilverOre = ModLoader.addOverride("/terrain.png","dock/block/silverore.png");
public static int PlatinumOre = ModLoader.addOverride("/terrain.png","dock/block/platinumore.png");
public static int SapphireOre = ModLoader.addOverride("/terrain.png","dock/block/sapphireore.png");
public static int RubyOre = ModLoader.addOverride("/terrain.png","dock/block/rubyore.png");
public static int TopazOre = ModLoader.addOverride("/terrain.png","dock/block/topazore.png");
public static int AmethystOre = ModLoader.addOverride("/terrain.png","dock/block/amethystore.png");
public static int MythrilOre = ModLoader.addOverride("/terrain.png","dock/block/mythrilore.png");
public static int AdmantiumOre = ModLoader.addOverride("/terrain.png","dock/block/admantiumore.png");
public static int TitaniumOre = ModLoader.addOverride("/terrain.png","dock/block/titaniumore.png");
public static int MoonstoneOre = ModLoader.addOverride("/terrain.png","dock/block/moonstoneore.png");
public static int TigerseyeOre = ModLoader.addOverride("/terrain.png","dock/block/tigerseyeore.png");
public static int CobaltOre = ModLoader.addOverride("/terrain.png","dock/block/cobaltore.png");
public String getVersion() {
return "1.2.5";
}
//Blocks
public void load() {
Block Blockcolorstone = new Blockcolorstone(240);
ModLoader.registerBlock(Blockcolorstone, net.minecraft.src.ItemBricks.class);
ModLoader.addName(new ItemStack(Blockcolorstone, 240,0),"Tin Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,1),"Copper Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,2),"Silver Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,3),"Platinum Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,4),"Sapphire Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,5),"Ruby Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,6),"Topaz Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,7),"Amethyst Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,8),"Mythril Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,9),"Admantium Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,10),"Titanium Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,11),"Moonstone Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,12),"Tigers Eye Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,13),"Cobalt Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,0),"Tin Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,1),"Copper Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,2),"Silver Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,3),"Platinum Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,4),"Sapphire Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,5),"Ruby Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,6),"Topaz Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,7),"Amethyst Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,8),"Mythril Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,9),"Admantium Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,10),"Titanium Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,11),"Moonstone Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,12),"Tigers Eye Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,13),"Cobalt Ore");
ModLoader.addSmelting(TinOre, new ItemStack(mod_oreitems.TinIngot, 1));
ModLoader.addSmelting(CopperOre, new ItemStack(mod_oreitems.CopperIngot, 1));
ModLoader.addSmelting(SilverOre, new ItemStack(mod_oreitems.SilverIngot, 1));
ModLoader.addSmelting(PlatinumOre, new ItemStack(mod_oreitems.PlatinumIngot, 1));
ModLoader.addSmelting(TitaniumOre, new ItemStack(mod_oreitems.TitaniumIngot, 1));
ModLoader.addSmelting(MythrilOre, new ItemStack(mod_oreitems.MythrilIngot, 1));
ModLoader.addSmelting(AdmantiumOre, new ItemStack(mod_oreitems.AdmantiumIngot, 1));
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(mod_colorless.TinOre, 12)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.CopperOre, 12)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.SilverOre, 6)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.PlatinumOre, 4)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.SapphireOre, 5)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.RubyOre, 3)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.TopazOre, 20)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.AmethystOre, 7)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.MythrilOre, 3)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.AdmantiumOre, 7)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.TitaniumOre, 2)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.MoonstoneOre, 9)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.TigerseyeOre, 2)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.CobaltOre, 14)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
}
I saw your post in Mod Development. If you use the setSize method in the entity's constructor then it will rotate but if you use something else it probably won't rotate.
setSize simply calls the bounding box maker. The only reason it looks like its rotating is because this method can only create square BBs. When the box was large enough, the edges of the box were confirmed to remain rooted on the axes.
Everything loads fine till I make a new map to gen the ores then it crashes with this.
java.lang.NullPointerException
at ack.a(SourceFile:408)
at ack.a(SourceFile:349)
at xd.d(SourceFile:392)
at eh.a(SourceFile:57)
at mod_colorless.generateSurface(mod_colorless.java:88)
at ModLoader.populateChunk(ModLoader.java:1217)
at ko.a(ko.java:125)
at ack.a(SourceFile:733)
at ko.c(ko.java:67)
at ko.b(ko.java:75)
at xd.d(SourceFile:359)
at xd.a(SourceFile:301)
at net.minecraft.client.Minecraft.e(SourceFile:1916)
at net.minecraft.client.Minecraft.a(SourceFile:1824)
at net.minecraft.client.Minecraft.a(SourceFile:1788)
at net.minecraft.client.Minecraft.a(SourceFile:1676)
at mw.c(SourceFile:171)
at iz.a(SourceFile:220)
at if.a(SourceFile:150)
at mw.a(SourceFile:192)
at lr.b(SourceFile:734)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.x(SourceFile:752)
at net.minecraft.client.Minecraft.run(SourceFile:671)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 9a69b243 ----------
My Code
package net.minecraft.src;
import java.util.Random;
public class mod_colorless extends BaseMod
{
public static int TinBlock = ModLoader.addOverride("/terrain.png","dock/block/tin.png");
public static int CopperBlock = ModLoader.addOverride("/terrain.png","dock/block/copper.png");
public static int SilverBlock = ModLoader.addOverride("/terrain.png","dock/block/silver.png");
public static int PlatinumBlock = ModLoader.addOverride("/terrain.png","dock/block/platinum.png");
public static int SapphireBlock = ModLoader.addOverride("/terrain.png","dock/block/sapphire.png");
public static int RubyBlock = ModLoader.addOverride("/terrain.png","dock/block/ruby.png");
public static int TopazBlock = ModLoader.addOverride("/terrain.png","dock/block/topaz.png");
public static int AmethystBlock = ModLoader.addOverride("/terrain.png","dock/block/amethyst.png");
public static int MythrilBlock = ModLoader.addOverride("/terrain.png","dock/block/mythril.png");
public static int AdmantiumBlock = ModLoader.addOverride("/terrain.png","dock/block/admantium.png");
public static int TitaniumBlock = ModLoader.addOverride("/terrain.png","dock/block/titanium.png");
public static int MoonstoneBlock = ModLoader.addOverride("/terrain.png","dock/block/moonstone.png");
public static int TigerseyeBlock = ModLoader.addOverride("/terrain.png","dock/block/tigerseye.png");
public static int CobaltBlock = ModLoader.addOverride("/terrain.png","dock/block/cobalt.png");
public static int TinOre = ModLoader.addOverride("/terrain.png","dock/block/tinore.png");
public static int CopperOre = ModLoader.addOverride("/terrain.png","dock/block/copperore.png");
public static int SilverOre = ModLoader.addOverride("/terrain.png","dock/block/silverore.png");
public static int PlatinumOre = ModLoader.addOverride("/terrain.png","dock/block/platinumore.png");
public static int SapphireOre = ModLoader.addOverride("/terrain.png","dock/block/sapphireore.png");
public static int RubyOre = ModLoader.addOverride("/terrain.png","dock/block/rubyore.png");
public static int TopazOre = ModLoader.addOverride("/terrain.png","dock/block/topazore.png");
public static int AmethystOre = ModLoader.addOverride("/terrain.png","dock/block/amethystore.png");
public static int MythrilOre = ModLoader.addOverride("/terrain.png","dock/block/mythrilore.png");
public static int AdmantiumOre = ModLoader.addOverride("/terrain.png","dock/block/admantiumore.png");
public static int TitaniumOre = ModLoader.addOverride("/terrain.png","dock/block/titaniumore.png");
public static int MoonstoneOre = ModLoader.addOverride("/terrain.png","dock/block/moonstoneore.png");
public static int TigerseyeOre = ModLoader.addOverride("/terrain.png","dock/block/tigerseyeore.png");
public static int CobaltOre = ModLoader.addOverride("/terrain.png","dock/block/cobaltore.png");
public String getVersion() {
return "1.2.5";
}
//Blocks
public void load() {
Block Blockcolorstone = new Blockcolorstone(240);
ModLoader.registerBlock(Blockcolorstone, net.minecraft.src.ItemBricks.class);
ModLoader.addName(new ItemStack(Blockcolorstone, 240,0),"Tin Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,1),"Copper Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,2),"Silver Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,3),"Platinum Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,4),"Sapphire Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,5),"Ruby Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,6),"Topaz Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,7),"Amethyst Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,8),"Mythril Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,9),"Admantium Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,10),"Titanium Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,11),"Moonstone Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,12),"Tigers Eye Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 240,13),"Cobalt Block");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,0),"Tin Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,1),"Copper Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,2),"Silver Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,3),"Platinum Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,4),"Sapphire Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,5),"Ruby Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,6),"Topaz Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,7),"Amethyst Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,8),"Mythril Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,9),"Admantium Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,10),"Titanium Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,11),"Moonstone Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,12),"Tigers Eye Ore");
ModLoader.addName(new ItemStack(Blockcolorstone, 241,13),"Cobalt Ore");
ModLoader.addSmelting(TinOre, new ItemStack(mod_oreitems.TinIngot, 1));
ModLoader.addSmelting(CopperOre, new ItemStack(mod_oreitems.CopperIngot, 1));
ModLoader.addSmelting(SilverOre, new ItemStack(mod_oreitems.SilverIngot, 1));
ModLoader.addSmelting(PlatinumOre, new ItemStack(mod_oreitems.PlatinumIngot, 1));
ModLoader.addSmelting(TitaniumOre, new ItemStack(mod_oreitems.TitaniumIngot, 1));
ModLoader.addSmelting(MythrilOre, new ItemStack(mod_oreitems.MythrilIngot, 1));
ModLoader.addSmelting(AdmantiumOre, new ItemStack(mod_oreitems.AdmantiumIngot, 1));
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(mod_colorless.TinOre, 12)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.CopperOre, 12)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.SilverOre, 6)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.PlatinumOre, 4)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.SapphireOre, 5)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.RubyOre, 3)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.TopazOre, 20)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.AmethystOre, 7)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.MythrilOre, 3)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.AdmantiumOre, 7)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.TitaniumOre, 2)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.MoonstoneOre, 9)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.TigerseyeOre, 2)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.CobaltOre, 14)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
}
You can't call all of those WorldGenMinables in one loop. You need to create a separate loop for each ore.
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(mod_colorless.TinOre, 12)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(mod_colorless.CopperOre, 12)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(mod_colorless.SilverOre, 6)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(mod_colorless.PlatinumOre, 4)).generate(world, random, randPosX, randPosY, randPosZ);
}
//etc. Do that with the rest.
(new WorldGenMinable(mod_colorless.SapphireOre, 5)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.RubyOre, 3)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.TopazOre, 20)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.AmethystOre, 7)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.MythrilOre, 3)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.AdmantiumOre, 7)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.TitaniumOre, 2)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.MoonstoneOre, 9)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.TigerseyeOre, 2)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(mod_colorless.CobaltOre, 14)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
After you've done the tutorial, can you test it by compiling, creating a .zip of it, then putting that in 'Mods' folder?
I want to know because I like to learn by testing and intuition, and the knowledge would help many other want-to-be modders reading these guides I suppose. (and I want to be able to use my mods/test them )
Thanks
You recompile it then use startclient.bat/sh to run the test client with your mod already in it.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
-snip, realized what you meant, decompile MC, recompile with the file inside-
But, what I also mean is, if my friend wants to use the mod, do I send him the mod file in a .zip, and then he can just put it in the Mods folder?
You must reobfuscate the mod before you can put it in a zip and use it in the mods folder.
I have never seen an error report like that so I don't know the issue. Try asking in Mod Development.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
To post a comment, please login or register a new account.
Just use
The bounding box should rotate with the entity.
I just answered this question on the last page.
together they are powerful beyond imagination."
Thanks
how about smelting a dye, how is that written?
With the current smelting system it is not possible. I believe that Forge adds a hook for this but I'm not sure.
together they are powerful beyond imagination."
Thanks, but now I think onUpdate() is not being called, because I tried to make it display a chat message when onUpdate() is called and in game I run around with this item and nothing is happening... currently I have:
public void onUpdate(EntityPlayer player) {/*rest of code*/}what should I change to get it called?
There is no tutorial on creating a new furnace. You just need to use the code from the current furnace. I don't think there are any updated tutorials on these forums for a new furnace but I'm not 100% sure.
Remove the EntityPlayer parameter from it.
public void onUpdate() {/*code*/}together they are powerful beyond imagination."
if I do that I get bunches of errors saying player could not be resolved. also If I change player to EntityPlayer I get errors about making a static referance to a non-static feild, can you please see my code and tell me what to fix:
package net.minecraft.src; public class NitroItem extends Item { public NitroItem(int i) { super(i); } public void onUpdate() { if(!player.isSneaking() && player.motionX > 0.5 && player.motionY > 0.5 && player.motionZ > 0.5) { explode(); } } boolean exploded = false; private void explode() { if(!exploded) { exploded = true; Entity entity = null; ModLoader.getMinecraftInstance().thePlayer.worldObj.createExplosion(entity, ModLoader.getMinecraftInstance().thePlayer.posX, ModLoader.getMinecraftInstance().thePlayer.posY, ModLoader.getMinecraftInstance().thePlayer.posZ, 16F); } } }You need to use to reference the player when there isn't a parameter in the super method defining EntityPlayer or a variable somewhere else in the class.
together they are powerful beyond imagination."
ok thank you, there are no errors but it still does nothing in game if I go and run around with the item...
Nope. Axis Aligned Bounding boxes don't rotate. They grow and shrink to fit sometimes, but they never rotate.
Any ideas on where to start research with Oriented Bounding Boxes?
I saw your post in Mod Development. If you use the setSize method in the entity's constructor then it will rotate but if you use something else it probably won't rotate.
together they are powerful beyond imagination."
It decompiles fine with only the bin folder. You don't need the server jar unless you are making a server mod. I don't include it in my starting tutorial because I am not teaching how to make SMP compatible mods.
That normally means that the icon index hasn't been set. It looks fine to me at the moment so I don't know what the problem is.
together they are powerful beyond imagination."
This isn't a mod, this is a tutorial for making mods. Please read threads before making unrelated posts such as this.
As for your errors, again, you need to actually READ the thread before posting stuff.
My Code
package net.minecraft.src; import java.util.Random; public class mod_colorless extends BaseMod { public static int TinBlock = ModLoader.addOverride("/terrain.png","dock/block/tin.png"); public static int CopperBlock = ModLoader.addOverride("/terrain.png","dock/block/copper.png"); public static int SilverBlock = ModLoader.addOverride("/terrain.png","dock/block/silver.png"); public static int PlatinumBlock = ModLoader.addOverride("/terrain.png","dock/block/platinum.png"); public static int SapphireBlock = ModLoader.addOverride("/terrain.png","dock/block/sapphire.png"); public static int RubyBlock = ModLoader.addOverride("/terrain.png","dock/block/ruby.png"); public static int TopazBlock = ModLoader.addOverride("/terrain.png","dock/block/topaz.png"); public static int AmethystBlock = ModLoader.addOverride("/terrain.png","dock/block/amethyst.png"); public static int MythrilBlock = ModLoader.addOverride("/terrain.png","dock/block/mythril.png"); public static int AdmantiumBlock = ModLoader.addOverride("/terrain.png","dock/block/admantium.png"); public static int TitaniumBlock = ModLoader.addOverride("/terrain.png","dock/block/titanium.png"); public static int MoonstoneBlock = ModLoader.addOverride("/terrain.png","dock/block/moonstone.png"); public static int TigerseyeBlock = ModLoader.addOverride("/terrain.png","dock/block/tigerseye.png"); public static int CobaltBlock = ModLoader.addOverride("/terrain.png","dock/block/cobalt.png"); public static int TinOre = ModLoader.addOverride("/terrain.png","dock/block/tinore.png"); public static int CopperOre = ModLoader.addOverride("/terrain.png","dock/block/copperore.png"); public static int SilverOre = ModLoader.addOverride("/terrain.png","dock/block/silverore.png"); public static int PlatinumOre = ModLoader.addOverride("/terrain.png","dock/block/platinumore.png"); public static int SapphireOre = ModLoader.addOverride("/terrain.png","dock/block/sapphireore.png"); public static int RubyOre = ModLoader.addOverride("/terrain.png","dock/block/rubyore.png"); public static int TopazOre = ModLoader.addOverride("/terrain.png","dock/block/topazore.png"); public static int AmethystOre = ModLoader.addOverride("/terrain.png","dock/block/amethystore.png"); public static int MythrilOre = ModLoader.addOverride("/terrain.png","dock/block/mythrilore.png"); public static int AdmantiumOre = ModLoader.addOverride("/terrain.png","dock/block/admantiumore.png"); public static int TitaniumOre = ModLoader.addOverride("/terrain.png","dock/block/titaniumore.png"); public static int MoonstoneOre = ModLoader.addOverride("/terrain.png","dock/block/moonstoneore.png"); public static int TigerseyeOre = ModLoader.addOverride("/terrain.png","dock/block/tigerseyeore.png"); public static int CobaltOre = ModLoader.addOverride("/terrain.png","dock/block/cobaltore.png"); public String getVersion() { return "1.2.5"; } //Blocks public void load() { Block Blockcolorstone = new Blockcolorstone(240); ModLoader.registerBlock(Blockcolorstone, net.minecraft.src.ItemBricks.class); ModLoader.addName(new ItemStack(Blockcolorstone, 240,0),"Tin Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,1),"Copper Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,2),"Silver Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,3),"Platinum Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,4),"Sapphire Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,5),"Ruby Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,6),"Topaz Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,7),"Amethyst Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,8),"Mythril Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,9),"Admantium Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,10),"Titanium Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,11),"Moonstone Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,12),"Tigers Eye Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 240,13),"Cobalt Block"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,0),"Tin Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,1),"Copper Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,2),"Silver Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,3),"Platinum Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,4),"Sapphire Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,5),"Ruby Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,6),"Topaz Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,7),"Amethyst Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,8),"Mythril Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,9),"Admantium Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,10),"Titanium Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,11),"Moonstone Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,12),"Tigers Eye Ore"); ModLoader.addName(new ItemStack(Blockcolorstone, 241,13),"Cobalt Ore"); ModLoader.addSmelting(TinOre, new ItemStack(mod_oreitems.TinIngot, 1)); ModLoader.addSmelting(CopperOre, new ItemStack(mod_oreitems.CopperIngot, 1)); ModLoader.addSmelting(SilverOre, new ItemStack(mod_oreitems.SilverIngot, 1)); ModLoader.addSmelting(PlatinumOre, new ItemStack(mod_oreitems.PlatinumIngot, 1)); ModLoader.addSmelting(TitaniumOre, new ItemStack(mod_oreitems.TitaniumIngot, 1)); ModLoader.addSmelting(MythrilOre, new ItemStack(mod_oreitems.MythrilIngot, 1)); ModLoader.addSmelting(AdmantiumOre, new ItemStack(mod_oreitems.AdmantiumIngot, 1)); } public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int i = 0; i < 7; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(128); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(mod_colorless.TinOre, 12)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.CopperOre, 12)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.SilverOre, 6)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.PlatinumOre, 4)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.SapphireOre, 5)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.RubyOre, 3)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.TopazOre, 20)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.AmethystOre, 7)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.MythrilOre, 3)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.AdmantiumOre, 7)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.TitaniumOre, 2)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.MoonstoneOre, 9)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.TigerseyeOre, 2)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.CobaltOre, 14)).generate(world, random, randPosX, randPosY, randPosZ); } } }setSize simply calls the bounding box maker. The only reason it looks like its rotating is because this method can only create square BBs. When the box was large enough, the edges of the box were confirmed to remain rooted on the axes.
You can't call all of those WorldGenMinables in one loop. You need to create a separate loop for each ore.
public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int i = 0; i < 7; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(128); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(mod_colorless.TinOre, 12)).generate(world, random, randPosX, randPosY, randPosZ); } for(int i = 0; i < 7; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(128); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(mod_colorless.CopperOre, 12)).generate(world, random, randPosX, randPosY, randPosZ); } for(int i = 0; i < 7; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(128); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(mod_colorless.SilverOre, 6)).generate(world, random, randPosX, randPosY, randPosZ); } for(int i = 0; i < 7; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(128); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(mod_colorless.PlatinumOre, 4)).generate(world, random, randPosX, randPosY, randPosZ); } //etc. Do that with the rest. (new WorldGenMinable(mod_colorless.SapphireOre, 5)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.RubyOre, 3)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.TopazOre, 20)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.AmethystOre, 7)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.MythrilOre, 3)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.AdmantiumOre, 7)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.TitaniumOre, 2)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.MoonstoneOre, 9)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.TigerseyeOre, 2)).generate(world, random, randPosX, randPosY, randPosZ); (new WorldGenMinable(mod_colorless.CobaltOre, 14)).generate(world, random, randPosX, randPosY, randPosZ); } }You recompile it then use startclient.bat/sh to run the test client with your mod already in it.
together they are powerful beyond imagination."
You must reobfuscate the mod before you can put it in a zip and use it in the mods folder.
I have never seen an error report like that so I don't know the issue. Try asking in Mod Development.
together they are powerful beyond imagination."