Jump to content

Recommended Posts

Posted

Hey folks,

 

I have an item that I store inside an inventory of my IEEP.

I need to have that item synchronized at all time because I am calculating values for custom gui rendering from its durabilty.

The problem is that right now it is only synchronized when I open the container where I use this item.

How can I force this item to update , I could use a custom packet but I feel like minecraft must have a built in way I dont know about.

 

Greetz Failender

Posted

I was sure that item updates occurred on both Client and Server.

Anyways, if you're trying to do what I think you're trying to do, you can always subscribe to LivingUpdateEvent and manually call the update. I found that IEEP doesn't always have the same values on client as server. (Maybe it does, and I'm just not using it correctly) But when my player first joins the world, I sync them once, and updates run on both sides.

With all due respect, sir: I do, what I do, the way I do it. ~ MacGyver

Posted

I am damaging the items on server side (they are a energy storage and im usign damage values to check out how much energy is left) .

I am rendering the energy left on client side which means I need the damage value on client side.

But its not getting synced by default, because its not in a opened container.

Which means I need to force the update. The question is not the where, the question is the how.

So my question is has vanilla a built in way to synchronize itemstacks I can use.

Posted

If I remember when an item receive a "damage change" it normally autosync client and server (normally in mc methods who return an itemstack).

 

But I can't imagine what you want without looking the item class or something more (GUI images, Container, ... ). "Probably" you are applying something much complicated without necessity. =/

 

// In my mod generally, when I start to make an idea of item or system, I look for something similar on Minecraft and try to make a "near concept" to after make the system like I planned.

// BSc CIS, hardcore gamer and a big fan of Minecraft.

 

TmzOS ::..

Posted

Exactly. It does that using detectAndSendChanges.

So. Is there a good way without detectAndSendChanges? I could of course also use a custom packet, but I feel like there must be another way

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.