Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
- prevent sleeping directly after killing an entity
- minor adjustments lightning dragon logic to be equal to the other types (took way too long to find the timeToWake override)
  • Loading branch information
SiverDX authored and TheBv committed Dec 26, 2023
1 parent f2964df commit 8ef175d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public EntityFireDragon(Level worldIn) {

public EntityFireDragon(EntityType<?> t, Level worldIn) {
super(t, worldIn, DragonType.FIRE, 1, 1 + IafConfig.dragonAttackDamage, IafConfig.dragonHealth * 0.04, IafConfig.dragonHealth, 0.15F, 0.4F);
this.setPathfindingMalus(BlockPathTypes.DANGER_FIRE, 0.0F);
this.setPathfindingMalus(BlockPathTypes.DAMAGE_FIRE, 0.0F);
this.setPathfindingMalus(BlockPathTypes.LAVA, 8.0F);
ANIMATION_SPEAK = Animation.create(20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public EntityLightningDragon(Level worldIn) {
public EntityLightningDragon(EntityType<?> t, Level worldIn) {
super(t, worldIn, DragonType.LIGHTNING, 1, 1 + IafConfig.dragonAttackDamage, IafConfig.dragonHealth * 0.04, IafConfig.dragonHealth, 0.15F, 0.4F);
this.setPathfindingMalus(BlockPathTypes.DANGER_FIRE, 0.0F);
this.setPathfindingMalus(BlockPathTypes.DAMAGE_FIRE, 0.0F);
this.setPathfindingMalus(BlockPathTypes.LAVA, 8.0F);
ANIMATION_SPEAK = Animation.create(20);
ANIMATION_BITE = Animation.create(35);
Expand All @@ -76,6 +75,7 @@ public EntityLightningDragon(EntityType<?> t, Level worldIn) {
this.growth_stages = new float[][]{growth_stage_1, growth_stage_2, growth_stage_3, growth_stage_4, growth_stage_5};
}

// FIXME :: Unused -> Change logic
public void onStruckByLightning(LightningBolt lightningBolt) {
this.heal(15F);
}
Expand Down Expand Up @@ -295,7 +295,6 @@ public void riderShootFire(Entity controller) {
d4 = d4 + this.random.nextGaussian() * 0.007499999832361937D * inaccuracy;
EntityDragonLightningCharge entitylargefireball = new EntityDragonLightningCharge(
IafEntityRegistry.LIGHTNING_DRAGON_CHARGE.get(), level(), this, d2, d3, d4);
float size = this.isBaby() ? 0.4F : this.shouldDropLoot() ? 1.3F : 0.8F;
entitylargefireball.setPos(headVec.x, headVec.y, headVec.z);
if (!level().isClientSide) {
level().addFreshEntity(entitylargefireball);
Expand Down Expand Up @@ -535,7 +534,7 @@ protected ItemStack getSkull() {
return new ItemStack(IafItemRegistry.DRAGON_SKULL_LIGHTNING.get());
}


/* FIXME :: Check -> why is this the only dragon overriding this?
@Override
public Vec3 getHeadPosition() {
//this.setDragonPitch(this.ticksExisted % 180 - 90);
Expand Down Expand Up @@ -574,4 +573,5 @@ public Vec3 getHeadPosition() {
float headPosZ = (float) (getZ() + (xzModSine) * Mth.sin((float) ((yBodyRot + 90) * Math.PI / 180)));
return new Vec3(headPosX, headPosY, headPosZ);
}
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
dragon logic separation for client, server and shared sides.
*/
public class IafDragonLogic {

private final EntityDragonBase dragon;

public IafDragonLogic(EntityDragonBase dragon) {
Expand Down Expand Up @@ -272,7 +271,6 @@ public void updateDragonServer() {
dragon.randomizeAttacks();
}
}

}

public void attackTarget(Entity target, Player ridingPlayer, float damage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ public void onVillagerTrades(VillagerTradesEvent event) {

@SubscribeEvent
public void onLightningHit(final EntityStruckByLightningEvent event) {
// TODO :: Set owner UUID in the tags as well to prevent damage to them?
if (event.getLightning().getTags().contains(BOLT_DONT_DESTROY_ITEMS) && (event.getEntity() instanceof ItemEntity || event.getEntity() instanceof ExperienceOrb)) {
event.setCanceled(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
dragon.homePos = new HomePosition(position, worldIn.getLevel());
dragon.hasHomePosition = true;
dragon.setHunger(50);
dragon.setInSittingPose(true);
worldIn.addFreshEntity(dragon);
}
{
Expand Down

0 comments on commit 8ef175d

Please sign in to comment.