Jump to content

Recommended Posts

Posted

Hey everyone, well, this is my first time modding (also my first post on the forum). I've seen some tutorials, but somehow i cant get my GUI to Open, it causes no error on the console. Also, i've checked various similar problems in the forums, but none of them help me.

 

Instance in my main class

 

  Reveal hidden contents

 

 

Registering Tile Entity

 

  Reveal hidden contents

 

 

initializing it in my main class

 

  Reveal hidden contents

 

 

Gui Class

 

  Reveal hidden contents

 

 

GuiHandler Class

 

  Reveal hidden contents

 

 

onBlockActivated function in my Block's class

 

  Reveal hidden contents

 

 

writeToNBT function in my Tile Entity Class

 

  Reveal hidden contents

 

 

readFromNBT funcion in my Tile Entity Class

 

  Reveal hidden contents

 

 

Sorry for my english, it's not my native language.

Also sorry if you see some of my random non-english anotations, i dont know if i manage to delete it all.

I dont know if i am missing something important here, or if you need more info to tell what am i doing wrong.

My minecraft version is 1.6.4 and my forge version is 9.11.1.965

 

Posted

You want to open the gui on both server and client. I know it sounds strange, but it is for the container and all.

Your code only opens the container of the GUI

[spoiler=so, this code]

public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){
    if(!world.isRemote){
      FMLNetworkHandler.openGui(player, AntiOres.instance, Ids.guiIdAntiFurnace, world, x, y, z);
    }
    
    return true;
  }

 

 

Dont check for a side:

@Override
public boolean onBlockActivated(World, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{
     player.openGui(AntiOres.instance, Ids.guiIdAntiFurnace, world, x, y, z) //Same as: FMLNetworkHandler.openGui(player, AntiOres.instance, Ids.guiIdAntiFurnace, world, x, y, z); though one less import 
     return true;
}

I am fairly new to Java and modding, so my answers are not always 100% correct. Sorry for that!

Posted
  On 1/4/2014 at 12:53 AM, diesieben07 said:

I suspect

Ids.tileEntityAntiFurnace_default

is not the same Id as

Ids.guiIdAntiFurnace

.

 

They aren't, do they have to be the same?

 

edit: Well, I tried that, thank you so much. Now i'm only getting a texture error but i thin i can manage that.

 

I though that if the ids were the same then i'd got an error

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



×
×
  • Create New...

Important Information

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