TristanvO Posted April 21, 2016 Posted April 21, 2016 So when I open my custom GUI the game crashes. main.java: http://pastebin.com/mPamAF6M GuiHandler.java: http://pastebin.com/rQirGUVq moriumWorkbench.java: http://pastebin.com/Re2gFmbG ContainerMoriumWorkbench.java: http://pastebin.com/r4VhqrEk GuiMoriumWorkbench.java: http://pastebin.com/T2nPNG6e Error log(txt): http://pastebin.com/TPUdFKCN I hope somebody can help! Thanks! Quote
TristanvO Posted April 21, 2016 Author Posted April 21, 2016 How? I'm using 8 gigs... And I have a beastly computer with 16 GB of memory Quote
Choonster Posted April 21, 2016 Posted April 21, 2016 Memory: 886877880 bytes (845 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M Minecraft is only configured to use 1 GB. Do you have the _JAVA_OPTIONS environment variable set? Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
TristanvO Posted April 21, 2016 Author Posted April 21, 2016 Yeah, I think so. But this out of memory error never occured before. I changed some code and after changing that code it randomly did occur..? Quote
Draco18s Posted April 21, 2016 Posted April 21, 2016 FFS, why do we keep seeing this? if(ID == mod.guiIDMoriumWorkbench) { return ID == mod.guiIDMoriumWorkbench //... You already checked the ID, why are you checking it again? Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
TristanvO Posted April 21, 2016 Author Posted April 21, 2016 I have tried everything for what to put there. I just don't know what to put there, because it gives an error for every thing I put there except that what you see there right now. Quote
Draco18s Posted April 21, 2016 Posted April 21, 2016 What you should have is if(ID == mod.guiIDMoriumWorkbench) { return ContainerMoriumWorkbench(player.inventory, world, x, y, z); } Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
TristanvO Posted April 21, 2016 Author Posted April 21, 2016 It underlines and gives an error on: ContainerMoriumWorkbench AND GuiMoriumWorkbench. It wants me to create a method for both but of course that won't do anything, it just needs to import is what I would think. package com.tristanvo.mod.gui; import com.tristanvo.mod.mod; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getTileEntity(x, y, z); if(ID == mod.guiIDMoriumWorkbench) { return ContainerMoriumWorkbench(player.inventory, world, x, y, z); } } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getTileEntity(x, y, z); if(ID == mod.guiIDMoriumWorkbench) { return GuiMoriumWorkbench(player.inventory, world, x, y, z); } } } Quote
Draco18s Posted April 21, 2016 Posted April 21, 2016 oh, sorry, I must have snipped out the "new" keyword by accident. You should have been able to fix that on your own. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
TristanvO Posted April 22, 2016 Author Posted April 22, 2016 Thanks, it doesn't give any error anymore. I could've know indeed haha. But it's still crashing when I'm opening the Gui. It says I'm running out of memory but I never ran out of memory before on Minecraft. So it's still not really fixed. Can you help? Quote
TristanvO Posted April 23, 2016 Author Posted April 23, 2016 It still crashes and freezes when I open my GUI... Quote
Choonster Posted April 23, 2016 Posted April 23, 2016 It still crashes and freezes when I open my GUI... If it's running out of memory, I suspect you still have 1 GB assigned; probably from the _JAVA_OPTIONS environment variable. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
TristanvO Posted April 23, 2016 Author Posted April 23, 2016 First how do I assign more RAM to Minecraft in eclipse then? And secondly, why would it run out of memory when opening a GUI. Why a crash when opening my custom GUI and not when opening the standard crafting table GUI? Quote
Choonster Posted April 23, 2016 Posted April 23, 2016 First how do I assign more RAM to Minecraft in eclipse then? And secondly, why would it run out of memory when opening a GUI. Why a crash when opening my custom GUI and not when opening the standard crafting table GUI? The default amount of memory (1.75 GB on my machine) should be fine, but something's limiting the memory to 1 GB with a JVM argument. This is most likely the run configuration in your IDE or an environment variable. If it's the former, delete the JVM arguments. If it's the latter, delete the environment variable. I'm not sure exactly why only your GUI is crashing, perhaps it just uses more memory than the vanilla GUI. I've just noticed that the crash report you linked in the OP doesn't mention your GUI (or any GUI) at all. Could you post the most recent crash report? Edit: Added a missing word. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
TristanvO Posted April 23, 2016 Author Posted April 23, 2016 It doesn't give an error log. Minecraft does this: http://picpaste.com/pics/mccrash-CpcSZLeb.1461410878.png Quote
Choonster Posted April 23, 2016 Posted April 23, 2016 Try set an exception breakpoint for OutOfMemoryError in your IDE's debugger and step through the stack frames. Does anything stand out? Upload your FML log (logs/fml-client-latest.log) to Gist/Pastebin and link it here, it may also contain some useful information. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
TristanvO Posted April 23, 2016 Author Posted April 23, 2016 I don't really understand what you are saying but here is the FML log: http://pastebin.com/mbbQ1fFv Quote
Choonster Posted April 23, 2016 Posted April 23, 2016 Breakpoints are part of your IDE's debugger, I suggest you read up on how to use it. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
TristanvO Posted April 23, 2016 Author Posted April 23, 2016 I've allocated 8 GB of RAM and the game still crashes.. I couldn't find anything about breakpoints and IDE. Do you know what to do now? Quote
Choonster Posted April 23, 2016 Posted April 23, 2016 Post the new FML log. Search the Internet for "how to set breakpoints <your IDE here>", there should be plenty of results. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
TristanvO Posted April 23, 2016 Author Posted April 23, 2016 Can you explain what an IDE is, because I don't really know what it is :3. fml log: http://pastebin.com/KtuLvqxk Quote
Choonster Posted April 23, 2016 Posted April 23, 2016 It definitely looks like a memory leak now, there's no way Minecraft should be running out of memory with 8 GB available. IDE stands for Integrated Development Environment, you could have looked this up yourself. Eclipse and IntelliJ IDEA are the two IDEs supported by Forge/ForgeGradle. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
TristanvO Posted April 23, 2016 Author Posted April 23, 2016 How to know where exactly to put the breakpoints? I can't find out. Because I guess you can only select breakpoints for certain lines right? Quote
Choonster Posted April 23, 2016 Posted April 23, 2016 Normally you'd set a breakpoint in a method related to your issue so you could step through it and see what's going on. In this case, set an exception breakpoint rather than a line breakpoint so execution is paused when an OutOfMemoryError is thrown. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
TristanvO Posted April 23, 2016 Author Posted April 23, 2016 I can't figure out what exception I want to set a breakpoint on. Something like GuiHandler.java is not an exception but a class. tutorial: http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fbreakpoints%2Fref-addexception_viewaction.htm Quote
Recommended Posts
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.