mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-13 17:04:25 +00:00
cd6420f7f280c1d7af3b6954fd362eb92f33a3e2
Replaces TCuboidPart.scala with Java implementations of TCuboidPart, JCuboidPart and the TCuboidPart$class bridge. The canonical behavior now lives in three statics on JCuboidPart; the deprecated bridge delegates to them, since old Scala forwarders call the statics directly and delegating to the instance methods would recurse. Every reference descriptor is preserved, verified by diffing javap -s output against the reference dev jar. ForgeRelocationFMP, OpenComputers, ProjRed and ProjectBlue all call these four statics, and a frozen Scala 2.11.5 consumer compiled against the reference jar loads and runs against the port. Scala trait linearization cannot be reproduced by a Java interface: a superclass method beats an interface default on the JVM, so a recompiled Scala class mixing TCuboidPart into a TMultiPart subclass silently gets TMultiPart's empty implementations. Declaring the methods default would not help, so they stay abstract, matching the reference bytecode. Existing binaries are unaffected. Microblock, the one in-repo case, now extends TMultiPart with TCuboidPart and forwards explicitly. See JAVA_MIGRATION_DIVERGENCES.md. The three files live under src/main/scala because compileJava runs before compileScala and they still reference TMultiPart. Validated with 33 plain-JVM tests, a clean build, and the Java 8 Forge dedicated-server suite.
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%