mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +01:00
Fix strange potion diff
By: md_5 <git@md-5.net>
This commit is contained in:
parent
8a5e72c953
commit
ed3feb34bd
1 changed files with 15 additions and 15 deletions
|
@ -61,7 +61,20 @@
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
|
- while (iterator2.hasNext()) {
|
||||||
|
- MobEffect mobeffect1 = (MobEffect) iterator2.next();
|
||||||
|
- MobEffectList mobeffectlist = mobeffect1.getMobEffect();
|
||||||
|
-
|
||||||
|
- if (mobeffectlist.isInstant()) {
|
||||||
|
- mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect1.getAmplifier(), d1);
|
||||||
|
- } else {
|
||||||
|
- int i = (int) (d1 * (double) mobeffect1.getDuration() + 0.5D);
|
||||||
|
-
|
||||||
|
- if (i > 20) {
|
||||||
|
- entityliving.addEffect(new MobEffect(mobeffectlist, i, mobeffect1.getAmplifier()));
|
||||||
|
- }
|
||||||
|
- }
|
||||||
+ org.bukkit.event.entity.PotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPotionSplashEvent(this, affected);
|
+ org.bukkit.event.entity.PotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPotionSplashEvent(this, affected);
|
||||||
+ if (!event.isCancelled() && list != null && !list.isEmpty()) { // do not process effects if there are no effects to process
|
+ if (!event.isCancelled() && list != null && !list.isEmpty()) { // do not process effects if there are no effects to process
|
||||||
+ for (LivingEntity victim : event.getAffectedEntities()) {
|
+ for (LivingEntity victim : event.getAffectedEntities()) {
|
||||||
|
@ -91,20 +104,7 @@
|
||||||
+ mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect1.getAmplifier(), d1);
|
+ mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect1.getAmplifier(), d1);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ int i = (int) (d1 * (double) mobeffect1.getDuration() + 0.5D);
|
+ int i = (int) (d1 * (double) mobeffect1.getDuration() + 0.5D);
|
||||||
|
+
|
||||||
- while (iterator2.hasNext()) {
|
|
||||||
- MobEffect mobeffect1 = (MobEffect) iterator2.next();
|
|
||||||
- MobEffectList mobeffectlist = mobeffect1.getMobEffect();
|
|
||||||
-
|
|
||||||
- if (mobeffectlist.isInstant()) {
|
|
||||||
- mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect1.getAmplifier(), d1);
|
|
||||||
- } else {
|
|
||||||
- int i = (int) (d1 * (double) mobeffect1.getDuration() + 0.5D);
|
|
||||||
-
|
|
||||||
- if (i > 20) {
|
|
||||||
- entityliving.addEffect(new MobEffect(mobeffectlist, i, mobeffect1.getAmplifier()));
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
+ if (i > 20) {
|
+ if (i > 20) {
|
||||||
+ entityliving.addEffect(new MobEffect(mobeffectlist, i, mobeffect1.getAmplifier()));
|
+ entityliving.addEffect(new MobEffect(mobeffectlist, i, mobeffect1.getAmplifier()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue