Commit Graph

10 Commits

Author SHA1 Message Date
kayjaydee 53b43d83c7 feat(02-02): add RegionTickLoop + plugin wiring (Task 3)
- RegionTickLoop: single-thread daemon scheduler @100ms, 2s initial delay,
  shutdown -> awaitTermination(5s) -> shutdownNow lifecycle.
  Three start overloads: (World), (Supplier<World>), (Runnable). Errors are
  routed to a Consumer<Throwable> so an exception in one tick never kills
  the scheduler.
- GravityFlipPlugin.start():
  * builds RegionRegistry from configHolder.get() + holder for save()
  * starts the tick loop with a Supplier<World> that lazily resolves
    Universe.get().getDefaultWorld() (deviation: PrepareUniverseEvent in the
    pinned API only carries WorldConfigProvider — no Universe/World access,
    so we use the lazy-supplier pattern from MythWorld instead)
  * registers the ScheduledFuture with TaskRegistry (raw cast, try/catch fallback)
- GravityFlipPlugin.shutdown(): tickLoop.stop() BEFORE super.shutdown()
- RegionTickLoopTest: 3 timing tests pass (>=8 ticks/sec, stop within 5s,
  exception resilience).
- gradle build green; fat jar contains both region/ and tick/ class dirs.
2026-04-23 00:56:12 +02:00
kayjaydee 6574c05128 feat(02-02): add RegionRegistry + RegionSnapshot with ECS refreshFor (Tasks 1+2)
- RegionSnapshot: immutable per-world occupancy view (byRegion/tickId/world)
- RegionRegistry:
  * AtomicReference<List<GravityFlipRegion>> for tick-loop-safe region reads
  * CRUD (add/remove/setEnabled) under mutationLock + atomic snapshot republish
  * refreshFromConfig(cfg) hook for Phase 4 command handlers
  * refreshFor(World) iterates ECS via forEachEntityParallel +
    TransformComponent.getComponentType() (ComponentType IS-A Query, no builder) +
    Box.containsPosition(x,y,z); publishes per-world snapshot via AtomicReference.
  * Lazy ComponentType init (avoids Hytale PluginBase static init in tests)
  * Snapshots map keyed by Object (not World) so JDK 25 tests don't need Mockito
- 7/7 RegionRegistryTest pass: CRUD, snapshot read/publish, cross-thread visibility,
  refreshFromConfig atomic swap.

Probe results (recorded for SUMMARY):
- ArchetypeChunk.getRef(int) NOT present; actual method is getReferenceTo(int)
- TransformComponent.getPosition() returns com.hypixel.hytale.math.vector.Vector3d
  in pinned 2026.03.26 (Phase 02-01 deviation pattern recurs)
2026-04-23 00:54:32 +02:00
kayjaydee 216f544d9b feat(02-01): wire GravityFlipConfig to regions.json via named withConfig
- GravityFlipConfig wraps List<GravityFlipRegion> via ArrayCodec under the
  KeyedCodec("Regions", ...) entry. Decoded list is a mutable ArrayList
  (NOT List.of(arr)) so Phase 4 commands can mutate at runtime.
- GravityFlipPlugin.configHolder uses the named overload
  withConfig("regions", GravityFlipConfig.CODEC) — produces
  <dataDirectory>/regions.json. The 1-arg overload would hardcode config.json.
- configHolder() javadoc documents the save contract (no auto-save on
  shutdown; mutators must call configHolder.save() explicitly) and the shared
  mutable reference caveat that 02-02's RegionRegistry will resolve.
- 4 round-trip tests cover: empty default, two-region order preservation,
  empty list, and list mutability (regression guard against List.of).
2026-04-23 00:43:26 +02:00
kayjaydee b046f44ab5 feat(02-01): add GravityFlipRegion POJO + BuilderCodec with round-trip tests
- GravityFlipRegion holds Name (String) + Box (Hytale AABB) + Enabled (boolean),
  serialised through a BuilderCodec keyed on "Name"/"Box"/"Enabled".
- Validators.nonNull() applied to Name and Box (correct package is
  com.hypixel.hytale.codec.validation.Validators, not codec.builder).
- Server jar 2026.03.26 uses com.hypixel.hytale.math.vector.Vector3d for Box.min/max
  (NOT org.joml.Vector3d, which only appeared in newer builds).
- 3 JUnit 5 round-trip tests cover name/box/enabled, enabled=false, and empty name.
- testImplementation added for the Server artifact so codec encode/decode is
  reachable from unit tests.
2026-04-23 00:41:36 +02:00
kayjaydee 59b33615df refactor(01): align scaffold with Mythlane conventions (Kotlin DSL, CamelCase manifest, pinned server version)
- Convert build.gradle/settings.gradle to Kotlin DSL matching VotePipe + myth_*
- Manifest keys: lowercase -> CamelCase (Group/Name/Version/Main/ServerVersion/...)
  matching production Mythlane plugins (empirical authority)
- gradle.properties adopts pluginGroup/pluginVersion/pluginDescription/hytaleServerVersion
- Template manifest via processResources.expand(${version}, ${description}, ${hytaleServerVersion})
- Add baseline deps: gson (relocated), jetbrains annotations, JUnit 5
- shadowJar archiveBaseName=hytale-gravity-flip

Rebuild: BUILD SUCCESSFUL, fat JAR regenerated with CamelCase manifest.
2026-04-22 23:32:25 +02:00
kayjaydee 2e26f8a10f feat(01): plugin manifest and entry class 2026-04-22 23:28:13 +02:00
kayjaydee 628c26aff2 feat(01): gradle scaffold (settings, properties, build, wrapper) 2026-04-22 23:23:52 +02:00
kayjaydee f9d8f71f0d chore: ignore .planning/ alongside .claude/ 2026-04-22 23:13:48 +02:00
kayjaydee 4252c8d07f chore: untrack .planning and .claude (local only) 2026-04-22 23:13:43 +02:00
kayjaydee 266b9b3f04 docs: initialize GSD project (Hytale Gravity Flip) — PROJECT, research, REQUIREMENTS, ROADMAP, STATE, config, CLAUDE.md 2026-04-22 23:12:11 +02:00