mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-12 16:37:38 +00:00
213ff0c8ea73c51ece23aa9ad5c9b9ba07edea44
Converts the scheduler, its two extension classes and PartTickEntry. No jar in the pack references this class, so the ABI constraint was minimal, but the reference shape was kept anyway: TickScheduler$ and PartTickEntry are descriptor-identical including the Scala-style accessor pairs, and the statics class adds only a private constructor. TickScheduler$ is the one companion singleton in this migration that is not a pure forwarder. The object extends WorldExtensionInstantiator and WorldExtensionManager is handed the instance itself, so the two instantiator hooks stay on the singleton. processTicks filtered a ListBuffer with a side-effecting predicate that fires part callbacks and mutates the entry; the Java version iterates and rebuilds in the same order, so callback order and the reschedule mutation are unchanged. One Scala call site changed: the registration now passes TickScheduler$.MODULE$. TRandomUpdateTick needed casts because a Scala trait extending a class is a bare interface in bytecode, the same pattern already recorded for JIconHitEffects. Five anonfun classes removed. Validated with 90 plain-JVM tests, a clean build, and the Java 8 Forge dedicated-server suite, which runs this code every tick because the scheduler is registered as a world extension at startup.
ForgeMultipart
An API for dynamically handling different functional parts in the one block space.
Requirements:
- The latest version of CCL (files.minecraftforge.net/CodeChickenLib/)
- Forge
- A scala compatible IDE and project (For eclipse, download the scala eclipse plugin and right click on the project -> Add Scala Nature)
If you only want to use the API and not modify it:
- Download the latest dev version from files.minecraftforge.net/ForgeMultipart/
- Download the latest dev version of CCL.
- Place both mods in your /libs/ folder and link them as libraries in your IDE.
Implementation of all parts of the API should be clean and easy in Java. The minecraft multipart mod is implemented in java as a test case.
Languages
Scala
85.4%
Java
14.6%