fix multiplayer: remove KNOCKED, swoon softlock, combat checks, dodge TP gate, inv cache, killfeed, threads/leaks

This commit is contained in:
SashegDev
2026-09-14 05:07:09 +00:00
parent e227ad63bd
commit 39ffe477a5
17 changed files with 419 additions and 230 deletions
@@ -57,6 +57,7 @@ public class SwordAttack {
}
expl.getWorld().spawnParticle(Particle.CRIT, expl, 6, 0.2, 0.2, 0.2, 0.05);
expl.getWorld().playSound(expl, Sound.BLOCK_STONE_BREAK, 1f, 0.8f);
EntityTracker.untrack(marker);
marker.remove();
cancel();
return;
@@ -84,6 +85,7 @@ public class SwordAttack {
hit.getWorld().playSound(hit, Sound.ENTITY_PLAYER_ATTACK_CRIT, 1f, 0.9f);
le.addPotionEffect(new org.bukkit.potion.PotionEffect(org.bukkit.potion.PotionEffectType.SLOWNESS, 40, 1, false, false, true));
le.addPotionEffect(new org.bukkit.potion.PotionEffect(org.bukkit.potion.PotionEffectType.WEAKNESS, 30, 0, false, false, true));
EntityTracker.untrack(marker);
marker.remove();
cancel();
return;
@@ -92,11 +94,13 @@ public class SwordAttack {
if (pl == p) continue;
double d = pl.getLocation().add(0, 1, 0).distanceSquared(nl);
if (d > 0.25 && d < 0.81) {
BlackKnifePlugin.getPlugin(BlackKnifePlugin.class).getTension().addTP(pl, 2.5f, "DODGE +1%");
BlackKnifePlugin.getPlugin(BlackKnifePlugin.class).getTension().tryGiveDodge(pl);
pl.getWorld().spawnParticle(Particle.DUST, pl.getLocation().add(0, 0.25, 0), 25, 0.5, 0.05, 0.5, 0, new Particle.DustOptions(Color.fromRGB(255, 255, 255), 0.15f));
}
}
EntityTracker.untrack(marker);
if (nl.distanceSquared(p.getEyeLocation()) > 14400) { marker.remove(); cancel(); return; }
EntityTracker.untrack(marker);
if (marker.getTicksLived() > 80) { marker.remove(); cancel(); }
}
}.runTaskTimer(plugin, 1L, 1L);