13
0
geforkt von Mirrors/Paper

Fix strange potion diff

Dieser Commit ist enthalten in:
md_5 2016-03-20 13:42:12 +11:00
Ursprung 549962feaf
Commit 6cac62c64d

Datei anzeigen

@ -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);
+ if (!event.isCancelled() && list != null && !list.isEmpty()) { // do not process effects if there are no effects to process
+ for (LivingEntity victim : event.getAffectedEntities()) {
@ -91,20 +104,7 @@
+ mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect1.getAmplifier(), d1);
+ } else {
+ 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) {
+ entityliving.addEffect(new MobEffect(mobeffectlist, i, mobeffect1.getAmplifier()));
}