--- a/net/minecraft/world/entity/projectile/Arrow.java
+++ b/net/minecraft/world/entity/projectile/Arrow.java
@@ -1,6 +1,8 @@
 package net.minecraft.world.entity.projectile;
 
+import java.util.Iterator;
 import javax.annotation.Nullable;
+import net.minecraft.core.Holder;
 import net.minecraft.core.component.DataComponents;
 import net.minecraft.core.particles.ColorParticleOption;
 import net.minecraft.core.particles.ParticleTypes;
@@ -13,10 +15,12 @@
 import net.minecraft.world.entity.LivingEntity;
 import net.minecraft.world.item.ItemStack;
 import net.minecraft.world.item.Items;
+import net.minecraft.world.item.alchemy.Potion;
 import net.minecraft.world.item.alchemy.PotionContents;
 import net.minecraft.world.level.Level;
 
 public class Arrow extends AbstractArrow {
+
     private static final int EXPOSED_POTION_DECAY_TIME = 600;
     public static final int NO_EFFECT_COLOR = -1;
     private static final EntityDataAccessor<Integer> ID_EFFECT_COLOR = SynchedEntityData.defineId(Arrow.class, EntityDataSerializers.INT);
@@ -37,7 +41,7 @@
     }
 
     public PotionContents getPotionContents() {
-        return this.getPickupItemStackOrigin().getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);
+        return (PotionContents) this.getPickupItemStackOrigin().getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);
     }
 
     public void setPotionContents(PotionContents potionContentsComponent) {
@@ -52,8 +56,9 @@
     }
 
     public void updateColor() {
-        PotionContents potionContents = this.getPotionContents();
-        this.entityData.set(ID_EFFECT_COLOR, potionContents.equals(PotionContents.EMPTY) ? -1 : potionContents.getColor());
+        PotionContents potioncontents = this.getPotionContents();
+
+        this.entityData.set(Arrow.ID_EFFECT_COLOR, potioncontents.equals(PotionContents.EMPTY) ? -1 : potioncontents.getColor());
     }
 
     public void addEffect(MobEffectInstance effect) {
@@ -63,7 +68,7 @@
     @Override
     protected void defineSynchedData(SynchedEntityData.Builder builder) {
         super.defineSynchedData(builder);
-        builder.define(ID_EFFECT_COLOR, -1);
+        builder.define(Arrow.ID_EFFECT_COLOR, -1);
     }
 
     @Override
@@ -78,56 +83,53 @@
                 this.makeParticle(2);
             }
         } else if (this.inGround && this.inGroundTime != 0 && !this.getPotionContents().equals(PotionContents.EMPTY) && this.inGroundTime >= 600) {
-            this.level().broadcastEntityEvent(this, (byte)0);
+            this.level().broadcastEntityEvent(this, (byte) 0);
             this.setPickupItemStack(new ItemStack(Items.ARROW));
         }
+
     }
 
     private void makeParticle(int amount) {
-        int i = this.getColor();
-        if (i != -1 && amount > 0) {
-            for (int j = 0; j < amount; j++) {
-                this.level()
-                    .addParticle(
-                        ColorParticleOption.create(ParticleTypes.ENTITY_EFFECT, i),
-                        this.getRandomX(0.5),
-                        this.getRandomY(),
-                        this.getRandomZ(0.5),
-                        0.0,
-                        0.0,
-                        0.0
-                    );
+        int j = this.getColor();
+
+        if (j != -1 && amount > 0) {
+            for (int k = 0; k < amount; ++k) {
+                this.level().addParticle(ColorParticleOption.create(ParticleTypes.ENTITY_EFFECT, j), this.getRandomX(0.5D), this.getRandomY(), this.getRandomZ(0.5D), 0.0D, 0.0D, 0.0D);
             }
+
         }
     }
 
     public int getColor() {
-        return this.entityData.get(ID_EFFECT_COLOR);
+        return (Integer) this.entityData.get(Arrow.ID_EFFECT_COLOR);
     }
 
     @Override
     protected void doPostHurtEffects(LivingEntity target) {
         super.doPostHurtEffects(target);
         Entity entity = this.getEffectSource();
-        PotionContents potionContents = this.getPotionContents();
-        if (potionContents.potion().isPresent()) {
-            for (MobEffectInstance mobEffectInstance : potionContents.potion().get().value().getEffects()) {
-                target.addEffect(
-                    new MobEffectInstance(
-                        mobEffectInstance.getEffect(),
-                        Math.max(mobEffectInstance.mapDuration(i -> i / 8), 1),
-                        mobEffectInstance.getAmplifier(),
-                        mobEffectInstance.isAmbient(),
-                        mobEffectInstance.isVisible()
-                    ),
-                    entity
-                );
+        PotionContents potioncontents = this.getPotionContents();
+        Iterator iterator;
+        MobEffectInstance mobeffect;
+
+        if (potioncontents.potion().isPresent()) {
+            iterator = ((Potion) ((Holder) potioncontents.potion().get()).value()).getEffects().iterator();
+
+            while (iterator.hasNext()) {
+                mobeffect = (MobEffectInstance) iterator.next();
+                target.addEffect(new MobEffectInstance(mobeffect.getEffect(), Math.max(mobeffect.mapDuration((i) -> {
+                    return i / 8;
+                }), 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible()), entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
             }
         }
 
-        for (MobEffectInstance mobEffectInstance2 : potionContents.customEffects()) {
-            target.addEffect(mobEffectInstance2, entity);
+        iterator = potioncontents.customEffects().iterator();
+
+        while (iterator.hasNext()) {
+            mobeffect = (MobEffectInstance) iterator.next();
+            target.addEffect(mobeffect, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
         }
+
     }
 
     @Override
@@ -139,26 +141,19 @@
     public void handleEntityEvent(byte status) {
         if (status == 0) {
             int i = this.getColor();
+
             if (i != -1) {
-                float f = (float)(i >> 16 & 0xFF) / 255.0F;
-                float g = (float)(i >> 8 & 0xFF) / 255.0F;
-                float h = (float)(i >> 0 & 0xFF) / 255.0F;
+                float f = (float) (i >> 16 & 255) / 255.0F;
+                float f1 = (float) (i >> 8 & 255) / 255.0F;
+                float f2 = (float) (i >> 0 & 255) / 255.0F;
 
-                for (int j = 0; j < 20; j++) {
-                    this.level()
-                        .addParticle(
-                            ColorParticleOption.create(ParticleTypes.ENTITY_EFFECT, f, g, h),
-                            this.getRandomX(0.5),
-                            this.getRandomY(),
-                            this.getRandomZ(0.5),
-                            0.0,
-                            0.0,
-                            0.0
-                        );
+                for (int j = 0; j < 20; ++j) {
+                    this.level().addParticle(ColorParticleOption.create(ParticleTypes.ENTITY_EFFECT, f, f1, f2), this.getRandomX(0.5D), this.getRandomY(), this.getRandomZ(0.5D), 0.0D, 0.0D, 0.0D);
                 }
             }
         } else {
             super.handleEntityEvent(status);
         }
+
     }
 }
