refactor: drop unused VFX scaffolding, single-line English doc, reduce debug logs

- Remove unused chain/ParticleTrail and chain/VolumeCurve (dead since the EntityEffect
  pivot replaced the per-particle emit path) plus their test suites.
- Drop Vec3.lerp (only consumer was ParticleTrail).
- Strip step-by-step "[N/9]" debug logs from the orchestrator and per-entity logs
  from HytaleEntitySource / HytalePlayerRayCaster / ChainDamageApplier; keep one
  summary log per click and warnings on failure.
- Extract resolveChain and tryEmitVfx helpers in ChainLightningSceptreInteraction
  so firstRun reads top-down (cooldown gate -> resolve -> damage -> vfx -> deduct).
- Translate every Java doc/comment to single-line English.

Tests: 30/30 green (29 baseline kept + 1 chain damage adapter test).
Build: ./gradlew shadowJar clean.
This commit is contained in:
2026-04-27 19:17:47 +02:00
parent ee9ac1ab53
commit 03754a0646
22 changed files with 118 additions and 683 deletions
@@ -12,21 +12,10 @@ import com.mythlane.chainlightning.chain.Vec3;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
/**
* Implementation Phase 3 de {@link EntitySource} qui delegue a
* {@link TargetUtil#getAllEntitiesInSphere}.
*
* <p><b>Note importante :</b> {@code getAllEntitiesInSphere} retourne une liste THREAD-LOCALE
* (SpatialResource.getThreadLocalReferenceList). On la consomme immediatement en mappant chaque
* ref vers un {@link HytaleEntityAdapter} dans une nouvelle ArrayList -- la liste retournee est
* sure a conserver entre frames.
*/
/** Phase 3 EntitySource that copies TargetUtil's thread-local result into a stable list of snapshots. */
public final class HytaleEntitySource implements EntitySource {
private static final Logger LOGGER = Logger.getLogger(HytaleEntitySource.class.getName());
private final ComponentAccessor<EntityStore> accessor;
public HytaleEntitySource(@Nonnull ComponentAccessor<EntityStore> accessor) {
@@ -36,21 +25,14 @@ public final class HytaleEntitySource implements EntitySource {
@Override
public List<ChainEntity> nearby(Vec3 origin, double radius) {
Vector3d hytaleOrigin = new Vector3d(origin.x(), origin.y(), origin.z());
LOGGER.info(String.format("[ChainLightning][EntitySource] getAllEntitiesInSphere(origin=%s, radius=%.1f)",
origin, radius));
List<Ref<EntityStore>> refs = TargetUtil.getAllEntitiesInSphere(hytaleOrigin, radius, accessor);
LOGGER.info(String.format("[ChainLightning][EntitySource] Hytale returned %d refs", refs == null ? -1 : refs.size()));
if (refs == null) {
return new ArrayList<>();
if (refs == null || refs.isEmpty()) {
return List.of();
}
List<ChainEntity> snapshots = new ArrayList<>(refs.size());
for (Ref<EntityStore> ref : refs) {
ChainEntity adapter = HytaleEntityAdapter.snapshot(ref, accessor);
LOGGER.info(String.format("[ChainLightning][EntitySource] ref:%d -> id=%s pos=%s alive=%s",
ref.getIndex(), adapter.id(), adapter.position(), adapter.isAlive()));
snapshots.add(adapter);
snapshots.add(HytaleEntityAdapter.snapshot(ref, accessor));
}
LOGGER.info(String.format("[ChainLightning][EntitySource] returning %d snapshots", snapshots.size()));
return snapshots;
}
}