--- a/net/minecraft/world/entity/projectile/Arrow.java
+++ b/net/minecraft/world/entity/projectile/Arrow.java
@@ -2,6 +2,7 @@
 
 import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.Set;
 import net.minecraft.core.particles.ParticleTypes;
 import net.minecraft.core.registries.BuiltInRegistries;
@@ -22,37 +23,50 @@
 import net.minecraft.world.level.Level;
 
 public class Arrow extends AbstractArrow {
+
     private static final int EXPOSED_POTION_DECAY_TIME = 600;
     private static final int NO_EFFECT_COLOR = -1;
     private static final EntityDataAccessor<Integer> ID_EFFECT_COLOR = SynchedEntityData.defineId(Arrow.class, EntityDataSerializers.INT);
     private static final byte EVENT_POTION_PUFF = 0;
-    public Potion potion = Potions.EMPTY;
-    public final Set<MobEffectInstance> effects = Sets.newHashSet();
+    public Potion potion;
+    public final Set<MobEffectInstance> effects;
     private boolean fixedColor;
 
     public Arrow(EntityType<? extends Arrow> type, Level world) {
         super(type, world);
+        this.potion = Potions.EMPTY;
+        this.effects = Sets.newHashSet();
     }
 
     public Arrow(Level world, double x, double y, double z) {
         super(EntityType.ARROW, x, y, z, world);
+        this.potion = Potions.EMPTY;
+        this.effects = Sets.newHashSet();
     }
 
     public Arrow(Level world, LivingEntity owner) {
         super(EntityType.ARROW, owner, world);
+        this.potion = Potions.EMPTY;
+        this.effects = Sets.newHashSet();
     }
 
     public void setEffectsFromItem(ItemStack stack) {
         if (stack.is(Items.TIPPED_ARROW)) {
             this.potion = PotionUtils.getPotion(stack);
             Collection<MobEffectInstance> collection = PotionUtils.getCustomEffects(stack);
+
             if (!collection.isEmpty()) {
-                for(MobEffectInstance mobEffectInstance : collection) {
-                    this.effects.add(new MobEffectInstance(mobEffectInstance));
+                Iterator iterator = collection.iterator();
+
+                while (iterator.hasNext()) {
+                    MobEffectInstance mobeffect = (MobEffectInstance) iterator.next();
+
+                    this.effects.add(new MobEffectInstance(mobeffect));
                 }
             }
 
-            int i = getCustomColor(stack);
+            int i = Arrow.getCustomColor(stack);
+
             if (i == -1) {
                 this.updateColor();
             } else {
@@ -61,35 +75,36 @@
         } else if (stack.is(Items.ARROW)) {
             this.potion = Potions.EMPTY;
             this.effects.clear();
-            this.entityData.set(ID_EFFECT_COLOR, -1);
+            this.entityData.set(Arrow.ID_EFFECT_COLOR, -1);
         }
 
     }
 
     public static int getCustomColor(ItemStack stack) {
-        CompoundTag compoundTag = stack.getTag();
-        return compoundTag != null && compoundTag.contains("CustomPotionColor", 99) ? compoundTag.getInt("CustomPotionColor") : -1;
+        CompoundTag nbttagcompound = stack.getTag();
+
+        return nbttagcompound != null && nbttagcompound.contains("CustomPotionColor", 99) ? nbttagcompound.getInt("CustomPotionColor") : -1;
     }
 
     public void updateColor() {
         this.fixedColor = false;
         if (this.potion == Potions.EMPTY && this.effects.isEmpty()) {
-            this.entityData.set(ID_EFFECT_COLOR, -1);
+            this.entityData.set(Arrow.ID_EFFECT_COLOR, -1);
         } else {
-            this.entityData.set(ID_EFFECT_COLOR, PotionUtils.getColor(PotionUtils.getAllEffects(this.potion, this.effects)));
+            this.entityData.set(Arrow.ID_EFFECT_COLOR, PotionUtils.getColor((Collection) PotionUtils.getAllEffects(this.potion, this.effects)));
         }
 
     }
 
     public void addEffect(MobEffectInstance effect) {
         this.effects.add(effect);
-        this.getEntityData().set(ID_EFFECT_COLOR, PotionUtils.getColor(PotionUtils.getAllEffects(this.potion, this.effects)));
+        this.getEntityData().set(Arrow.ID_EFFECT_COLOR, PotionUtils.getColor((Collection) PotionUtils.getAllEffects(this.potion, this.effects)));
     }
 
     @Override
     protected void defineSynchedData() {
         super.defineSynchedData();
-        this.entityData.define(ID_EFFECT_COLOR, -1);
+        this.entityData.define(Arrow.ID_EFFECT_COLOR, -1);
     }
 
     @Override
@@ -104,35 +119,36 @@
                 this.makeParticle(2);
             }
         } else if (this.inGround && this.inGroundTime != 0 && !this.effects.isEmpty() && this.inGroundTime >= 600) {
-            this.level().broadcastEntityEvent(this, (byte)0);
+            this.level().broadcastEntityEvent(this, (byte) 0);
             this.potion = Potions.EMPTY;
             this.effects.clear();
-            this.entityData.set(ID_EFFECT_COLOR, -1);
+            this.entityData.set(Arrow.ID_EFFECT_COLOR, -1);
         }
 
     }
 
     private void makeParticle(int amount) {
-        int i = this.getColor();
-        if (i != -1 && amount > 0) {
-            double d = (double)(i >> 16 & 255) / 255.0D;
-            double e = (double)(i >> 8 & 255) / 255.0D;
-            double f = (double)(i >> 0 & 255) / 255.0D;
+        int j = this.getColor();
 
-            for(int j = 0; j < amount; ++j) {
-                this.level().addParticle(ParticleTypes.ENTITY_EFFECT, this.getRandomX(0.5D), this.getRandomY(), this.getRandomZ(0.5D), d, e, f);
+        if (j != -1 && amount > 0) {
+            double d0 = (double) (j >> 16 & 255) / 255.0D;
+            double d1 = (double) (j >> 8 & 255) / 255.0D;
+            double d2 = (double) (j >> 0 & 255) / 255.0D;
+
+            for (int k = 0; k < amount; ++k) {
+                this.level().addParticle(ParticleTypes.ENTITY_EFFECT, this.getRandomX(0.5D), this.getRandomY(), this.getRandomZ(0.5D), d0, d1, d2);
             }
 
         }
     }
 
     public int getColor() {
-        return this.entityData.get(ID_EFFECT_COLOR);
+        return (Integer) this.entityData.get(Arrow.ID_EFFECT_COLOR);
     }
 
     public void setFixedColor(int color) {
         this.fixedColor = true;
-        this.entityData.set(ID_EFFECT_COLOR, color);
+        this.entityData.set(Arrow.ID_EFFECT_COLOR, color);
     }
 
     @Override
@@ -147,13 +163,16 @@
         }
 
         if (!this.effects.isEmpty()) {
-            ListTag listTag = new ListTag();
+            ListTag nbttaglist = new ListTag();
+            Iterator iterator = this.effects.iterator();
 
-            for(MobEffectInstance mobEffectInstance : this.effects) {
-                listTag.add(mobEffectInstance.save(new CompoundTag()));
+            while (iterator.hasNext()) {
+                MobEffectInstance mobeffect = (MobEffectInstance) iterator.next();
+
+                nbttaglist.add(mobeffect.save(new CompoundTag()));
             }
 
-            nbt.put("custom_potion_effects", listTag);
+            nbt.put("custom_potion_effects", nbttaglist);
         }
 
     }
@@ -165,8 +184,12 @@
             this.potion = PotionUtils.getPotion(nbt);
         }
 
