diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Strider.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Strider.java.patch | 583 |
1 files changed, 583 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Strider.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Strider.java.patch new file mode 100644 index 0000000000..23517c9040 --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Strider.java.patch @@ -0,0 +1,583 @@ +--- a/net/minecraft/world/entity/monster/Strider.java ++++ b/net/minecraft/world/entity/monster/Strider.java +@@ -1,6 +1,8 @@ + package net.minecraft.world.entity.monster; + + import com.google.common.collect.Sets; ++import com.google.common.collect.UnmodifiableIterator; ++import java.util.Iterator; + import java.util.Set; + import java.util.UUID; + import javax.annotation.Nullable; +@@ -19,22 +21,22 @@ + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.world.DifficultyInstance; +-import net.minecraft.world.InteractionHand; ++import net.minecraft.world.EnumHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.AgeableMob; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityDimensions; ++import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntityType; ++import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.EquipmentSlot; ++import net.minecraft.world.entity.GroupDataEntity; ++import net.minecraft.world.entity.ISteerable; + import net.minecraft.world.entity.ItemBasedSteering; +-import net.minecraft.world.entity.ItemSteerable; + import net.minecraft.world.entity.LivingEntity; + import net.minecraft.world.entity.Mob; +-import net.minecraft.world.entity.MobSpawnType; +-import net.minecraft.world.entity.Pose; + import net.minecraft.world.entity.Saddleable; +-import net.minecraft.world.entity.SpawnGroupData; + import net.minecraft.world.entity.ai.attributes.AttributeInstance; + import net.minecraft.world.entity.ai.attributes.AttributeModifier; + import net.minecraft.world.entity.ai.attributes.AttributeSupplier; +@@ -55,28 +57,28 @@ + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; + import net.minecraft.world.item.crafting.Ingredient; ++import net.minecraft.world.level.IMaterial; + import net.minecraft.world.level.Level; + import net.minecraft.world.level.LevelAccessor; + import net.minecraft.world.level.LevelReader; + import net.minecraft.world.level.ServerLevelAccessor; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.LiquidBlock; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.level.material.FluidState; + import net.minecraft.world.level.pathfinder.BlockPathTypes; +-import net.minecraft.world.level.pathfinder.PathComputationType; + import net.minecraft.world.level.pathfinder.PathFinder; ++import net.minecraft.world.level.pathfinder.PathMode; + import net.minecraft.world.level.pathfinder.WalkNodeEvaluator; + import net.minecraft.world.phys.AABB; + import net.minecraft.world.phys.Vec3; + import net.minecraft.world.phys.shapes.CollisionContext; + import org.joml.Vector3f; + +-public class Strider extends Animal implements ItemSteerable, Saddleable { ++public class Strider extends Animal implements ISteerable, Saddleable { ++ + private static final UUID SUFFOCATING_MODIFIER_UUID = UUID.fromString("9e362924-01de-4ddd-a2b2-d0f7a405a174"); +- private static final AttributeModifier SUFFOCATING_MODIFIER = new AttributeModifier( +- SUFFOCATING_MODIFIER_UUID, "Strider suffocating modifier", -0.34F, AttributeModifier.Operation.MULTIPLY_BASE +- ); ++ private static final AttributeModifier SUFFOCATING_MODIFIER = new AttributeModifier(Strider.SUFFOCATING_MODIFIER_UUID, "Strider suffocating modifier", -0.3400000035762787D, AttributeModifier.Operation.MULTIPLY_BASE); + private static final float SUFFOCATE_STEERING_MODIFIER = 0.35F; + private static final float STEERING_MODIFIER = 0.55F; + private static final Ingredient FOOD_ITEMS = Ingredient.of(Items.WARPED_FUNGUS); +@@ -84,12 +86,13 @@ + private static final EntityDataAccessor<Integer> DATA_BOOST_TIME = SynchedEntityData.defineId(Strider.class, EntityDataSerializers.INT); + private static final EntityDataAccessor<Boolean> DATA_SUFFOCATING = SynchedEntityData.defineId(Strider.class, EntityDataSerializers.BOOLEAN); + private static final EntityDataAccessor<Boolean> DATA_SADDLE_ID = SynchedEntityData.defineId(Strider.class, EntityDataSerializers.BOOLEAN); +- private final ItemBasedSteering steering = new ItemBasedSteering(this.entityData, DATA_BOOST_TIME, DATA_SADDLE_ID); ++ public final ItemBasedSteering steering; + @Nullable + private TemptGoal temptGoal; + + public Strider(EntityType<? extends Strider> entityType, Level level) { + super(entityType, level); ++ this.steering = new ItemBasedSteering(this.entityData, Strider.DATA_BOOST_TIME, Strider.DATA_SADDLE_ID); + this.blocksBuilding = true; + this.setPathfindingMalus(BlockPathTypes.WATER, -1.0F); + this.setPathfindingMalus(BlockPathTypes.LAVA, 0.0F); +@@ -97,19 +100,19 @@ + this.setPathfindingMalus(BlockPathTypes.DAMAGE_FIRE, 0.0F); + } + +- public static boolean checkStriderSpawnRules(EntityType<Strider> strider, LevelAccessor level, MobSpawnType spawnType, BlockPos pos, RandomSource random) { +- BlockPos.MutableBlockPos mutableBlockPos = pos.mutable(); ++ public static boolean checkStriderSpawnRules(EntityType<Strider> strider, LevelAccessor level, EnumMobSpawn spawnType, BlockPos pos, RandomSource random) { ++ BlockPos.MutableBlockPos blockposition_mutableblockposition = pos.mutable(); + + do { +- mutableBlockPos.move(Direction.UP); +- } while (level.getFluidState(mutableBlockPos).is(FluidTags.LAVA)); ++ blockposition_mutableblockposition.move(Direction.UP); ++ } while (level.getFluidState(blockposition_mutableblockposition).is(FluidTags.LAVA)); + +- return level.getBlockState(mutableBlockPos).isAir(); ++ return level.getBlockState(blockposition_mutableblockposition).isAir(); + } + + @Override + public void onSyncedDataUpdated(EntityDataAccessor<?> key) { +- if (DATA_BOOST_TIME.equals(key) && this.level().isClientSide) { ++ if (Strider.DATA_BOOST_TIME.equals(key) && this.level().isClientSide) { + this.steering.onSynced(); + } + +@@ -119,9 +122,9 @@ + @Override + protected void defineSynchedData() { + super.defineSynchedData(); +- this.entityData.define(DATA_BOOST_TIME, 0); +- this.entityData.define(DATA_SUFFOCATING, false); +- this.entityData.define(DATA_SADDLE_ID, false); ++ this.entityData.define(Strider.DATA_BOOST_TIME, 0); ++ this.entityData.define(Strider.DATA_SUFFOCATING, false); ++ this.entityData.define(Strider.DATA_SADDLE_ID, false); + } + + @Override +@@ -150,37 +153,40 @@ + public void equipSaddle(@Nullable SoundSource source) { + this.steering.setSaddle(true); + if (source != null) { +- this.level().playSound(null, this, SoundEvents.STRIDER_SADDLE, source, 0.5F, 1.0F); ++ this.level().playSound((Player) null, (Entity) this, SoundEvents.STRIDER_SADDLE, source, 0.5F, 1.0F); + } ++ + } + + @Override + protected void registerGoals() { +- this.goalSelector.addGoal(1, new PanicGoal(this, 1.65)); +- this.goalSelector.addGoal(2, new BreedGoal(this, 1.0)); +- this.temptGoal = new TemptGoal(this, 1.4, TEMPT_ITEMS, false); ++ this.goalSelector.addGoal(1, new PanicGoal(this, 1.65D)); ++ this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D)); ++ this.temptGoal = new TemptGoal(this, 1.4D, Strider.TEMPT_ITEMS, false); + this.goalSelector.addGoal(3, this.temptGoal); +- this.goalSelector.addGoal(4, new Strider.StriderGoToLavaGoal(this, 1.0)); +- this.goalSelector.addGoal(5, new FollowParentGoal(this, 1.0)); +- this.goalSelector.addGoal(7, new RandomStrollGoal(this, 1.0, 60)); ++ this.goalSelector.addGoal(4, new Strider.StriderGoToLavaGoal(this, 1.0D)); ++ this.goalSelector.addGoal(5, new FollowParentGoal(this, 1.0D)); ++ this.goalSelector.addGoal(7, new RandomStrollGoal(this, 1.0D, 60)); + this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 8.0F)); + this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); + this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Strider.class, 8.0F)); + } + + public void setSuffocating(boolean suffocating) { +- this.entityData.set(DATA_SUFFOCATING, suffocating); +- AttributeInstance attribute = this.getAttribute(Attributes.MOVEMENT_SPEED); +- if (attribute != null) { +- attribute.removeModifier(SUFFOCATING_MODIFIER_UUID); ++ this.entityData.set(Strider.DATA_SUFFOCATING, suffocating); ++ AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); ++ ++ if (attributemodifiable != null) { ++ attributemodifiable.removeModifier(Strider.SUFFOCATING_MODIFIER_UUID); + if (suffocating) { +- attribute.addTransientModifier(SUFFOCATING_MODIFIER); ++ attributemodifiable.addTransientModifier(Strider.SUFFOCATING_MODIFIER); + } + } ++ + } + + public boolean isSuffocating() { +- return this.entityData.get(DATA_SUFFOCATING); ++ return (Boolean) this.entityData.get(Strider.DATA_SUFFOCATING); + } + + @Override +@@ -189,11 +195,12 @@ + } + + @Override +- protected Vector3f getPassengerAttachmentPoint(Entity entity, EntityDimensions entityDimensions, float f) { +- float min = Math.min(0.25F, this.walkAnimation.speed()); +- float f1 = this.walkAnimation.position(); +- float f2 = 0.12F * Mth.cos(f1 * 1.5F) * 2.0F * min; +- return new Vector3f(0.0F, entityDimensions.height + f2 * f, 0.0F); ++ protected Vector3f getPassengerAttachmentPoint(Entity entity, EntityDimensions entitysize, float f) { ++ float f1 = Math.min(0.25F, this.walkAnimation.speed()); ++ float f2 = this.walkAnimation.position(); ++ float f3 = 0.12F * Mth.cos(f2 * 1.5F) * 2.0F * f1; ++ ++ return new Vector3f(0.0F, entitysize.height + f3 * f, 0.0F); + } + + @Override +@@ -204,45 +211,61 @@ + @Nullable + @Override + public LivingEntity getControllingPassenger() { +- return (LivingEntity)(this.isSaddled() && this.getFirstPassenger() instanceof Player player && player.isHolding(Items.WARPED_FUNGUS_ON_A_STICK) +- ? player +- : super.getControllingPassenger()); ++ if (this.isSaddled()) { ++ Entity entity = this.getFirstPassenger(); ++ ++ if (entity instanceof Player) { ++ Player entityhuman = (Player) entity; ++ ++ if (entityhuman.isHolding(Items.WARPED_FUNGUS_ON_A_STICK)) { ++ return entityhuman; ++ } ++ } ++ } ++ ++ return super.getControllingPassenger(); + } + + @Override + public Vec3 getDismountLocationForPassenger(LivingEntity livingEntity) { +- Vec3[] vec3s = new Vec3[]{ +- getCollisionHorizontalEscapeVector((double)this.getBbWidth(), (double)livingEntity.getBbWidth(), livingEntity.getYRot()), +- getCollisionHorizontalEscapeVector((double)this.getBbWidth(), (double)livingEntity.getBbWidth(), livingEntity.getYRot() - 22.5F), +- getCollisionHorizontalEscapeVector((double)this.getBbWidth(), (double)livingEntity.getBbWidth(), livingEntity.getYRot() + 22.5F), +- getCollisionHorizontalEscapeVector((double)this.getBbWidth(), (double)livingEntity.getBbWidth(), livingEntity.getYRot() - 45.0F), +- getCollisionHorizontalEscapeVector((double)this.getBbWidth(), (double)livingEntity.getBbWidth(), livingEntity.getYRot() + 45.0F) +- }; ++ Vec3[] avec3d = new Vec3[]{getCollisionHorizontalEscapeVector((double) this.getBbWidth(), (double) livingEntity.getBbWidth(), livingEntity.getYRot()), getCollisionHorizontalEscapeVector((double) this.getBbWidth(), (double) livingEntity.getBbWidth(), livingEntity.getYRot() - 22.5F), getCollisionHorizontalEscapeVector((double) this.getBbWidth(), (double) livingEntity.getBbWidth(), livingEntity.getYRot() + 22.5F), getCollisionHorizontalEscapeVector((double) this.getBbWidth(), (double) livingEntity.getBbWidth(), livingEntity.getYRot() - 45.0F), getCollisionHorizontalEscapeVector((double) this.getBbWidth(), (double) livingEntity.getBbWidth(), livingEntity.getYRot() + 45.0F)}; + Set<BlockPos> set = Sets.newLinkedHashSet(); +- double d = this.getBoundingBox().maxY; +- double d1 = this.getBoundingBox().minY - 0.5; +- BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(); ++ double d0 = this.getBoundingBox().maxY; ++ double d1 = this.getBoundingBox().minY - 0.5D; ++ BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); ++ Vec3[] avec3d1 = avec3d; ++ int i = avec3d.length; + +- for (Vec3 vec3 : vec3s) { +- mutableBlockPos.set(this.getX() + vec3.x, d, this.getZ() + vec3.z); ++ for (int j = 0; j < i; ++j) { ++ Vec3 vec3d = avec3d1[j]; + +- for (double d2 = d; d2 > d1; d2--) { +- set.add(mutableBlockPos.immutable()); +- mutableBlockPos.move(Direction.DOWN); ++ blockposition_mutableblockposition.set(this.getX() + vec3d.x, d0, this.getZ() + vec3d.z); ++ ++ for (double d2 = d0; d2 > d1; --d2) { ++ set.add(blockposition_mutableblockposition.immutable()); ++ blockposition_mutableblockposition.move(Direction.DOWN); + } + } + +- for (BlockPos blockPos : set) { +- if (!this.level().getFluidState(blockPos).is(FluidTags.LAVA)) { +- double blockFloorHeight = this.level().getBlockFloorHeight(blockPos); +- if (DismountHelper.isBlockFloorValid(blockFloorHeight)) { +- Vec3 vec31 = Vec3.upFromBottomCenterOf(blockPos, blockFloorHeight); ++ Iterator iterator = set.iterator(); + +- for (Pose pose : livingEntity.getDismountPoses()) { +- AABB localBoundsForPose = livingEntity.getLocalBoundsForPose(pose); +- if (DismountHelper.canDismountTo(this.level(), livingEntity, localBoundsForPose.move(vec31))) { +- livingEntity.setPose(pose); +- return vec31; ++ while (iterator.hasNext()) { ++ BlockPos blockposition = (BlockPos) iterator.next(); ++ ++ if (!this.level().getFluidState(blockposition).is(FluidTags.LAVA)) { ++ double d3 = this.level().getBlockFloorHeight(blockposition); ++ ++ if (DismountHelper.isBlockFloorValid(d3)) { ++ Vec3 vec3d1 = Vec3.upFromBottomCenterOf(blockposition, d3); ++ UnmodifiableIterator unmodifiableiterator = livingEntity.getDismountPoses().iterator(); ++ ++ while (unmodifiableiterator.hasNext()) { ++ EntityPose entitypose = (EntityPose) unmodifiableiterator.next(); ++ AABB axisalignedbb = livingEntity.getLocalBoundsForPose(entitypose); ++ ++ if (DismountHelper.canDismountTo(this.level(), livingEntity, axisalignedbb.move(vec3d1))) { ++ livingEntity.setPose(entitypose); ++ return vec3d1; + } + } + } +@@ -262,12 +285,12 @@ + + @Override + protected Vec3 getRiddenInput(Player player, Vec3 travelVector) { +- return new Vec3(0.0, 0.0, 1.0); ++ return new Vec3(0.0D, 0.0D, 1.0D); + } + + @Override + protected float getRiddenSpeed(Player player) { +- return (float)(this.getAttributeValue(Attributes.MOVEMENT_SPEED) * (double)(this.isSuffocating() ? 0.35F : 0.55F) * (double)this.steering.boostFactor()); ++ return (float) (this.getAttributeValue(Attributes.MOVEMENT_SPEED) * (double) (this.isSuffocating() ? 0.35F : 0.55F) * (double) this.steering.boostFactor()); + } + + @Override +@@ -276,7 +299,7 @@ + } + + @Override +- protected void playStepSound(BlockPos pos, BlockState block) { ++ protected void playStepSound(BlockPos pos, IBlockData block) { + this.playSound(this.isInLava() ? SoundEvents.STRIDER_STEP_LAVA : SoundEvents.STRIDER_STEP, 1.0F, 1.0F); + } + +@@ -286,12 +309,12 @@ + } + + @Override +- protected void checkFallDamage(double y, boolean onGround, BlockState state, BlockPos pos) { ++ protected void checkFallDamage(double y, boolean flag, IBlockData onGround, BlockPos state) { + this.checkInsideBlocks(); + if (this.isInLava()) { + this.resetFallDistance(); + } else { +- super.checkFallDamage(y, onGround, state, pos); ++ super.checkFallDamage(y, flag, onGround, state); + } + } + +@@ -305,23 +328,37 @@ + + if (!this.isNoAi()) { + boolean flag; +- boolean var10000; +- label36: { +- BlockState blockState = this.level().getBlockState(this.blockPosition()); +- BlockState blockStateOnLegacy = this.getBlockStateOnLegacy(); +- flag = blockState.is(BlockTags.STRIDER_WARM_BLOCKS) +- || blockStateOnLegacy.is(BlockTags.STRIDER_WARM_BLOCKS) +- || this.getFluidHeight(FluidTags.LAVA) > 0.0; +- if (this.getVehicle() instanceof Strider strider && strider.isSuffocating()) { +- var10000 = true; +- break label36; ++ boolean flag1; ++ label36: ++ { ++ IBlockData iblockdata = this.level().getBlockState(this.blockPosition()); ++ IBlockData iblockdata1 = this.getBlockStateOnLegacy(); ++ ++ flag = iblockdata.is(BlockTags.STRIDER_WARM_BLOCKS) || iblockdata1.is(BlockTags.STRIDER_WARM_BLOCKS) || this.getFluidHeight(FluidTags.LAVA) > 0.0D; ++ Entity entity = this.getVehicle(); ++ ++ if (entity instanceof Strider) { ++ Strider entitystrider = (Strider) entity; ++ ++ if (entitystrider.isSuffocating()) { ++ flag1 = true; ++ break label36; ++ } + } + +- var10000 = false; ++ flag1 = false; + } + +- boolean flag1 = var10000; +- this.setSuffocating(!flag || flag1); ++ boolean flag2 = flag1; ++ ++ // CraftBukkit start ++ boolean suffocating = !flag || flag2; ++ if (suffocating ^ this.isSuffocating()) { ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callStriderTemperatureChangeEvent(this, suffocating)) { ++ this.setSuffocating(suffocating); ++ } ++ } ++ // CraftBukkit end + } + + super.tick(); +@@ -340,18 +377,19 @@ + + private void floatStrider() { + if (this.isInLava()) { +- CollisionContext collisionContext = CollisionContext.of(this); +- if (collisionContext.isAbove(LiquidBlock.STABLE_SHAPE, this.blockPosition(), true) +- && !this.level().getFluidState(this.blockPosition().above()).is(FluidTags.LAVA)) { ++ CollisionContext voxelshapecollision = CollisionContext.of(this); ++ ++ if (voxelshapecollision.isAbove(LiquidBlock.STABLE_SHAPE, this.blockPosition(), true) && !this.level().getFluidState(this.blockPosition().above()).is(FluidTags.LAVA)) { + this.setOnGround(true); + } else { +- this.setDeltaMovement(this.getDeltaMovement().scale(0.5).add(0.0, 0.05, 0.0)); ++ this.setDeltaMovement(this.getDeltaMovement().scale(0.5D).add(0.0D, 0.05D, 0.0D)); + } + } ++ + } + + public static AttributeSupplier.Builder createAttributes() { +- return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.175F).add(Attributes.FOLLOW_RANGE, 16.0); ++ return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.17499999701976776D).add(Attributes.FOLLOW_RANGE, 16.0D); + } + + @Override +@@ -391,109 +429,101 @@ + + @Override + public float getWalkTargetValue(BlockPos pos, LevelReader level) { +- if (level.getBlockState(pos).getFluidState().is(FluidTags.LAVA)) { +- return 10.0F; +- } else { +- return this.isInLava() ? Float.NEGATIVE_INFINITY : 0.0F; +- } ++ return level.getBlockState(pos).getFluidState().is(FluidTags.LAVA) ? 10.0F : (this.isInLava() ? Float.NEGATIVE_INFINITY : 0.0F); + } + + @Nullable + @Override + public Strider getBreedOffspring(ServerLevel level, AgeableMob otherParent) { +- return EntityType.STRIDER.create(level); ++ return (Strider) EntityType.STRIDER.create(level); + } + + @Override + public boolean isFood(ItemStack stack) { +- return FOOD_ITEMS.test(stack); ++ return Strider.FOOD_ITEMS.test(stack); + } + + @Override + protected void dropEquipment() { + super.dropEquipment(); + if (this.isSaddled()) { +- this.spawnAtLocation(Items.SADDLE); ++ this.spawnAtLocation((IMaterial) Items.SADDLE); + } ++ + } + + @Override +- public InteractionResult mobInteract(Player player, InteractionHand hand) { +- boolean isFood = this.isFood(player.getItemInHand(hand)); +- if (!isFood && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) { ++ public InteractionResult mobInteract(Player player, EnumHand hand) { ++ boolean flag = this.isFood(player.getItemInHand(hand)); ++ ++ if (!flag && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) { + if (!this.level().isClientSide) { + player.startRiding(this); + } + + return InteractionResult.sidedSuccess(this.level().isClientSide); + } else { +- InteractionResult interactionResult = super.mobInteract(player, hand); +- if (!interactionResult.consumesAction()) { +- ItemStack itemInHand = player.getItemInHand(hand); +- return itemInHand.is(Items.SADDLE) ? itemInHand.interactLivingEntity(player, this, hand) : InteractionResult.PASS; ++ InteractionResult enuminteractionresult = super.mobInteract(player, hand); ++ ++ if (!enuminteractionresult.consumesAction()) { ++ ItemStack itemstack = player.getItemInHand(hand); ++ ++ return itemstack.is(Items.SADDLE) ? itemstack.interactLivingEntity(player, this, hand) : InteractionResult.PASS; + } else { +- if (isFood && !this.isSilent()) { +- this.level() +- .playSound( +- null, +- this.getX(), +- this.getY(), +- this.getZ(), +- SoundEvents.STRIDER_EAT, +- this.getSoundSource(), +- 1.0F, +- 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F +- ); ++ if (flag && !this.isSilent()) { ++ this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.STRIDER_EAT, this.getSoundSource(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); + } + +- return interactionResult; ++ return enuminteractionresult; + } + } + } + + @Override + public Vec3 getLeashOffset() { +- return new Vec3(0.0, (double)(0.6F * this.getEyeHeight()), (double)(this.getBbWidth() * 0.4F)); ++ return new Vec3(0.0D, (double) (0.6F * this.getEyeHeight()), (double) (this.getBbWidth() * 0.4F)); + } + + @Nullable + @Override +- public SpawnGroupData finalizeSpawn( +- ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType reason, @Nullable SpawnGroupData spawnData, @Nullable CompoundTag dataTag +- ) { ++ public GroupDataEntity finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, EnumMobSpawn reason, @Nullable GroupDataEntity spawnData, @Nullable CompoundTag dataTag) { + if (this.isBaby()) { +- return super.finalizeSpawn(level, difficulty, reason, spawnData, dataTag); ++ return super.finalizeSpawn(level, difficulty, reason, (GroupDataEntity) spawnData, dataTag); + } else { +- RandomSource random = level.getRandom(); +- if (random.nextInt(30) == 0) { +- Mob mob = EntityType.ZOMBIFIED_PIGLIN.create(level.getLevel()); +- if (mob != null) { +- spawnData = this.spawnJockey(level, difficulty, mob, new Zombie.ZombieGroupData(Zombie.getSpawnAsBabyOdds(random), false)); +- mob.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(Items.WARPED_FUNGUS_ON_A_STICK)); +- this.equipSaddle(null); ++ RandomSource randomsource = level.getRandom(); ++ ++ if (randomsource.nextInt(30) == 0) { ++ Mob entityinsentient = (Mob) EntityType.ZOMBIFIED_PIGLIN.create(level.getLevel()); ++ ++ if (entityinsentient != null) { ++ spawnData = this.spawnJockey(level, difficulty, entityinsentient, new Zombie.ZombieGroupData(Zombie.getSpawnAsBabyOdds(randomsource), false)); ++ entityinsentient.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(Items.WARPED_FUNGUS_ON_A_STICK)); ++ this.equipSaddle((SoundSource) null); + } +- } else if (random.nextInt(10) == 0) { +- AgeableMob ageableMob = EntityType.STRIDER.create(level.getLevel()); +- if (ageableMob != null) { +- ageableMob.setAge(-24000); +- spawnData = this.spawnJockey(level, difficulty, ageableMob, null); ++ } else if (randomsource.nextInt(10) == 0) { ++ AgeableMob entityageable = (AgeableMob) EntityType.STRIDER.create(level.getLevel()); ++ ++ if (entityageable != null) { ++ entityageable.setAge(-24000); ++ spawnData = this.spawnJockey(level, difficulty, entityageable, (GroupDataEntity) null); + } + } else { + spawnData = new AgeableMob.AgeableMobGroupData(0.5F); + } + +- return super.finalizeSpawn(level, difficulty, reason, spawnData, dataTag); ++ return super.finalizeSpawn(level, difficulty, reason, (GroupDataEntity) spawnData, dataTag); + } + } + +- private SpawnGroupData spawnJockey(ServerLevelAccessor serverLevel, DifficultyInstance difficulty, Mob jockey, @Nullable SpawnGroupData spawnData) { ++ private GroupDataEntity spawnJockey(ServerLevelAccessor serverLevel, DifficultyInstance difficulty, Mob jockey, @Nullable GroupDataEntity spawnData) { + jockey.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F); +- jockey.finalizeSpawn(serverLevel, difficulty, MobSpawnType.JOCKEY, spawnData, null); ++ jockey.finalizeSpawn(serverLevel, difficulty, EnumMobSpawn.JOCKEY, spawnData, (CompoundTag) null); + jockey.startRiding(this, true); + return new AgeableMob.AgeableMobGroupData(0.0F); + } + +- static class StriderGoToLavaGoal extends MoveToBlockGoal { ++ private static class StriderGoToLavaGoal extends MoveToBlockGoal { ++ + private final Strider strider; + + StriderGoToLavaGoal(Strider strider, double speedModifier) { +@@ -523,11 +553,12 @@ + + @Override + protected boolean isValidTarget(LevelReader level, BlockPos pos) { +- return level.getBlockState(pos).is(Blocks.LAVA) && level.getBlockState(pos.above()).isPathfindable(level, pos, PathComputationType.LAND); ++ return level.getBlockState(pos).is(Blocks.LAVA) && level.getBlockState(pos.above()).isPathfindable(level, pos, PathMode.LAND); + } + } + +- static class StriderPathNavigation extends GroundPathNavigation { ++ private static class StriderPathNavigation extends GroundPathNavigation { ++ + StriderPathNavigation(Strider strider, Level level) { + super(strider, level); + } +@@ -541,10 +572,7 @@ + + @Override + protected boolean hasValidPathType(BlockPathTypes pathType) { +- return pathType == BlockPathTypes.LAVA +- || pathType == BlockPathTypes.DAMAGE_FIRE +- || pathType == BlockPathTypes.DANGER_FIRE +- || super.hasValidPathType(pathType); ++ return pathType != BlockPathTypes.LAVA && pathType != BlockPathTypes.DAMAGE_FIRE && pathType != BlockPathTypes.DANGER_FIRE ? super.hasValidPathType(pathType) : true; + } + + @Override |