Jump to content

Recommended Posts

Posted

First post so excuse me if i don't include everything needed, but I find myself having a lot of trouble loading my config file into minecraft.  For some reason the config file is generated every time I delete it but when I go to my mod in minecraft the config button is greyed out. I'm working with 1.7.10, the error log says it can't initialize gui factory

 

  Reveal hidden contents

 

I've included a picture in case I'm not making myself clear enough.

 

  Reveal hidden contents

 

Posted

The Button is grayed out for me as well... It seems like it is a WIP or you have to implement it yourself.

The error itself seems to be coming from your config class. Check if your config file is actually doing something (Being generated / accepting values), try to print out your config values and change them to see if they are actually being read.

But just an error (especially this) isn't enough to help you. Any code would be great :D

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

I'm sort of following along with a tutorial and all my code matches that in the videos, the only difference is that in the videos the config button actually works.  I don't know which config class has the error, since I have two, so I'll post them both

 

  Reveal hidden contents

 

Posted

You have to actually load the Config file after creating it:

public static void loadConfiguration()
{
        configuration.load();
        ...

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

I didn't know about the functionality of the Config buttons because I concentrated on other things recently since ID's aren't a problem anymore :/

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

I tried loading the configuration in loadConfiguration(), which I'm sad I didn't do in the first place, but still nothing.  I'm about ready to say it's just not gonna work and give up  >:(

Posted

Where are you getting your config file path from? I got mine from "event.getSuggestedConfigurationFile()" in the MOD class.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

Where's your GUI factory class?  Can you show all your code related to configruation?  You should have an annotation in your main class pointing to the GUI factory class as well.  Also, you say you do it but don't show your proxy call to the init() where you pass the file location.  Coding is all about the details so need to see all related code to help you.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

class list

 

  Reveal hidden contents

 

 

gui factory

 

  Reveal hidden contents

 

 

gui config

 

  Reveal hidden contents

 

 

config handler

 

  Reveal hidden contents

 

 

main mod class

 

  Reveal hidden contents

 

 

also i get this message in the system output pane when i run the game and i don't know what exactly it's complaining about

[16:06:55] [Client thread/ERROR] [FML]: A critical error occurred instantiating the gui factory for mod betterRPG
java.lang.ClassCastException: class com.syntaxjedi.betterRPG.client.gui.BetterRPGguiConfig
at java.lang.Class.asSubclass(Unknown Source) ~[?:1.8.0_05]
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:316) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:596) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:941) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

Posted

From the looks of your error, you aren't implementing an interface, or not extending something.

 

That's all I got for a ClassCastException.

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Posted

That was my general thinking but I couldn't for the life of me figure out what to do, and google wasn't much help either :/

 

**EDIT**

I FIXED IT!!!! it was such a dumb mistake  >:( in my reference file i had

CONFIG_GUI_CLASS = "com.syntaxjedi.betterRPG.client.gui.BetterRPGguiConfig";

instead of

CONFIG_GUI_CLASS = "com.syntaxjedi.betterRPG.client.gui.GuiFactory";

:/

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

    • Hi everyone, I'm currently developing a Forge 1.21 mod for Minecraft and I want to display a custom HUD overlay for a minigame. My goal: When the game starts, all players should see an item/block icon (from the base game, not a custom texture) plus its name/text in the HUD – similar to how the bossbar overlay works. The HUD should appear centered above the hotbar (or at a similar prominent spot), and update dynamically (icon and name change as the target item changes). What I've tried: I looked at many online tutorials and several GitHub repos (e.g. SeasonHUD, MiniHUD), but most of them use NeoForge or Forge versions <1.20 that provide the IGuiOverlay API (e.g. implements IGuiOverlay, RegisterGuiOverlaysEvent). In Forge 1.21, it seems that neither IGuiOverlay nor RegisterGuiOverlaysEvent exist anymore – at least, I can't import them and they are missing from the docs and code completion. I tried using RenderLevelStageEvent as a workaround but it is probably not intended for custom HUDs. I am not using NeoForge, and switching the project to NeoForge is currently not an option for me. I tried to look at the original minecraft source code to see how elements like hearts, hotbar etc are drawn on the screen but I am too new to Minecraft modding to understand. What I'm looking for: What is the correct way to add a custom HUD element (icon + text) in Forge 1.21, given that the previous overlay API is missing? Is there a new recommended event, callback, or method in Forge 1.21 for custom HUD overlays, or is everyone just using a workaround? Is there a minimal open-source example repo for Forge 1.21 that demonstrates a working HUD overlay without relying on NeoForge or deprecated Forge APIs? My ideal solution: Centered HUD element with an in-game item/block icon (from the base game's assets, e.g. a diamond or any ItemStack / Item) and its name as text, with a transparent background rectangle. It should be visible to the players when the mini game is running. Easy to update the item (e.g. static variable or other method), so it can change dynamically during the game. Any help, code snippets, or up-to-date references would be really appreciated! If this is simply not possible right now in Forge 1.21, it would also help to know that for sure. Thank you very much in advance!
    • The simple answer is there is not an easy way. You would need to know how to program in Java, as well as at least some familiarity with how Forge works so you could port the differences. You would also need the sourcecode for the original mod, and permission from the author to modify it, if they did not use some sort of open source license. So it's not impossible, but it would take some effort, but doing so would open up a whole new world of possibilities for you!
    • Does it still crash if you remove holdmyitems? Looks like that mod doesn't work on a server as far as I can tell from the error.  
    • Crashes the server when trying to start. Error code -1. Log  
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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