From a0957f863f0a1bdb35d94d7989b34f78d2e8eb5c Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Wed, 19 Mar 2025 19:25:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=B8=80=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=AE=9E=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/projectile/CannonShellEntity.java | 5 +- ...ctile.java => CustomSyncMotionEntity.java} | 2 +- .../projectile/FastThrowableProjectile.java | 46 ++++++++++ .../entity/projectile/MelonBombEntity.java | 9 +- .../entity/projectile/MortarShellEntity.java | 3 +- .../entity/projectile/ProjectileEntity.java | 2 +- .../entity/projectile/RpgRocketEntity.java | 9 +- .../projectile/SmallCannonShellEntity.java | 7 +- .../superbwarfare/init/ModEntities.java | 89 +++++++++++-------- 9 files changed, 106 insertions(+), 66 deletions(-) rename src/main/java/com/atsuishio/superbwarfare/entity/projectile/{FastProjectile.java => CustomSyncMotionEntity.java} (66%) create mode 100644 src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java 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 a44badc37..407fe1f92 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java @@ -25,7 +25,6 @@ import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.projectile.ThrowableItemProjectile; import net.minecraft.world.item.Item; import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Level; @@ -51,7 +50,7 @@ import software.bernie.geckolib.util.GeckoLibUtil; import java.util.HashSet; import java.util.Set; -public class CannonShellEntity extends ThrowableItemProjectile implements GeoEntity, FastProjectile { +public class CannonShellEntity extends FastThrowableProjectile implements GeoEntity { public static final EntityDataAccessor ANIMATION = SynchedEntityData.defineId(CannonShellEntity.class, EntityDataSerializers.STRING); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); @@ -256,8 +255,6 @@ public class CannonShellEntity extends ThrowableItemProjectile implements GeoEnt } this.discard(); } - - this.syncMotion(); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastProjectile.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CustomSyncMotionEntity.java similarity index 66% rename from src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastProjectile.java rename to src/main/java/com/atsuishio/superbwarfare/entity/projectile/CustomSyncMotionEntity.java index 0e18416a9..106fb3e3b 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastProjectile.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CustomSyncMotionEntity.java @@ -1,6 +1,6 @@ package com.atsuishio.superbwarfare.entity.projectile; -public interface FastProjectile { +public interface CustomSyncMotionEntity { void syncMotion(); } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java new file mode 100644 index 000000000..bb6335d59 --- /dev/null +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/FastThrowableProjectile.java @@ -0,0 +1,46 @@ +package com.atsuishio.superbwarfare.entity.projectile; + +import com.atsuishio.superbwarfare.ModUtils; +import com.atsuishio.superbwarfare.network.message.ClientMotionSyncMessage; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.projectile.ThrowableItemProjectile; +import net.minecraft.world.level.Level; +import net.minecraftforge.network.PacketDistributor; + +public abstract class FastThrowableProjectile extends ThrowableItemProjectile implements CustomSyncMotionEntity { + + public FastThrowableProjectile(EntityType pEntityType, Level pLevel) { + super(pEntityType, pLevel); + } + + public FastThrowableProjectile(EntityType pEntityType, double pX, double pY, double pZ, Level pLevel) { + super(pEntityType, pX, pY, pZ, pLevel); + } + + public FastThrowableProjectile(EntityType pEntityType, LivingEntity pShooter, Level pLevel) { + super(pEntityType, pShooter, pLevel); + } + + @Override + public void tick() { + super.tick(); + this.syncMotion(); + } + + @Override + public void syncMotion() { + if (this.level().isClientSide) return; + + var motion = this.getDeltaMovement(); + double length = motion.length(); + int tickNeeded = 5; + if (length > 0) { + tickNeeded = (int) Mth.clamp(10D / length, 1, 5); + } + if (this.tickCount % tickNeeded == 0) { + ModUtils.PACKET_HANDLER.send(PacketDistributor.ALL.noArg(), new ClientMotionSyncMessage(this)); + } + } +} diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MelonBombEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MelonBombEntity.java index 7363ba946..4a1289b13 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MelonBombEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MelonBombEntity.java @@ -7,7 +7,6 @@ import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.projectile.ThrowableItemProjectile; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; @@ -15,7 +14,8 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraftforge.network.NetworkHooks; import net.minecraftforge.network.PlayMessages; -public class MelonBombEntity extends ThrowableItemProjectile { +public class MelonBombEntity extends FastThrowableProjectile { + public MelonBombEntity(EntityType type, Level world) { super(type, world); this.noCulling = true; @@ -60,11 +60,6 @@ public class MelonBombEntity extends ThrowableItemProjectile { ProjectileTool.causeCustomExplode(this, VehicleConfig.TOM_6_BOMB_EXPLOSION_DAMAGE.get(), VehicleConfig.TOM_6_BOMB_EXPLOSION_RADIUS.get().floatValue(), 1.5f); } } - -// if (!this.level().isClientSide() && this.level() instanceof ServerLevel serverLevel) { -// ParticleTool.sendParticle(serverLevel, ParticleTypes.SMOKE, this.xo, this.yo, this.zo, -// 1, 0, 0, 0, 0.01, true); -// } } @Override 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 4026fe348..13e30af18 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java @@ -20,7 +20,6 @@ import net.minecraft.world.entity.AreaEffectCloud; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.projectile.ThrowableItemProjectile; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.alchemy.Potion; @@ -44,7 +43,7 @@ import java.util.HashSet; import java.util.Objects; import java.util.Set; -public class MortarShellEntity extends ThrowableItemProjectile implements GeoEntity { +public class MortarShellEntity extends FastThrowableProjectile implements GeoEntity { private float damage = ExplosionConfig.MORTAR_SHELL_EXPLOSION_DAMAGE.get(); private int life = 600; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java index a391b1e0a..02e4860f4 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java @@ -67,7 +67,7 @@ import java.util.function.Function; import java.util.function.Predicate; @SuppressWarnings({"unused", "UnusedReturnValue", "SuspiciousNameCombination"}) -public class ProjectileEntity extends Projectile implements IEntityAdditionalSpawnData, GeoEntity, FastProjectile { +public class ProjectileEntity extends Projectile implements IEntityAdditionalSpawnData, GeoEntity, CustomSyncMotionEntity { public static final EntityDataAccessor COLOR_R = SynchedEntityData.defineId(ProjectileEntity.class, EntityDataSerializers.FLOAT); public static final EntityDataAccessor COLOR_G = SynchedEntityData.defineId(ProjectileEntity.class, EntityDataSerializers.FLOAT); 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 e8d6618d1..811030e07 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java @@ -22,7 +22,6 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.monster.Monster; -import net.minecraft.world.entity.projectile.ThrowableItemProjectile; import net.minecraft.world.item.Item; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.BellBlock; @@ -41,13 +40,11 @@ import software.bernie.geckolib.core.animation.RawAnimation; import software.bernie.geckolib.core.object.PlayState; import software.bernie.geckolib.util.GeckoLibUtil; -public class RpgRocketEntity extends ThrowableItemProjectile implements GeoEntity { +public class RpgRocketEntity extends FastThrowableProjectile implements GeoEntity { public static final EntityDataAccessor ANIMATION = SynchedEntityData.defineId(RpgRocketEntity.class, EntityDataSerializers.STRING); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); - public String animationProcedure = "empty"; - private float monsterMultiplier = 0.0f; private float damage = 250f; private float explosionDamage = 200f; @@ -186,10 +183,6 @@ public class RpgRocketEntity extends ThrowableItemProjectile implements GeoEntit return super.getGravity(); } - public String getSyncedAnimation() { - return this.entityData.get(ANIMATION); - } - public void setAnimation(String animation) { this.entityData.set(ANIMATION, animation); } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java index ad4a22092..2478fbc0a 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java @@ -20,7 +20,6 @@ import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.projectile.ThrowableItemProjectile; import net.minecraft.world.item.Item; import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Level; @@ -38,7 +37,8 @@ import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache import software.bernie.geckolib.core.animation.AnimatableManager; import software.bernie.geckolib.util.GeckoLibUtil; -public class SmallCannonShellEntity extends ThrowableItemProjectile implements GeoEntity { +public class SmallCannonShellEntity extends FastThrowableProjectile implements GeoEntity { + private float damage = 40.0f; private float explosionDamage = 80f; private float explosionRadius = 5f; @@ -162,7 +162,7 @@ public class SmallCannonShellEntity extends ThrowableItemProjectile implements G } if (onGround()) { - this.setDeltaMovement(0,0,0); + this.setDeltaMovement(0, 0, 0); } if (this.tickCount > 200 || this.isInWater()) { @@ -183,5 +183,4 @@ public class SmallCannonShellEntity extends ThrowableItemProjectile implements G public AnimatableInstanceCache getAnimatableInstanceCache() { return this.cache; } - } diff --git a/src/main/java/com/atsuishio/superbwarfare/init/ModEntities.java b/src/main/java/com/atsuishio/superbwarfare/init/ModEntities.java index d25d43ad9..894c2dcd0 100644 --- a/src/main/java/com/atsuishio/superbwarfare/init/ModEntities.java +++ b/src/main/java/com/atsuishio/superbwarfare/init/ModEntities.java @@ -21,76 +21,87 @@ import net.minecraftforge.registries.RegistryObject; public class ModEntities { public static final DeferredRegister> REGISTRY = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, ModUtils.MODID); - + // TODO 重构实体命名 + // Living Entities public static final RegistryObject> TARGET = register("target", - EntityType.Builder.of(TargetEntity::new, MobCategory.CREATURE).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(TargetEntity::new).fireImmune().sized(0.875f, 2f)); - public static final RegistryObject> MORTAR = register("mortar", - EntityType.Builder.of(MortarEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(MortarEntity::new).fireImmune().sized(0.8f, 1.4f)); + EntityType.Builder.of(TargetEntity::new, MobCategory.CREATURE).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(TargetEntity::new).fireImmune().sized(0.875f, 2f)); public static final RegistryObject> SENPAI = register("senpai", - EntityType.Builder.of(SenpaiEntity::new, MobCategory.MONSTER).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(SenpaiEntity::new) + EntityType.Builder.of(SenpaiEntity::new, MobCategory.MONSTER).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(SenpaiEntity::new) .sized(0.6f, 2f)); + + // Misc Entities + public static final RegistryObject> MORTAR = register("mortar", + EntityType.Builder.of(MortarEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(MortarEntity::new).fireImmune().sized(0.8f, 1.4f)); + + // Projectiles public static final RegistryObject> CLAYMORE = register("claymore", - EntityType.Builder.of(ClaymoreEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f)); + EntityType.Builder.of(ClaymoreEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f)); public static final RegistryObject> C_4 = register("c4", - EntityType.Builder.of(C4Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f)); - public static final RegistryObject> MK_42 = register("mk_42", - EntityType.Builder.of(Mk42Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Mk42Entity::new).fireImmune().sized(3.4f, 3.5f)); - public static final RegistryObject> MLE_1934 = register("mle_1934", - EntityType.Builder.of(Mle1934Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Mle1934Entity::new).fireImmune().sized(4.5f, 2.8f)); - public static final RegistryObject> ANNIHILATOR = register("annihilator", - EntityType.Builder.of(AnnihilatorEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(AnnihilatorEntity::new).fireImmune().sized(13f, 4.2f)); - - public static final RegistryObject> DRONE = register("drone", - EntityType.Builder.of(DroneEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(DroneEntity::new).sized(0.6f, 0.2f)); - + EntityType.Builder.of(C4Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f)); public static final RegistryObject> TASER_BULLET_PROJECTILE = register("projectile_taser_bullet_projectile", EntityType.Builder.of(TaserBulletProjectileEntity::new, MobCategory.MISC).setCustomClientFactory(TaserBulletProjectileEntity::new).setShouldReceiveVelocityUpdates(true).setTrackingRange(64) .setUpdateInterval(1).sized(0.5f, 0.5f)); public static final RegistryObject> GUN_GRENADE = register("projectile_gun_grenade", - EntityType.Builder.of(GunGrenadeEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(GunGrenadeEntity::new).sized(0.5f, 0.5f)); + EntityType.Builder.of(GunGrenadeEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(GunGrenadeEntity::new).sized(0.5f, 0.5f)); + + // Fast Projectiles public static final RegistryObject> SMALL_CANNON_SHELL = register("projectile_small_cannon_shell", - EntityType.Builder.of(SmallCannonShellEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(SmallCannonShellEntity::new).sized(0.5f, 0.5f)); + EntityType.Builder.of(SmallCannonShellEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(SmallCannonShellEntity::new).sized(0.5f, 0.5f)); public static final RegistryObject> RPG_ROCKET = register("projectile_rpg_rocket", - EntityType.Builder.of(RpgRocketEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(RpgRocketEntity::new).sized(0.5f, 0.5f)); + EntityType.Builder.of(RpgRocketEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(RpgRocketEntity::new).sized(0.5f, 0.5f)); public static final RegistryObject> MORTAR_SHELL = register("projectile_mortar_shell", - EntityType.Builder.of(MortarShellEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(MortarShellEntity::new).sized(0.5f, 0.5f)); + EntityType.Builder.of(MortarShellEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(MortarShellEntity::new).sized(0.5f, 0.5f)); public static final RegistryObject> PROJECTILE = register("projectile", EntityType.Builder.of(ProjectileEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).setCustomClientFactory(ProjectileEntity::new).setTrackingRange(64).noSave().noSummon().sized(0.25f, 0.25f)); public static final RegistryObject> CANNON_SHELL = register("projectile_cannon_shell", EntityType.Builder.of(CannonShellEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(CannonShellEntity::new).sized(0.5f, 0.5f)); + public static final RegistryObject> HAND_GRENADE_ENTITY = register("projectile_hand_grenade_entity", EntityType.Builder.of(HandGrenadeEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(HandGrenadeEntity::new).sized(0.3f, 0.3f)); public static final RegistryObject> RGO_GRENADE = register("projectile_rgo_grenade", EntityType.Builder.of(RgoGrenadeEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(RgoGrenadeEntity::new).sized(0.3f, 0.3f)); public static final RegistryObject> JAVELIN_MISSILE = register("projectile_javelin_missile", EntityType.Builder.of(JavelinMissileEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(JavelinMissileEntity::new).sized(0.5f, 0.5f)); + public static final RegistryObject> LASER = register("laser", EntityType.Builder.of(LaserEntity::new, MobCategory.MISC).sized(0.1f, 0.1f).fireImmune().setUpdateInterval(1)); - public static final RegistryObject> SPEEDBOAT = register("speedboat", - EntityType.Builder.of(SpeedboatEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(SpeedboatEntity::new).fireImmune().sized(3.0f, 2.0f)); - public static final RegistryObject> WHEEL_CHAIR = register("wheel_chair", - EntityType.Builder.of(WheelChairEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(WheelChairEntity::new).fireImmune().sized(1.0f, 1.0f)); - public static final RegistryObject> AH_6 = register("ah_6", - EntityType.Builder.of(Ah6Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Ah6Entity::new).fireImmune().sized(2.8f, 2.9f)); public static final RegistryObject> HELI_ROCKET = register("projectile_heli_rocket", - EntityType.Builder.of(HeliRocketEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(HeliRocketEntity::new).sized(0.5f, 0.5f)); + EntityType.Builder.of(HeliRocketEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(HeliRocketEntity::new).sized(0.5f, 0.5f)); public static final RegistryObject> FLARE_DECOY = register("flare_decoy_entity", - EntityType.Builder.of(FlareDecoyEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(FlareDecoyEntity::new).sized(0.5f, 0.5f)); - public static final RegistryObject> LAV_150 = register("lav_150", - EntityType.Builder.of(Lav150Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Lav150Entity::new).fireImmune().sized(2.8f, 3.1f)); - public static final RegistryObject> TOM_6 = register("tom_6", - EntityType.Builder.of(Tom6Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Tom6Entity::new).fireImmune().sized(1.05f, 1.0f)); + EntityType.Builder.of(FlareDecoyEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(FlareDecoyEntity::new).sized(0.5f, 0.5f)); public static final RegistryObject> MELON_BOMB = register("melon_bomb", - EntityType.Builder.of(MelonBombEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(MelonBombEntity::new).sized(1f, 1f)); - public static final RegistryObject> BMP_2 = register("bmp_2", - EntityType.Builder.of(Bmp2Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Bmp2Entity::new).fireImmune().sized(4f, 3f)); + EntityType.Builder.of(MelonBombEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(MelonBombEntity::new).sized(1f, 1f)); public static final RegistryObject> WG_MISSILE = register("wg_missile", - EntityType.Builder.of(WgMissileEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(WgMissileEntity::new).fireImmune().sized(0.5f, 0.5f)); - public static final RegistryObject> LASER_TOWER = register("laser_tower", - EntityType.Builder.of(LaserTowerEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(LaserTowerEntity::new).fireImmune().sized(0.9f, 1.65f)); + EntityType.Builder.of(WgMissileEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(WgMissileEntity::new).fireImmune().sized(0.5f, 0.5f)); + + // Vehicles + public static final RegistryObject> MK_42 = register("mk_42", + EntityType.Builder.of(Mk42Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Mk42Entity::new).fireImmune().sized(3.4f, 3.5f)); + public static final RegistryObject> MLE_1934 = register("mle_1934", + EntityType.Builder.of(Mle1934Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Mle1934Entity::new).fireImmune().sized(4.5f, 2.8f)); + public static final RegistryObject> ANNIHILATOR = register("annihilator", + EntityType.Builder.of(AnnihilatorEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(AnnihilatorEntity::new).fireImmune().sized(13f, 4.2f)); + + public static final RegistryObject> SPEEDBOAT = register("speedboat", + EntityType.Builder.of(SpeedboatEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(SpeedboatEntity::new).fireImmune().sized(3.0f, 2.0f)); + public static final RegistryObject> WHEEL_CHAIR = register("wheel_chair", + EntityType.Builder.of(WheelChairEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(WheelChairEntity::new).fireImmune().sized(1.0f, 1.0f)); + public static final RegistryObject> AH_6 = register("ah_6", + EntityType.Builder.of(Ah6Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Ah6Entity::new).fireImmune().sized(2.8f, 2.9f)); + public static final RegistryObject> LAV_150 = register("lav_150", + EntityType.Builder.of(Lav150Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Lav150Entity::new).fireImmune().sized(2.8f, 3.1f)); + public static final RegistryObject> TOM_6 = register("tom_6", + EntityType.Builder.of(Tom6Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Tom6Entity::new).fireImmune().sized(1.05f, 1.0f)); + public static final RegistryObject> BMP_2 = register("bmp_2", + EntityType.Builder.of(Bmp2Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Bmp2Entity::new).fireImmune().sized(4f, 3f)); public static final RegistryObject> YX_100 = register("yx_100", EntityType.Builder.of(Yx100Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Yx100Entity::new).fireImmune().sized(5.5f, 3.25f)); + public static final RegistryObject> DRONE = register("drone", + EntityType.Builder.of(DroneEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(DroneEntity::new).sized(0.6f, 0.2f)); + public static final RegistryObject> LASER_TOWER = register("laser_tower", + EntityType.Builder.of(LaserTowerEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(LaserTowerEntity::new).fireImmune().sized(0.9f, 1.65f)); + private static RegistryObject> register(String name, EntityType.Builder entityTypeBuilder) { return REGISTRY.register(name, () -> entityTypeBuilder.build(name)); }