Jump to content

Recommended Posts

Posted

Hello I try to make a custom GUI of my Block to give the block a "internal" name so each Block has a string that can be changed.

But first of all I just wanted to create a gui with a textfield and a button but I'm always failing, I'm new to forge and java as well and the tutorials on the forge wiki don't help me at all so I post my code here and you tell me why it is not working and what has to be changed. Tips and explanations I would really appreciate and sorry for my english I'm not a native speaker.

 

 

FastTravelMod

 

  Reveal hidden contents

 

 

CommonProxy

 

  Reveal hidden contents

 

 

ClientProxy

 

  Reveal hidden contents

 

 

FastTravelBlock

 

  Reveal hidden contents

 

 

GuiTravelMark

 

  Reveal hidden contents

 

 

GuiHandler

 

  Reveal hidden contents

 

 

And the errorlog by opening the gui :

 

  Reveal hidden contents

 

 

Thank you for helping me , LG Graphic :P

Posted

Well first, delete the GuiHandler class.

You already made it in the proxies.

Then register the proxy.

Finally, getServerGuiElement(args) should return a Container, not a GUI.

Posted

Seems like I'm still stuck at my gui I just wanna show the gui now at all I've tried to change the code to a Container and looked at the tutorial in the wiki but now I have the error : " java.lang.ClassCastException: org.setcore.fasttravel.ContainerTravelMark cannot be cast to net.minecraft.client.gui.GuiScreen"

 

My Code so far :

 

ClientProxy

 

  Reveal hidden contents

 

 

CommonProxy

 

  Reveal hidden contents

 

 

ContainerTravelMark

 

  Reveal hidden contents

 

 

FastTravelBlock

 

  Reveal hidden contents

 

 

FastTravelMod

 

  Reveal hidden contents

 

 

GuiTravelMark

 

  Reveal hidden contents

 

TileEntityTravel

 

  Reveal hidden contents

 

Posted

I changed it now so that the server returns the container and the client returns the gui know I'm running into the following error caused by a nullpointerexception but I don't know where ...:

 

 

  Reveal hidden contents

 

Posted

Here you go :

 

CommonProxy

 

  Reveal hidden contents

 

 

 

ClientProxy

 

  Reveal hidden contents

 

 

I think it has something to do with the TileEntity

Posted

either this works or show us more of the error log (specially 5-6 lines after the one in OP)

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

I don't know what you mean exactly but this is whole Log from the debug :

 

 

  Reveal hidden contents

 

 

 

And I've got 2 crash reports as files :

 

 

  Reveal hidden contents

 

 

 

  Reveal hidden contents

 

Posted
  Quote
java.lang.NullPointerException

at net.minecraft.inventory.Slot.getStack(Slot.java:91)

at net.minecraft.client.gui.inventory.GuiContainer.drawSlotInventory(GuiContainer.java:353)

at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:132)

 

basicly its telling you that its trying to draw an item on the screen the a Slot return null and it isnt expecting that

 

@Override
public TileEntity createNewTileEntity(World world) {
	return null;
}

 

thsi should be returning a new TileEntityTravel, because if you dont you will never create your tile entity.

 

 

also add thsi to your block because else it will never even ASK to create a new tile entity

 

@Override
public boolean hasTileEntity(int meta) {
	return true;
}

those bugs are kinda shitty becasue they tell you something but the root cause is totally not there

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

I'm going to die for this mod  ::)

 

So I changed my FastTravelBlock to

 

 

  Reveal hidden contents

 

 

But I don't know what to do in createNewTileEntity....

 

My errorlog but it's seems like it's about the same

 

 

  Reveal hidden contents

 

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 can't figure out if you're looking for help trying to steal someone elses work, or cheat at the game....
    • Title: Why Is It So Hard to Rename and Restructure Mods Like Xray or AntiXray? 🤔 Post text: Hey everyone! I’ve been digging into Minecraft modding for a while and have one big question that I can’t figure out on my own. Maybe someone with more experience could help or give me some advice. Here’s the issue: When I take a “normal” Minecraft mod — for example, one that just adds some blocks or new items — I can easily change its structure, package names, or even rebrand it entirely. It’s straightforward. But as soon as I try this with cheat-type mods like XrayMod or AntiXray, everything falls apart. Even if I just rename the classes, refactor the packages, or hide its identity somehow, the mod either breaks or stops working properly. XrayMod in particular is proving to be a nightmare to modify without losing its core function. So my question is — why is this so much harder with cheat mods like Xray? Is there something fundamentally different about how they’re coded, loaded, or protected that prevents simple renaming or restructuring? And if so, how can I actually learn to understand someone else’s cheat mod enough to safely refactor it without breaking the core features? I’ve already been spending over two months trying to figure this out and haven’t gotten anywhere. It feels like there must be some trick or knowledge I’m missing. Would really appreciate any thoughts, tips, or references — maybe there are guides or techniques for understanding cheat-mod internals? Or if you’ve successfully “disguised” a cheat mod like Xray before, I’d love to hear how you did it. Thanks in advance for any help or discussion. ✌️
    • just started making cinamatic contect check it out on my channel or check out my facebook page    Humbug City Minecraft Youtube https://www.youtube.com/watch?v=v2N6OveKwno https://www.facebook.com/profile.php?id=61575866982337  
    • Where did you get the schematic? Source/Link? And do use an own modpack or a pre-configured from curseforge? If yes, which one On a later time, I can make some tests on my own - but I need the schematic and the modpack name
  • Topics

×
×
  • Create New...

Important Information

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