--- a/net/minecraft/world/entity/monster/Vex.java
+++ b/net/minecraft/world/entity/monster/Vex.java
@@ -45,6 +45,7 @@
 import org.joml.Vector3f;
 
 public class Vex extends Monster implements TraceableEntity {
+
     public static final float FLAP_DEGREES_PER_TICK = 45.836624F;
     public static final int TICKS_PER_FLAP = Mth.ceil(3.9269907F);
     protected static final EntityDataAccessor<Byte> DATA_FLAGS_ID = SynchedEntityData.defineId(Vex.class, EntityDataSerializers.BYTE);
@@ -69,7 +70,7 @@
 
     @Override
     public boolean isFlapping() {
-        return this.tickCount % TICKS_PER_FLAP == 0;
+        return this.tickCount % Vex.TICKS_PER_FLAP == 0;
     }
 
     @Override
@@ -99,7 +100,7 @@
         this.goalSelector.addGoal(8, new Vex.VexRandomMoveGoal());
         this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F));
         this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F));
-        this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, Raider.class)).setAlertOthers());
+        this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Raider.class})).setAlertOthers());
         this.targetSelector.addGoal(2, new Vex.VexCopyOwnerTargetGoal(this));
         this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, true));
     }
@@ -111,7 +112,7 @@
     @Override
     protected void defineSynchedData() {
         super.defineSynchedData();
-        this.entityData.define(DATA_FLAGS_ID, (byte)0);
+        this.entityData.define(Vex.DATA_FLAGS_ID, (byte) 0);
     }
 
     @Override
@@ -158,19 +159,22 @@
     }
 
     private boolean getVexFlag(int mask) {
-        int i = this.entityData.get(DATA_FLAGS_ID);
-        return (i & mask) != 0;
+        byte b0 = (Byte) this.entityData.get(Vex.DATA_FLAGS_ID);
+
+        return (b0 & mask) != 0;
     }
 
     private void setVexFlag(int mask, boolean value) {
-        int i = this.entityData.get(DATA_FLAGS_ID);
+        byte b0 = (Byte) this.entityData.get(Vex.DATA_FLAGS_ID);
+        int j;
+
         if (value) {
-            i |= mask;
+            j = b0 | mask;
         } else {
-            i &= ~mask;
+            j = b0 & ~mask;
         }
 
-        this.entityData.set(DATA_FLAGS_ID, (byte)(i & 255));
+        this.entityData.set(Vex.DATA_FLAGS_ID, (byte) (j & 255));
     }
 
     public boolean isCharging() {
@@ -213,9 +217,10 @@
     @Nullable
     @Override
     public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
-        RandomSource randomSource = world.getRandom();
-        this.populateDefaultEquipmentSlots(randomSource, difficulty);
-        this.populateDefaultEquipmentEnchantments(randomSource, difficulty);
+        RandomSource randomsource = world.getRandom();
+
+        this.populateDefaultEquipmentSlots(randomsource, difficulty);
+        this.populateDefaultEquipmentEnchantments(randomsource, difficulty);
         return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
     }
 
@@ -235,19 +240,52 @@
         return new Vector3f(0.0F, dimensions.height - 0.0625F * scaleFactor, 0.0F);
     }
 
