Skip to content

Commit

Permalink
Read CHANGES.md
Browse files Browse the repository at this point in the history
  • Loading branch information
RadonCoding committed Nov 23, 2023
1 parent 106c6f5 commit 39ce019
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Fixed fish shikigami hurting caster
- Fixed volcano not working
- Fixed stun not stopping dashing
- Fix toad tongue stun thing

## Animation Rework
- Gave all disaster curses runnning animations
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@

public class ToadTongueProjectile extends AbstractHurtingProjectile {
public static final float SPEED = 2.0F;
private static final double PULL_STRENGTH = 0.5D;

private int range;
private UUID target;
private boolean grabbed;
private Vec3 pos;

public ToadTongueProjectile(EntityType<? extends AbstractHurtingProjectile> pEntityType, Level pLevel) {
super(pEntityType, pLevel);
Expand Down Expand Up @@ -73,8 +75,8 @@ protected void onHitEntity(@NotNull EntityHitResult pResult) {
if (!target.getUUID().equals(this.target)) return;

this.grabbed = true;
this.pos = target.position();
}

@Override
protected void onHitBlock(@NotNull BlockHitResult pResult) {
this.discard();
Expand Down Expand Up @@ -104,11 +106,13 @@ public void tick() {

if (this.grabbed) {
if (((ServerLevel) this.level()).getEntity(this.target) instanceof LivingEntity living) {
if ((owner instanceof ToadEntity toad && toad.getTarget() != living) || !owner.isAlive() || owner.isRemoved())
if (!(owner instanceof ToadEntity toad) || toad.getTarget() != living || living.isDeadOrDying() || living.isRemoved() || !owner.isAlive() || owner.isRemoved())
this.discard();

living.addEffect(new MobEffectInstance(JJKEffects.STUN.get(), 2, 0, false, false, false));
living.setDeltaMovement(living.getDeltaMovement().add(this.pos.subtract(living.position()).normalize().scale(PULL_STRENGTH)));
this.setPos(living.getX(), living.getY() + (living.getBbHeight() / 2.0F), living.getZ());
} else {
this.discard();
}
this.setDeltaMovement(Vec3.ZERO);
} else {
Expand Down

0 comments on commit 39ce019

Please sign in to comment.