I've never seen an error like that, so I don't know how to fix it. When I quick breeze through the code, I don't see anything that should break it.
Well do you think it would be possible for you to make a working version for me, since my code isn't working, I don't want to be a bother but I would greatly appreciate it. I have set myself deadlines and with those deadlines I had wanted to get the mod done by next week. Now I know that this isn't what the page is for but you have been so helpful. All i am trying to make is a mod where it is basically the f1 screen but it releases the mouse, so that I can control another instance of the game and still record from the modded GUI screen. I would like for it to be a separate screen that I can access without modifying the f1 screen and it HAS to be accessible in multiplayer. I know this isn't what this thread is for or what you normally do, but I would appreciate it if you could help me out with this.
Here's my code for it if you want to use any of it:
package net.minecraft.src;
import org.lwjgl.input.Keyboard;
import net.minecraft.client.Minecraft;
public abstract class mod_TimelapseGUI extends BaseMod
{
private KeyBinding key_GuiTimelapse = new KeyBinding("Timelapse GUI", 20);
public static World world;
protected Minecraft mc;
public boolean charStatsShowing;
public mod_TimelapseGUI()
{
mc = ModLoader.getMinecraftInstance();
charStatsShowing = false;
ModLoader.registerKey(this, this.key_GuiTimelapse, false);
//addLocalization adds it to the controls option
ModLoader.addLocalization("Timelapse GUI", "Timelapse GUI");
ModLoader.setInGameHook(this, true, false);
ModLoader.setInGUIHook(this, true, false);
}
public void isCharStat(KeyBinding keybinding)
{
if(keybinding == this.key_GuiTimelapse && charStatsShowing == true)
{
mc.displayGuiScreen(null);
}
else if(keybinding == this.key_GuiTimelapse)
{
mc.displayGuiScreen(new GuiTimelapse());
}
}
public void keyboardEvent(KeyBinding keybinding)
{
isCharStat(keybinding);
}
public boolean statsGui;
public void KeyboardEvent(KeyBinding event)
{
if(event == this.key_GuiTimelapse)
{
mc.displayGuiScreen(new GuiTimelapse());
ModLoader.getMinecraftInstance().displayGuiScreen(new GuiTimelapse());
}
}
public String getVersion() {
return "TimelapseGUI v1.0";
}
public boolean TimelapseGUI;
}
package net.minecraft.src;
public class GuiTimelapse extends GuiScreen
{
public GuiTimelapse()
{
}
public void intiGui()
{
controlList.clear();
}
public boolean doesGuiPauseGame()
{
return false;
}
public void drawScreen(int i, int j, float f)
{
drawBackground(0x000000FF);
drawCenteredString(fontRenderer, "GUI OPEN", width / 0, 0, 0xFFFFFF);
super.drawScreen(i, j, f);
}
}
Well do you think it would be possible for you to make a working version for me.
One thing I couldn't figure out is the F1 effect. I was looking through GuiIngame and I couldn't find it anywhere. I'm not entirely sure where it is :/
GuiSteward
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class GuiSteward extends GuiScreen
{
public GuiSteward()
{
super();
}
public boolean doesGuiPauseGame()
{
return false;
}
public void onGuiClosed(){}
public void initGui()
{
controlList.clear();
}
protected void actionPerformed(GuiButton guibutton)
{
if (!guibutton.enabled)
{
return;
}
}
public void drawScreen(int i, int j, float f)
{
try
{
}
finally
{
}
super.drawScreen(i, j, f);
}
}
mod_Steward
package net.minecraft.src;
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard;
public class mod_Steward extends BaseMod
{
private KeyBinding key_Timelapse = new KeyBinding("Timelapse Button", 33);
public static World world;
protected Minecraft mc;
public boolean timelapseOpen;
public mod_Steward()
{
mc = ModLoader.getMinecraftInstance();
ModLoader.registerKey(this, this.key_Timelapse, false);
ModLoader.addLocalization("Character Stats", "CharacterStats");
ModLoader.setInGameHook(this, true, false);
ModLoader.setInGUIHook(this, true, false);
timelapseOpen = false;
}
public void keyboardEvent(KeyBinding keybinding)
{
isCharStat(keybinding);
}
public void isCharStat(KeyBinding keybinding)
{
if(keybinding == this.key_Timelapse && timelapseOpen == true)
{
mc.displayGuiScreen(null);
timelapseOpen = false;
}
else if(keybinding == this.key_Timelapse)
{
mc.displayGuiScreen(new GuiSteward());
timelapseOpen = true;
}
}
public boolean statsGui;
public void KeyboardEvent(KeyBinding event)
{
if(event == this.key_Timelapse)
{
mc.displayGuiScreen(new GuiSteward());
}
}
public String getVersion() {return "Steward's Mod v1";}
public void load() {}
}
One thing I couldn't figure out is the F1 effect. I was looking through GuiIngame and I couldn't find it anywhere. I'm not entirely sure where it is :/
GuiSteward
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class GuiSteward extends GuiScreen
{
public GuiSteward()
{
super();
}
public boolean doesGuiPauseGame()
{
return false;
}
public void onGuiClosed(){}
public void initGui()
{
controlList.clear();
}
protected void actionPerformed(GuiButton guibutton)
{
if (!guibutton.enabled)
{
return;
}
}
public void drawScreen(int i, int j, float f)
{
try
{
}
finally
{
}
super.drawScreen(i, j, f);
}
}
mod_Steward
package net.minecraft.src;
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard;
public class mod_Steward extends BaseMod
{
private KeyBinding key_Timelapse = new KeyBinding("Timelapse Button", 33);
public static World world;
protected Minecraft mc;
public boolean timelapseOpen;
public mod_Steward()
{
mc = ModLoader.getMinecraftInstance();
ModLoader.registerKey(this, this.key_Timelapse, false);
ModLoader.addLocalization("Character Stats", "CharacterStats");
ModLoader.setInGameHook(this, true, false);
ModLoader.setInGUIHook(this, true, false);
timelapseOpen = false;
}
public void keyboardEvent(KeyBinding keybinding)
{
isCharStat(keybinding);
}
public void isCharStat(KeyBinding keybinding)
{
if(keybinding == this.key_Timelapse && timelapseOpen == true)
{
mc.displayGuiScreen(null);
timelapseOpen = false;
}
else if(keybinding == this.key_Timelapse)
{
mc.displayGuiScreen(new GuiSteward());
timelapseOpen = true;
}
}
public boolean statsGui;
public void KeyboardEvent(KeyBinding event)
{
if(event == this.key_Timelapse)
{
mc.displayGuiScreen(new GuiSteward());
}
}
public String getVersion() {return "Steward's Mod v1";}
public void load() {}
}
Thanks, I may play with it some to get the perfect GUI but it will help allot, many thanks... Also i clicked your sig and saw that you needed a texture artist, my server tech guy and I both used to do textures for different mods, I have changed comps since then so i don't have any pics but if you want I may be able to help you out.
java.lang.ArrayIndexOutOfBoundsException: 8
at tc.a(SourceFile:590)
at ModLoader.addRecipe(ModLoader.java:452)
at mod_VariantCraft.addRecipes(mod_VariantCraft.java:29)
at mod_VariantCraft.<init>(mod_VariantCraft.java:8)
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 ModLoader.addMod(ModLoader.java:327)
at ModLoader.readFromClassPath(ModLoader.java:1317)
at ModLoader.init(ModLoader.java:915)
at ModLoader.addAllRenderers(ModLoader.java:169)
at avx.<init>(RenderManager.java:86)
at avx.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.a(SourceFile:260)
at net.minecraft.client.Minecraft.run(SourceFile:516)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 8d92dc45 ----------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hmmmm... I think it's something wrong with the crafting recipe. Anyone confirm me?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ publicvoid addRecipes() { ModLoader.addRecipe( new ItemStack(plastic, 8), new Object[] {
"##", "##", Character.valueOf('#'), Block.wood }); ModLoader.addRecipe( new ItemStack(cement, 4), new Object [] {
" X ", " Y ", " Z ", Character.valueOf('X'), Block.sand, Character.valueOf('Y'), Block.gravel, Character.valueOf('Z'), Item.bucketWater }); ModLoader.addRecipe( new ItemStack(cement, 4), new Object [] {
" Y ", " X ", " Z ", Character.valueOf('X'), Block.sand, Character.valueOf('Y'), Block.gravel, Character.valueOf('Z'), Item.bucketWater }); }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOL no probs on this i think
It dosent work cus the problem is that I changed the PATH but dosent know how to fix it.
Do you?
Yes change the path to be C:\Program Files\Java\JDK 1.7.0_05\bin or where ever you JDK install is. It must be the jdk not the jre otherwise the javac command won't work. To test it type javac -version you should see Version 1.7.0_05 or something similar.
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/mod_Professional.java:4: net.minecraft.src.mod_Professional is not abstract and does not override abstract method load() in net.minecraft.src.BaseMod
public class mod_Professional extends BaseMod {
^
1 error
==================
> Done in 13.45 seconds
> Recompiling server...
!! Can not find server sources !!
I know a tiny little thing about java so i thought: Just make my class abstract, just like BaseMod
public abstract class mod_Professional extends BaseMod {
But i guess that minecraft doesn't like that. I do not get any error when recompiling and reobfuscating. But when i add the classes to my minecraft.jar (of course with the .png files)
it crashes. With this error:
Dec 25, 2011 11:03:52 AM ModLoader addMod
FINE: Failed to load mod from "mod_Professional.class"
Dec 25, 2011 11:03:52 AM ModLoader addMod
FINER: THROW
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at ModLoader.addMod(ModLoader.java:275)
at ModLoader.readFromClassPath(ModLoader.java:1227)
at ModLoader.init(ModLoader.java:825)
at ModLoader.AddAllRenderers(ModLoader.java:186)
at wb.<init>(wb.java:76)
at wb.<clinit>(wb.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:265)
at nm.a(nm.java:27)
at net.minecraft.client.Minecraft.run(SourceFile:644)
at java.lang.Thread.run(Thread.java:680)
Dec 25, 2011 11:04:02 AM ModLoader readFromModFolder
I'm sorry, I've never seen anything about 'abstract'. I can't help you here.
-Muserae
You need to have the public void load(){} method no matter what for it to work it should look like (this is what it is in my mod) :
@Override
public void load(){
addRecipies
}
That overides the abstract and causes the recipes to be called to load.
Hey, I'm having a bit of a problem being able to craft my block.
Here's the main mod code;
package net.minecraft.src;
import java.util.Random;
public class Mod_AttractiveScarecrows extends BaseMod {
public Mod_AttractiveScarecrows(){
addNames();
setTextures();
registerBlocks();
addRecipes();
addSmelting();
}
public void addNames(){
ModLoader.AddName(scarecrow, "Scarecrow");
ModLoader.AddName(scarecrowblock, "Scarecrow Block");
}
public void setTextures(){
scarecrowblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/AttractiveScarecrows/scarecrowtexture.png");
}
public void registerBlocks(){
ModLoader.RegisterBlock(scarecrowblock);
}
public void addRecipes(){
ModLoader.AddRecipe(new ItemStack(scarecrow,1), new Object[]{
" P ", "SDS"," S ", Character.valueOf('P'), Block.pumpkin, Character.valueOf('S'), Item.stick, Character.valueOf('D'), Item.diamond});
ModLoader.AddRecipe(new ItemStack(scarecrowblock,1), new Object[]{
"SSS", Character.valueOf('S'), Block.sand});
}
public void addSmelting(){
}
public static Item scarecrow;
static
{
scarecrow = (new ItemScarecrow (1200)).setItemName("Scarecrow");
}
public static Block scarecrowblock;
static{
scarecrowblock = new BlockScarecrow(251, 0, Material.cloth).setHardness(0.3f).setResistance(2f).setBlockName("scarecrowblock");
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return "Attractive Scarecrows V1";
}
@Override
public void load() {
// TODO Auto-generated method stub
}
}
and here's the code for the block itself;
package net.minecraft.src;
import java.util.Random;
public class BlockScarecrow extends Block{
public BlockScarecrow(int i, int j, Material material){
super(i, Material.cloth);
}
public int idDropped(int i, Random random, int j){
return Mod_AttractiveScarecrows.scarecrowblock.blockID;
}
public int quantityDropped(Random random){
return 1;
}
}
It won't let me craft the block ingame.
Can you please tell me what I've done wrong?
You have to have this in your code:
@Override
public void load(){
addRecipes
}
One thing that would be really helpful to me is an explanation of how to make blcks with complex shapes and hitboxes
I was going to make a tutorial on this eventually, but I'm trying to figure out how the textures work with it.
public void addCollidingBlockToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
{
this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F);
super.addCollidingBlockToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
//repeat this.setBlockBounds and super.addCollidingBlockToList for more. This will take trial and error.
//Not 100% sure if you need the ForItemRender, but just incase, here it is
this.setBlockBoundsForItemRender();
}
public void setBlockBoundsForItemRender()
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
Hi! Since 1.3.2 I've been having issues with my mod that I have yet to figure out. There is no error but it does not want to work the way it use to. I have sent you a PM regarding the issue
I've looked at tens of different tutorials, and tried everythng possible, but I cannot get rid of these errors. Any advice?
From what I can guess, you've added or edited a class that has an error in it. If you maximize the one with the error, you can look for a class with the same X, that's where the problem is.
So I am having some trouble getting the random generator to work for the ore I am making. I wanted to know what you thought was wrong. I have done everything you have said to do and even looked on other sites to see if I was missing something but each time it says "Random" cannot be resolved as a type.
package net.minecraft.src;
public class mod_Grinder extends BaseMod
{
public static final Block Grinder = new BlockGrinder(230, 0).setHardness(.5F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setBlockName("Grinder");
public mod_Grinder()
{
ModLoader.registerBlock(Grinder);
ModLoader.addName(Grinder, "Grinder");
Grinder.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Grinder/Grinder.png");
}
public String Version()
{
return "1.7.3";
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return null;
}
@Override
public void load() {
// TODO Auto-generated method stub
}
@Override
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for (int i=0; i < 16; i++)
{
int randPosX = chunkX + random.nextInt(6);
int randPosY = random.nextInt(150);
int randPosZ = chunkZ + random.nextInt(6);
(new WorldGenMinable(this.Grinder.blockID, 50)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
}
If you look at the code above then Random is fine but in Eclipse i get the error for it.
Hi! I'm having a bit of trouble with returning items during crafting. Think you could see what my problem is?
package net.minecraft.src;
import java.util.Random;
public class mod_minecraft extends BaseMod
{
//Tin Ore
public static final Block tinore = new BlockTinOre(153, 0).setHardness(6F).setResistance(2.0F).setBlockName("tinore");
//Tin Ingot
public static final Item tiningot = new ItemTinIngot(253).setItemName("tiningot");
//Copper Ore
public static final Block copperore = new BlockCopperOre(152, 0).setContainerItem(Item.bowlEmpty, Item.stick).setHardness(4F).setResistance(2.0F).setBlockName("copperore");
//Eclipse doesn't seem to like this line of code ".setConatinerItem".
//Copper Ingot
public static final Item copperingot = new ItemCopperIngot(251).setItemName("copperingot");
//Copper Dust
public static final Item copperdust = new ItemCopperDust(252).setItemName("copperdust");
//Tin Ore Generator
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
Random randomGenerator = random;
for (int i = 0; i < 10; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(10);
int randPosY = random.nextInt(75);
int randPosZ = chunkZ + randomGenerator.nextInt(10);
(new WorldGenMinable(tinore.blockID, 9)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
//Copper Ore Generator
public void generateSurface1(World world, Random random, int chunkX, int chunkZ)
{
Random randomGenerator = random;
for (int i = 0; i < 10; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(10);
int randPosY = random.nextInt(75);
int randPosZ = chunkZ + randomGenerator.nextInt(10);
(new WorldGenMinable(copperore.blockID, 9)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public void load()
{
//SMELTING
//SMELTING ITEM TO ITEM
//Copper dust to Copper Ingot
ModLoader.addSmelting(copperdust.itemID, new ItemStack(copperingot, 1), 6.0F);
//Copper Ore to Ingot
ModLoader.addSmelting(copperore.blockID, new ItemStack(copperingot, 1), 6.0F);
//Tin Ore to Ingot
ModLoader.addSmelting(tinore.blockID, new ItemStack(tiningot, 1), 6.0F);
And the error that appears when I launch the actual game:
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Exception occured in ModLoader
A full error report has been saved to C:\Users\Wool\Desktop\Modding\jars\.\crash-reports\crash-2013-02-09_14.57.04-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash
--- BEGIN ERROR REPORT d7a7cd2 --------
Full report at:
C:\Users\Daniel\Desktop\Modding\jars\.\crash-reports\crash-2013-02-09_14.57.04-client.txt
Please show that file to Mojang, NOT just this screen!
Generated 2/9/13 2:57 PM
-- System Details --
Details:
Minecraft Version: 1.4.7
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_13, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 994943136 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, MinecraftFakeLauncher, ThreadShutdown, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 1
ModLoader 1.4.7
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:395)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1406)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:190)
at net.minecraft.src.RenderManager.(RenderManager.java:93)
at net.minecraft.src.RenderManager.(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:421)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.minecraft.src.mod_minecraft.(mod_minecraft.java:13)
... 16 more
--- END ERROR REPORT c2320046 ----------
I'm working on my mod, and I'm adding dust to the game (similar to that of IC2), but I want the recipe for the dust (stick, ore, bowl) to return the stick and bowl, as if using a mortar and pestle to grind the rock to dust. If you could reply sometime soon, that would be great. I don't want to bother you, because I can see you're working hard yourself on your own project. I am hoping to release my mod to the public, but this one line of code I added seems to crash the game. Hope you can help!
I've never seen an error like that, so I don't know how to fix it. When I quick breeze through the code, I don't see anything that should break it.
Well do you think it would be possible for you to make a working version for me, since my code isn't working, I don't want to be a bother but I would greatly appreciate it. I have set myself deadlines and with those deadlines I had wanted to get the mod done by next week. Now I know that this isn't what the page is for but you have been so helpful. All i am trying to make is a mod where it is basically the f1 screen but it releases the mouse, so that I can control another instance of the game and still record from the modded GUI screen. I would like for it to be a separate screen that I can access without modifying the f1 screen and it HAS to be accessible in multiplayer. I know this isn't what this thread is for or what you normally do, but I would appreciate it if you could help me out with this.
Here's my code for it if you want to use any of it:
One thing I couldn't figure out is the F1 effect. I was looking through GuiIngame and I couldn't find it anywhere. I'm not entirely sure where it is :/
GuiSteward
mod_Steward
Thanks, I may play with it some to get the perfect GUI but it will help allot, many thanks... Also i clicked your sig and saw that you needed a texture artist, my server tech guy and I both used to do textures for different mods, I have changed comps since then so i don't have any pics but if you want I may be able to help you out.
--- BEGIN ERROR REPORT c6c223ab --------
Generated 5/08/12 6:31 PM
- Minecraft Version: 1.3.1
- Operating System: Windows 7 (x86) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
- Memory: 451109656 bytes (430 MB) / 518979584 bytes (494 MB) up to 1037959168 bytes (989 MB)
- JVM Flags: 2 total; -Xms512m -Xmx1024m
- ModLoader: Mods loaded: 1
ModLoader 1.3.1
java.lang.ArrayIndexOutOfBoundsException: 8
at tc.a(SourceFile:590)
at ModLoader.addRecipe(ModLoader.java:452)
at mod_VariantCraft.addRecipes(mod_VariantCraft.java:29)
at mod_VariantCraft.<init>(mod_VariantCraft.java:8)
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 ModLoader.addMod(ModLoader.java:327)
at ModLoader.readFromClassPath(ModLoader.java:1317)
at ModLoader.init(ModLoader.java:915)
at ModLoader.addAllRenderers(ModLoader.java:169)
at avx.<init>(RenderManager.java:86)
at avx.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.a(SourceFile:260)
at net.minecraft.client.Minecraft.run(SourceFile:516)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 8d92dc45 ----------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hmmmm... I think it's something wrong with the crafting recipe. Anyone confirm me?
A crappy animator's Youtube channel
My guess is yes
ArrayIndexOutOfBoundsException
makes me want to think you did something like "XXXX" instead of "XXX" look for spaces or something.
public void addRecipes() {
ModLoader.addRecipe(
new ItemStack(plastic, 8), new Object[] {
"##", "##", Character.valueOf('#'), Block.wood
});
ModLoader.addRecipe(
new ItemStack(cement, 4), new Object [] {
" X ", " Y ", " Z ", Character.valueOf('X'), Block.sand, Character.valueOf('Y'), Block.gravel, Character.valueOf('Z'), Item.bucketWater
});
ModLoader.addRecipe(
new ItemStack(cement, 4), new Object [] {
" Y ", " X ", " Z ", Character.valueOf('X'), Block.sand, Character.valueOf('Y'), Block.gravel, Character.valueOf('Z'), Item.bucketWater
});
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOL no probs on this i think
A crappy animator's Youtube channel
Yes change the path to be C:\Program Files\Java\JDK 1.7.0_05\bin or where ever you JDK install is. It must be the jdk not the jre otherwise the javac command won't work. To test it type javac -version you should see Version 1.7.0_05 or something similar.
You need to have the public void load(){} method no matter what for it to work it should look like (this is what it is in my mod) :
@Override
public void load(){
addRecipies
}
That overides the abstract and causes the recipes to be called to load.
You have to have this in your code:
@Override
public void load(){
addRecipes
}
I was going to make a tutorial on this eventually, but I'm trying to figure out how the textures work with it.
From what I can guess, you've added or edited a class that has an error in it. If you maximize the one with the error, you can look for a class with the same X, that's where the problem is.
If you look at the code above then Random is fine but in Eclipse i get the error for it.
package net.minecraft.src;
import java.util.Random;
public class mod_minecraft extends BaseMod
{
//Tin Ore
public static final Block tinore = new BlockTinOre(153, 0).setHardness(6F).setResistance(2.0F).setBlockName("tinore");
//Tin Ingot
public static final Item tiningot = new ItemTinIngot(253).setItemName("tiningot");
//Copper Ore
public static final Block copperore = new BlockCopperOre(152, 0).setContainerItem(Item.bowlEmpty, Item.stick).setHardness(4F).setResistance(2.0F).setBlockName("copperore");
//Eclipse doesn't seem to like this line of code ".setConatinerItem".
//Copper Ingot
public static final Item copperingot = new ItemCopperIngot(251).setItemName("copperingot");
//Copper Dust
public static final Item copperdust = new ItemCopperDust(252).setItemName("copperdust");
//Tin Ore Generator
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
Random randomGenerator = random;
for (int i = 0; i < 10; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(10);
int randPosY = random.nextInt(75);
int randPosZ = chunkZ + randomGenerator.nextInt(10);
(new WorldGenMinable(tinore.blockID, 9)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
//Copper Ore Generator
public void generateSurface1(World world, Random random, int chunkX, int chunkZ)
{
Random randomGenerator = random;
for (int i = 0; i < 10; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(10);
int randPosY = random.nextInt(75);
int randPosZ = chunkZ + randomGenerator.nextInt(10);
(new WorldGenMinable(copperore.blockID, 9)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public void load()
{
//SMELTING
//SMELTING ITEM TO ITEM
//Copper dust to Copper Ingot
ModLoader.addSmelting(copperdust.itemID, new ItemStack(copperingot, 1), 6.0F);
//Copper Ore to Ingot
ModLoader.addSmelting(copperore.blockID, new ItemStack(copperingot, 1), 6.0F);
//Tin Ore to Ingot
ModLoader.addSmelting(tinore.blockID, new ItemStack(tiningot, 1), 6.0F);
//SMELTING BLOCK TO BLOCK
//=======================================================================================
//Copper Ore
copperore.setCreativeTab(CreativeTabs.tabBlock);
ModLoader.registerBlock(copperore);
copperore.blockIndexInTexture = ModLoader.addOverride("/terrain.png" , "/items/copperore.png");
ModLoader.addName(copperore, "Copper Ore");
//Tin Ore
tinore.setCreativeTab(CreativeTabs.tabBlock);
ModLoader.registerBlock(tinore);
tinore.blockIndexInTexture = ModLoader.addOverride("/terrain.png" , "/items/tinore.png");
ModLoader.addName(tinore, "Tin Ore");
//Tin Ingot
tiningot.setCreativeTab(CreativeTabs.tabMaterials);
tiningot.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/tiningot.png");
ModLoader.addName(tiningot, "Tin Ingot");
//Copper Ingot
copperingot.setCreativeTab(CreativeTabs.tabMaterials);
copperingot.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/copperingot.png");
ModLoader.addName(copperingot, "Copper Ingot");
//Copper Dust
copperdust.setCreativeTab(CreativeTabs.tabMaterials);
copperdust.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/copperdust.png");
ModLoader.addName(copperdust, "Copper Dust");
ModLoader.addRecipe(new ItemStack(copperdust, 1), new Object[]
{
" | ",
" O ",
" U ",
'|', Item.stick, 'U', Item.bowlEmpty, 'O', copperore
});
}
public String getVersion()
{
return "3.14159265";
}
}
And the error that appears when I launch the actual game:
I'm working on my mod, and I'm adding dust to the game (similar to that of IC2), but I want the recipe for the dust (stick, ore, bowl) to return the stick and bowl, as if using a mortar and pestle to grind the rock to dust. If you could reply sometime soon, that would be great. I don't want to bother you, because I can see you're working hard yourself on your own project. I am hoping to release my mod to the public, but this one line of code I added seems to crash the game. Hope you can help!