Jump to content

Recommended Posts

Posted

Ok, so I am the author of Damage Indicators mod, and the client side health really benefited the mod as now a server mod is not needed, HOWEVER, some extras i threw in due to the server mod being previously required have been problematic. One being potion effects.

 

When a living entity has a potion effect applied, a formula is applied to combine the colors of all current potion effects and applied to the datawatcher server side, which is then later delivered to the client, and I have deemed data extraction from this as not viable, as colors are somewhat generic and do not give details on exactly the strength duration etc of the potion effect, IF the generic effects could actually be accurately extracted.

 

However, i have noticed that when a mob is first spawned via a chunk load, the client side actually receives the exact potion info, although it is never  updated again. Does anyone know a way the client side might force the server to resend the initial spawn packet on demand? Is there a spawn info request packet, or is the initial spawn data packet sent only when the server wants it to? Any info on this would be much appreciated and would save me days of logic following.

Posted

That method is protected, and on top of that, would not do anything client side.

Iterator iterator = this.activePotionsMap.keySet().iterator();

        while (iterator.hasNext())
        {
            Integer integer = (Integer)iterator.next();
            PotionEffect potioneffect = (PotionEffect)this.activePotionsMap.get(integer);

            if (!potioneffect.onUpdate(this))
            {
                if (!this.worldObj.isRemote)
                {
                    iterator.remove();
                    this.onFinishedPotionEffect(potioneffect);
                }
            }
            else if (potioneffect.getDuration() % 600 == 0)
            {
                this.onChangedPotionEffect(potioneffect, false);
            }
        }

On the client side, activePotionsMap never changes from what it is when the mob originally spawned. So running this client side would not really do anything.

Posted

Ok, I stand corrected. I didn't check when the Packet41EntityEffect got send, and it's really only once in the "spawn packet" (multiple actually).

I don't see any way of getting all information about the potions to the client without modding the server.

Thanks for trying anyways, and yeah I am aware of this :(. I was hoping someone might know of, or have a stroke of genius and might give me a hint on how I might coax the Packet41EntityEffect out of the server, client side, on demand.

Posted

Client can then compute the data however you want.

No, because when the entity receives a new potion effect, the server only tells the client the new particle color, not the entire potion effect.

 

Well actually, the potion color is updated, but is not extractable into anything useful. The issue is, a mobs REAL potion effect is only applied when spawned, so if any potion effects change after spawning, it will never apply client side, only a particle effect is applied(which is a color set on the datawatcher server side) which as i said, cannot be used to accurately tell detailed information about the potions applied.

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.