Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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! :)

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?

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.

  • Author

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..?

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?

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.

  • Author

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.

What you should have is

 

        if(ID == mod.guiIDMoriumWorkbench)
        {
            return ContainerMoriumWorkbench(player.inventory, world, x, y, z);
        }

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.

  • Author

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);

}

}

}

oh, sorry, I must have snipped out the "new" keyword by accident.  You should have been able to fix that on your own.

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.

  • Author

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? :)

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.

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.

  • Author

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?

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.

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.

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.

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.

Breakpoints are part of your IDE's debugger, I suggest you read up on how to use it.

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.

  • Author

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?

Post the new FML log.

 

Search the Internet for "how to set breakpoints <your IDE here>", there should be plenty of results.

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.

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.

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.

  • Author

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?

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.

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.