cave bois

This commit is contained in:
FatherToast 2022-07-24 00:12:12 -05:00
parent fca7272074
commit 2a221eaddc
16 changed files with 318 additions and 3 deletions

View file

@ -81,8 +81,8 @@ public class MobFamily<T extends LivingEntity, V extends FamilyConfig> {
);
public static final MobFamily<CaveSpiderEntity, FamilyConfig> CAVE_SPIDER = new MobFamily<>( FamilyConfig::newMoreSpecial,
"CaveSpider", "cave spiders", 0x0C424E, new EntityType[] { EntityType.CAVE_SPIDER },
"Baby", /*"Desert", "Fire",*/ "Flying", "Mother", /*"Water",*/ "Web", "Witch"
);//TODO desert, fire, water
"Baby", "Desert", "Fire", "Flying", "Mother", "Pale", "Water", "Web", "Witch"
);
public static final MobFamily<SilverfishEntity, SilverfishFamilyConfig> SILVERFISH = new MobFamily<>( SilverfishFamilyConfig::new,
"Silverfish", "silverfish", 0x6E6E6E, new EntityType[] { EntityType.SILVERFISH },

View file

@ -0,0 +1,77 @@
package fathertoast.specialmobs.common.entity.cavespider;
import fathertoast.specialmobs.common.bestiary.BestiaryInfo;
import fathertoast.specialmobs.common.bestiary.MobFamily;
import fathertoast.specialmobs.common.bestiary.SpecialMob;
import fathertoast.specialmobs.common.config.Config;
import fathertoast.specialmobs.common.entity.MobHelper;
import fathertoast.specialmobs.common.util.References;
import fathertoast.specialmobs.datagen.loot.LootTableBuilder;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.attributes.Attributes;
import net.minecraft.item.Items;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.world.World;
@SpecialMob
public class DesertCaveSpiderEntity extends _SpecialCaveSpiderEntity {
//--------------- Static Special Mob Hooks ----------------
@SpecialMob.SpeciesReference
public static MobFamily.Species<DesertCaveSpiderEntity> SPECIES;
@SpecialMob.BestiaryInfoSupplier
public static void getBestiaryInfo( BestiaryInfo.Builder bestiaryInfo ) {
bestiaryInfo.color( 0xE6DDAC ).theme( BestiaryInfo.Theme.DESERT )
.uniqueTextureWithEyes()
.size( 0.6F, 0.7F, 0.5F )
.addExperience( 2 )
.addToAttribute( Attributes.MAX_HEALTH, 4.0 );
}
@SpecialMob.LanguageProvider
public static String[] getTranslations( String langKey ) {
return References.translations( langKey, "Desert Cave Spider",
"", "", "", "", "", "" );//TODO
}
@SpecialMob.LootTableProvider
public static void buildLootTable( LootTableBuilder loot ) {
addBaseLoot( loot );
loot.addCommonDrop( "common", Items.LEATHER );
}
@SpecialMob.Factory
public static EntityType.IFactory<DesertCaveSpiderEntity> getVariantFactory() { return DesertCaveSpiderEntity::new; }
/** @return This entity's mob species. */
@SpecialMob.SpeciesSupplier
@Override
public MobFamily.Species<? extends DesertCaveSpiderEntity> getSpecies() { return SPECIES; }
//--------------- Variant-Specific Implementations ----------------
public DesertCaveSpiderEntity( EntityType<? extends _SpecialCaveSpiderEntity> entityType, World world ) { super( entityType, world ); }
/** Override to apply effects when this entity hits a target with a melee attack. */
@Override
protected void onVariantAttack( Entity target ) {
if( target instanceof LivingEntity ) {
final LivingEntity livingTarget = (LivingEntity) target;
final int duration = MobHelper.getDebuffDuration( level.getDifficulty() );
if( Config.MAIN.GENERAL.enableNausea.get() ) {
livingTarget.addEffect( new EffectInstance( Effects.CONFUSION, duration, 0 ) );
}
livingTarget.addEffect( new EffectInstance( Effects.BLINDNESS, duration, 0 ) );
livingTarget.addEffect( new EffectInstance( Effects.MOVEMENT_SLOWDOWN, duration, 2 ) );
livingTarget.addEffect( new EffectInstance( Effects.DAMAGE_RESISTANCE, duration, -3 ) ); // 40% inc damage taken
}
}
}

View file

@ -0,0 +1,68 @@
package fathertoast.specialmobs.common.entity.cavespider;
import fathertoast.specialmobs.common.bestiary.BestiaryInfo;
import fathertoast.specialmobs.common.bestiary.MobFamily;
import fathertoast.specialmobs.common.bestiary.SpecialMob;
import fathertoast.specialmobs.common.util.References;
import fathertoast.specialmobs.datagen.loot.LootTableBuilder;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.Items;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@SpecialMob
public class FireCaveSpiderEntity extends _SpecialCaveSpiderEntity {
//--------------- Static Special Mob Hooks ----------------
@SpecialMob.SpeciesReference
public static MobFamily.Species<FireCaveSpiderEntity> SPECIES;
@SpecialMob.BestiaryInfoSupplier
public static void getBestiaryInfo( BestiaryInfo.Builder bestiaryInfo ) {
bestiaryInfo.color( 0xDFA21B ).weight( BestiaryInfo.DefaultWeight.LOW ).theme( BestiaryInfo.Theme.FIRE )
.uniqueTextureWithEyes()
.addExperience( 2 ).fireImmune().waterSensitive();
}
@SpecialMob.LanguageProvider
public static String[] getTranslations( String langKey ) {
return References.translations( langKey, "Cave Firefang",
"", "", "", "", "", "" );//TODO
}
@SpecialMob.LootTableProvider
public static void buildLootTable( LootTableBuilder loot ) {
addBaseLoot( loot );
loot.addCommonDrop( "common", Items.FIRE_CHARGE );
loot.addUncommonDrop( "uncommon", Items.COAL );
}
@SpecialMob.Factory
public static EntityType.IFactory<FireCaveSpiderEntity> getVariantFactory() { return FireCaveSpiderEntity::new; }
/** @return This entity's mob species. */
@SpecialMob.SpeciesSupplier
@Override
public MobFamily.Species<? extends FireCaveSpiderEntity> getSpecies() { return SPECIES; }
//--------------- Variant-Specific Implementations ----------------
public FireCaveSpiderEntity( EntityType<? extends _SpecialCaveSpiderEntity> entityType, World world ) { super( entityType, world ); }
/** Override to apply effects when this entity hits a target with a melee attack. */
@Override
protected void onVariantAttack( Entity target ) {
if( !level.isClientSide() && target instanceof LivingEntity ) {
final BlockPos pos = target.blockPosition();
if( level.getBlockState( pos ).getMaterial().isReplaceable() ) {
level.setBlock( pos, Blocks.FIRE.defaultBlockState(), References.SetBlockFlags.DEFAULTS );
}
}
target.setSecondsOnFire( 5 );
}
}

View file

@ -0,0 +1,70 @@
package fathertoast.specialmobs.common.entity.cavespider;
import fathertoast.specialmobs.common.bestiary.BestiaryInfo;
import fathertoast.specialmobs.common.bestiary.MobFamily;
import fathertoast.specialmobs.common.bestiary.SpecialMob;
import fathertoast.specialmobs.common.entity.MobHelper;
import fathertoast.specialmobs.common.util.References;
import fathertoast.specialmobs.datagen.loot.LootTableBuilder;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.attributes.Attributes;
import net.minecraft.item.Items;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.world.World;
@SpecialMob
public class PaleCaveSpiderEntity extends _SpecialCaveSpiderEntity {
//--------------- Static Special Mob Hooks ----------------
@SpecialMob.SpeciesReference
public static MobFamily.Species<PaleCaveSpiderEntity> SPECIES;
@SpecialMob.BestiaryInfoSupplier
public static void getBestiaryInfo( BestiaryInfo.Builder bestiaryInfo ) {
bestiaryInfo.color( 0xDED4C6 ).theme( BestiaryInfo.Theme.ICE )
.uniqueTextureWithEyes()
.addExperience( 1 )
.addToAttribute( Attributes.ARMOR, 15.0 );
}
@SpecialMob.LanguageProvider
public static String[] getTranslations( String langKey ) {
return References.translations( langKey, "Pale Cave Spider",
"", "", "", "", "", "" );//TODO
}
@SpecialMob.LootTableProvider
public static void buildLootTable( LootTableBuilder loot ) {
addBaseLoot( loot );
loot.addSemicommonDrop( "semicommon", Items.FERMENTED_SPIDER_EYE );
}
@SpecialMob.Factory
public static EntityType.IFactory<PaleCaveSpiderEntity> getVariantFactory() { return PaleCaveSpiderEntity::new; }
/** @return This entity's mob species. */
@SpecialMob.SpeciesSupplier
@Override
public MobFamily.Species<? extends PaleCaveSpiderEntity> getSpecies() { return SPECIES; }
//--------------- Variant-Specific Implementations ----------------
public PaleCaveSpiderEntity( EntityType<? extends _SpecialCaveSpiderEntity> entityType, World world ) { super( entityType, world ); }
/** Override to apply effects when this entity hits a target with a melee attack. */
@Override
protected void onVariantAttack( Entity target ) {
if( target instanceof LivingEntity ) {
final LivingEntity livingTarget = (LivingEntity) target;
final int duration = MobHelper.getDebuffDuration( level.getDifficulty() );
livingTarget.addEffect( new EffectInstance( Effects.WEAKNESS, duration, 0 ) );
livingTarget.addEffect( new EffectInstance( Effects.DIG_SLOWDOWN, duration, 1 ) );
}
}
}

View file

@ -0,0 +1,100 @@
package fathertoast.specialmobs.common.entity.cavespider;
import fathertoast.specialmobs.common.bestiary.BestiaryInfo;
import fathertoast.specialmobs.common.bestiary.MobFamily;
import fathertoast.specialmobs.common.bestiary.SpecialMob;
import fathertoast.specialmobs.common.entity.MobHelper;
import fathertoast.specialmobs.common.entity.ai.AIHelper;
import fathertoast.specialmobs.common.entity.ai.FluidPathNavigator;
import fathertoast.specialmobs.common.util.References;
import fathertoast.specialmobs.datagen.loot.LootEntryItemBuilder;
import fathertoast.specialmobs.datagen.loot.LootPoolBuilder;
import fathertoast.specialmobs.datagen.loot.LootTableBuilder;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.ai.attributes.Attributes;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.pathfinding.PathNavigator;
import net.minecraft.pathfinding.PathNodeType;
import net.minecraft.tags.FluidTags;
import net.minecraft.world.World;
@SpecialMob
public class WaterCaveSpiderEntity extends _SpecialCaveSpiderEntity {
//--------------- Static Special Mob Hooks ----------------
@SpecialMob.SpeciesReference
public static MobFamily.Species<WaterCaveSpiderEntity> SPECIES;
@SpecialMob.BestiaryInfoSupplier
public static void getBestiaryInfo( BestiaryInfo.Builder bestiaryInfo ) {
bestiaryInfo.color( 0x2D41F4 ).theme( BestiaryInfo.Theme.WATER )
.uniqueTextureWithEyes()
.addExperience( 1 ).drownImmune().fluidPushImmune()
.addToAttribute( Attributes.ATTACK_DAMAGE, 1.0 );
}
@SpecialMob.LanguageProvider
public static String[] getTranslations( String langKey ) {
return References.translations( langKey, "Water Cave Spider",
"", "", "", "", "", "" );//TODO
}
@SpecialMob.LootTableProvider
public static void buildLootTable( LootTableBuilder loot ) {
addBaseLoot( loot );
loot.addPool( new LootPoolBuilder( "common" )
.addEntry( new LootEntryItemBuilder( Items.COD ).setCount( 0, 2 ).addLootingBonus( 0, 1 ).smeltIfBurning().toLootEntry() )
.toLootPool() );
loot.addPool( new LootPoolBuilder( "semicommon" )
.addEntry( new LootEntryItemBuilder( Items.SALMON ).setCount( 0, 1 ).addLootingBonus( 0, 1 ).smeltIfBurning().toLootEntry() )
.toLootPool() );
}
@SpecialMob.Factory
public static EntityType.IFactory<WaterCaveSpiderEntity> getVariantFactory() { return WaterCaveSpiderEntity::new; }
/** @return This entity's mob species. */
@SpecialMob.SpeciesSupplier
@Override
public MobFamily.Species<? extends WaterCaveSpiderEntity> getSpecies() { return SPECIES; }
//--------------- Variant-Specific Implementations ----------------
public WaterCaveSpiderEntity( EntityType<? extends _SpecialCaveSpiderEntity> entityType, World world ) {
super( entityType, world );
setPathfindingMalus( PathNodeType.WATER, PathNodeType.WALKABLE.getMalus() );
}
/** Override to change this entity's AI goals. */
@Override
protected void registerVariantGoals() {
AIHelper.replaceWaterAvoidingRandomWalking( this, 0.8 );
}
/** @return A new path navigator for this entity to use. */
@Override
protected PathNavigator createNavigation( World world ) {
return new FluidPathNavigator( this, world, true, false );
}
/** @return Whether this entity can stand on a particular type of fluid. */
@Override
public boolean canStandOnFluid( Fluid fluid ) { return fluid.is( FluidTags.WATER ); }
/** Called each tick to update this entity. */
@Override
public void tick() {
super.tick();
MobHelper.floatInFluid( this, 0.06, FluidTags.WATER );
}
/** Override to load data from this entity's NBT data. */
@Override
public void readVariantSaveData( CompoundNBT saveTag ) {
setPathfindingMalus( PathNodeType.WATER, PathNodeType.WALKABLE.getMalus() );
}
}

View file

@ -33,7 +33,7 @@ public class WaterSpiderEntity extends _SpecialSpiderEntity {
bestiaryInfo.color( 0x2D41F4 ).theme( BestiaryInfo.Theme.WATER )
.uniqueTextureWithEyes()
.addExperience( 1 ).drownImmune().fluidPushImmune()
.addToAttribute( Attributes.ATTACK_DAMAGE, 1.0 );
.addToAttribute( Attributes.ATTACK_DAMAGE, 1.0 ).addToRangedDamage( 1.0 );
}
@SpecialMob.LanguageProvider

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 380 B