forked from SteamWar/SteamWar
Merge pull request 'fix(FightSystem): arrow stopper removing entites not shot by player (#399)' (#402) from wip/399-fix-error-stopper-for-dispensers into main
Reviewed-on: SteamWar/SteamWar#402 Reviewed-by: Chaoscaot <max@chaoscaot.de>
This commit is contained in:
@@ -46,6 +46,7 @@ public class ArrowStopper {
|
|||||||
private void run() {
|
private void run() {
|
||||||
Recording.iterateOverEntities(AbstractArrow.class::isInstance, entity -> {
|
Recording.iterateOverEntities(AbstractArrow.class::isInstance, entity -> {
|
||||||
Projectile arrow = (Projectile) entity;
|
Projectile arrow = (Projectile) entity;
|
||||||
|
if(!(arrow.getShooter() instanceof Player)) return;
|
||||||
if (invalidEntity(arrow)) return;
|
if (invalidEntity(arrow)) return;
|
||||||
|
|
||||||
Location prevLocation = arrow.getLocation().toVector().subtract(arrow.getVelocity()).toLocation(arrow.getWorld());
|
Location prevLocation = arrow.getLocation().toVector().subtract(arrow.getVelocity()).toLocation(arrow.getWorld());
|
||||||
|
|||||||
Reference in New Issue
Block a user