diff --git a/src/main/java/com/atsuishio/superbwarfare/Mod.java b/src/main/java/com/atsuishio/superbwarfare/Mod.java index 25856d560..96c5fec16 100644 --- a/src/main/java/com/atsuishio/superbwarfare/Mod.java +++ b/src/main/java/com/atsuishio/superbwarfare/Mod.java @@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare; import com.atsuishio.superbwarfare.api.event.RegisterContainersEvent; import com.atsuishio.superbwarfare.client.MouseMovementHandler; import com.atsuishio.superbwarfare.client.renderer.molang.MolangVariable; +import com.atsuishio.superbwarfare.client.sound.FastProjectileSoundInstance; import com.atsuishio.superbwarfare.client.sound.VehicleFireSoundInstance; import com.atsuishio.superbwarfare.client.sound.VehicleSoundInstance; import com.atsuishio.superbwarfare.compat.CompatHolder; @@ -11,6 +12,7 @@ import com.atsuishio.superbwarfare.component.ModDataComponents; import com.atsuishio.superbwarfare.config.ClientConfig; import com.atsuishio.superbwarfare.config.CommonConfig; import com.atsuishio.superbwarfare.config.ServerConfig; +import com.atsuishio.superbwarfare.entity.projectile.FastThrowableProjectile; import com.atsuishio.superbwarfare.entity.vehicle.A10Entity; import com.atsuishio.superbwarfare.entity.vehicle.Hpj11Entity; import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity; @@ -135,6 +137,9 @@ public class Mod { A10Entity.fireSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.A10FireSound(vehicle)); Hpj11Entity.fireSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.HPJ11CloseFireSound(vehicle)); + + FastThrowableProjectile.flySound = entity -> Minecraft.getInstance().getSoundManager().play(new FastProjectileSoundInstance.FlySound(entity)); + FastThrowableProjectile.nearFlySound = entity -> Minecraft.getInstance().getSoundManager().play(new FastProjectileSoundInstance.NearFlySound(entity)); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/sound/ClientSoundHandler.java b/src/main/java/com/atsuishio/superbwarfare/client/sound/ClientSoundHandler.java deleted file mode 100644 index 01aaab9cd..000000000 --- a/src/main/java/com/atsuishio/superbwarfare/client/sound/ClientSoundHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.atsuishio.superbwarfare.client.sound; - -import com.atsuishio.superbwarfare.entity.LoudlyEntity; -import net.minecraft.client.Minecraft; -import net.minecraft.world.entity.Entity; -import net.neoforged.api.distmarker.Dist; -import net.neoforged.api.distmarker.OnlyIn; - -@OnlyIn(Dist.CLIENT) -public class ClientSoundHandler { - - public static void playClientSoundInstance(Entity entity) { - if (entity instanceof LoudlyEntity) { - Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySound(entity)); - Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySoundClose(entity)); - } - } -} diff --git a/src/main/java/com/atsuishio/superbwarfare/client/sound/LoudlyEntitySoundInstance.java b/src/main/java/com/atsuishio/superbwarfare/client/sound/FastProjectileSoundInstance.java similarity index 51% rename from src/main/java/com/atsuishio/superbwarfare/client/sound/LoudlyEntitySoundInstance.java rename to src/main/java/com/atsuishio/superbwarfare/client/sound/FastProjectileSoundInstance.java index 4ad69c6c2..d96e9bb82 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/sound/LoudlyEntitySoundInstance.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/sound/FastProjectileSoundInstance.java @@ -1,21 +1,23 @@ package com.atsuishio.superbwarfare.client.sound; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; +import com.atsuishio.superbwarfare.entity.projectile.FastThrowableProjectile; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.sounds.AbstractTickableSoundInstance; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.Entity; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; -public abstract class LoudlyEntitySoundInstance extends AbstractTickableSoundInstance { +@OnlyIn(Dist.CLIENT) +public abstract class FastProjectileSoundInstance extends AbstractTickableSoundInstance { private final Minecraft client; - private final Entity entity; + private final FastThrowableProjectile entity; private double lastDistance; private int fade = 0; private boolean die = false; - public LoudlyEntitySoundInstance(SoundEvent sound, Minecraft client, Entity entity) { + public FastProjectileSoundInstance(SoundEvent sound, Minecraft client, FastThrowableProjectile entity) { super(sound, SoundSource.AMBIENT, entity.getCommandSenderWorld().getRandom()); this.client = client; this.entity = entity; @@ -23,11 +25,11 @@ public abstract class LoudlyEntitySoundInstance extends AbstractTickableSoundIns this.delay = 0; } - protected abstract boolean canPlay(Entity entity); + protected abstract boolean canPlay(FastThrowableProjectile entity); - protected abstract float getPitch(Entity entity); + protected abstract float getPitch(FastThrowableProjectile entity); - protected abstract float getVolume(Entity entity); + protected abstract float getVolume(FastThrowableProjectile entity); @Override public void tick() { @@ -67,51 +69,49 @@ public abstract class LoudlyEntitySoundInstance extends AbstractTickableSoundIns } } - public static class EntitySound extends LoudlyEntitySoundInstance { - public EntitySound(Entity entity) { - super(entity instanceof LoudlyEntity loudlyEntity ? loudlyEntity.getSound() : null, Minecraft.getInstance(), entity); + @OnlyIn(Dist.CLIENT) + public static class FlySound extends FastProjectileSoundInstance { + + public FlySound(FastThrowableProjectile entity) { + super(entity.getSound(), Minecraft.getInstance(), entity); } @Override - protected boolean canPlay(Entity entity) { - return true; + protected boolean canPlay(FastThrowableProjectile entity) { + return entity.isFastMoving(); } @Override - protected float getPitch(Entity entity) { + protected float getPitch(FastThrowableProjectile entity) { return 1; } @Override - protected float getVolume(Entity entity) { - if (entity instanceof LoudlyEntity loudlyEntity) { - return (float) Math.min(loudlyEntity.getVolume() * 0.1 * entity.getDeltaMovement().length(), 1.5); - } - return 0; + protected float getVolume(FastThrowableProjectile entity) { + return (float) Math.min(entity.getVolume() * 0.1 * entity.getDeltaMovement().length(), 1.5); } } - public static class EntitySoundClose extends LoudlyEntitySoundInstance { - public EntitySoundClose(Entity entity) { - super(entity instanceof LoudlyEntity loudlyEntity ? loudlyEntity.getCloseSound() : null, Minecraft.getInstance(), entity); + @OnlyIn(Dist.CLIENT) + public static class NearFlySound extends FastProjectileSoundInstance { + + public NearFlySound(FastThrowableProjectile entity) { + super(entity.getCloseSound(), Minecraft.getInstance(), entity); } @Override - protected boolean canPlay(Entity entity) { - return true; + protected boolean canPlay(FastThrowableProjectile entity) { + return entity.isFastMoving(); } @Override - protected float getPitch(Entity entity) { + protected float getPitch(FastThrowableProjectile entity) { return 1; } @Override - protected float getVolume(Entity entity) { - if (entity instanceof LoudlyEntity loudlyEntity) { - return (float) Math.min(loudlyEntity.getVolume() * 0.1 * entity.getDeltaMovement().length(), 1.5); - } - return 0; + protected float getVolume(FastThrowableProjectile entity) { + return (float) Math.min(entity.getVolume() * 0.1 * entity.getDeltaMovement().length(), 1.5); } } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/LoudlyEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/LoudlyEntity.java deleted file mode 100644 index 487426b9d..000000000 --- a/src/main/java/com/atsuishio/superbwarfare/entity/LoudlyEntity.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.atsuishio.superbwarfare.entity; - -import net.minecraft.sounds.SoundEvent; -import net.minecraft.sounds.SoundEvents; -import org.jetbrains.annotations.NotNull; - -public interface LoudlyEntity { - - @NotNull - default SoundEvent getCloseSound() { - return SoundEvents.EMPTY; - } - - @NotNull - SoundEvent getSound(); - - float getVolume(); -} diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/Agm65Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/Agm65Entity.java index 3f1452145..6d816c638 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/Agm65Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/Agm65Entity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; @@ -41,6 +40,7 @@ import net.minecraft.world.phys.Vec3; import net.neoforged.neoforge.event.EventHooks; import net.neoforged.neoforge.network.PacketDistributor; import org.jetbrains.annotations.NotNull; +import org.joml.Math; import software.bernie.geckolib.animatable.GeoEntity; import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache; import software.bernie.geckolib.animation.*; @@ -48,7 +48,8 @@ import software.bernie.geckolib.util.GeckoLibUtil; import java.util.List; -public class Agm65Entity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, LoudlyEntity, ExplosiveProjectile { +public class Agm65Entity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, ExplosiveProjectile { + public static final EntityDataAccessor HEALTH = SynchedEntityData.defineId(Agm65Entity.class, EntityDataSerializers.FLOAT); public static final EntityDataAccessor TARGET_UUID = SynchedEntityData.defineId(Agm65Entity.class, EntityDataSerializers.STRING); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java index f519ddec4..9972bd567 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.init.*; import com.atsuishio.superbwarfare.network.message.receive.ClientIndicatorMessage; @@ -42,7 +41,8 @@ import software.bernie.geckolib.util.GeckoLibUtil; import java.util.HashSet; import java.util.Set; -public class CannonShellEntity extends FastThrowableProjectile implements GeoEntity, LoudlyEntity, ExplosiveProjectile { +public class CannonShellEntity extends FastThrowableProjectile implements GeoEntity, ExplosiveProjectile { + private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); private float damage = 0; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java index 0a0abcaf7..75056a795 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java @@ -2,6 +2,8 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.network.message.receive.ClientMotionSyncMessage; import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.projectile.ThrowableItemProjectile; @@ -9,11 +11,20 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.neoforged.neoforge.entity.IEntityWithComplexSpawn; import net.neoforged.neoforge.network.PacketDistributor; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.function.Consumer; public abstract class FastThrowableProjectile extends ThrowableItemProjectile implements CustomSyncMotionEntity, IEntityWithComplexSpawn { + public static Consumer flySound = projectile -> { + }; + public static Consumer nearFlySound = projectile -> { + }; + + private boolean isFastMoving = false; + public FastThrowableProjectile(EntityType pEntityType, Level pLevel) { super(pEntityType, pLevel); } @@ -34,6 +45,12 @@ public abstract class FastThrowableProjectile extends ThrowableItemProjectile im public void tick() { super.tick(); + if (!this.isFastMoving && this.isFastMoving() && this.level().isClientSide) { + flySound.accept(this); + nearFlySound.accept(this); + } + this.isFastMoving = this.isFastMoving(); + Vec3 vec3 = this.getDeltaMovement(); float friction; if (this.isInWater()) { @@ -62,6 +79,10 @@ public abstract class FastThrowableProjectile extends ThrowableItemProjectile im } } + public boolean isFastMoving() { + return this.getDeltaMovement().lengthSqr() >= 2500; + } + public boolean shouldSyncMotion() { return false; } @@ -78,4 +99,18 @@ public abstract class FastThrowableProjectile extends ThrowableItemProjectile im public void readSpawnData(RegistryFriendlyByteBuf additionalData) { this.setDeltaMovement(additionalData.readFloat(), additionalData.readFloat(), additionalData.readFloat()); } + + @NotNull + public SoundEvent getCloseSound() { + return SoundEvents.EMPTY; + } + + @NotNull + public SoundEvent getSound() { + return SoundEvents.EMPTY; + } + + public float getVolume() { + return 0.5f; + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/HeliRocketEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/HeliRocketEntity.java index 9aac8bc8f..a05e2dcdf 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/HeliRocketEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/HeliRocketEntity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; import com.atsuishio.superbwarfare.init.ModItems; @@ -35,7 +34,7 @@ import software.bernie.geckolib.util.GeckoLibUtil; import javax.annotation.Nullable; -public class HeliRocketEntity extends FastThrowableProjectile implements GeoEntity, LoudlyEntity, ExplosiveProjectile { +public class HeliRocketEntity extends FastThrowableProjectile implements GeoEntity, ExplosiveProjectile { private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); private float damage = 140f; @@ -59,14 +58,8 @@ public class HeliRocketEntity extends FastThrowableProjectile implements GeoEnti this.explosionRadius = explosionRadius; } - // TODO 音效 -// public HeliRocketEntity(PlayMessages.SpawnEntity spawnEntity, Level level) { -// this(ModEntities.HELI_ROCKET.get(), level); -// DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> ClientSoundHandler.playClientSoundInstance(this)); -// } - @Override - public void addAdditionalSaveData(CompoundTag pCompound) { + public void addAdditionalSaveData(@NotNull CompoundTag pCompound) { super.addAdditionalSaveData(pCompound); pCompound.putFloat("Damage", this.damage); pCompound.putFloat("ExplosionDamage", this.explosionDamage); @@ -74,7 +67,7 @@ public class HeliRocketEntity extends FastThrowableProjectile implements GeoEnti } @Override - public void readAdditionalSaveData(CompoundTag pCompound) { + public void readAdditionalSaveData(@NotNull CompoundTag pCompound) { super.readAdditionalSaveData(pCompound); if (pCompound.contains("Damage")) { this.damage = pCompound.getFloat("Damage"); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/JavelinMissileEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/JavelinMissileEntity.java index 999baaf1e..b61fc95c1 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/JavelinMissileEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/JavelinMissileEntity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; @@ -50,7 +49,8 @@ import software.bernie.geckolib.util.GeckoLibUtil; import java.util.List; -public class JavelinMissileEntity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, LoudlyEntity, ExplosiveProjectile { +public class JavelinMissileEntity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, ExplosiveProjectile { + public static final EntityDataAccessor HEALTH = SynchedEntityData.defineId(JavelinMissileEntity.class, EntityDataSerializers.FLOAT); public static final EntityDataAccessor TARGET_UUID = SynchedEntityData.defineId(JavelinMissileEntity.class, EntityDataSerializers.STRING); public static final EntityDataAccessor TOP = SynchedEntityData.defineId(JavelinMissileEntity.class, EntityDataSerializers.BOOLEAN); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/Mk82Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/Mk82Entity.java index 789205691..d099f9169 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/Mk82Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/Mk82Entity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; import com.atsuishio.superbwarfare.init.ModEntities; import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.init.ModSounds; @@ -27,7 +26,8 @@ import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache; import software.bernie.geckolib.animation.*; import software.bernie.geckolib.util.GeckoLibUtil; -public class Mk82Entity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, LoudlyEntity, AerialBombEntity { +public class Mk82Entity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, AerialBombEntity { + public static final EntityDataAccessor HEALTH = SynchedEntityData.defineId(Mk82Entity.class, EntityDataSerializers.FLOAT); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); @@ -152,11 +152,6 @@ public class Mk82Entity extends FastThrowableProjectile implements GeoEntity, De return this.cache; } - @Override - public @NotNull SoundEvent getCloseSound() { - return LoudlyEntity.super.getCloseSound(); - } - @Override public @NotNull SoundEvent getSound() { return ModSounds.SHELL_FLY.get(); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java index 5fc8885f7..e9f0aa349 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; import com.atsuishio.superbwarfare.init.ModItems; @@ -47,7 +46,8 @@ import java.util.HashSet; import java.util.Objects; import java.util.Set; -public class MortarShellEntity extends FastThrowableProjectile implements GeoEntity, LoudlyEntity, ExplosiveProjectile { +public class MortarShellEntity extends FastThrowableProjectile implements GeoEntity, ExplosiveProjectile { + private float damage = 50; private float explosionDamage = ExplosionConfig.MORTAR_SHELL_EXPLOSION_DAMAGE.get(); private int life = 600; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java index ad70a0745..09d498262 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; import com.atsuishio.superbwarfare.init.ModItems; @@ -37,7 +36,7 @@ import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache; import software.bernie.geckolib.animation.*; import software.bernie.geckolib.util.GeckoLibUtil; -public class RpgRocketEntity extends FastThrowableProjectile implements GeoEntity, LoudlyEntity, ExplosiveProjectile { +public class RpgRocketEntity extends FastThrowableProjectile implements GeoEntity, ExplosiveProjectile { private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SwarmDroneEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SwarmDroneEntity.java index cb92fccd5..355129657 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SwarmDroneEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SwarmDroneEntity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; import com.atsuishio.superbwarfare.init.ModItems; @@ -45,7 +44,7 @@ import software.bernie.geckolib.util.GeckoLibUtil; import javax.annotation.Nullable; import java.util.List; -public class SwarmDroneEntity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, LoudlyEntity, ExplosiveProjectile { +public class SwarmDroneEntity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, ExplosiveProjectile { public static final EntityDataAccessor TARGET_UUID = SynchedEntityData.defineId(SwarmDroneEntity.class, EntityDataSerializers.STRING); public static final EntityDataAccessor TARGET_X = SynchedEntityData.defineId(SwarmDroneEntity.class, EntityDataSerializers.FLOAT); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/WgMissileEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/WgMissileEntity.java index 5a0326914..7f1e337a2 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/WgMissileEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/WgMissileEntity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.entity.LoudlyEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; @@ -44,7 +43,8 @@ import software.bernie.geckolib.util.GeckoLibUtil; import javax.annotation.Nullable; -public class WgMissileEntity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, LoudlyEntity, ExplosiveProjectile { +public class WgMissileEntity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, ExplosiveProjectile { + public static final EntityDataAccessor HEALTH = SynchedEntityData.defineId(WgMissileEntity.class, EntityDataSerializers.FLOAT); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);