fix multiplayer: remove KNOCKED, swoon softlock, combat checks, dodge TP gate, inv cache, killfeed, threads/leaks
This commit is contained in:
@@ -57,13 +57,16 @@ public class PhantomBarrageAttack {
|
||||
Vector toTarget = target.clone().subtract(cur).toVector().normalize().multiply(1.6);
|
||||
Location nl = cur.clone().add(toTarget);
|
||||
int steps = Math.max(1,(int)Math.ceil(toTarget.length()/0.5));
|
||||
EntityTracker.untrack(orb);
|
||||
for(int s=0;s<=steps;s++){ Location check=cur.clone().add(toTarget.clone().multiply((double)s/steps)); if(check.getBlock().isSolid()){orb.remove();cancel();return;} }
|
||||
orb.teleport(nl);
|
||||
cur = nl;
|
||||
nl.getWorld().spawnParticle(Particle.DUST, nl,1,0,0,0,0,new Particle.DustOptions(Color.fromRGB(30,10,50),1.2f));
|
||||
nl.getWorld().spawnParticle(Particle.SCULK_SOUL, nl,1,0.05,0.05,0.05,0);
|
||||
EntityTracker.untrack(orb);
|
||||
for(LivingEntity le: nl.getWorld().getNearbyLivingEntities(nl,0.9)){ if(le==p) continue; DamageUtil.apply(p, le, 6.0); le.getWorld().spawnParticle(Particle.CRIT, le.getLocation().add(0,1,0),8,0.3,0.3,0.3,0.1); orb.remove(); cancel(); return; }
|
||||
for(Player pl: nl.getWorld().getNearbyPlayers(nl,0.9)){ if(pl==p) continue; double d2=pl.getLocation().add(0,1,0).distanceSquared(nl); if(d2>0.25 && d2<0.81) plugin.getTension().addTP(pl,2.5f,"DODGE +1%"); }
|
||||
for(Player pl: nl.getWorld().getNearbyPlayers(nl,0.9)){ if(pl==p) continue; double d2=pl.getLocation().add(0,1,0).distanceSquared(nl); if(d2>0.25 && d2<0.81) plugin.getTension().tryGiveDodge(pl); }
|
||||
EntityTracker.untrack(orb);
|
||||
if(cur.distanceSquared(target) < 1 || orb.getTicksLived() > 100){ orb.remove(); cancel(); }
|
||||
ticks++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user