Jump to content

[1.7.10] Gui only drawing one string value when the real value is different


Recommended Posts

Posted

I have a string being drawn on a custom gui that is supposed to present useful information, but the only two values it displays are "Empty" and "Unknown", even when the actual string value in the TileEntity is different.

 

TileEntity:

 

  Reveal hidden contents

 

 

Gui:

 

  Reveal hidden contents

 

 

I'm probably overlooking something really simple, but I can't seem to figure out what's wrong.

Posted

Hi

 

My guess - perhaps your string is never being set correctly; or perhaps you are updating some of the components on the server side, but not on the client side.

 

Perhaps try adding a diagnostic at the very end of updateEntity, for example

 

System.out.println("TileEntityCrucible::updateEntity side= " +  FMLcommonHandler.instance().getEffectiveSide() + ", fillResultString= " +  fillResultString);

 

-TGG

Posted

Yep, it turned out that the server has the correct value and the client doesn't.

Pardon my stupidity, but how exactly would I go about fixing this? I'm very new to Minecraft modding.

Posted

Hi

 

You may not need packets if you can calculate the string using information available on the client.  Is there any way your client can calculate tin and copper itself, in parallel with the server?

 

Vanilla synchronises some aspects of Inventories / Containers automatically, although I'm not clear on the details because I've never used it.

 

If tin and copper are being altered by something else on the server that the client doesn't know about, then you will need to use Packets to tell the client what is happening on the server.  In 1.6.4 you could use  Packet132TileEntityData for this sort of thing (->TileEntity.onDataPacket(), TileEntity.getDescriptionPacket()); I don't know what it's called know but it's likely to be very similar.  Try looking in TileEntityBeacon or TileEntitySkull for clues.

 

-TGG

 

 

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.