From 8b2c84c433f84ffcedeac6ba4d33acfe9f54d08c Mon Sep 17 00:00:00 2001 From: FatherToast Date: Wed, 29 Jun 2022 16:58:06 -0500 Subject: [PATCH 1/3] o yeh --- .../specialmobs/common/core/SpecialMobs.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/fathertoast/specialmobs/common/core/SpecialMobs.java b/src/main/java/fathertoast/specialmobs/common/core/SpecialMobs.java index ff747cc..4d998d3 100644 --- a/src/main/java/fathertoast/specialmobs/common/core/SpecialMobs.java +++ b/src/main/java/fathertoast/specialmobs/common/core/SpecialMobs.java @@ -78,8 +78,8 @@ public class SpecialMobs { * o ability to equip held items * o ghasts * o melee attack AI - * o blazes - * o melee attack AI + * - blazes + * - melee attack AI * ? piglins * ? hoglins * ? zoglins @@ -122,10 +122,10 @@ public class SpecialMobs { MobFamily.initBestiary(); } - - public void sendIMCMessages(InterModEnqueueEvent event) { - if (ModList.get().isLoaded("theoneprobe")) { - InterModComms.sendTo("theoneprobe", "getTheOneProbe", SMTheOneProbe::new); + + public void sendIMCMessages( InterModEnqueueEvent event ) { + if( ModList.get().isLoaded( "theoneprobe" ) ) { + InterModComms.sendTo( "theoneprobe", "getTheOneProbe", SMTheOneProbe::new ); } } From f6c24ecda0ff6555df8d01b78b55ae575f3108cc Mon Sep 17 00:00:00 2001 From: FatherToast Date: Thu, 30 Jun 2022 10:03:13 -0500 Subject: [PATCH 2/3] add more new blocks as disguises --- .../common/entity/ai/NinjaGoal.java | 147 +++++++++++++++--- .../entity/skeleton/NinjaSkeletonEntity.java | 14 +- .../NinjaWitherSkeletonEntity.java | 2 - 3 files changed, 127 insertions(+), 36 deletions(-) diff --git a/src/main/java/fathertoast/specialmobs/common/entity/ai/NinjaGoal.java b/src/main/java/fathertoast/specialmobs/common/entity/ai/NinjaGoal.java index 5b59019..e06a008 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/ai/NinjaGoal.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/ai/NinjaGoal.java @@ -6,6 +6,7 @@ import net.minecraft.block.Blocks; import net.minecraft.entity.MobEntity; import net.minecraft.entity.ai.goal.Goal; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.state.properties.AttachFace; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; @@ -81,18 +82,20 @@ public class NinjaGoal extends Goal { // Options available regardless of position switch( random.nextInt( 200 ) ) { - case 0: return Blocks.CHEST.defaultBlockState().setValue( BlockStateProperties.HORIZONTAL_FACING, - Direction.Plane.HORIZONTAL.getRandomDirection( random ) ); + case 0: return Blocks.TNT.defaultBlockState(); case 1: return Blocks.OAK_LOG.defaultBlockState(); case 2: return Blocks.SPONGE.defaultBlockState(); case 3: return Blocks.DEAD_BUSH.defaultBlockState(); case 4: return Blocks.OAK_LEAVES.defaultBlockState(); - case 5: return Blocks.BEE_NEST.defaultBlockState(); + case 5: return randomRotation( Blocks.BEE_NEST.defaultBlockState(), random ); case 6: return Blocks.CAKE.defaultBlockState(); case 7: return Blocks.CRAFTING_TABLE.defaultBlockState(); - case 8: return Blocks.FURNACE.defaultBlockState(); - case 9: return Blocks.ANVIL.defaultBlockState(); + case 8: return randomRotation( Blocks.FURNACE.defaultBlockState(), random ); + case 9: return randomRotation( Blocks.ANVIL.defaultBlockState(), random ); case 10: return Blocks.BREWING_STAND.defaultBlockState(); + case 11: return randomRotation( Blocks.LEVER.defaultBlockState() + .setValue( BlockStateProperties.ATTACH_FACE, AttachFace.FLOOR ), random ); + case 12: return randomPottedFlower( random ); } final BlockPos posUnderFeet = entity.blockPosition().below(); @@ -103,8 +106,8 @@ public class NinjaGoal extends Goal { if( blockUnderFeet.is( Blocks.STONE ) || blockUnderFeet.is( Blocks.STONE_BRICKS ) ) { // Cave theme switch( random.nextInt( 30 ) ) { - case 0: return blockUnderFeet; - case 1: return Blocks.MOSSY_COBBLESTONE.defaultBlockState(); + case 0: return Blocks.BROWN_MUSHROOM.defaultBlockState(); + case 1: return Blocks.RED_MUSHROOM.defaultBlockState(); case 2: return Blocks.CLAY.defaultBlockState(); case 3: return Blocks.GRAVEL.defaultBlockState(); case 4: return Blocks.COAL_ORE.defaultBlockState(); @@ -114,11 +117,12 @@ public class NinjaGoal extends Goal { case 8: return Blocks.REDSTONE_ORE.defaultBlockState(); case 9: return Blocks.DIAMOND_ORE.defaultBlockState(); case 10: return Blocks.EMERALD_ORE.defaultBlockState(); + case 11: return Blocks.MOSSY_COBBLESTONE.defaultBlockState(); } } else if( blockUnderFeet.is( Blocks.GRASS ) || blockUnderFeet.is( Blocks.DIRT ) || blockUnderFeet.is( Blocks.PODZOL ) ) { // Field theme - switch( random.nextInt( 15 ) ) { + switch( random.nextInt( 20 ) ) { case 0: return blockUnderFeet; case 1: return Blocks.OAK_LOG.defaultBlockState(); case 2: return Blocks.OAK_LEAVES.defaultBlockState(); @@ -126,16 +130,19 @@ public class NinjaGoal extends Goal { case 4: return Blocks.MELON.defaultBlockState(); case 5: return Blocks.TALL_GRASS.defaultBlockState(); case 6: return Blocks.FERN.defaultBlockState(); - case 7: return Blocks.BEE_NEST.defaultBlockState(); + case 7: return randomRotation( Blocks.BEE_NEST.defaultBlockState(), random ); + case 8: return randomFlower( random ); + case 9: return randomPottedFlower( random ); + case 10: return randomPottedPlant( random ); } } else if( blockUnderFeet.is( Blocks.SAND ) || blockUnderFeet.is( Blocks.RED_SAND ) || blockUnderFeet.is( Blocks.SANDSTONE ) || blockUnderFeet.is( Blocks.RED_SANDSTONE ) ) { // Desert theme switch( random.nextInt( 5 ) ) { - case 0: return blockUnderFeet; - case 1: return Blocks.CACTUS.defaultBlockState(); - case 2: return Blocks.DEAD_BUSH.defaultBlockState(); + case 0: return Blocks.CACTUS.defaultBlockState(); + case 1: return Blocks.DEAD_BUSH.defaultBlockState(); + case 2: return randomPottedDesertPlant( random ); } } else if( blockUnderFeet.is( Blocks.NETHERRACK ) || blockUnderFeet.is( Blocks.NETHER_BRICKS ) || @@ -145,25 +152,27 @@ public class NinjaGoal extends Goal { switch( random.nextInt( 25 ) ) { case 0: return blockUnderFeet; case 1: return Blocks.GRAVEL.defaultBlockState(); - case 2: return Blocks.SOUL_SAND.defaultBlockState(); - case 3: return Blocks.GLOWSTONE.defaultBlockState(); - case 4: return Blocks.NETHER_QUARTZ_ORE.defaultBlockState(); - case 5: return Blocks.NETHER_GOLD_ORE.defaultBlockState(); - case 6: return Blocks.ANCIENT_DEBRIS.defaultBlockState(); - case 7: return Blocks.BROWN_MUSHROOM.defaultBlockState(); - case 8: return Blocks.RED_MUSHROOM.defaultBlockState(); - case 9: return Blocks.CRIMSON_STEM.defaultBlockState(); - case 10: return Blocks.WARPED_STEM.defaultBlockState(); + case 2: return Blocks.NETHER_QUARTZ_ORE.defaultBlockState(); + case 3: return Blocks.NETHER_GOLD_ORE.defaultBlockState(); + case 4: return Blocks.ANCIENT_DEBRIS.defaultBlockState(); + case 5: return Blocks.BROWN_MUSHROOM.defaultBlockState(); + case 6: return Blocks.RED_MUSHROOM.defaultBlockState(); + case 7: return Blocks.CRIMSON_STEM.defaultBlockState(); + case 8: return Blocks.WARPED_STEM.defaultBlockState(); + case 9: return Blocks.CRIMSON_ROOTS.defaultBlockState(); + case 10: return Blocks.WARPED_ROOTS.defaultBlockState(); + case 11: return Blocks.CRIMSON_FUNGUS.defaultBlockState(); + case 12: return Blocks.WARPED_FUNGUS.defaultBlockState(); + case 13: return randomPottedNetherThing( random ); } } else if( blockUnderFeet.is( Blocks.END_STONE ) || blockUnderFeet.is( Blocks.END_STONE_BRICKS ) || blockUnderFeet.is( Blocks.PURPUR_BLOCK ) ) { // End theme switch( random.nextInt( 10 ) ) { - case 0: return blockUnderFeet; - case 1: return Blocks.CHORUS_PLANT.defaultBlockState(); - case 2: return Blocks.PURPUR_PILLAR.defaultBlockState(); - case 3: return Blocks.END_ROD.defaultBlockState(); + case 0: return Blocks.CHORUS_PLANT.defaultBlockState(); + case 1: return Blocks.PURPUR_PILLAR.defaultBlockState(); + case 2: return randomPottedEndThing( random ); } } } @@ -183,4 +192,92 @@ public class NinjaGoal extends Goal { // Hide as a log if none of the other options are chosen return Blocks.OAK_LOG.defaultBlockState(); } + + /** @return The block state with a random rotation (horizontal facing). */ + private static BlockState randomRotation( BlockState block, Random random ) { + return block.setValue( BlockStateProperties.HORIZONTAL_FACING, Direction.Plane.HORIZONTAL.getRandomDirection( random ) ); + } + + /** @return A random flower. */ + private static BlockState randomFlower( Random random ) { + switch( random.nextInt( 12 ) ) { + case 0: return Blocks.DANDELION.defaultBlockState(); + case 1: return Blocks.POPPY.defaultBlockState(); + case 2: return Blocks.BLUE_ORCHID.defaultBlockState(); + case 3: return Blocks.ALLIUM.defaultBlockState(); + case 4: return Blocks.AZURE_BLUET.defaultBlockState(); + case 5: return Blocks.RED_TULIP.defaultBlockState(); + case 6: return Blocks.ORANGE_TULIP.defaultBlockState(); + case 7: return Blocks.WHITE_TULIP.defaultBlockState(); + case 8: return Blocks.PINK_TULIP.defaultBlockState(); + case 9: return Blocks.OXEYE_DAISY.defaultBlockState(); + case 10: return Blocks.CORNFLOWER.defaultBlockState(); + default: return Blocks.LILY_OF_THE_VALLEY.defaultBlockState(); + } + } + + /** @return A random potted flower. */ + private static BlockState randomPottedFlower( Random random ) { + switch( random.nextInt( 12 ) ) { + case 0: return Blocks.POTTED_DANDELION.defaultBlockState(); + case 1: return Blocks.POTTED_POPPY.defaultBlockState(); + case 2: return Blocks.POTTED_BLUE_ORCHID.defaultBlockState(); + case 3: return Blocks.POTTED_ALLIUM.defaultBlockState(); + case 4: return Blocks.POTTED_AZURE_BLUET.defaultBlockState(); + case 5: return Blocks.POTTED_RED_TULIP.defaultBlockState(); + case 6: return Blocks.POTTED_ORANGE_TULIP.defaultBlockState(); + case 7: return Blocks.POTTED_WHITE_TULIP.defaultBlockState(); + case 8: return Blocks.POTTED_PINK_TULIP.defaultBlockState(); + case 9: return Blocks.POTTED_OXEYE_DAISY.defaultBlockState(); + case 10: return Blocks.POTTED_CORNFLOWER.defaultBlockState(); + default: return Blocks.POTTED_LILY_OF_THE_VALLEY.defaultBlockState(); + } + } + + /** @return A random potted non-flower plant. */ + private static BlockState randomPottedPlant( Random random ) { + switch( random.nextInt( 8 ) ) { + case 0: return Blocks.POTTED_OAK_SAPLING.defaultBlockState(); + case 1: return Blocks.POTTED_SPRUCE_SAPLING.defaultBlockState(); + case 2: return Blocks.POTTED_BIRCH_SAPLING.defaultBlockState(); + case 3: return Blocks.POTTED_JUNGLE_SAPLING.defaultBlockState(); + case 4: return Blocks.POTTED_ACACIA_SAPLING.defaultBlockState(); + case 5: return Blocks.POTTED_DARK_OAK_SAPLING.defaultBlockState(); + case 6: return Blocks.POTTED_FERN.defaultBlockState(); + default: return Blocks.POTTED_BAMBOO.defaultBlockState(); + } + } + + /** @return A random potted desert plant. */ + private static BlockState randomPottedDesertPlant( Random random ) { + //noinspection SwitchStatementWithTooFewBranches + switch( random.nextInt( 2 ) ) { + case 0: return Blocks.POTTED_DEAD_BUSH.defaultBlockState(); + default: return Blocks.POTTED_CACTUS.defaultBlockState(); + } + } + + /** @return A random potted Nether plant/fungus. */ + private static BlockState randomPottedNetherThing( Random random ) { + switch( random.nextInt( 7 ) ) { + case 0: return Blocks.POTTED_WITHER_ROSE.defaultBlockState(); + case 1: return Blocks.POTTED_RED_MUSHROOM.defaultBlockState(); + case 2: return Blocks.POTTED_BROWN_MUSHROOM.defaultBlockState(); + case 3: return Blocks.POTTED_CRIMSON_FUNGUS.defaultBlockState(); + case 4: return Blocks.POTTED_WARPED_FUNGUS.defaultBlockState(); + case 5: return Blocks.POTTED_CRIMSON_ROOTS.defaultBlockState(); + default: return Blocks.POTTED_WARPED_ROOTS.defaultBlockState(); + } + } + + /** @return A random potted End-themed plant. */ + private static BlockState randomPottedEndThing( Random random ) { + switch( random.nextInt( 5 ) ) { + case 0: return Blocks.POTTED_WITHER_ROSE.defaultBlockState(); + case 1: return Blocks.POTTED_ALLIUM.defaultBlockState(); + case 2: return Blocks.POTTED_AZURE_BLUET.defaultBlockState(); + case 3: return Blocks.POTTED_OXEYE_DAISY.defaultBlockState(); + default: return Blocks.POTTED_LILY_OF_THE_VALLEY.defaultBlockState(); + } + } } \ No newline at end of file diff --git a/src/main/java/fathertoast/specialmobs/common/entity/skeleton/NinjaSkeletonEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/skeleton/NinjaSkeletonEntity.java index 5c1b0b3..5091069 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/skeleton/NinjaSkeletonEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/skeleton/NinjaSkeletonEntity.java @@ -6,15 +6,12 @@ import fathertoast.specialmobs.common.bestiary.SpecialMob; import fathertoast.specialmobs.common.entity.MobHelper; import fathertoast.specialmobs.common.entity.ai.INinja; import fathertoast.specialmobs.common.entity.ai.NinjaGoal; -import fathertoast.specialmobs.common.network.NetworkHelper; import fathertoast.specialmobs.common.util.AttributeHelper; import fathertoast.specialmobs.common.util.References; import fathertoast.specialmobs.datagen.loot.LootTableBuilder; import mcp.MethodsReturnNonnullByDefault; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.client.renderer.BlockRendererDispatcher; -import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; @@ -31,7 +28,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.World; -import net.minecraftforge.client.model.data.IModelData; import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; @@ -144,18 +140,18 @@ public class NinjaSkeletonEntity extends _SpecialSkeletonEntity implements INinj } super.tick(); } - + @Override - protected void playStepSound(BlockPos pos, BlockState state) { + protected void playStepSound( BlockPos pos, BlockState state ) { // Nope } - + /** @return The sound this entity makes idly. */ @Override protected SoundEvent getAmbientSound() { - return getHiddenDragon() == null ? null: SoundEvents.SKELETON_AMBIENT; + return getHiddenDragon() == null ? null : SoundEvents.SKELETON_AMBIENT; } - + /** Moves this entity to a new position and rotation. */ @Override public void moveTo( double x, double y, double z, float yaw, float pitch ) { diff --git a/src/main/java/fathertoast/specialmobs/common/entity/witherskeleton/NinjaWitherSkeletonEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/witherskeleton/NinjaWitherSkeletonEntity.java index 3688c8f..ec11a04 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/witherskeleton/NinjaWitherSkeletonEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/witherskeleton/NinjaWitherSkeletonEntity.java @@ -6,7 +6,6 @@ import fathertoast.specialmobs.common.bestiary.SpecialMob; import fathertoast.specialmobs.common.entity.MobHelper; import fathertoast.specialmobs.common.entity.ai.INinja; import fathertoast.specialmobs.common.entity.ai.NinjaGoal; -import fathertoast.specialmobs.common.network.NetworkHelper; import fathertoast.specialmobs.common.util.AttributeHelper; import fathertoast.specialmobs.common.util.References; import fathertoast.specialmobs.datagen.loot.LootTableBuilder; @@ -240,7 +239,6 @@ public class NinjaWitherSkeletonEntity extends _SpecialWitherSkeletonEntity impl @Override public void setHiddenDragon( @Nullable BlockState block ) { getEntityData().set( HIDING_BLOCK, Optional.ofNullable( block ) ); - NetworkHelper.updateNinjaModelData( level, getId(), blockPosition() ); canHide = false; // Smoke puff when emerging from disguise From 9f372a526121e8851fcb91bae1b6cfe9facd166c Mon Sep 17 00:00:00 2001 From: FatherToast Date: Thu, 30 Jun 2022 12:04:54 -0500 Subject: [PATCH 3/3] rebase variance as a normal multiplier, fix blaze variance --- .../common/entity/SpecialMobData.java | 2 +- .../entity/blaze/HellfireBlazeEntity.java | 18 ++++++++++++++++-- .../entity/blaze/_SpecialBlazeEntity.java | 3 ++- .../cavespider/_SpecialCaveSpiderEntity.java | 2 +- .../silverfish/FishingSilverfishEntity.java | 2 +- .../silverfish/_SpecialSilverfishEntity.java | 1 - .../skeleton/_SpecialSkeletonEntity.java | 3 +-- .../entity/spider/_SpecialSpiderEntity.java | 2 +- .../_SpecialWitherSkeletonEntity.java | 3 +-- .../entity/zombie/FishingZombieEntity.java | 2 +- .../entity/zombie/_SpecialZombieEntity.java | 4 ++-- .../FishingZombifiedPiglinEntity.java | 2 +- .../_SpecialZombifiedPiglinEntity.java | 3 +-- 13 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/main/java/fathertoast/specialmobs/common/entity/SpecialMobData.java b/src/main/java/fathertoast/specialmobs/common/entity/SpecialMobData.java index c4f259c..be28560 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/SpecialMobData.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/SpecialMobData.java @@ -64,7 +64,7 @@ public class SpecialMobData> { /** The damage the entity uses for its ranged attacks, when applicable. */ public float rangedAttackDamage; /** The spread (inaccuracy) of the entity's ranged attacks. */ - public float rangedAttackSpread; + public float rangedAttackSpread = 1.0F; /** The movement speed multiplier the entity uses during its ranged attack ai. Requires an AI reload to take effect. */ public float rangedWalkSpeed = 1.0F; /** The delay (in ticks) before a new ranged attack can begin after firing. Requires an AI reload to take effect. */ diff --git a/src/main/java/fathertoast/specialmobs/common/entity/blaze/HellfireBlazeEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/blaze/HellfireBlazeEntity.java index c674a65..eafac4e 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/blaze/HellfireBlazeEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/blaze/HellfireBlazeEntity.java @@ -11,9 +11,11 @@ import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.ai.attributes.AttributeModifierMap; import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.FireballEntity; import net.minecraft.item.Items; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.DamageSource; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; @@ -73,7 +75,7 @@ public class HellfireBlazeEntity extends _SpecialBlazeEntity { /** Override to change this entity's AI goals. */ @Override protected void registerVariantGoals() { - getSpecialData().rangedAttackSpread = 0.0F; + getSpecialData().rangedAttackSpread *= 0.05F; setRangedAI( 1, 0, 60, 100, 40.0F ); } @@ -82,7 +84,7 @@ public class HellfireBlazeEntity extends _SpecialBlazeEntity { public void performRangedAttack( LivingEntity target, float damageMulti ) { if( !isSilent() ) level.levelEvent( null, 1018, blockPosition(), 0 ); - final float accelVariance = MathHelper.sqrt( distanceTo( target ) ) * getSpecialData().rangedAttackSpread / 28.0F; + final float accelVariance = MathHelper.sqrt( distanceTo( target ) ) * 0.5F * getSpecialData().rangedAttackSpread; final double dX = target.getX() - getX() + getRandom().nextGaussian() * accelVariance; final double dY = target.getY( 0.5 ) - getY( 0.5 ); final double dZ = target.getZ() - getZ() + getRandom().nextGaussian() * accelVariance; @@ -93,6 +95,18 @@ public class HellfireBlazeEntity extends _SpecialBlazeEntity { level.addFreshEntity( fireball ); } + /** @return Attempts to damage this entity; returns true if the hit was successful. */ + @Override + public boolean hurt( DamageSource source, float amount ) { + if( isInvulnerableTo( source ) ) return false; + + if( source.getDirectEntity() instanceof FireballEntity && source.getEntity() instanceof PlayerEntity ) { + super.hurt( source, 1000.0F ); // Die from returned fireballs (like ghasts) + return true; + } + return super.hurt( source, amount ); + } + /** Override to save data to this entity's NBT data. */ @Override public void addVariantSaveData( CompoundNBT saveTag ) { diff --git a/src/main/java/fathertoast/specialmobs/common/entity/blaze/_SpecialBlazeEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/blaze/_SpecialBlazeEntity.java index a5fa153..f587129 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/blaze/_SpecialBlazeEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/blaze/_SpecialBlazeEntity.java @@ -86,6 +86,7 @@ public class _SpecialBlazeEntity extends BlazeEntity implements IRangedAttackMob goalSelector.addGoal( 4, new SpecialBlazeAttackGoal( this ) ); AIHelper.replaceHurtByTarget( this, new SpecialHurtByTargetGoal( this, BlazeEntity.class ).setAlertOthers() ); + getSpecialData().rangedAttackDamage = 2.0F; setRangedAI( 3, 6, 60, 100, 48.0F ); registerVariantGoals(); } @@ -147,7 +148,7 @@ public class _SpecialBlazeEntity extends BlazeEntity implements IRangedAttackMob public void performRangedAttack( LivingEntity target, float damageMulti ) { if( !isSilent() ) level.levelEvent( null, 1018, blockPosition(), 0 ); - final float accelVariance = MathHelper.sqrt( distanceTo( target ) ) * getSpecialData().rangedAttackSpread / 28.0F; + final float accelVariance = MathHelper.sqrt( distanceTo( target ) ) * 0.5F * getSpecialData().rangedAttackSpread; final double dX = target.getX() - getX() + getRandom().nextGaussian() * accelVariance; final double dY = target.getY( 0.5 ) - getY( 0.5 ); final double dZ = target.getZ() - getZ() + getRandom().nextGaussian() * accelVariance; diff --git a/src/main/java/fathertoast/specialmobs/common/entity/cavespider/_SpecialCaveSpiderEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/cavespider/_SpecialCaveSpiderEntity.java index 82755a3..f7fc739 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/cavespider/_SpecialCaveSpiderEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/cavespider/_SpecialCaveSpiderEntity.java @@ -78,7 +78,7 @@ public class _SpecialCaveSpiderEntity extends CaveSpiderEntity implements ISpeci super.registerGoals(); getSpecialData().rangedAttackDamage = 1.0F; - getSpecialData().rangedAttackSpread = 18.0F; + getSpecialData().rangedAttackSpread = 1.3F; getSpecialData().rangedAttackCooldown = 40; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxRange = 10.0F; diff --git a/src/main/java/fathertoast/specialmobs/common/entity/silverfish/FishingSilverfishEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/silverfish/FishingSilverfishEntity.java index ee69c50..f91be8c 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/silverfish/FishingSilverfishEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/silverfish/FishingSilverfishEntity.java @@ -76,7 +76,7 @@ public class FishingSilverfishEntity extends _SpecialSilverfishEntity implements /** Override to change this entity's AI goals. */ @Override protected void registerVariantGoals() { - getSpecialData().rangedAttackSpread = 10.0F; + getSpecialData().rangedAttackSpread *= 0.7F; getSpecialData().rangedAttackCooldown = 32; getSpecialData().rangedAttackMaxCooldown = 48; getSpecialData().rangedAttackMaxRange = 10.0F; diff --git a/src/main/java/fathertoast/specialmobs/common/entity/silverfish/_SpecialSilverfishEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/silverfish/_SpecialSilverfishEntity.java index 2e61d19..3c49aa3 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/silverfish/_SpecialSilverfishEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/silverfish/_SpecialSilverfishEntity.java @@ -83,7 +83,6 @@ public class _SpecialSilverfishEntity extends SilverfishEntity implements ISpeci AIHelper.replaceHurtByTarget( this, new SpecialHurtByTargetGoal( this, SilverfishEntity.class ).setAlertOthers() ); getSpecialData().rangedAttackDamage = 1.0F; - getSpecialData().rangedAttackSpread = 14.0F; getSpecialData().rangedAttackCooldown = 40; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxRange = 10.0F; diff --git a/src/main/java/fathertoast/specialmobs/common/entity/skeleton/_SpecialSkeletonEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/skeleton/_SpecialSkeletonEntity.java index fb727f5..006b9e7 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/skeleton/_SpecialSkeletonEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/skeleton/_SpecialSkeletonEntity.java @@ -97,7 +97,6 @@ public class _SpecialSkeletonEntity extends AbstractSkeletonEntity implements IS super.registerGoals(); getSpecialData().rangedAttackDamage = 2.0F; - getSpecialData().rangedAttackSpread = 14.0F; getSpecialData().rangedAttackCooldown = 20; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxRange = 15.0F; @@ -152,7 +151,7 @@ public class _SpecialSkeletonEntity extends AbstractSkeletonEntity implements IS final double dZ = target.getZ() - getZ(); final double dH = MathHelper.sqrt( dX * dX + dZ * dZ ); arrow.shoot( dX, dY + dH * 0.2, dZ, 1.6F, - getSpecialData().rangedAttackSpread * (1.0F - 0.2858F * level.getDifficulty().getId()) ); + getSpecialData().rangedAttackSpread * (14 - 4 * level.getDifficulty().getId()) ); playSound( SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F) ); level.addFreshEntity( arrow ); diff --git a/src/main/java/fathertoast/specialmobs/common/entity/spider/_SpecialSpiderEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/spider/_SpecialSpiderEntity.java index 2efedc9..696096d 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/spider/_SpecialSpiderEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/spider/_SpecialSpiderEntity.java @@ -78,7 +78,7 @@ public class _SpecialSpiderEntity extends SpiderEntity implements ISpecialMob<_S super.registerGoals(); getSpecialData().rangedAttackDamage = 2.0F; - getSpecialData().rangedAttackSpread = 18.0F; + getSpecialData().rangedAttackSpread = 1.3F; getSpecialData().rangedAttackCooldown = 40; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxRange = 10.0F; diff --git a/src/main/java/fathertoast/specialmobs/common/entity/witherskeleton/_SpecialWitherSkeletonEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/witherskeleton/_SpecialWitherSkeletonEntity.java index b1331cf..8a52987 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/witherskeleton/_SpecialWitherSkeletonEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/witherskeleton/_SpecialWitherSkeletonEntity.java @@ -94,7 +94,6 @@ public class _SpecialWitherSkeletonEntity extends WitherSkeletonEntity implement super.registerGoals(); getSpecialData().rangedAttackDamage = 2.0F; - getSpecialData().rangedAttackSpread = 14.0F; getSpecialData().rangedAttackCooldown = 20; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxRange = 15.0F; @@ -149,7 +148,7 @@ public class _SpecialWitherSkeletonEntity extends WitherSkeletonEntity implement final double dZ = target.getZ() - getZ(); final double dH = MathHelper.sqrt( dX * dX + dZ * dZ ); arrow.shoot( dX, dY + dH * 0.2, dZ, 1.6F, - getSpecialData().rangedAttackSpread * (1.0F - 0.2858F * level.getDifficulty().getId()) ); + getSpecialData().rangedAttackSpread * (14 - 4 * level.getDifficulty().getId()) ); playSound( SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F) ); level.addFreshEntity( arrow ); diff --git a/src/main/java/fathertoast/specialmobs/common/entity/zombie/FishingZombieEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/zombie/FishingZombieEntity.java index 645c548..0093e27 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/zombie/FishingZombieEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/zombie/FishingZombieEntity.java @@ -84,7 +84,7 @@ public class FishingZombieEntity extends _SpecialZombieEntity implements IAngler /** Override to change this entity's AI goals. */ @Override protected void registerVariantGoals() { - getSpecialData().rangedAttackSpread = 10.0F; + getSpecialData().rangedAttackSpread *= 0.7F; getSpecialData().rangedAttackCooldown = 32; getSpecialData().rangedAttackMaxCooldown = 48; getSpecialData().rangedAttackMaxRange = 10.0F; diff --git a/src/main/java/fathertoast/specialmobs/common/entity/zombie/_SpecialZombieEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/zombie/_SpecialZombieEntity.java index 77c94a3..d699396 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/zombie/_SpecialZombieEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/zombie/_SpecialZombieEntity.java @@ -97,7 +97,7 @@ public class _SpecialZombieEntity extends ZombieEntity implements IRangedAttackM .setAlertOthers( ZombifiedPiglinEntity.class ) ); getSpecialData().rangedAttackDamage = 2.0F; - getSpecialData().rangedAttackSpread = 20.0F; + getSpecialData().rangedAttackSpread = 1.4F; getSpecialData().rangedWalkSpeed = 0.8F; getSpecialData().rangedAttackCooldown = 30; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; @@ -153,7 +153,7 @@ public class _SpecialZombieEntity extends ZombieEntity implements IRangedAttackM final double dZ = target.getZ() - getZ(); final double dH = MathHelper.sqrt( dX * dX + dZ * dZ ); arrow.shoot( dX, dY + dH * 0.2, dZ, 1.6F, - getSpecialData().rangedAttackSpread * (1.0F - 0.2858F * level.getDifficulty().getId()) ); + getSpecialData().rangedAttackSpread * (14 - 4 * level.getDifficulty().getId()) ); playSound( SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F) ); level.addFreshEntity( arrow ); diff --git a/src/main/java/fathertoast/specialmobs/common/entity/zombifiedpiglin/FishingZombifiedPiglinEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/zombifiedpiglin/FishingZombifiedPiglinEntity.java index 4c7a5b0..3f57f28 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/zombifiedpiglin/FishingZombifiedPiglinEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/zombifiedpiglin/FishingZombifiedPiglinEntity.java @@ -84,7 +84,7 @@ public class FishingZombifiedPiglinEntity extends _SpecialZombifiedPiglinEntity /** Override to change this entity's AI goals. */ @Override protected void registerVariantGoals() { - getSpecialData().rangedAttackSpread = 10.0F; + getSpecialData().rangedAttackSpread *= 0.7F; getSpecialData().rangedAttackCooldown = 32; getSpecialData().rangedAttackMaxCooldown = 48; getSpecialData().rangedAttackMaxRange = 10.0F; diff --git a/src/main/java/fathertoast/specialmobs/common/entity/zombifiedpiglin/_SpecialZombifiedPiglinEntity.java b/src/main/java/fathertoast/specialmobs/common/entity/zombifiedpiglin/_SpecialZombifiedPiglinEntity.java index cf25af5..d71a7d4 100644 --- a/src/main/java/fathertoast/specialmobs/common/entity/zombifiedpiglin/_SpecialZombifiedPiglinEntity.java +++ b/src/main/java/fathertoast/specialmobs/common/entity/zombifiedpiglin/_SpecialZombifiedPiglinEntity.java @@ -95,7 +95,6 @@ public class _SpecialZombifiedPiglinEntity extends ZombifiedPiglinEntity impleme AIHelper.replaceHurtByTarget( this, new SpecialHurtByTargetGoal( this, ZombifiedPiglinEntity.class ).setAlertOthers() ); getSpecialData().rangedAttackDamage = 2.0F; - getSpecialData().rangedAttackSpread = 14.0F; getSpecialData().rangedWalkSpeed = 0.8F; getSpecialData().rangedAttackCooldown = 20; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; @@ -157,7 +156,7 @@ public class _SpecialZombifiedPiglinEntity extends ZombifiedPiglinEntity impleme final double dZ = target.getZ() - getZ(); final double dH = MathHelper.sqrt( dX * dX + dZ * dZ ); arrow.shoot( dX, dY + dH * 0.2, dZ, 1.6F, - getSpecialData().rangedAttackSpread * (1.0F - 0.2858F * level.getDifficulty().getId()) ); + getSpecialData().rangedAttackSpread * (14 - 4 * level.getDifficulty().getId()) ); playSound( SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F) ); level.addFreshEntity( arrow );