diff --git a/src/main/java/com/paneedah/mwc/entities/Entities.java b/src/main/java/com/paneedah/mwc/entities/Entities.java index 98cc88967..bf9450900 100644 --- a/src/main/java/com/paneedah/mwc/entities/Entities.java +++ b/src/main/java/com/paneedah/mwc/entities/Entities.java @@ -25,11 +25,14 @@ public static void init(CommonProxy commonProxy) { .withMaxHealth(40) .withEntityIdSupplier(() -> 10000) .withEquipmentOption(Guns.VSSVintorez, EnumDifficulty.EASY, 0.1f, Magazines.VSSVintorezMag) - .withEquipmentOption(Guns.VSSVintorez, EnumDifficulty.HARD, 0.1f, Magazines.ASValMag) - .withEquipmentOption(Guns.MakarovPM, EnumDifficulty.EASY, 0.1f, Magazines.MakarovMag) .withEquipmentOption(Guns.Remington870, EnumDifficulty.EASY, 0.07f) + .withEquipmentOption(Guns.AK47, EnumDifficulty.NORMAL, 0.07f, Magazines.AK47Mag) + .withEquipmentOption(Guns.VSSVintorez, EnumDifficulty.HARD, 0.1f, Magazines.ASValMag) + .withEquipmentOption(Guns.HS12, EnumDifficulty.HARD, 0.1f) + .withSecondaryEquipmentOption(Guns.Python, EnumDifficulty.NORMAL, 0.1f) .withPrimaryEquipmentDropChance(0.4f) - .withSpawn(10, 0, 15, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.HILLS) + .withMaxAmmo(1000) + .withSpawn(10, 0, 8, BiomeDictionary.Type.CONIFEROUS, BiomeDictionary.Type.WASTELAND, BiomeDictionary.Type.SNOWY, BiomeDictionary.Type.HILLS) .withMaxTolerableLightBrightness(1f) .withSpawnEgg(0xFF808000, 0xFF556B2F) .withTexturedModelVariant("com.paneedah.mwc.models.BanditNew", "banditnew.png") @@ -39,39 +42,38 @@ public static void init(CommonProxy commonProxy) { .withTexturedModelVariant("com.paneedah.mwc.models.BanditNew5", "banditnew5.png") .withHurtSound("hurt") .withAmbientSound("drawweapon") -// .withStepSound("step") + .withStepSound("step") + .withLookHeightMulitplier(3) .withAiTask(1, e -> new EntityAISwimming(e)) - .withAiTask(3, e -> new EntityAIAvoidEntity<>((EntityCreature) e, EntityWolf.class, 6.0F, 1.0D, 1.2D)) + .withAiTask(3, e -> new EntityAIAvoidEntity<>(e, EntityWolf.class, 6.0F, 1.0D, 1.2D)) .withAiTask(4, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 10, 30.0F)) - .withAiTask(5, e -> new EntityAIWander((EntityCreature) e, 1.0D)) + .withAiTask(5, e -> new EntityAIWander(e, 1.0D)) .withAiTask(6, e -> new EntityAIWatchClosest(e, EntityPlayer.class, 50.0F)) .withAiTask(6, e -> new EntityAILookIdle(e)) -// .withAiTask(7, e -> new EntityAIBreakDoor(e)) - .withAiTargetTask(1, e -> new EntityAIHurtByTarget((EntityCreature) e, false)) - .withAiTargetTask(2, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityPlayer.class, true)) - .withAiTargetTask(2, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "soldier", true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVillager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityHusk.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySkeleton.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpider.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEnderman.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityCreeper.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySlime.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityDragon.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEndermite.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityBlaze.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityGhast.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityIllusionIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityMagmaCube.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityPigZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpellcasterIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityStray.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVindicator.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityWitch.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombieVillager.class, true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "tyke", true)) + .withAiTargetTask(1, e -> new EntityAIHurtByTarget( e, false)) + .withAiTargetTask(2, e -> new EntityAINearestAttackableTarget<>( e, EntityPlayer.class, true)) + .withAiTargetTask(2, e -> new BetterAINearestAttackableTarget<>( e, EntityCustomMob.class, "soldier", true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVillager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityHusk.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySkeleton.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpider.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEnderman.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityCreeper.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySlime.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityDragon.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEndermite.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityBlaze.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityGhast.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityIllusionIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityMagmaCube.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityPigZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpellcasterIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityStray.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVindicator.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityWitch.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombieVillager.class, true)) .register(MWC.modContext); new EntityConfiguration.Builder() @@ -81,7 +83,14 @@ public static void init(CommonProxy commonProxy) { .withEntityIdSupplier(() -> 10011) .withEquipmentOption(Guns.M4A1, EnumDifficulty.EASY, 0.1f, Magazines.M4A1Mag) .withEquipmentOption(Guns.M110, EnumDifficulty.EASY, 0.1f, Magazines.M110Mag) + .withEquipmentOption(Guns.M16A1, EnumDifficulty.NORMAL, 0.2f, Magazines.M4A1Mag) + .withEquipmentOption(Guns.FNFAL, EnumDifficulty.NORMAL, 0.1f, Magazines.FNFALMag) + .withEquipmentOption(Guns.M4A1, EnumDifficulty.HARD, 0.2f, Magazines.Stanag100) + .withEquipmentOption(Guns.M249, EnumDifficulty.HARD, 0.1f, Magazines.M249Mag) + .withSecondaryEquipmentOption(Guns.Glock18C, EnumDifficulty.NORMAL, 0.1f, Magazines.M9A1Mag) + .withSecondaryEquipmentOption(Guns.DesertEagle, EnumDifficulty.HARD, 0.1f, Magazines.DesertEagleMag) .withPrimaryEquipmentDropChance(0.4f) + .withMaxAmmo(1500) .withSpawn(0, 5, 6, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS) .withMaxTolerableLightBrightness(1f) .withSpawnEgg(0x5A674F, 0x464039) @@ -90,39 +99,39 @@ public static void init(CommonProxy commonProxy) { .withTexturedModelVariant("com.paneedah.mwc.models.SoldierSniper", "soldiersniper.png") .withHurtSound("hurt") .withAmbientSound("drawweapon") -// .withStepSound("step") + .withStepSound("step") + .withLookHeightMulitplier(3) .withAiTask(1, e -> new EntityAISwimming(e)) - .withAiTask(3, e -> new EntityAIAvoidEntity<>((EntityCreature) e, EntityWolf.class, 6.0F, 1.0D, 1.2D)) - .withAiTask(4, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 10, 30.0F)) - .withAiTask(5, e -> new EntityAIWander((EntityCreature) e, 1.0D)) + .withAiTask(3, e -> new EntityAIAvoidEntity<>(e, EntityWolf.class, 6.0F, 1.0D, 1.2D)) + .withAiTask(4, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 10, 35.0F)) + .withAiTask(5, e -> new EntityAIWander(e, 1.0D)) .withAiTask(6, e -> new EntityAIWatchClosest(e, EntityPlayer.class, 50.0F)) .withAiTask(6, e -> new EntityAILookIdle(e)) .withAiTask(7, e -> new EntityAIBreakDoor(e)) - .withAiTargetTask(1, e -> new EntityAIHurtByTarget((EntityCreature) e, false)) - .withAiTargetTask(2, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityPlayer.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVillager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityHusk.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySkeleton.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpider.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEnderman.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityCreeper.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySlime.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityDragon.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEndermite.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityBlaze.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityGhast.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityIllusionIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityMagmaCube.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityPigZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpellcasterIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityStray.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVindicator.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityWitch.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombieVillager.class, true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "terrorist", true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "tyke", true)) + .withAiTargetTask(1, e -> new EntityAIHurtByTarget( e, false)) + .withAiTargetTask(2, e -> new EntityAINearestAttackableTarget<>( e, EntityPlayer.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVillager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityHusk.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySkeleton.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpider.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEnderman.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityCreeper.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySlime.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityDragon.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEndermite.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityBlaze.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityGhast.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityIllusionIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityMagmaCube.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityPigZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpellcasterIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityStray.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVindicator.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityWitch.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombieVillager.class, true)) + .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>( e, EntityCustomMob.class, "terrorist", true)) .register(MWC.modContext); new EntityConfiguration.Builder() @@ -132,12 +141,9 @@ public static void init(CommonProxy commonProxy) { .withEntityIdSupplier(() -> 10012) .withEquipmentOption(Guns.turretgun, EnumDifficulty.EASY, 0.1f) .withPrimaryEquipmentDropChance(0.0f) -// .withSpawn(1, 5, 6, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS) -// .withMaxTolerableLightBrightness(1f) .withSpawnEgg(0x5A674F, 0x464039) .withTexturedModelVariant("com.paneedah.mwc.models.Turret", "turret.png") .withAmbientSound("turret_turn") -// .withStepSound("step") .withMaxSpeed(0.0F) // 0.1-0.3 is normal speed .withAiTask(1, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 1, 50.0F)) .withAiTask(2, e -> new EntityAILookIdle(e)) @@ -149,30 +155,29 @@ public static void init(CommonProxy commonProxy) { .withSize(1f, 0.7f) .withPickupItemID(1) - .withAiTargetTask(1, e -> new EntityAIHurtByTarget((EntityCreature) e, false)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVillager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityHusk.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySkeleton.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpider.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEnderman.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityCreeper.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySlime.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityDragon.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEndermite.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityBlaze.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityGhast.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityIllusionIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityMagmaCube.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityPigZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpellcasterIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityStray.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVindicator.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityWitch.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombieVillager.class, true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "soldier", true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "terrorist", true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "tyke", true)) + .withAiTargetTask(1, e -> new EntityAIHurtByTarget( e, false)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVillager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityHusk.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySkeleton.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpider.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEnderman.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityCreeper.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySlime.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityDragon.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEndermite.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityBlaze.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityGhast.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityIllusionIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityMagmaCube.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityPigZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpellcasterIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityStray.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVindicator.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityWitch.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombieVillager.class, true)) + .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>( e, EntityCustomMob.class, "soldier", true)) + .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>( e, EntityCustomMob.class, "terrorist", true)) .register(MWC.modContext); new EntityConfiguration.Builder() .withName("turretupgraded") @@ -181,12 +186,9 @@ public static void init(CommonProxy commonProxy) { .withEntityIdSupplier(() -> 10013) .withEquipmentOption(Guns.turretgunupgraded, EnumDifficulty.EASY, 0.1f) .withPrimaryEquipmentDropChance(0.0f) -// .withSpawn(1, 5, 6, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS) -// .withMaxTolerableLightBrightness(1f) .withSpawnEgg(0x5A674F, 0x464039) .withTexturedModelVariant("com.paneedah.mwc.models.TurretBuff", "turretbuff.png") .withAmbientSound("turret_turn") -// .withStepSound("step") .withMaxSpeed(0.0F) // 0.1-0.3 is normal speed .withAiTask(1, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 1, 50.0F)) .withAiTask(2, e -> new EntityAILookIdle(e)) @@ -198,30 +200,29 @@ public static void init(CommonProxy commonProxy) { .withSize(1f, 0.7f) .withPickupItemID(2) - .withAiTargetTask(1, e -> new EntityAIHurtByTarget((EntityCreature) e, false)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVillager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityHusk.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySkeleton.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpider.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEnderman.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityCreeper.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySlime.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityDragon.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEndermite.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityBlaze.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityGhast.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityIllusionIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityMagmaCube.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityPigZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpellcasterIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityStray.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVindicator.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityWitch.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombieVillager.class, true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "soldier", true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "terrorist", true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "tyke", true)) + .withAiTargetTask(1, e -> new EntityAIHurtByTarget( e, false)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVillager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityHusk.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySkeleton.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpider.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEnderman.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityCreeper.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySlime.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityDragon.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEndermite.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityBlaze.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityGhast.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityIllusionIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityMagmaCube.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityPigZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpellcasterIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityStray.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVindicator.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityWitch.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombieVillager.class, true)) + .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>( e, EntityCustomMob.class, "soldier", true)) + .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>( e, EntityCustomMob.class, "terrorist", true)) .register(MWC.modContext); new EntityConfiguration.Builder() @@ -231,12 +232,9 @@ public static void init(CommonProxy commonProxy) { .withEntityIdSupplier(() -> 10014) .withEquipmentOption(Guns.turretgunsilenced, EnumDifficulty.EASY, 0.1f) .withPrimaryEquipmentDropChance(0.0f) -// .withSpawn(1, 5, 6, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS) -// .withMaxTolerableLightBrightness(1f) .withSpawnEgg(0x5A674F, 0x464039) .withTexturedModelVariant("com.paneedah.mwc.models.turretsilenced", "turretsilenced.png") .withAmbientSound("turret_turn") -// .withStepSound("step") .withMaxSpeed(0.0F) // 0.1-0.3 is normal speed .withAiTask(1, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 1, 50.0F)) .withAiTask(2, e -> new EntityAILookIdle(e)) @@ -248,30 +246,29 @@ public static void init(CommonProxy commonProxy) { .withSize(1f, 0.7f) .withPickupItemID(3) - .withAiTargetTask(1, e -> new EntityAIHurtByTarget((EntityCreature) e, false)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVillager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityHusk.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySkeleton.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpider.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEnderman.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityCreeper.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySlime.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityDragon.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityEndermite.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityBlaze.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityGhast.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityIllusionIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityMagmaCube.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityPigZombie.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntitySpellcasterIllager.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityStray.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityVindicator.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityWitch.class, true)) - .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>((EntityCreature) e, EntityZombieVillager.class, true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "soldier", true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "terrorist", true)) - .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>((EntityCreature) e, EntityCustomMob.class, "tyke", true)) + .withAiTargetTask(1, e -> new EntityAIHurtByTarget( e, false)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVillager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityHusk.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySkeleton.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpider.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEnderman.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityCreeper.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySlime.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityDragon.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityEndermite.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityBlaze.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityGhast.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityIllusionIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityMagmaCube.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityPigZombie.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntitySpellcasterIllager.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityStray.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityVindicator.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityWitch.class, true)) + .withAiTargetTask(3, e -> new EntityAINearestAttackableTarget<>( e, EntityZombieVillager.class, true)) + .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>( e, EntityCustomMob.class, "soldier", true)) + .withAiTargetTask(4, e -> new BetterAINearestAttackableTarget<>( e, EntityCustomMob.class, "terrorist", true)) .register(MWC.modContext); } } diff --git a/src/main/java/com/paneedah/weaponlib/ai/EntityConfiguration.java b/src/main/java/com/paneedah/weaponlib/ai/EntityConfiguration.java index 5737ec376..9fcae086b 100644 --- a/src/main/java/com/paneedah/weaponlib/ai/EntityConfiguration.java +++ b/src/main/java/com/paneedah/weaponlib/ai/EntityConfiguration.java @@ -42,7 +42,7 @@ public class EntityConfiguration { private static class AiTask { int priority; - Function taskSupplier; + Function taskSupplier; } public static class Equipment { @@ -294,7 +294,7 @@ public Builder withTexturedModelVariant(String modelClassName, String texture) { return this; } - public Builder withAiTask(int priority, Function taskSupplier) { + public Builder withAiTask(int priority, Function taskSupplier) { AiTask task = new AiTask(); task.priority = priority; task.taskSupplier = taskSupplier; @@ -302,7 +302,7 @@ public Builder withAiTask(int priority, Function tas return this; } - public Builder withAiTargetTask(int priority, Function taskSupplier) { + public Builder withAiTargetTask(int priority, Function taskSupplier) { AiTask task = new AiTask(); task.priority = priority; task.taskSupplier = taskSupplier; @@ -596,8 +596,8 @@ private static void registerRenderableEntity(ModContext context, Class safeCast(Class entityClass) { - return (Class) entityClass; + private Class safeCast(Class entityClass) { + return (Class) entityClass; } } @@ -670,11 +670,11 @@ public int getPickupItemID() { return this.pickupItemID; } - public void addAiTasks(EntityLiving e, EntityAITasks tasks) { + public void addAiTasks(EntityCreature e, EntityAITasks tasks) { aiTasks.stream().forEach(t -> tasks.addTask(t.priority, t.taskSupplier.apply(e))); } - public void addAiTargetTasks(EntityLiving e, EntityAITasks tasks) { + public void addAiTargetTasks(EntityCreature e, EntityAITasks tasks) { aiTargetTasks.stream().forEach(t -> tasks.addTask(t.priority, t.taskSupplier.apply(e))); }