修复导弹对于末影龙的判定问题

This commit is contained in:
Atsuihsio 2024-09-01 15:22:28 +08:00
parent 472c1a1a3d
commit 2c0f6a6fd9

View file

@ -23,6 +23,7 @@ import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.entity.projectile.ThrowableItemProjectile; import net.minecraft.world.entity.projectile.ThrowableItemProjectile;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Explosion;
@ -166,10 +167,10 @@ public class JavelinMissileEntity extends ThrowableItemProjectile implements Geo
if (this.position().distanceTo(entity.position()) > 40) { if (this.position().distanceTo(entity.position()) > 40) {
this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(entity.getX(),entity.getY() + 30,entity.getZ())); this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(entity.getX(),entity.getY() + 30,entity.getZ()));
} else { } else {
this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(entity.getX(),entity.getEyeY() + 1,entity.getZ())); this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(entity.getX(),entity.getEyeY() + (entity instanceof EnderDragon? -3 : 1),entity.getZ()));
} }
} else { } else {
this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(entity.getX(),entity.getEyeY() + 1,entity.getZ())); this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(entity.getX(),entity.getEyeY() + (entity instanceof EnderDragon? -3 : 1),entity.getZ()));
} }
if (this.position().distanceTo(entity.position()) < 4) { if (this.position().distanceTo(entity.position()) < 4) {
triggerExplode(entity); triggerExplode(entity);