--- a/net/minecraft/world/entity/animal/horse/Llama.java
+++ b/net/minecraft/world/entity/animal/horse/Llama.java
@@ -1,6 +1,7 @@
 package net.minecraft.world.entity.animal.horse;
 
 import com.mojang.serialization.Codec;
+import java.util.Iterator;
 import java.util.function.IntFunction;
 import javax.annotation.Nullable;
 import net.minecraft.Util;
@@ -63,6 +64,7 @@
 import org.joml.Vector3f;
 
 public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.Variant>, RangedAttackMob {
+
     private static final int MAX_STRENGTH = 5;
     private static final Ingredient FOOD_ITEMS = Ingredient.of(Items.WHEAT, Blocks.HAY_BLOCK.asItem());
     private static final EntityDataAccessor<Integer> DATA_STRENGTH_ID = SynchedEntityData.defineId(Llama.class, EntityDataSerializers.INT);
@@ -72,7 +74,7 @@
     @Nullable
     private Llama caravanHead;
     @Nullable
-    private Llama caravanTail;
+    public Llama caravanTail; // Paper
 
     public Llama(EntityType<? extends Llama> type, Level world) {
         super(type, world);
@@ -82,17 +84,23 @@
         return false;
     }
 
+    // CraftBukkit start
+    public void setStrengthPublic(int i) {
+        this.setStrength(i);
+    }
+    // CraftBukkit end
     private void setStrength(int strength) {
-        this.entityData.set(DATA_STRENGTH_ID, Math.max(1, Math.min(5, strength)));
+        this.entityData.set(Llama.DATA_STRENGTH_ID, Math.max(1, Math.min(5, strength)));
     }
 
     private void setRandomStrength(RandomSource random) {
         int i = random.nextFloat() < 0.04F ? 5 : 3;
+
         this.setStrength(1 + random.nextInt(i));
     }
 
     public int getStrength() {
-        return this.entityData.get(DATA_STRENGTH_ID);
+        return (Integer) this.entityData.get(Llama.DATA_STRENGTH_ID);
     }
 
     @Override
@@ -122,7 +130,7 @@
     protected void registerGoals() {
         this.goalSelector.addGoal(0, new FloatGoal(this));
         this.goalSelector.addGoal(1, new RunAroundLikeCrazyGoal(this, 1.2D));
-        this.goalSelector.addGoal(2, new LlamaFollowCaravanGoal(this, (double)2.1F));
+        this.goalSelector.addGoal(2, new LlamaFollowCaravanGoal(this, 2.0999999046325684D));
         this.goalSelector.addGoal(3, new RangedAttackGoal(this, 1.25D, 40, 20.0F));
         this.goalSelector.addGoal(3, new PanicGoal(this, 1.2D));
         this.goalSelector.addGoal(4, new BreedGoal(this, 1.0D));
@@ -142,19 +150,18 @@
     @Override
     protected void defineSynchedData() {
         super.defineSynchedData();
-        this.entityData.define(DATA_STRENGTH_ID, 0);
-        this.entityData.define(DATA_SWAG_ID, -1);
-        this.entityData.define(DATA_VARIANT_ID, 0);
+        this.entityData.define(Llama.DATA_STRENGTH_ID, 0);
+        this.entityData.define(Llama.DATA_SWAG_ID, -1);
+        this.entityData.define(Llama.DATA_VARIANT_ID, 0);
     }
 
     @Override
     public Llama.Variant getVariant() {
-        return Llama.Variant.byId(this.entityData.get(DATA_VARIANT_ID));
+        return Llama.Variant.byId((Integer) this.entityData.get(Llama.DATA_VARIANT_ID));
     }
 
-    @Override
     public void setVariant(Llama.Variant variant) {
-        this.entityData.set(DATA_VARIANT_ID, variant.id);
+        this.entityData.set(Llama.DATA_VARIANT_ID, variant.id);
     }
 
     @Override
@@ -164,58 +171,60 @@
 
     @Override
     public boolean isFood(ItemStack stack) {
-        return FOOD_ITEMS.test(stack);
+        return Llama.FOOD_ITEMS.test(stack);
     }
 
     @Override
     protected boolean handleEating(Player player, ItemStack item) {
-        int i = 0;
-        int j = 0;
+        byte b0 = 0;
+        byte b1 = 0;
         float f = 0.0F;
-        boolean bl = false;
+        boolean flag = false;
+
         if (item.is(Items.WHEAT)) {
-            i = 10;
-            j = 3;
+            b0 = 10;
+            b1 = 3;
             f = 2.0F;
         } else if (item.is(Blocks.HAY_BLOCK.asItem())) {
-            i = 90;
-            j = 6;
+            b0 = 90;
+            b1 = 6;
             f = 10.0F;
             if (this.isTamed() && this.getAge() == 0 && this.canFallInLove()) {
-                bl = true;
-                this.setInLove(player);
+                flag = true;
+                this.setInLove(player, item.copy()); // Paper
             }
         }
 
         if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
-            this.heal(f);
-            bl = true;
+            this.heal(f, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper
+            flag = true;
         }
 
-        if (this.isBaby() && i > 0) {
+        if (this.isBaby() && b0 > 0) {
             this.level().addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 0.0D, 0.0D, 0.0D);
             if (!this.level().isClientSide) {
-                this.ageUp(i);
+                this.ageUp(b0);
             }
 
-            bl = true;
+            flag = true;
         }
 
-        if (j > 0 && (bl || !this.isTamed()) && this.getTemper() < this.getMaxTemper()) {
-            bl = true;
+        if (b1 > 0 && (flag || !this.isTamed()) && this.getTemper() < this.getMaxTemper()) {
+            flag = true;
             if (!this.level().isClientSide) {
-                this.modifyTemper(j);
+                this.modifyTemper(b1);
             }
         }
 
-        if (bl && !this.isSilent()) {
-            SoundEvent soundEvent = this.getEatingSound();
-            if (soundEvent != null) {
-                this.level().playSound((Player)null, this.getX(), this.getY(), this.getZ(), this.getEatingSound(), this.getSoundSource(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
+        if (flag && !this.isSilent()) {
+            SoundEvent soundeffect = this.getEatingSound();
+
+            if (soundeffect != null) {
+                this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), this.getEatingSound(), this.getSoundSource(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
             }
         }
 
-        return bl;
+        return flag;
     }
 
     @Override
@@ -226,18 +235,20 @@
     @Nullable
     @Override
     public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
-        RandomSource randomSource = world.getRandom();
-        this.setRandomStrength(randomSource);
-        Llama.Variant variant;
+        RandomSource randomsource = world.getRandom();
+
+        this.setRandomStrength(randomsource);
+        Llama.Variant entityllama_variant;
+
         if (entityData instanceof Llama.LlamaGroupData) {
-            variant = ((Llama.LlamaGroupData)entityData).variant;
+            entityllama_variant = ((Llama.LlamaGroupData) entityData).variant;
         } else {
-            variant = Util.getRandom(Llama.Variant.values(), randomSource);
-            entityData = new Llama.LlamaGroupData(variant);
+            entityllama_variant = (Llama.Variant) Util.getRandom((Object[]) Llama.Variant.values(), randomsource);
+            entityData = new Llama.LlamaGroupData(entityllama_variant);
         }
 
-        this.setVariant(variant);
-        return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
+        this.setVariant(entityllama_variant);
+        return super.finalizeSpawn(world, difficulty, spawnReason, (SpawnGroupData) entityData, entityNbt);
     }
 
     @Override
@@ -308,10 +319,12 @@
 
     @Override
     public void containerChanged(Container sender) {
-        DyeColor dyeColor = this.getSwag();
+        DyeColor enumcolor = this.getSwag();
+
         super.containerChanged(sender);
-        DyeColor dyeColor2 = this.getSwag();
-        if (this.tickCount > 20 && dyeColor2 != null && dyeColor2 != dyeColor) {
+        DyeColor enumcolor1 = this.getSwag();
+
+        if (this.tickCount > 20 && enumcolor1 != null && enumcolor1 != enumcolor) {
             this.playSound(SoundEvents.LLAMA_SWAG, 0.5F, 1.0F);
         }
 
@@ -321,23 +334,25 @@
     protected void updateContainerEquipment() {
         if (!this.level().isClientSide) {
             super.updateContainerEquipment();
-            this.setSwag(getDyeColor(this.inventory.getItem(1)));
+            this.setSwag(Llama.getDyeColor(this.inventory.getItem(1)));
         }
     }
 
     private void setSwag(@Nullable DyeColor color) {
-        this.entityData.set(DATA_SWAG_ID, color == null ? -1 : color.getId());
+        this.entityData.set(Llama.DATA_SWAG_ID, color == null ? -1 : color.getId());
     }
 
     @Nullable
     private static DyeColor getDyeColor(ItemStack color) {
         Block block = Block.byItem(color.getItem());
-        return block instanceof WoolCarpetBlock ? ((WoolCarpetBlock)block).getColor() : null;
+
+        return block instanceof WoolCarpetBlock ? ((WoolCarpetBlock) block).getColor() : null;
     }
 
     @Nullable
     public DyeColor getSwag() {
-        int i = this.entityData.get(DATA_SWAG_ID);
+        int i = (Integer) this.entityData.get(Llama.DATA_SWAG_ID);
+
         return i == -1 ? null : DyeColor.byId(i);
     }
 
@@ -348,45 +363,48 @@
 
     @Override
     public boolean canMate(Animal other) {
-        return other != this && other instanceof Llama && this.canParent() && ((Llama)other).canParent();
+        return other != this && other instanceof Llama && this.canParent() && ((Llama) other).canParent();
     }
 
     @Nullable
     @Override
-    public Llama getBreedOffspring(ServerLevel serverLevel, AgeableMob ageableMob) {
-        Llama llama = this.makeNewLlama();
-        if (llama != null) {
-            this.setOffspringAttributes(ageableMob, llama);
-            Llama llama2 = (Llama)ageableMob;
-            int i = this.random.nextInt(Math.max(this.getStrength(), llama2.getStrength())) + 1;
+    public Llama getBreedOffspring(ServerLevel world, AgeableMob entity) {
+        Llama entityllama = this.makeNewLlama();
+
+        if (entityllama != null) {
+            this.setOffspringAttributes(entity, entityllama);
+            Llama entityllama1 = (Llama) entity;
+            int i = this.random.nextInt(Math.max(this.getStrength(), entityllama1.getStrength())) + 1;
+
             if (this.random.nextFloat() < 0.03F) {
                 ++i;
             }
 
-            llama.setStrength(i);
-            llama.setVariant(this.random.nextBoolean() ? this.getVariant() : llama2.getVariant());
+            entityllama.setStrength(i);
+            entityllama.setVariant(this.random.nextBoolean() ? this.getVariant() : entityllama1.getVariant());
         }
 
-        return llama;
+        return entityllama;
     }
 
     @Nullable
     protected Llama makeNewLlama() {
-        return EntityType.LLAMA.create(this.level());
+        return (Llama) EntityType.LLAMA.create(this.level());
     }
 
     private void spit(LivingEntity target) {
-        LlamaSpit llamaSpit = new LlamaSpit(this.level(), this);
-        double d = target.getX() - this.getX();
-        double e = target.getY(0.3333333333333333D) - llamaSpit.getY();
-        double f = target.getZ() - this.getZ();
-        double g = Math.sqrt(d * d + f * f) * (double)0.2F;
-        llamaSpit.shoot(d, e + g, f, 1.5F, 10.0F);
+        LlamaSpit entityllamaspit = new LlamaSpit(this.level(), this);
+        double d0 = target.getX() - this.getX();
+        double d1 = target.getY(0.3333333333333333D) - entityllamaspit.getY();
+        double d2 = target.getZ() - this.getZ();
+        double d3 = Math.sqrt(d0 * d0 + d2 * d2) * 0.20000000298023224D;
+
+        entityllamaspit.shoot(d0, d1 + d3, d2, 1.5F, 10.0F);
         if (!this.isSilent()) {
-            this.level().playSound((Player)null, this.getX(), this.getY(), this.getZ(), SoundEvents.LLAMA_SPIT, this.getSoundSource(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
+            this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.LLAMA_SPIT, this.getSoundSource(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
         }
 
-        this.level().addFreshEntity(llamaSpit);
+        this.level().addFreshEntity(entityllamaspit);
         this.didSpit = true;
     }
 
@@ -397,14 +415,19 @@
     @Override
     public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
         int i = this.calculateFallDamage(fallDistance, damageMultiplier);
+
         if (i <= 0) {
             return false;
         } else {
             if (fallDistance >= 6.0F) {
-                this.hurt(damageSource, (float)i);
+                this.hurt(damageSource, (float) i);
                 if (this.isVehicle()) {
-                    for(Entity entity : this.getIndirectPassengers()) {
-                        entity.hurt(damageSource, (float)i);
+                    Iterator iterator = this.getIndirectPassengers().iterator();
+
+                    while (iterator.hasNext()) {
+                        Entity entity = (Entity) iterator.next();
+
+                        entity.hurt(damageSource, (float) i);
                     }
                 }
             }
@@ -465,7 +488,7 @@
 
     @Override
     public Vec3 getLeashOffset() {
-        return new Vec3(0.0D, 0.75D * (double)this.getEyeHeight(), (double)this.getBbWidth() * 0.5D);
+        return new Vec3(0.0D, 0.75D * (double) this.getEyeHeight(), (double) this.getBbWidth() * 0.5D);
     }
 
     @Override
@@ -473,39 +496,49 @@
         return new Vector3f(0.0F, dimensions.height - (this.isBaby() ? 0.8125F : 0.5F) * scaleFactor, -0.3F * scaleFactor);
     }
 
-    static class LlamaAttackWolfGoal extends NearestAttackableTargetGoal<Wolf> {
-        public LlamaAttackWolfGoal(Llama llama) {
-            super(llama, Wolf.class, 16, false, true, (wolf) -> {
-                return !((Wolf)wolf).isTame();
-            });
+    public static enum Variant implements StringRepresentable {
+
+        CREAMY(0, "creamy"), WHITE(1, "white"), BROWN(2, "brown"), GRAY(3, "gray");
+
+        public static final Codec<Llama.Variant> CODEC = StringRepresentable.fromEnum(Llama.Variant::values);
+        private static final IntFunction<Llama.Variant> BY_ID = ByIdMap.continuous(Llama.Variant::getId, values(), ByIdMap.OutOfBoundsStrategy.CLAMP);
+        final int id;
+        private final String name;
+
+        private Variant(int i, String s) {
+            this.id = i;
+            this.name = s;
         }
 
-        @Override
-        protected double getFollowDistance() {
-            return super.getFollowDistance() * 0.25D;
+        public int getId() {
+            return this.id;
         }
-    }
 
-    static class LlamaGroupData extends AgeableMob.AgeableMobGroupData {
-        public final Llama.Variant variant;
+        public static Llama.Variant byId(int id) {
+            return (Llama.Variant) Llama.Variant.BY_ID.apply(id);
+        }
 
-        LlamaGroupData(Llama.Variant variant) {
-            super(true);
-            this.variant = variant;
+        @Override
+        public String getSerializedName() {
+            return this.name;
         }
     }
 
-    static class LlamaHurtByTargetGoal extends HurtByTargetGoal {
+    private static class LlamaHurtByTargetGoal extends HurtByTargetGoal {
+
         public LlamaHurtByTargetGoal(Llama llama) {
             super(llama);
         }
 
         @Override
         public boolean canContinueToUse() {
-            Mob var2 = this.mob;
-            if (var2 instanceof Llama llama) {
-                if (llama.didSpit) {
-                    llama.setDidSpit(false);
+            Mob entityinsentient = this.mob;
+
+            if (entityinsentient instanceof Llama) {
+                Llama entityllama = (Llama) entityinsentient;
+
+                if (entityllama.didSpit) {
+                    entityllama.setDidSpit(false);
                     return false;
                 }
             }
@@ -514,33 +547,27 @@
         }
     }
 
-    public static enum Variant implements StringRepresentable {
-        CREAMY(0, "creamy"),
-        WHITE(1, "white"),
-        BROWN(2, "brown"),
-        GRAY(3, "gray");
-
-        public static final Codec<Llama.Variant> CODEC = StringRepresentable.fromEnum(Llama.Variant::values);
-        private static final IntFunction<Llama.Variant> BY_ID = ByIdMap.continuous(Llama.Variant::getId, values(), ByIdMap.OutOfBoundsStrategy.CLAMP);
-        final int id;
-        private final String name;
+    private static class LlamaAttackWolfGoal extends NearestAttackableTargetGoal<Wolf> {
 
-        private Variant(int id, String name) {
-            this.id = id;
-            this.name = name;
+        public LlamaAttackWolfGoal(Llama llama) {
+            super(llama, Wolf.class, 16, false, true, (entityliving) -> {
+                return !((Wolf) entityliving).isTame();
+            });
         }
 
-        public int getId() {
-            return this.id;
+        @Override
+        protected double getFollowDistance() {
+            return super.getFollowDistance() * 0.25D;
         }
+    }
 
-        public static Llama.Variant byId(int id) {
-            return BY_ID.apply(id);
-        }
+    private static class LlamaGroupData extends AgeableMob.AgeableMobGroupData {
 
-        @Override
-        public String getSerializedName() {
-            return this.name;
+        public final Llama.Variant variant;
+
+        LlamaGroupData(Llama.Variant variant) {
+            super(true);
+            this.variant = variant;
         }
     }
 }
