mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-12 08:27:50 +00:00
f2f187093120bda9610c81a596f831237c53a720
Replaces ItemMultiPart.scala with Java implementations of JItemMultiPart, TItemMultiPart and the TItemMultiPart$class bridge. The interface is descriptor-identical to the reference, JItemMultiPart keeps its constructor and both instance methods and gains only additive statics, and the bridge keeps all three public statics for ProjRed, its only consumer. The emitted class-file set for this area is unchanged. This is the first converted trait that extends a Minecraft class rather than TMultiPart, so the linearization check ran against Item. The same split applied: getHitDepth became a real default because Item does not declare it, while onItemUse stayed abstract because Item does and a default would silently lose to the vanilla implementation. The rule generalises to the implementor's actual superclass. The bridge's getHitDepth ignores its part argument and calls the static directly, matching the reference whose trait body never used this. The onItemUse path still dispatches getHitDepth through the interface, so an implementor's override is honoured. Validated with 57 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%