mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-13 17:04:25 +00:00
52ff8ff460a8b53b367e5f8733f53268b5ab5695
Extracts the Saw trait out of ItemSaw.scala into a Java interface and retains the Saw$class bridge for ProjRed. ItemSaw itself stays Scala. The interface is descriptor-identical to the reference, the bridge adds only a private constructor, and the emitted class-file set for this area is unchanged. Item does not declare getMaxCuttingStrength, so it becomes a real default method. One consequence is worth noting: ItemSaw previously carried a Scala trait forwarder for it and now inherits the default instead, so it no longer declares that method. Three jars reference the ItemSaw type but none reference its members, and an invokevirtual would still resolve through the interface default. This is the first port that changed the declared members of a class it did not touch. Unlike TFacePart$class and TEdgePart$class, which hold constants and ignore overrides, this bridge dispatches getCuttingStrength back through the interface so an implementor's override is honoured. Both behaviors are preserved as found and asserted separately. First port outside codechicken.multipart. Validated with 65 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%