Replaces MultiPartRegistry.scala with a Java registry, its companion
singleton and the three nested interfaces. All three interfaces are
descriptor-identical to the reference and MODULE$ keeps every instance
method downstream links against. Twelve jars reference this type.
Both Scala-typed registerParts descriptors are preserved, since
ForgeRelocationFMP links against the Function2 form and ProjRed against
the IPartFactory2 Seq form. That leaves TileMultipart.partList as the last
Scala-typed descriptor in the inventory.
The two array overloads are declared varargs. The descriptor is unchanged
and ACC_VARARGS does not affect linkage, but MicroblockClass called the
Scala varargs form with a single string, which no longer resolves against
a plain array parameter.
readIDMap moves to java.util.List and the mangled accessors Scala emitted
for its closures are gone; neither is referenced by any jar. Eight anonfun
classes and one anonymous class are replaced by the two Java adapters the
deprecated overloads build.
Validated with 78 plain-JVM tests, a clean build, and the Java 8 Forge
dedicated-server suite, which is the only layer where registration can run
at all since it needs FML's active mod container.
Splits the characterization across both layers, because part registration
needs FML's active mod container and throws without one, so it cannot run
headless at all.
Plain JVM covers what is reachable: converters are dispatched per block,
a converter returning null does not stop the scan, converters registered
for another block are never consulted, a converter claiming several blocks
is registered for each, and an unknown mod container throws rather than
returning null.
The Forge server suite covers registration itself, and deliberately
exercises both overloads downstream depends on. Content registers through
the deprecated IPartFactory array form that seven jars use, and each
microblock class registers through the IPartFactory2 varargs form that
ProjRed uses, so resolving mc_torch and mcr_face proves both paths. Part
ids also round trip through the shared IDWriter carrier.
78 plain-JVM tests and 5 server tests, all passing against the untouched
Scala.
Replaces MicroMaterialRegistry.scala with a Java registry, its companion
singleton and the two nested interfaces. Both nested interfaces are
descriptor-identical to the reference and MODULE$ keeps every instance
method ProjRed links against. Ten jars reference this type and three more
reach it reflectively, so the surface was checked member by member rather
than by descriptor count.
getIdMap keeps its scala.Tuple2 array because extrautilities links against
it, so the registry still stores tuples internally. readIDMap moves from
scala.collection.Seq to java.util.List, which no jar references; the one
in-repo caller moved from mkString to String.join. That clears one of the
five Scala-typed descriptors the inventory identified.
Three removals, all verified unreferenced: the mangled public accessors
Scala emitted so its closure classes could reach private state,
IMicroMaterial$class, and the MissingMicroMaterial forwarders for the two
members it does not override. The last of those was caught by the
characterization failing to compile, not by inspection.
IMicroMaterial's loadIcons, canRenderInPass and isSolid become real Java
defaults, so implementors can inherit rather than restate them. Eleven
anonfun classes are gone.
Validated with 73 plain-JVM tests passing against both the Scala baseline
and the port, a clean build, and the Java 8 Forge dedicated-server suite,
which exercises setupIDMap and calcMaxCuttingStrength during real startup.
Freezes the registry lifecycle before the port: setupIDMap sorts the type
map by name into the id array, ids are the index into it, materialID and
materialName round trip, remapName resolves on both getMaterial(String)
and materialID, getMissingId points at the registered placeholder rather
than falling back to zero, ids round trip through the shared IDWriter, and
a highlight renderer that claims the highlight short-circuits the default
client renderer.
Also freezes the two members IMicroMaterial supplies. A Java class cannot
inherit them today, so they are observed through MissingMicroMaterial,
which overrides only isTransparent and loadIcons.
Two limits are deliberate and recorded in the test. The registry is global
mutable state, so both test classes guard their registrations and assert
only relative facts. The error paths are not covered at all: they call the
microblock logger, which is null until MicroblockProxy.preInit runs.
Adds a frozen Scala 2.11.5 consumer compiled against the reference dev jar
at 52ff8ff, reading MODULE$ and the raw scala.Tuple2 array.
73 plain-JVM tests, all passing against the untouched Scala.
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.
Freezes the one supplied member before the port: getMaxCuttingStrength
asks the saw about a stack of itself, so the stack handed to
getCuttingStrength wraps the saw and has size 1.
Unlike the constant-returning bridges ported so far, this one dispatches
getCuttingStrength through the interface, so a subclass override is
honoured even when the bridge is called directly. That is asserted
explicitly.
Adds a frozen Scala 2.11.5 consumer compiled against the reference dev jar
at 0de7283. It reports its strength only when handed a stack that actually
wraps itself, so the test proves the bridge built the stack rather than
only that it linked. ProjRed is the only consumer.
First characterization outside codechicken.multipart; these tests live in
codechicken.microblock alongside the type under test.
65 plain-JVM tests, all passing against the untouched Scala.
Replaces TEdgePart.scala with a Java interface and retains the
TEdgePart$class bridge for OpenComputers. 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.
TMultiPart does not declare conductsRedstone and neither does anything in
the microblock superclass chain, so it becomes a real default method and
no in-repo Scala needed changing. The generated microblock classes now
resolve the interface default instead of a Scala trait forwarder, which
the functional generation case added during the TFacePart port covers.
conductsRedstone is kept on the bridge even though OpenComputers only
links against $init$, since the bridge class is being kept regardless.
Validated with 61 plain-JVM tests, a clean build, and the Java 8 Forge
dedicated-server suite.
Freezes the single trait default before the port: conductsRedstone returns
false, TEdgePart extends TSlottedPart, and the $class static holds the
default rather than dispatching, so an overriding part gets its own value
from a direct call but false from the bridge.
The member is abstract on the reference interface, so a Java class cannot
inherit it today; the test part mirrors the forwarder Scala emits instead,
which keeps the file compiling before and after the port.
Adds a frozen Scala 2.11.5 consumer compiled against the reference dev jar
at f2f1870. OpenComputers is the only consumer, and it links against
$init$ rather than conductsRedstone.
61 plain-JVM tests, all passing against the untouched Scala.
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.
Freezes the placement logic before the port. getHitDepth projects the hit
vector onto the axis for that side and adds 1 on even sides, giving the
six frozen values, and it copies the vector rather than mutating the
caller's. onItemUse tries the clicked block first only when the depth is
below 1, then always tries the neighbour on that side, reusing and
mutating a single BlockCoord across both attempts.
Placement short-circuits as soon as newPart returns null, before any
world, player or stack access, so all of that is reachable headless with
null arguments. Real placement needs a world and stays on the functional
and manual layers.
Adds a frozen Scala 2.11.5 consumer compiled against the reference dev jar
at 7843f13, whose forwarders call all three statics. ProjRed is the only
consumer of this bridge.
57 plain-JVM tests, all passing against the untouched Scala.
Replaces TIconHitEffects.scala with Java implementations of IconHitEffects,
JIconHitEffects, TIconHitEffects and both $class bridges. The two
interfaces are descriptor-identical to the reference; the statics class
and both bridges add only a private constructor. A frozen Scala consumer
compiled against the reference jar still links through all five statics.
The default-versus-abstract rule discriminates within this one file.
JIconHitEffects.getBreakingIcon becomes a real default because TMultiPart
does not declare it, so Java implementors can now inherit it.
TIconHitEffects.addHitEffects and addDestroyEffects stay abstract because
TMultiPart does declare them and a default would silently lose.
MicroblockClient, the one in-repo case, now declares that pair explicitly.
Removes IconHitEffects$ and its MODULE$ field. No jar in the pack
references it, in bytecode or by name; consumers use either the static
forwarders on IconHitEffects or the two $class bridges. This is the first
public class dropped rather than a method, and it contrasts with
NormalOcclusionTest$, which is referenced and was kept.
Evaluation order inside addDestroyEffects is preserved rather than hoisting
the tile read, since the characterization pins which work happens before a
null tile fails.
Validated with 49 plain-JVM tests, a clean build, and the Java 8 Forge
dedicated-server suite.
Freezes what is reachable without a client: getBreakingIcon falls back to
getBrokenIcon for the same side and ignores its subPart argument, destroy
effects request sides 0 through 5 in order, and the scaleDensity overload
decides whether the part's own bounds are consulted at all. The particle
calls need a world and an EffectRenderer, so actual appearance stays on
the manual checklist.
Adds a frozen Scala 2.11.5 consumer compiled against the reference dev jar
at 57130a6. It exercises both bridges: getBreakingIcon proves
JIconHitEffects$class delegates to the fixture's getBrokenIcon, and
addDestroyEffects proves TIconHitEffects$class resolves by collecting all
six icons before failing on the null tile.
49 plain-JVM tests, all passing against the untouched Scala.
Replaces TFacePart.scala with a Java interface and retains the
TFacePart$class bridge for OpenComputers, ProjRed and ProjectBlue. The
interface is descriptor-identical to the reference; the bridge adds only a
private constructor.
This is the first converted trait where Java default methods are safe.
TMultiPart declares neither solid nor redstoneConductionMap, and neither
does anything in the microblock superclass chain, so there is no
superclass method for a default to lose to. Both members therefore become
real defaults rather than staying abstract with explicit forwarders, and
no in-repo Scala needed changing. The rule for the remaining traits is to
check that condition before choosing.
A side effect is that Java classes can now inherit these members;
McSidedMetaPart previously had to declare both just to accept the
defaults, and stays descriptor-identical.
Adds the first functional coverage of runtime class generation against a
ported type. Microblock classes are built by ASM at run time, so the
server suite now checks that a generated FaceMicroblock resolves the
inherited default and that a generated HollowMicroblock still returns its
own overrides.
Validated with 43 plain-JVM tests, a clean build, and the Java 8 Forge
dedicated-server suite at 3 tests.
Freezes the trait defaults before the port: solid returns true for every
side including out-of-range values, and redstoneConductionMap returns 0.
Also freezes that TFacePart extends TSlottedPart, and that the $class
statics hold the defaults rather than dispatching, so an overriding part
gets its own values from a direct call but the trait values from the
bridge.
Both members are abstract on the reference interface, so a Java class
cannot inherit them today; the test part mirrors the forwarders Scala
emits instead, which keeps the file compiling before and after the port.
Adds a frozen Scala 2.11.5 consumer compiled against the reference dev jar
at a1bf3c8, whose forwarders call all three statics. OpenComputers,
ProjRed and ProjectBlue depend on them.
43 plain-JVM tests, all passing against the untouched Scala.
Replaces TNormalOcclusion.scala with Java implementations of the six types
it held: NormalOcclusionTest, NormalOcclusionTest$, JNormalOcclusion,
TNormalOcclusion, TNormalOcclusion$class and NormallyOccludedPart. The
singleton and both interfaces are descriptor-identical to the reference;
the other three add only private members. A frozen Scala consumer compiled
against the reference jar still links through forwarder, $class, singleton
and super accessor.
Scala emits trait super accessors as ACC_SYNTHETIC, which javac hides
entirely, so an abstract synthetic method cannot be implemented by any
Java class or by Scala recompiled against a Java interface.
codechicken$multipart$TNormalOcclusion$$super$occlusionTest is therefore a
non-synthetic default returning true, the identity for the && chain the
bridge builds. Method resolution ignores the flag, so existing call sites
are unaffected.
Both in-repo mixins needed work, in different ways. HollowMicroblock had
no occlusionTest override and now declares one. PostMicroblock already had
one ending in super.occlusionTest, which used to route through the trait
and would now reach Microblock directly, silently dropping the box test;
the same expression was substituted at that call site.
Two further source-only divergences, both recorded: apply sugar on
NormalOcclusionTest no longer compiles for Scala callers, and
NormallyOccludedPart loses the scala.runtime.Null$ getType variant that
Scala inferred for a null literal. No jar in the pack references either.
Validated with 38 plain-JVM tests, a clean build, and the Java 8 Forge
dedicated-server suite.
Extends the occlusion characterization to the parts of the area the port
will touch: the NormalOcclusionTest$ singleton and its MODULE$ field, the
TNormalOcclusion$class bridge, the super accessor the bridge calls back
through, NormallyOccludedPart's single-box constructor that AE2 links
against, and its null getType.
The generated codechicken$multipart$TNormalOcclusion$$super$occlusionTest
accessor is ACC_SYNTHETIC on the reference interface, so javac neither
sees nor allows implementing it. It is reached by reflection here, and the
port has to expose it as an ordinary method for any new implementor to be
able to satisfy it.
Adds a frozen Scala 2.11.5 consumer compiled against the reference dev jar
at cd6420f. It mixes in the trait without overriding occlusionTest, so
invoking it covers the whole bridge round trip: forwarder, $class,
singleton, and the callback through the accessor. ForgeRelocationFMP,
OpenComputers and ProjRed all depend on that path.
38 plain-JVM tests, all passing against the untouched Scala.
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.
Freezes the observable behavior of TCuboidPart, JCuboidPart and the
TCuboidPart$class bridge before the Java port, per the test-first gate in
JAVA_MIGRATION.md. All cases pass against the untouched Scala.
Records two asymmetries worth preserving: getSubParts wraps the bounds in
an IndexedCuboid6, whose copy constructor makes it a copy carrying a boxed
Integer 0 as data, while getCollisionBoxes aliases the bounds instance
itself. Cuboid6 has no equals, so geometry is compared component-wise.
Also adds a frozen Scala consumer compiled with 2.11.5 against the
reference dev jar at 246daff. Its forwarders call all four $class statics,
so it detects the linkage break that a freshly recompiled test would miss.
ForgeRelocationFMP, OpenComputers, ProjRed and ProjectBlue all depend on
those descriptors.
One case exists specifically to guard the port: TMultiPart supplies empty
getSubParts and getCollisionBoxes, and on the JVM a superclass method beats
an interface default, so a Java interface cannot reproduce Scala trait
linearization on its own.
The downstream ABI inventory scanned 240 mod jars in GTNH daily
2026-08-14+678 and found no consumer of either bridge. Both were written
speculatively, before the inventory existed.
IDWriter had no downstream reference at all, so its four Scala function
accessors are removed and the class now selects a carrier width directly.
That also removes the Integer boxing and Function1/Function2 allocation
per read and write that the first port had preserved. Calling write or
read before setMax now throws IllegalStateException rather than
NullPointerException; no caller reaches that state.
JPartialOcclusion$class had no downstream reference either. The two
consumers that touch JPartialOcclusion only call getPartialOcclusionBoxes,
and the two jars that implement the interface emit no call to the helper.
The interface and both of its method descriptors are unchanged. The
ReferenceScalaPartialOcclusion fixture is removed with the helper it
existed to verify.
Validated with 27 plain-JVM tests, a clean checkstyleTest build with
Spotless re-enabled, and the Java 8 Forge dedicated-server suite.