Jump to content

Recommended Posts

Posted

Okay so I'm trying to get my head back into modding minecraft instead of work and programming lectures. So I decided to create all the stuff I know I already should know how to create and therefore I started to create an FurnaceChest. Which is exactly that but how it works is besides the point.

 

I want a GUI looking like the vanilla chest to open and I want to be able to put items into and out of it. So I implement a block, a TileEntity along with a GUI and a Container.

Upon activating the block, the game shows the GUI for 1sec before crashing.

Or rather not crashing as far as I can tell it's stopping the server, then while trying to stop the server it crashes. So I'm not even sure why it's stopping the server, except that I probably fucked up somewhere big time :P

 

Some names are still cryptic and contains their vanilla names, but hopefully it's not confusing. If it's unclear I will refactor and re-post.

 

EDIT: I updated forge to get the crash report generation to work which made things a lot more clear.

I followed the stacktrace and I see it's getting passed inn an array of 90 slots when mine is expecting 45.

I'm not sure why yet but I will dig into it now :)

 

Heres the new error log:

 


2013-04-28 16:18:47 [iNFO] [sTDERR] net.minecraft.util.ReportedException: Exception in world tick
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1877)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:834)
at net.minecraft.client.Minecraft.run(Minecraft.java:759)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IndexOutOfBoundsException: Index: 45, Size: 45
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at net.minecraft.inventory.Container.getSlot(Container.java:132)
at net.minecraft.inventory.Container.putStacksInSlots(Container.java:558)
at net.minecraft.client.multiplayer.NetClientHandler.handleWindowItems(NetClientHandler.java:1227)
at net.minecraft.network.packet.Packet104WindowItems.processPacket(Packet104WindowItems.java:67)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:266)
at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:94)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1861)

 

 

 

Heres the error log/ Stack Trace, since it's short I'll post it here:

 

java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at net.minecraft.crash.CrashReportCategory.func_85073_a(CrashReportCategory.java:137)
at net.minecraft.crash.CrashReport.makeCategoryDepth(CrashReport.java:251)
at net.minecraft.world.World.addWorldInfoToCrashReport(World.java:4389)
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:441)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1871)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:831)
at net.minecraft.client.Minecraft.run(Minecraft.java:756)
at java.lang.Thread.run(Unknown Source)

 

 

Heres the console log into the crash:

 


2013-04-27 16:47:54 [iNFO] [Minecraft-Server] mazetar[/127.0.0.1:0] logged in with entity id 500 at (53.21801094383978, 64.0, 248.08529862925218)
2013-04-27 16:47:56 [iNFO] [Minecraft-Server] Stopping server
2013-04-27 16:47:56 [iNFO] [Minecraft-Server] Saving players
2013-04-27 16:47:56 [iNFO] [Minecraft-Server] Saving worlds
2013-04-27 16:47:56 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2013-04-27 16:47:56 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2013-04-27 16:47:56 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2013-04-27 16:47:56 [iNFO] [ForgeModLoader] Unloading dimension 0
2013-04-27 16:47:56 [iNFO] [ForgeModLoader] Unloading dimension -1
2013-04-27 16:47:56 [iNFO] [ForgeModLoader] Unloading dimension 1
2013-04-27 16:47:56 [iNFO] [sTDERR] java.lang.ArrayIndexOutOfBoundsException

 

 

As you can see at 16:47:54 I enter the world, and 16:47:55 presumably I activate the block.

and Bang. Okay so What I want and what happens is documented, here is my faulty code:

 

The @Mod file: http://pastebin.com/zRK2mGTx

BlockFurnaceChest - http://pastebin.com/QkGRNBSt

 

Note: TileEntityMaz only contains methods for orientation and is probably irrelevant.

TileEntityFurnaceChest - http://pastebin.com/iixziZTa

ContainerFurnaceChest - http://pastebin.com/N2j2BQwE

GuiFurnaceChest - http://pastebin.com/6phtUaYZ

 

GUI Handler Methods:

 

 

public class CommonProxy implements IGuiHandler {
  @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world,
            int x, int y, int z) {
        if (ID == GuiIds.FURNACE_CHEST_ID)
            return new CotainerFurnaceChest(world.getBlockTileEntity(x, y, z), player);
    }

    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world,
            int x, int y, int z) {
        if (ID == GuiIds.FURNACE_CHEST_ID)
            return new GuiFurnaceChest(player, world, x, y, z);
        return null;
    }
}

 

 

Well there is all the code related to the GUI and Block.

I was unable to figure this out as the stack trace seemed to give me nothing, although the array made me think of the inventory size at the TileEntity I couldn't see what would be wrong there and surely it would be traces to one of my classes inn the StackTrace?

If you guys dont get it.. then well ya.. try harder...

Posted

Are those errors pointing to crash report writing...

Huh?

 

Not sure what you mean here but the error log / StackTrace above is the one found inn the crash file.

The full crash report can be found here: http://pastebin.com/QV20vHNJ

I'm pretty sure that the above snippet is all the relevant data, as the rest is just the position of entities and such.

If you guys dont get it.. then well ya.. try harder...

Posted

The error message you have up doesn't seem to be talking about your gui, it's showing something wrong with the crash report generation

Writing a steampunk mod called MineTech, and author of a long dead fishing mod

Posted

The error message you have up doesn't seem to be talking about your gui, it's showing something wrong with the crash report generation

 

Yeah it could seem like that, but when something crashes while coding then it's usually your own fault and not the API or lib's fault :)

There is probably an error inn my GUI as well tough since it's crashing inn the first place ^^

If you guys dont get it.. then well ya.. try harder...

Posted

Updated forge again removed the crash report error and now shows the real error.

I guess I need to check what my Container and TE is doing doing with the inventory, even though I'm pretty sure I use 45 to instantiate it and it's length everywhere else hmm..

If you guys dont get it.. then well ya.. try harder...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.