Skip to content

Commit

Permalink
update latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iron431 committed Dec 13, 2023
1 parent 22872b1 commit d685377
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
5 changes: 3 additions & 2 deletions LATEST_CHANGES.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
- Dragonskin dropped from Ender Dragons now floats and glows

### Fixes
-

- Fixed Spell MobEffects persisting after death
- Fixed Summoned Entities with no summoner causing a crash after killing a player
- Fixed /kill not working on Dead King Corpse entity
### API
-
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ public boolean checkPreCastConditions(Level level, int spellLevel, LivingEntity
}
}

@Override
public void onCast(Level world, int spellLevel, LivingEntity entity, MagicData playerMagicData) {
super.onCast(world, spellLevel, entity, playerMagicData);
}

@Override
public void onServerCastTick(Level level, int spellLevel, LivingEntity entity, @Nullable MagicData playerMagicData) {
super.onServerCastTick(level, spellLevel, entity, playerMagicData);
Expand All @@ -131,9 +126,11 @@ private void handleTelekinesis(ServerLevel world, LivingEntity entity, MagicData
if (force.y > 0) {
targetEntity.resetFallDistance();
}
int airborne = (int) (travel.x * travel.x + travel.z * travel.z) / 2;
targetEntity.addEffect(new MobEffectInstance(MobEffectRegistry.AIRBORNE.get(), 31, airborne));
targetEntity.addEffect(new MobEffectInstance(MobEffectRegistry.ANTIGRAVITY.get(), 11, 0));
if ((playerMagicData.getCastDurationRemaining()) % 10 == 0) {
int airborne = (int) (travel.x * travel.x + travel.z * travel.z) / 2;
targetEntity.addEffect(new MobEffectInstance(MobEffectRegistry.AIRBORNE.get(), 31, airborne));
targetEntity.addEffect(new MobEffectInstance(MobEffectRegistry.ANTIGRAVITY.get(), 11, 0));
}
targetEntity.setDeltaMovement(targetEntity.getDeltaMovement().add(force));
targetEntity.hurtMarked = true;
}
Expand Down

0 comments on commit d685377

Please sign in to comment.