-        for(MobEffectInstance mobEffectInstance : PotionUtils.getCustomEffects(nbt)) {
-            this.addEffect(mobEffectInstance);
+        Iterator iterator = PotionUtils.getCustomEffects(nbt).iterator();
+
+        while (iterator.hasNext()) {
+            MobEffectInstance mobeffect = (MobEffectInstance) iterator.next();
+
+            this.addEffect(mobeffect);
         }
 
         if (nbt.contains("Color", 99)) {
@@ -181,16 +204,23 @@
     protected void doPostHurtEffects(LivingEntity target) {
         super.doPostHurtEffects(target);
         Entity entity = this.getEffectSource();
+        Iterator iterator = this.potion.getEffects().iterator();
 
-        for(MobEffectInstance mobEffectInstance : this.potion.getEffects()) {
-            target.addEffect(new MobEffectInstance(mobEffectInstance.getEffect(), Math.max(mobEffectInstance.mapDuration((i) -> {
+        MobEffectInstance mobeffect;
+
+        while (iterator.hasNext()) {
+            mobeffect = (MobEffectInstance) iterator.next();
+            target.addEffect(new MobEffectInstance(mobeffect.getEffect(), Math.max(mobeffect.mapDuration((i) -> {
                 return i / 8;
-            }), 1), mobEffectInstance.getAmplifier(), mobEffectInstance.isAmbient(), mobEffectInstance.isVisible()), entity);
+            }), 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible()), entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
         }
 
         if (!this.effects.isEmpty()) {
-            for(MobEffectInstance mobEffectInstance2 : this.effects) {
-                target.addEffect(mobEffectInstance2, entity);
+            iterator = this.effects.iterator();
+
+            while (iterator.hasNext()) {
+                mobeffect = (MobEffectInstance) iterator.next();
+                target.addEffect(mobeffect, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
             }
         }
 
@@ -201,14 +231,15 @@
         if (this.effects.isEmpty() && this.potion == Potions.EMPTY) {
             return new ItemStack(Items.ARROW);
         } else {
-            ItemStack itemStack = new ItemStack(Items.TIPPED_ARROW);
-            PotionUtils.setPotion(itemStack, this.potion);
-            PotionUtils.setCustomEffects(itemStack, this.effects);
+            ItemStack itemstack = new ItemStack(Items.TIPPED_ARROW);
+
+            PotionUtils.setPotion(itemstack, this.potion);
+            PotionUtils.setCustomEffects(itemstack, this.effects);
             if (this.fixedColor) {
-                itemStack.getOrCreateTag().putInt("CustomPotionColor", this.getColor());
+                itemstack.getOrCreateTag().putInt("CustomPotionColor", this.getColor());
             }
 
-            return itemStack;
+            return itemstack;
         }
     }
 
@@ -216,13 +247,14 @@
     public void handleEntityEvent(byte status) {
         if (status == 0) {
             int i = this.getColor();
+
             if (i != -1) {
-                double d = (double)(i >> 16 & 255) / 255.0D;
-                double e = (double)(i >> 8 & 255) / 255.0D;
-                double f = (double)(i >> 0 & 255) / 255.0D;
+                double d0 = (double) (i >> 16 & 255) / 255.0D;
+                double d1 = (double) (i >> 8 & 255) / 255.0D;
+                double d2 = (double) (i >> 0 & 255) / 255.0D;
 
-                for(int j = 0; j < 20; ++j) {
-                    this.level().addParticle(ParticleTypes.ENTITY_EFFECT, this.getRandomX(0.5D), this.getRandomY(), this.getRandomZ(0.5D), d, e, f);
+                for (int j = 0; j < 20; ++j) {
+                    this.level().addParticle(ParticleTypes.ENTITY_EFFECT, this.getRandomX(0.5D), this.getRandomY(), this.getRandomZ(0.5D), d0, d1, d2);
                 }
             }
         } else {
