Jump to content

Minecraft crashes when opening custom crafting table


TristanvO

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

}

}

}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am following a tutorial for modding minecraft 1.20.1, and while running the mod with the minecraft of the idea, no errors was present but, when I switched to real minecraft, it started to want a default constructor "public ZeroToAutomation()" instead of the one recomended by the video "public ZeroToAutomation(FMLJavaModLoadingContext context) {...}", and I can't use the default constructor because I need the FMLJavaModLoadingContext to register the blocks and items.   The problem is at: "net/myself/zerotoautomation/ZeroToAutomation.java" the file contains the default constructor, "Logger"s, and the code for the mod the defaut constructor was added after an error requesting it the Loggers was used to see which methods/constructors was used by the Launcher   things that I tried to fix the issue: remove the default constructor, but an error appeared "net.myself.zerotoautomation.ZeroToAutomation.<init>()", and nothing else on the class runs adding an "public static void init()" method, but it changed nothing   The mod files: https://github.com/Matwaua/Zero_To_Automation/tree/not-finished
    • It is an issue/conflict with distanthorizons
    • I have been trying to combat this issue between oculus and embeddium and to no avail... I have already tried a few online tutorials on how to get this working but it doesn't work at all. https://pastebin.com/geQgifjc
    • wow you sound like fun to play with
    • Instale el mod en mi servidor y este se queda iniciando por horas, en la consola me habla de algo de permisos y trate de seguir la ruta que me da pero no existe.   [13:05:32 INFO]: CustomNPC Permissions available: [13:05:32 INFO]: customnpcs.edit.blocks [13:05:32 INFO]: customnpcs.edit.villager [13:05:32 INFO]: customnpcs.global.bank [13:05:32 INFO]: customnpcs.global.dialog [13:05:32 INFO]: customnpcs.global.faction [13:05:32 INFO]: customnpcs.global.linked [13:05:32 INFO]: customnpcs.global.naturalspawn [13:05:32 INFO]: customnpcs.global.playerdata [13:05:32 INFO]: customnpcs.global.quest [13:05:32 INFO]: customnpcs.global.recipe [13:05:32 INFO]: customnpcs.global.transport [13:05:32 INFO]: customnpcs.npc.advanced [13:05:32 INFO]: customnpcs.npc.ai [13:05:32 INFO]: customnpcs.npc.clone [13:05:32 INFO]: customnpcs.npc.create [13:05:32 INFO]: customnpcs.npc.delete [13:05:32 INFO]: customnpcs.npc.display [13:05:32 INFO]: customnpcs.npc.freeze [13:05:32 INFO]: customnpcs.npc.gui [13:05:32 INFO]: customnpcs.npc.inventory [13:05:32 INFO]: customnpcs.npc.reset [13:05:32 INFO]: customnpcs.npc.stats [13:05:32 INFO]: customnpcs.scenes [13:05:32 INFO]: customnpcs.soulstone.all [13:05:32 INFO]: customnpcs.spawner.create [13:05:32 INFO]: customnpcs.spawner.mob [13:05:32 INFO]: customnpcs.tool.mounter [13:05:32 INFO]: customnpcs.tool.nbtbook [13:05:32 INFO]: customnpcs.tool.pather [13:05:32 INFO]: customnpcs.tool.scripter
  • Topics

×
×
  • Create New...

Important Information

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