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

Hi Guys!

 

I want to create a Gui for a new Sign, which is shown when te sign is placed, but it won't work.

I don't really know why and I need some help..

 

My Code:

 

Reveal hidden contents

 

 

I hope, anybody knows, which mistake I made.

 

Thanks in Advance!

 

  On 9/21/2013 at 10:22 AM, SenpaiSubaraki said:

dont return null on server side. you want to add your tileentity there, or a container.

sign gui's are bound to their TE and edit strings from the TE to show the message.

For a strictly client side GUI that shouldnt be necessary. Its probably not working because the vanilla sign GUI notices that it doesnt have a container.

You seriously need to do something here

public void onGuiClosed()
    {
    	//TODO: Need to be edited! 
    	/*
        Keyboard.enableRepeatEvents(false);
        NetClientHandler netclienthandler = this.mc.getNetHandler();

        if (netclienthandler != null)
        {
            netclienthandler.addToSendQueue(new Packet130UpdateSign(this.entitySign.xCoord, this.entitySign.yCoord, this.entitySign.zCoord, this.entitySign.signText));
        }

        this.entitySign.setEditable(true); */
    }

  • Author

@GotoLink: But this shouldn't stop the Gui from being shown.

 

@khlorghaal: I tried it with a custom GUI and even this isn't shown

I think, it's because the getClientGuiElement method isn't called... Any ideas why?

 

@SenpaiSubaraki: I don't have any container to return and with a TE Java responds with a Cast-Exception.

  • Author

I don't limit the Call to the server side..

 

I do it like this:

 

 public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
    {
      [...]
                par2EntityPlayer.openGui(Main.instance, 0, par3World, par4, par5, par6);

                return true;
            }
        }
    }

 

And I don't know, which container to use, because I actually don't have one

  • Author

I added

System.out.println(par3World.isRemote);

And it only prints out false on server side and nothing on client side.

I got the same problem in another project: http://www.minecraftforge.net/forum/index.php/topic,12543.0.html

Have I done something wrong in the Initialisation of the Mod?

 

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

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.