-    class VexChargeAttackGoal extends Goal {
+    private class VexMoveControl extends MoveControl {
+
+        public VexMoveControl(Vex entityvex) {
+            super(entityvex);
+        }
+
+        @Override
+        public void tick() {
+            if (this.operation == MoveControl.Operation.MOVE_TO) {
+                Vec3 vec3d = new Vec3(this.wantedX - Vex.this.getX(), this.wantedY - Vex.this.getY(), this.wantedZ - Vex.this.getZ());
+                double d0 = vec3d.length();
+
+                if (d0 < Vex.this.getBoundingBox().getSize()) {
+                    this.operation = MoveControl.Operation.WAIT;
+                    Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().scale(0.5D));
+                } else {
+                    Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().add(vec3d.scale(this.speedModifier * 0.05D / d0)));
+                    if (Vex.this.getTarget() == null) {
+                        Vec3 vec3d1 = Vex.this.getDeltaMovement();
+
+                        Vex.this.setYRot(-((float) Mth.atan2(vec3d1.x, vec3d1.z)) * 57.295776F);
+                        Vex.this.yBodyRot = Vex.this.getYRot();
+                    } else {
+                        double d1 = Vex.this.getTarget().getX() - Vex.this.getX();
+                        double d2 = Vex.this.getTarget().getZ() - Vex.this.getZ();
+
+                        Vex.this.setYRot(-((float) Mth.atan2(d1, d2)) * 57.295776F);
+                        Vex.this.yBodyRot = Vex.this.getYRot();
+                    }
+                }
+
+            }
+        }
+    }
+
+    private class VexChargeAttackGoal extends Goal {
+
         public VexChargeAttackGoal() {
             this.setFlags(EnumSet.of(Goal.Flag.MOVE));
         }
 
         @Override
         public boolean canUse() {
-            LivingEntity livingEntity = Vex.this.getTarget();
-            if (livingEntity != null && livingEntity.isAlive() && !Vex.this.getMoveControl().hasWanted() && Vex.this.random.nextInt(reducedTickDelay(7)) == 0) {
-                return Vex.this.distanceToSqr(livingEntity) > 4.0D;
-            } else {
-                return false;
-            }
+            LivingEntity entityliving = Vex.this.getTarget();
+
+            return entityliving != null && entityliving.isAlive() && !Vex.this.getMoveControl().hasWanted() && Vex.this.random.nextInt(reducedTickDelay(7)) == 0 ? Vex.this.distanceToSqr((Entity) entityliving) > 4.0D : false;
         }
 
         @Override
@@ -257,10 +295,12 @@
 
         @Override
         public void start() {
-            LivingEntity livingEntity = Vex.this.getTarget();
-            if (livingEntity != null) {
-                Vec3 vec3 = livingEntity.getEyePosition();
-                Vex.this.moveControl.setWantedPosition(vec3.x, vec3.y, vec3.z, 1.0D);
+            LivingEntity entityliving = Vex.this.getTarget();
+
+            if (entityliving != null) {
+                Vec3 vec3d = entityliving.getEyePosition();
+
+                Vex.this.moveControl.setWantedPosition(vec3d.x, vec3d.y, vec3d.z, 1.0D);
             }
 
             Vex.this.setIsCharging(true);
@@ -279,66 +319,19 @@
 
         @Override
         public void tick() {
-            LivingEntity livingEntity = Vex.this.getTarget();
-            if (livingEntity != null) {
-                if (Vex.this.getBoundingBox().intersects(livingEntity.getBoundingBox())) {
-                    Vex.this.doHurtTarget(livingEntity);
+            LivingEntity entityliving = Vex.this.getTarget();
+
+            if (entityliving != null) {
+                if (Vex.this.getBoundingBox().intersects(entityliving.getBoundingBox())) {
+                    Vex.this.doHurtTarget(entityliving);
                     Vex.this.setIsCharging(false);
                 } else {
-                    double d = Vex.this.distanceToSqr(livingEntity);
-                    if (d < 9.0D) {
-                        Vec3 vec3 = livingEntity.getEyePosition();
-                        Vex.this.moveControl.setWantedPosition(vec3.x, vec3.y, vec3.z, 1.0D);
-                    }
-                }
-
-            }
-        }
-    }
-
-    class VexCopyOwnerTargetGoal extends TargetGoal {
-        private final TargetingConditions copyOwnerTargeting = TargetingConditions.forNonCombat().ignoreLineOfSight().ignoreInvisibilityTesting();
-
-        public VexCopyOwnerTargetGoal(PathfinderMob mob) {
-            super(mob, false);
-        }
-
-        @Override
-        public boolean canUse() {
-            return Vex.this.owner != null && Vex.this.owner.getTarget() != null && this.canAttack(Vex.this.owner.getTarget(), this.copyOwnerTargeting);
-        }
-
-        @Override
-        public void start() {
-            Vex.this.setTarget(Vex.this.owner.getTarget());
-            super.start();
-        }
-    }
+                    double d0 = Vex.this.distanceToSqr((Entity) entityliving);
 
-    class VexMoveControl extends MoveControl {
-        public VexMoveControl(Vex owner) {
-            super(owner);
-        }
+                    if (d0 < 9.0D) {
+                        Vec3 vec3d = entityliving.getEyePosition();
 
-        @Override
-        public void tick() {
-            if (this.operation == MoveControl.Operation.MOVE_TO) {
-                Vec3 vec3 = new Vec3(this.wantedX - Vex.this.getX(), this.wantedY - Vex.this.getY(), this.wantedZ - Vex.this.getZ());
-                double d = vec3.length();
-                if (d < Vex.this.getBoundingBox().getSize()) {
-                    this.operation = MoveControl.Operation.WAIT;
-                    Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().scale(0.5D));
-                } else {
-                    Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().add(vec3.scale(this.speedModifier * 0.05D / d)));
-                    if (Vex.this.getTarget() == null) {
-                        Vec3 vec32 = Vex.this.getDeltaMovement();
-                        Vex.this.setYRot(-((float)Mth.atan2(vec32.x, vec32.z)) * (180F / (float)Math.PI));
-                        Vex.this.yBodyRot = Vex.this.getYRot();
-                    } else {
-                        double e = Vex.this.getTarget().getX() - Vex.this.getX();
-                        double f = Vex.this.getTarget().getZ() - Vex.this.getZ();
-                        Vex.this.setYRot(-((float)Mth.atan2(e, f)) * (180F / (float)Math.PI));
-                        Vex.this.yBodyRot = Vex.this.getYRot();
+                        Vex.this.moveControl.setWantedPosition(vec3d.x, vec3d.y, vec3d.z, 1.0D);
                     }
                 }
 
@@ -346,7 +339,8 @@
         }
     }
 
-    class VexRandomMoveGoal extends Goal {
+    private class VexRandomMoveGoal extends Goal {
+
         public VexRandomMoveGoal() {
             this.setFlags(EnumSet.of(Goal.Flag.MOVE));
         }
@@ -363,17 +357,19 @@
 
         @Override
         public void tick() {
-            BlockPos blockPos = Vex.this.getBoundOrigin();
-            if (blockPos == null) {
-                blockPos = Vex.this.blockPosition();
+            BlockPos blockposition = Vex.this.getBoundOrigin();
+
+            if (blockposition == null) {
+                blockposition = Vex.this.blockPosition();
             }
 
-            for(int i = 0; i < 3; ++i) {
-                BlockPos blockPos2 = blockPos.offset(Vex.this.random.nextInt(15) - 7, Vex.this.random.nextInt(11) - 5, Vex.this.random.nextInt(15) - 7);
-                if (Vex.this.level().isEmptyBlock(blockPos2)) {
-                    Vex.this.moveControl.setWantedPosition((double)blockPos2.getX() + 0.5D, (double)blockPos2.getY() + 0.5D, (double)blockPos2.getZ() + 0.5D, 0.25D);
+            for (int i = 0; i < 3; ++i) {
+                BlockPos blockposition1 = blockposition.offset(Vex.this.random.nextInt(15) - 7, Vex.this.random.nextInt(11) - 5, Vex.this.random.nextInt(15) - 7);
+
+                if (Vex.this.level().isEmptyBlock(blockposition1)) {
+                    Vex.this.moveControl.setWantedPosition((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.5D, (double) blockposition1.getZ() + 0.5D, 0.25D);
                     if (Vex.this.getTarget() == null) {
-                        Vex.this.getLookControl().setLookAt((double)blockPos2.getX() + 0.5D, (double)blockPos2.getY() + 0.5D, (double)blockPos2.getZ() + 0.5D, 180.0F, 20.0F);
+                        Vex.this.getLookControl().setLookAt((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.5D, (double) blockposition1.getZ() + 0.5D, 180.0F, 20.0F);
                     }
                     break;
                 }
@@ -381,4 +377,24 @@
 
         }
     }
+
+    private class VexCopyOwnerTargetGoal extends TargetGoal {
+
+        private final TargetingConditions copyOwnerTargeting = TargetingConditions.forNonCombat().ignoreLineOfSight().ignoreInvisibilityTesting();
+
+        public VexCopyOwnerTargetGoal(PathfinderMob entitycreature) {
+            super(entitycreature, false);
+        }
+
+        @Override
+        public boolean canUse() {
+            return Vex.this.owner != null && Vex.this.owner.getTarget() != null && this.canAttack(Vex.this.owner.getTarget(), this.copyOwnerTargeting);
+        }
+
+        @Override
+        public void start() {
+            Vex.this.setTarget(Vex.this.owner.getTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.OWNER_ATTACKED_TARGET, true); // CraftBukkit
+            super.start();
+        }
+    }
 }
