forked from SteamWar/SteamWar
Refactor lobby particle runtime for multi-entry particles
Tick particles from per-player cached always/move lists, drop the per-instance listeners in Delayed and RandomParticle, and compute particle viewers once per tick instead of once per spawned point.
This commit is contained in:
@@ -26,6 +26,8 @@ import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@@ -36,6 +38,7 @@ public class ParticleTickData {
|
||||
private Location location;
|
||||
private final double deg;
|
||||
private final boolean isMoving;
|
||||
private final List<Player> viewers;
|
||||
private boolean onlySelf = false;
|
||||
private boolean onlyOthers = false;
|
||||
|
||||
@@ -65,6 +68,6 @@ public class ParticleTickData {
|
||||
}
|
||||
|
||||
public ParticleTickData copy() {
|
||||
return new ParticleTickData(world, player, location, deg, isMoving, onlySelf, onlyOthers);
|
||||
return new ParticleTickData(world, player, location, deg, isMoving, viewers, onlySelf, onlyOthers);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user