Merge branch '1.16.5' of https://github.com/FatherToast/SpecialMobs into 1.16.5

This commit is contained in:
Sarinsa 2022-07-01 02:52:16 +02:00
commit 1ced1adef7
16 changed files with 162 additions and 54 deletions

View file

@ -78,8 +78,8 @@ public class SpecialMobs {
* o ability to equip held items * o ability to equip held items
* o ghasts * o ghasts
* o melee attack AI * o melee attack AI
* o blazes * - blazes
* o melee attack AI * - melee attack AI
* ? piglins * ? piglins
* ? hoglins * ? hoglins
* ? zoglins * ? zoglins
@ -123,9 +123,9 @@ public class SpecialMobs {
MobFamily.initBestiary(); MobFamily.initBestiary();
} }
public void sendIMCMessages(InterModEnqueueEvent event) { public void sendIMCMessages( InterModEnqueueEvent event ) {
if (ModList.get().isLoaded("theoneprobe")) { if( ModList.get().isLoaded( "theoneprobe" ) ) {
InterModComms.sendTo("theoneprobe", "getTheOneProbe", SMTheOneProbe::new); InterModComms.sendTo( "theoneprobe", "getTheOneProbe", SMTheOneProbe::new );
} }
} }

View file

@ -64,7 +64,7 @@ public class SpecialMobData<T extends LivingEntity & ISpecialMob<T>> {
/** The damage the entity uses for its ranged attacks, when applicable. */ /** The damage the entity uses for its ranged attacks, when applicable. */
public float rangedAttackDamage; public float rangedAttackDamage;
/** The spread (inaccuracy) of the entity's ranged attacks. */ /** 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. */ /** The movement speed multiplier the entity uses during its ranged attack ai. Requires an AI reload to take effect. */
public float rangedWalkSpeed = 1.0F; 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. */ /** The delay (in ticks) before a new ranged attack can begin after firing. Requires an AI reload to take effect. */

View file

@ -6,6 +6,7 @@ import net.minecraft.block.Blocks;
import net.minecraft.entity.MobEntity; import net.minecraft.entity.MobEntity;
import net.minecraft.entity.ai.goal.Goal; import net.minecraft.entity.ai.goal.Goal;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.properties.AttachFace;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -80,18 +81,20 @@ public class NinjaGoal<T extends MobEntity & INinja> extends Goal {
final Random random = entity.getRandom(); final Random random = entity.getRandom();
switch( random.nextInt( 200 ) ) { switch( random.nextInt( 200 ) ) {
case 0: return Blocks.CHEST.defaultBlockState().setValue( BlockStateProperties.HORIZONTAL_FACING, case 0: return Blocks.TNT.defaultBlockState();
Direction.Plane.HORIZONTAL.getRandomDirection( random ) );
case 1: return Blocks.OAK_LOG.defaultBlockState(); case 1: return Blocks.OAK_LOG.defaultBlockState();
case 2: return Blocks.SPONGE.defaultBlockState(); case 2: return Blocks.SPONGE.defaultBlockState();
case 3: return Blocks.DEAD_BUSH.defaultBlockState(); case 3: return Blocks.DEAD_BUSH.defaultBlockState();
case 4: return Blocks.OAK_LEAVES.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 6: return Blocks.CAKE.defaultBlockState();
case 7: return Blocks.CRAFTING_TABLE.defaultBlockState(); case 7: return Blocks.CRAFTING_TABLE.defaultBlockState();
case 8: return Blocks.FURNACE.defaultBlockState(); case 8: return randomRotation( Blocks.FURNACE.defaultBlockState(), random );
case 9: return Blocks.ANVIL.defaultBlockState(); case 9: return randomRotation( Blocks.ANVIL.defaultBlockState(), random );
case 10: return Blocks.BREWING_STAND.defaultBlockState(); 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(); final BlockPos posUnderFeet = entity.blockPosition().below();
@ -102,8 +105,8 @@ public class NinjaGoal<T extends MobEntity & INinja> extends Goal {
if( blockUnderFeet.is( Blocks.STONE ) || blockUnderFeet.is( Blocks.STONE_BRICKS ) ) { if( blockUnderFeet.is( Blocks.STONE ) || blockUnderFeet.is( Blocks.STONE_BRICKS ) ) {
// Cave theme // Cave theme
switch( random.nextInt( 30 ) ) { switch( random.nextInt( 30 ) ) {
case 0: return blockUnderFeet; case 0: return Blocks.BROWN_MUSHROOM.defaultBlockState();
case 1: return Blocks.MOSSY_COBBLESTONE.defaultBlockState(); case 1: return Blocks.RED_MUSHROOM.defaultBlockState();
case 2: return Blocks.CLAY.defaultBlockState(); case 2: return Blocks.CLAY.defaultBlockState();
case 3: return Blocks.GRAVEL.defaultBlockState(); case 3: return Blocks.GRAVEL.defaultBlockState();
case 4: return Blocks.COAL_ORE.defaultBlockState(); case 4: return Blocks.COAL_ORE.defaultBlockState();
@ -113,11 +116,12 @@ public class NinjaGoal<T extends MobEntity & INinja> extends Goal {
case 8: return Blocks.REDSTONE_ORE.defaultBlockState(); case 8: return Blocks.REDSTONE_ORE.defaultBlockState();
case 9: return Blocks.DIAMOND_ORE.defaultBlockState(); case 9: return Blocks.DIAMOND_ORE.defaultBlockState();
case 10: return Blocks.EMERALD_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 ) ) { else if( blockUnderFeet.is( Blocks.GRASS ) || blockUnderFeet.is( Blocks.DIRT ) || blockUnderFeet.is( Blocks.PODZOL ) ) {
// Field theme // Field theme
switch( random.nextInt( 15 ) ) { switch( random.nextInt( 20 ) ) {
case 0: return blockUnderFeet; case 0: return blockUnderFeet;
case 1: return Blocks.OAK_LOG.defaultBlockState(); case 1: return Blocks.OAK_LOG.defaultBlockState();
case 2: return Blocks.OAK_LEAVES.defaultBlockState(); case 2: return Blocks.OAK_LEAVES.defaultBlockState();
@ -125,16 +129,19 @@ public class NinjaGoal<T extends MobEntity & INinja> extends Goal {
case 4: return Blocks.MELON.defaultBlockState(); case 4: return Blocks.MELON.defaultBlockState();
case 5: return Blocks.TALL_GRASS.defaultBlockState(); case 5: return Blocks.TALL_GRASS.defaultBlockState();
case 6: return Blocks.FERN.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 ) || else if( blockUnderFeet.is( Blocks.SAND ) || blockUnderFeet.is( Blocks.RED_SAND ) ||
blockUnderFeet.is( Blocks.SANDSTONE ) || blockUnderFeet.is( Blocks.RED_SANDSTONE ) ) { blockUnderFeet.is( Blocks.SANDSTONE ) || blockUnderFeet.is( Blocks.RED_SANDSTONE ) ) {
// Desert theme // Desert theme
switch( random.nextInt( 5 ) ) { switch( random.nextInt( 5 ) ) {
case 0: return blockUnderFeet; case 0: return Blocks.CACTUS.defaultBlockState();
case 1: return Blocks.CACTUS.defaultBlockState(); case 1: return Blocks.DEAD_BUSH.defaultBlockState();
case 2: return Blocks.DEAD_BUSH.defaultBlockState(); case 2: return randomPottedDesertPlant( random );
} }
} }
else if( blockUnderFeet.is( Blocks.NETHERRACK ) || blockUnderFeet.is( Blocks.NETHER_BRICKS ) || else if( blockUnderFeet.is( Blocks.NETHERRACK ) || blockUnderFeet.is( Blocks.NETHER_BRICKS ) ||
@ -144,25 +151,27 @@ public class NinjaGoal<T extends MobEntity & INinja> extends Goal {
switch( random.nextInt( 25 ) ) { switch( random.nextInt( 25 ) ) {
case 0: return blockUnderFeet; case 0: return blockUnderFeet;
case 1: return Blocks.GRAVEL.defaultBlockState(); case 1: return Blocks.GRAVEL.defaultBlockState();
case 2: return Blocks.SOUL_SAND.defaultBlockState(); case 2: return Blocks.NETHER_QUARTZ_ORE.defaultBlockState();
case 3: return Blocks.GLOWSTONE.defaultBlockState(); case 3: return Blocks.NETHER_GOLD_ORE.defaultBlockState();
case 4: return Blocks.NETHER_QUARTZ_ORE.defaultBlockState(); case 4: return Blocks.ANCIENT_DEBRIS.defaultBlockState();
case 5: return Blocks.NETHER_GOLD_ORE.defaultBlockState(); case 5: return Blocks.BROWN_MUSHROOM.defaultBlockState();
case 6: return Blocks.ANCIENT_DEBRIS.defaultBlockState(); case 6: return Blocks.RED_MUSHROOM.defaultBlockState();
case 7: return Blocks.BROWN_MUSHROOM.defaultBlockState(); case 7: return Blocks.CRIMSON_STEM.defaultBlockState();
case 8: return Blocks.RED_MUSHROOM.defaultBlockState(); case 8: return Blocks.WARPED_STEM.defaultBlockState();
case 9: return Blocks.CRIMSON_STEM.defaultBlockState(); case 9: return Blocks.CRIMSON_ROOTS.defaultBlockState();
case 10: return Blocks.WARPED_STEM.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 ) || else if( blockUnderFeet.is( Blocks.END_STONE ) || blockUnderFeet.is( Blocks.END_STONE_BRICKS ) ||
blockUnderFeet.is( Blocks.PURPUR_BLOCK ) ) { blockUnderFeet.is( Blocks.PURPUR_BLOCK ) ) {
// End theme // End theme
switch( random.nextInt( 10 ) ) { switch( random.nextInt( 10 ) ) {
case 0: return blockUnderFeet; case 0: return Blocks.CHORUS_PLANT.defaultBlockState();
case 1: return Blocks.CHORUS_PLANT.defaultBlockState(); case 1: return Blocks.PURPUR_PILLAR.defaultBlockState();
case 2: return Blocks.PURPUR_PILLAR.defaultBlockState(); case 2: return randomPottedEndThing( random );
case 3: return Blocks.END_ROD.defaultBlockState();
} }
} }
} }
@ -182,4 +191,92 @@ public class NinjaGoal<T extends MobEntity & INinja> extends Goal {
// Hide as a log if none of the other options are chosen // Hide as a log if none of the other options are chosen
return Blocks.OAK_LOG.defaultBlockState(); 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();
}
}
} }

View file

@ -11,9 +11,11 @@ import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.attributes.AttributeModifierMap; import net.minecraft.entity.ai.attributes.AttributeModifierMap;
import net.minecraft.entity.ai.attributes.Attributes; import net.minecraft.entity.ai.attributes.Attributes;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.FireballEntity; import net.minecraft.entity.projectile.FireballEntity;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -73,7 +75,7 @@ public class HellfireBlazeEntity extends _SpecialBlazeEntity {
/** Override to change this entity's AI goals. */ /** Override to change this entity's AI goals. */
@Override @Override
protected void registerVariantGoals() { protected void registerVariantGoals() {
getSpecialData().rangedAttackSpread = 0.0F; getSpecialData().rangedAttackSpread *= 0.05F;
setRangedAI( 1, 0, 60, 100, 40.0F ); setRangedAI( 1, 0, 60, 100, 40.0F );
} }
@ -82,7 +84,7 @@ public class HellfireBlazeEntity extends _SpecialBlazeEntity {
public void performRangedAttack( LivingEntity target, float damageMulti ) { public void performRangedAttack( LivingEntity target, float damageMulti ) {
if( !isSilent() ) level.levelEvent( null, 1018, blockPosition(), 0 ); 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 dX = target.getX() - getX() + getRandom().nextGaussian() * accelVariance;
final double dY = target.getY( 0.5 ) - getY( 0.5 ); final double dY = target.getY( 0.5 ) - getY( 0.5 );
final double dZ = target.getZ() - getZ() + getRandom().nextGaussian() * accelVariance; final double dZ = target.getZ() - getZ() + getRandom().nextGaussian() * accelVariance;
@ -93,6 +95,18 @@ public class HellfireBlazeEntity extends _SpecialBlazeEntity {
level.addFreshEntity( fireball ); 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 to save data to this entity's NBT data. */
@Override @Override
public void addVariantSaveData( CompoundNBT saveTag ) { public void addVariantSaveData( CompoundNBT saveTag ) {

View file

@ -86,6 +86,7 @@ public class _SpecialBlazeEntity extends BlazeEntity implements IRangedAttackMob
goalSelector.addGoal( 4, new SpecialBlazeAttackGoal( this ) ); goalSelector.addGoal( 4, new SpecialBlazeAttackGoal( this ) );
AIHelper.replaceHurtByTarget( this, new SpecialHurtByTargetGoal( this, BlazeEntity.class ).setAlertOthers() ); AIHelper.replaceHurtByTarget( this, new SpecialHurtByTargetGoal( this, BlazeEntity.class ).setAlertOthers() );
getSpecialData().rangedAttackDamage = 2.0F;
setRangedAI( 3, 6, 60, 100, 48.0F ); setRangedAI( 3, 6, 60, 100, 48.0F );
registerVariantGoals(); registerVariantGoals();
} }
@ -147,7 +148,7 @@ public class _SpecialBlazeEntity extends BlazeEntity implements IRangedAttackMob
public void performRangedAttack( LivingEntity target, float damageMulti ) { public void performRangedAttack( LivingEntity target, float damageMulti ) {
if( !isSilent() ) level.levelEvent( null, 1018, blockPosition(), 0 ); 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 dX = target.getX() - getX() + getRandom().nextGaussian() * accelVariance;
final double dY = target.getY( 0.5 ) - getY( 0.5 ); final double dY = target.getY( 0.5 ) - getY( 0.5 );
final double dZ = target.getZ() - getZ() + getRandom().nextGaussian() * accelVariance; final double dZ = target.getZ() - getZ() + getRandom().nextGaussian() * accelVariance;

View file

@ -78,7 +78,7 @@ public class _SpecialCaveSpiderEntity extends CaveSpiderEntity implements ISpeci
super.registerGoals(); super.registerGoals();
getSpecialData().rangedAttackDamage = 1.0F; getSpecialData().rangedAttackDamage = 1.0F;
getSpecialData().rangedAttackSpread = 18.0F; getSpecialData().rangedAttackSpread = 1.3F;
getSpecialData().rangedAttackCooldown = 40; getSpecialData().rangedAttackCooldown = 40;
getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown;
getSpecialData().rangedAttackMaxRange = 10.0F; getSpecialData().rangedAttackMaxRange = 10.0F;

View file

@ -76,7 +76,7 @@ public class FishingSilverfishEntity extends _SpecialSilverfishEntity implements
/** Override to change this entity's AI goals. */ /** Override to change this entity's AI goals. */
@Override @Override
protected void registerVariantGoals() { protected void registerVariantGoals() {
getSpecialData().rangedAttackSpread = 10.0F; getSpecialData().rangedAttackSpread *= 0.7F;
getSpecialData().rangedAttackCooldown = 32; getSpecialData().rangedAttackCooldown = 32;
getSpecialData().rangedAttackMaxCooldown = 48; getSpecialData().rangedAttackMaxCooldown = 48;
getSpecialData().rangedAttackMaxRange = 10.0F; getSpecialData().rangedAttackMaxRange = 10.0F;

View file

@ -83,7 +83,6 @@ public class _SpecialSilverfishEntity extends SilverfishEntity implements ISpeci
AIHelper.replaceHurtByTarget( this, new SpecialHurtByTargetGoal( this, SilverfishEntity.class ).setAlertOthers() ); AIHelper.replaceHurtByTarget( this, new SpecialHurtByTargetGoal( this, SilverfishEntity.class ).setAlertOthers() );
getSpecialData().rangedAttackDamage = 1.0F; getSpecialData().rangedAttackDamage = 1.0F;
getSpecialData().rangedAttackSpread = 14.0F;
getSpecialData().rangedAttackCooldown = 40; getSpecialData().rangedAttackCooldown = 40;
getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown;
getSpecialData().rangedAttackMaxRange = 10.0F; getSpecialData().rangedAttackMaxRange = 10.0F;

View file

@ -143,14 +143,14 @@ public class NinjaSkeletonEntity extends _SpecialSkeletonEntity implements INinj
} }
@Override @Override
protected void playStepSound(BlockPos pos, BlockState state) { protected void playStepSound( BlockPos pos, BlockState state ) {
// Nope // Nope
} }
/** @return The sound this entity makes idly. */ /** @return The sound this entity makes idly. */
@Override @Override
protected SoundEvent getAmbientSound() { 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. */ /** Moves this entity to a new position and rotation. */

View file

@ -97,7 +97,6 @@ public class _SpecialSkeletonEntity extends AbstractSkeletonEntity implements IS
super.registerGoals(); super.registerGoals();
getSpecialData().rangedAttackDamage = 2.0F; getSpecialData().rangedAttackDamage = 2.0F;
getSpecialData().rangedAttackSpread = 14.0F;
getSpecialData().rangedAttackCooldown = 20; getSpecialData().rangedAttackCooldown = 20;
getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown;
getSpecialData().rangedAttackMaxRange = 15.0F; getSpecialData().rangedAttackMaxRange = 15.0F;
@ -152,7 +151,7 @@ public class _SpecialSkeletonEntity extends AbstractSkeletonEntity implements IS
final double dZ = target.getZ() - getZ(); final double dZ = target.getZ() - getZ();
final double dH = MathHelper.sqrt( dX * dX + dZ * dZ ); final double dH = MathHelper.sqrt( dX * dX + dZ * dZ );
arrow.shoot( dX, dY + dH * 0.2, dZ, 1.6F, 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) ); playSound( SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F) );
level.addFreshEntity( arrow ); level.addFreshEntity( arrow );

View file

@ -78,7 +78,7 @@ public class _SpecialSpiderEntity extends SpiderEntity implements ISpecialMob<_S
super.registerGoals(); super.registerGoals();
getSpecialData().rangedAttackDamage = 2.0F; getSpecialData().rangedAttackDamage = 2.0F;
getSpecialData().rangedAttackSpread = 18.0F; getSpecialData().rangedAttackSpread = 1.3F;
getSpecialData().rangedAttackCooldown = 40; getSpecialData().rangedAttackCooldown = 40;
getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown;
getSpecialData().rangedAttackMaxRange = 10.0F; getSpecialData().rangedAttackMaxRange = 10.0F;

View file

@ -94,7 +94,6 @@ public class _SpecialWitherSkeletonEntity extends WitherSkeletonEntity implement
super.registerGoals(); super.registerGoals();
getSpecialData().rangedAttackDamage = 2.0F; getSpecialData().rangedAttackDamage = 2.0F;
getSpecialData().rangedAttackSpread = 14.0F;
getSpecialData().rangedAttackCooldown = 20; getSpecialData().rangedAttackCooldown = 20;
getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown;
getSpecialData().rangedAttackMaxRange = 15.0F; getSpecialData().rangedAttackMaxRange = 15.0F;
@ -149,7 +148,7 @@ public class _SpecialWitherSkeletonEntity extends WitherSkeletonEntity implement
final double dZ = target.getZ() - getZ(); final double dZ = target.getZ() - getZ();
final double dH = MathHelper.sqrt( dX * dX + dZ * dZ ); final double dH = MathHelper.sqrt( dX * dX + dZ * dZ );
arrow.shoot( dX, dY + dH * 0.2, dZ, 1.6F, 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) ); playSound( SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F) );
level.addFreshEntity( arrow ); level.addFreshEntity( arrow );

View file

@ -84,7 +84,7 @@ public class FishingZombieEntity extends _SpecialZombieEntity implements IAngler
/** Override to change this entity's AI goals. */ /** Override to change this entity's AI goals. */
@Override @Override
protected void registerVariantGoals() { protected void registerVariantGoals() {
getSpecialData().rangedAttackSpread = 10.0F; getSpecialData().rangedAttackSpread *= 0.7F;
getSpecialData().rangedAttackCooldown = 32; getSpecialData().rangedAttackCooldown = 32;
getSpecialData().rangedAttackMaxCooldown = 48; getSpecialData().rangedAttackMaxCooldown = 48;
getSpecialData().rangedAttackMaxRange = 10.0F; getSpecialData().rangedAttackMaxRange = 10.0F;

View file

@ -97,7 +97,7 @@ public class _SpecialZombieEntity extends ZombieEntity implements IRangedAttackM
.setAlertOthers( ZombifiedPiglinEntity.class ) ); .setAlertOthers( ZombifiedPiglinEntity.class ) );
getSpecialData().rangedAttackDamage = 2.0F; getSpecialData().rangedAttackDamage = 2.0F;
getSpecialData().rangedAttackSpread = 20.0F; getSpecialData().rangedAttackSpread = 1.4F;
getSpecialData().rangedWalkSpeed = 0.8F; getSpecialData().rangedWalkSpeed = 0.8F;
getSpecialData().rangedAttackCooldown = 30; getSpecialData().rangedAttackCooldown = 30;
getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown;
@ -153,7 +153,7 @@ public class _SpecialZombieEntity extends ZombieEntity implements IRangedAttackM
final double dZ = target.getZ() - getZ(); final double dZ = target.getZ() - getZ();
final double dH = MathHelper.sqrt( dX * dX + dZ * dZ ); final double dH = MathHelper.sqrt( dX * dX + dZ * dZ );
arrow.shoot( dX, dY + dH * 0.2, dZ, 1.6F, 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) ); playSound( SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F) );
level.addFreshEntity( arrow ); level.addFreshEntity( arrow );

View file

@ -84,7 +84,7 @@ public class FishingZombifiedPiglinEntity extends _SpecialZombifiedPiglinEntity
/** Override to change this entity's AI goals. */ /** Override to change this entity's AI goals. */
@Override @Override
protected void registerVariantGoals() { protected void registerVariantGoals() {
getSpecialData().rangedAttackSpread = 10.0F; getSpecialData().rangedAttackSpread *= 0.7F;
getSpecialData().rangedAttackCooldown = 32; getSpecialData().rangedAttackCooldown = 32;
getSpecialData().rangedAttackMaxCooldown = 48; getSpecialData().rangedAttackMaxCooldown = 48;
getSpecialData().rangedAttackMaxRange = 10.0F; getSpecialData().rangedAttackMaxRange = 10.0F;

View file

@ -95,7 +95,6 @@ public class _SpecialZombifiedPiglinEntity extends ZombifiedPiglinEntity impleme
AIHelper.replaceHurtByTarget( this, new SpecialHurtByTargetGoal( this, ZombifiedPiglinEntity.class ).setAlertOthers() ); AIHelper.replaceHurtByTarget( this, new SpecialHurtByTargetGoal( this, ZombifiedPiglinEntity.class ).setAlertOthers() );
getSpecialData().rangedAttackDamage = 2.0F; getSpecialData().rangedAttackDamage = 2.0F;
getSpecialData().rangedAttackSpread = 14.0F;
getSpecialData().rangedWalkSpeed = 0.8F; getSpecialData().rangedWalkSpeed = 0.8F;
getSpecialData().rangedAttackCooldown = 20; getSpecialData().rangedAttackCooldown = 20;
getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown; getSpecialData().rangedAttackMaxCooldown = getSpecialData().rangedAttackCooldown;
@ -157,7 +156,7 @@ public class _SpecialZombifiedPiglinEntity extends ZombifiedPiglinEntity impleme
final double dZ = target.getZ() - getZ(); final double dZ = target.getZ() - getZ();
final double dH = MathHelper.sqrt( dX * dX + dZ * dZ ); final double dH = MathHelper.sqrt( dX * dX + dZ * dZ );
arrow.shoot( dX, dY + dH * 0.2, dZ, 1.6F, 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) ); playSound( SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F) );
level.addFreshEntity( arrow ); level.addFreshEntity( arrow );