I'll get right to the point, don't want to waste your time...
EDIT 1: If you need extra code, let me know. I posted what is relevant.
The error:
java.lang.NullPointerException
at net.minecraft.src.ContainerChest.<init>(ContainerChest.java:11)
at net.minecraft.src.GuiChest.<init>(GuiChest.java:17)
at dm.base.block.DMBlockContainer.onBlockActivated(DMBlockContainer.java:18)
at net.minecraft.src.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:331)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1306)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1785)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:828)
at net.minecraft.client.Minecraft.run(Minecraft.java:753)
at java.lang.Thread.run(Unknown Source)
The code causing it:
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int par6, float par7, float par8, float par9)
{
System.out.println("Chest Opened");
ModLoader.openGUI(player, new GuiChest(chestinv, playerInv));
return true;
}
When I look at the log it says Chest Opened, but then gives a NullPointerException.
Both chestinv and playerInv are initialized at the top.
Eons ago, there was only void. Then came the big bang. Voxels colliding with voxels, cubes with cubes. Blocks were forming, each texture unique from the rest. That was when our universe was born.
Eons ago, there was only void. Then came the big bang. Voxels colliding with voxels, cubes with cubes. Blocks were forming, each texture unique from the rest. That was when our universe was born.
player.openGui(YourMod.instance, 0, world, i, j, k);
then make an instance in your mod like this, this goes in your public class YourMod{}:
@Instance(yourModID)
public static YourMod instance = new YourMod();
hope this helps!
-sorash67 || Skorpio
Currently, I'm using ModLoader, but I'll try it out, with a few modifications of course. I'll get back to you if it works. Thanks.
Rollback Post to RevisionRollBack
Eons ago, there was only void. Then came the big bang. Voxels colliding with voxels, cubes with cubes. Blocks were forming, each texture unique from the rest. That was when our universe was born.
EDIT 1: If you need extra code, let me know. I posted what is relevant.
The error:
Both chestinv and playerInv are initialized at the top.
to
then make an instance in your mod like this, this goes in your public class YourMod{}:
hope this helps!
-sorash67 || Skorpio
http://www.minecraftforum.net/topic/1839245-1615-forge-sspsmp-skorpios-notonlymoreores-mod-the-crossbow-update/
Currently, I'm using ModLoader, but I'll try it out, with a few modifications of course. I'll get back to you if it works. Thanks.