移除部分代码

This commit is contained in:
Light_Quanta 2025-04-04 01:58:42 +08:00
parent 14addf7f1e
commit c42f0c18f7
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
4 changed files with 1 additions and 53 deletions

View file

@ -43,7 +43,6 @@ import java.util.Set;
public class CannonShellEntity extends FastThrowableProjectile implements GeoEntity {
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
public String animationProcedure = "empty";
private float damage = 0;
private float radius = 0;
private float explosionDamage = 0;

View file

@ -23,7 +23,6 @@ import net.minecraft.world.level.block.BellBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.neoforged.neoforge.event.EventHooks;
import net.neoforged.neoforge.network.PacketDistributor;
@ -122,24 +121,6 @@ public class SmallCannonShellEntity extends FastThrowableProjectile implements G
ParticleTool.spawnSmallExplosionParticles(this.level(), vec3);
}
private void causeExplodeBlock(HitResult result) {
CustomExplosion explosion = new CustomExplosion(this.level(), this,
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(),
this,
this.getOwner()),
explosionDamage,
result.getLocation().x,
result.getLocation().y,
result.getLocation().z,
explosionRadius,
ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).
setDamageMultiplier(1.25f);
explosion.explode();
EventHooks.onExplosionStart(this.level(), explosion);
explosion.finalizeExplosion(false);
ParticleTool.spawnSmallExplosionParticles(this.level(), result.getLocation());
}
@Override
public void tick() {
super.tick();

View file

@ -531,38 +531,6 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity,
this.setXRot(Mth.clamp(this.getXRot() + Mth.clamp(diffX, -0.8f, 0.8f), -45, 5f));
}
public void autoAim() {
if (this.getEnergy() <= 0) return;
Entity target = SeekTool.seekLivingEntity(this, this.level(), 64, 30);
if (target == null) return;
float yRot = this.getYRot();
if (yRot < 0) {
yRot += 360;
}
yRot = yRot + 90 % 360;
var BarrelRoot = new Vector3d(4.95, 2.25, 0);
BarrelRoot.rotateY(-yRot * Mth.DEG_TO_RAD);
Vec3 barrelRootPos = new Vec3(this.getX() + BarrelRoot.x, this.getY() + BarrelRoot.y, this.getZ() + BarrelRoot.z);
Vec3 targetVec = new Vec3(target.getX() - barrelRootPos.x, target.getEyeY() - barrelRootPos.y, target.getZ() - barrelRootPos.z).normalize();
double d0 = targetVec.x;
double d1 = targetVec.y;
double d2 = targetVec.z;
double d3 = Math.sqrt(d0 * d0 + d2 * d2);
this.setXRot(Mth.wrapDegrees((float) (-(Mth.atan2(d1, d3) * 57.2957763671875))));
float targetY = Mth.wrapDegrees((float) (Mth.atan2(d2, d0) * 57.2957763671875) - 90.0F);
float diffY = Math.clamp(-90f, 90f, Mth.wrapDegrees(targetY - this.getYRot()));
this.setYRot(this.getYRot() + Mth.clamp(0.5f * diffY, -1f, 1f));
this.setRot(this.getYRot(), this.getXRot());
}
protected void clampRotation(Entity entity) {
float f = Mth.wrapDegrees(entity.getXRot());
float f1 = Mth.clamp(f, -45.0F, 5);

View file

@ -174,7 +174,7 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo
}
private void handleAmmo() {
if (!(this.getFirstPassenger() instanceof Player player)) return;
if (!(this.getFirstPassenger() instanceof Player)) return;
int ammoCount = this.getItemStacks().stream().filter(stack -> {
if (stack.is(ModItems.AMMO_BOX.get())) {