FallenMoonNetwork / CanaryRecode

CanaryMod Recode Repository
Other
11 stars 44 forks source link

Splash potions of instant health and instant damage don't call PotionEffectAppliedHook #22

Closed irrelevantknight closed 11 years ago

irrelevantknight commented 11 years ago

I tested by making a listener with "onPotionApplied(PotionEffectAppliedHook hook){plugin.getLogman().logInfo("blah");}". All potions and splash potions seem to call the hook, except for splash potions of instant health (1 and 2), and splash potions of instant damage (1 and 2).

damagefilter commented 11 years ago

That will be because they do not have a lasting effect, this hook is called only for potions that have a duration.

NiccosSystem commented 11 years ago

Irrelevant claimed that they DO have a lasting effect though, but that it is set to one tick?

ayyron-dev commented 11 years ago

It is called instant.... The method called for these will be different. It will just require us to add a hook call at the right spot.

damagefilter commented 11 years ago

It's called instant for a reason ;) For instance: Splash invisibility potion. It's a splash poition but actually applies a lasting effect on the entity. Insta damage or insta heal do not. They do their thing once and are not added the the effects list of an entity.

NiccosSystem commented 11 years ago

Ah, guess he was wrong then :-)

irrelevantknight commented 11 years ago

Regular (non splash) potions of instant health and damage do call the hook though. Also, according to the Minecraft wiki, the potions can even be made to last more than one tick, and will heal the player once per tick. http://www.minecraftwiki.net/wiki/Status_effect

damagefilter commented 11 years ago

The method to apply the potion effect is STILL not called on the server. Please feel free to test it yourself ;) As @somners said. We need to find a different place as it's not the same thing.