Skip to content

Commit

Permalink
feat: add dark dragon and egg
Browse files Browse the repository at this point in the history
  • Loading branch information
ShangguanXi committed Nov 26, 2024
1 parent 011c4bd commit 32399af
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package top.dragonmounts.objects.entity.entitytameabledragon.breeds;

import net.minecraft.init.Blocks;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import top.dragonmounts.inits.ModSounds;
import top.dragonmounts.objects.entity.entitytameabledragon.EntityTameableDragon;
import top.dragonmounts.objects.entity.entitytameabledragon.breath.BreathNode;
import top.dragonmounts.objects.entity.entitytameabledragon.breath.effects.PoisonBreathFX;
import top.dragonmounts.objects.entity.entitytameabledragon.breath.sound.SoundEffectName;
import top.dragonmounts.objects.entity.entitytameabledragon.breath.sound.SoundState;
import top.dragonmounts.objects.entity.entitytameabledragon.breath.weapons.BreathWeapon;
import top.dragonmounts.objects.entity.entitytameabledragon.breath.weapons.BreathWeaponPoison;
import top.dragonmounts.objects.entity.entitytameabledragon.helper.DragonLifeStage;
import top.dragonmounts.objects.items.EnumItemBreedTypes;

public class DragonBreedDark extends DragonBreed {
DragonBreedDark() {
super("dark", 0X5e5602);

setImmunity(DamageSource.MAGIC);
setImmunity(DamageSource.HOT_FLOOR);
setImmunity(DamageSource.LIGHTNING_BOLT);
setImmunity(DamageSource.WITHER);

setHabitatBlock(Blocks.SOUL_SAND);
setHabitatBlock(Blocks.NETHER_WART_BLOCK);
}

@Override
public void onEnable(EntityTameableDragon dragon) {}

@Override
public void onDisable(EntityTameableDragon dragon) {}

@Override
public void onDeath(EntityTameableDragon dragon) {}

@Override
public void spawnClientNodeEntity(World world, Vec3d position, Vec3d direction, BreathNode.Power power, float partialTicks) {
world.spawnEntity(new PoisonBreathFX(world, position, direction, power, partialTicks));
}

@Override
public SoundEvent getLivingSound(EntityTameableDragon dragon) {
return dragon.isBaby() ? ModSounds.ENTITY_DRAGON_HATCHLING_GROWL : ModSounds.ZOMBIE_DRAGON_GROWL;
}


// @Override
// public boolean isInfertile() {
// return true;
// }

@Override
public SoundEffectName getBreathWeaponSoundEffect(DragonLifeStage stage, SoundState state) {
return state.ice;// why
}

@Override
public EnumParticleTypes getSneezeParticle() {
return null;
}

@Override
public BreathWeapon createBreathWeapon(EntityTameableDragon dragon) {
return new BreathWeaponPoison(dragon);
}

@Override
public EnumItemBreedTypes getItemBreed(EntityTameableDragon dragon) {
return EnumItemBreedTypes.DARK;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public enum EnumDragonBreed implements IStringSerializable {
STORM(11, DragonBreedStorm::new),
ZOMBIE(12, DragonBreedZombie::new),
TERRA(13, DragonBreedTerra::new),
MOONLIGHT(14, DragonBreedMoonlight::new);
MOONLIGHT(14, DragonBreedMoonlight::new),
// LIGHT(15, DragonBreedLight::new);
// DARK(16, DragonBreedDark::new);
DARK(15, DragonBreedDark::new);
// SPECTER(17, DragonBreedSpecter::new);

public static final EnumSerializer<EnumDragonBreed> SERIALIZER = new EnumSerializer<>(EnumDragonBreed.class, EnumDragonBreed.END);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
"textures": {
"all": "dragonmounts:entities/dragon/moonlight/egg"
}
},
"dark": {
"textures": {
"all": "dragonmounts:entities/dragon/dark/egg"
}
}
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"animation": {
"frametime": 8,
"interpolate": true,
"frames": [
0,
1,
2
]
}
}

0 comments on commit 32399af

Please sign in to comment.