mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-13 17:04:25 +00:00
cacc9a30a80ce7f513237af6f07edf65604e9fbf
Converts the central tile class and its companion object. TileMultipartClient moves to its own Scala file unchanged: it is registered with the ASM generator through registerTrait, so converting it is Phase 5 registerJavaTrait work rather than part of this step. Every public member of the reference survives except protected$worldObj, the accessor Scala emitted so the dropItems closure could reach the protected field; no jar references it, and TileMultipartClient lost nothing including its generated super accessor for markRender. All five Scala-typed descriptors are preserved: partList and its setter, operate, getOrConvertTile2's Tuple2, loadParts, and the Tuple2 rayTraceAll stores into ExtendedMOP.data. partList stays an immutable Scala List republished on each mutation, which matches the reference semantics exactly and takes no performance decision; that belongs to Phase 4 with profiling. Internal callers still go through operate rather than a private loop, so a trait overriding it still sees every call. Recompiled Scala consumers need four adjustments, all source-only: partList.apply(i) for indexing, renderID_$eq for assignment, an explicit cast on getOrConvertTile2._2, and an explicit AbstractFunction1 for operate since 2.11 will not adapt a lambda to Function1[_, BoxedUnit]. Eleven, one, two and one in-repo call sites respectively. 31 anonfun classes collapse to one Java anonymous class. Validated with 90 plain-JVM tests, a clean build, and the Java 8 Forge dedicated-server suite, which is the load-bearing check here because the ASM generator builds composite tiles on top of this class.
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%