Add Phase 9 and Phase 10 to the migration plan.
Phase 9 is a deprecation pass, not a redesign. The published API is already
largely Java-shaped; nine public entries still carry Scala types, two of which
already have a Java sibling. It also covers a second problem: private[multipart]
compiles to public, so seventeen implementation hooks are advertised as API.
Phase 10 covers upstream consumer cleanup, where consumer-side reflection and
Scala-trait registration constrain FMP internals. It is unsequenced and parts of
it can land before this port merges. ProjectRed's is not one of them, so its two
blockers are recorded as Phase 7 prerequisites.
Phase 8 now notes that removing Scala from FMP has no pack-level payoff.
Preserve the exact generated client interfaces, render-cache behavior, and ordered display ticks.
Teach Java mixin generation to linearize a registered parent and exclude transient runtime caches from copying.
Keep TIInventoryTile as AE2's public rebuild API and JInventoryTile as the registered mixin input, preserving both generated interfaces and flattened sided-slot behavior.
Preserve the exact generated interface and ordered fluid behavior.
Isolate FluidStack.amount access outside the transformed class. The transformer treats every field read as trait-owned state.
Kept in the TickScheduler$ shape: the companion holds the implementation
because Forge registers that instance itself, and the plain class holds static
forwarders. Both halves are load-bearing for different reasons -- guidenh
resolves renderWorldBlock as a static first and falls back to MODULE$ -- and
neither has a bytecode consumer, only reflective names.
The emitted class list is unchanged. All five rendering callbacks keep their
signatures, MODULE$ keeps its type and flags, and both classes keep class-level
@SideOnly(CLIENT). Only three Scala forwarders for inherited
TileEntitySpecialRenderer members and the companion clinit's ACC_PUBLIC differ.
The render id is still claimed in the singleton's initialiser, matching the
reference's first-access timing. The breaking-overlay branch moved to a private
helper that checks the erased Tuple2 and the boxed index before unboxing, which
is what the reference's pattern match compiled to.
125 plain-JVM tests and 22 Forge server tests pass, none changed by the port.
This class needs a client, so it adds nothing to either suite and everything to
the manual checklist.
A Scala package object compiles to a class literally named 'package', and that
is a Java keyword, so no Java source can declare or even name it. The
characterization had to reach both through Class.forName, which is the argument
in one line. There is no Java form to port to.
Each held exactly one member, a logger alias for its proxy, so the indirection
is inlined at its eight call sites: ConfigContent (7) and MultipartGenerator
(1). The functional characterization asserted beforehand that each alias
returned the very instance its proxy holds, so the substitution is an identity;
both classes are descriptor-identical afterwards.
Exactly four classes leave the jar and nothing else changes. No consumer
referenced them, and no Java consumer could have.
120 plain-JVM tests and 22 Forge server tests pass. PackageObjectCharacterization
went with its subject; ProxyLoggerFunctionalTest keeps the assertion worth
having, that both proxies publish a logger during preInit.
isControlDown(EntityPlayer) and isClientPressing() keep their descriptors.
map() became a java.util.Map and isClientPressing_$eq became setClientPressing.
Dropped playerControlValue and ControlKeyValue. They existed only to give Scala
player.isControlDown sugar through an implicit conversion, and the reference
already shipped the explicit static 'for Java users'. MicroblockPlacement now
calls that static directly.
ControlKeyHandler was a Scala object extending KeyBinding, so the instance both
the key registry and the event bus needed was ControlKeyHandler$.MODULE$. It is
now an ordinary KeyBinding subclass with an INSTANCE constant, which also drops
the twelve static forwarders Scala generated for inherited KeyBinding members.
The misspelling in ControlKeyModifer is the published type name and is kept;
only the file name, which said ControlKeyModifier.scala, is corrected.
120 plain-JVM tests and 21 Forge server tests pass, none of them changed by the
port.
IScheduledPacketPart is descriptor-identical and schedulePacket is unchanged.
TScheduledPacketPart.read stays abstract: TMultiPart declares read, so a
default would be shadowed and a part would silently read a description instead
of a mask. The dispatch that lived in the $class helper is now the interface
static readMask, with the one-line forwarder documented on read.
writeScheduled and readScheduled became defaults. TMultiPart declares neither,
and empty bodies are what mixing the Scala trait in already gave a Scala
implementor -- only Java implementors ever had to write them out.
sendScheduled is public because the reference's private[multipart] reaches the
handler package and Java has no equivalent scope. An unsupported mask width now
throws IllegalArgumentException rather than scala.MatchError; both are
RuntimeException and the map is still left uncleared on that path, as before.
Dropped PacketScheduler$, TScheduledPacketPart$class and two closure classes,
none referenced in bytecode or by reflective name.
118 plain-JVM tests and 18 Forge server tests pass.
The first port free to change shape rather than preserve it: TileCache has zero
downstream references in bytecode and does not appear in guidenh's reflective
names. map() became a java.util.Map, add/remove became void, and apply returns
a nullable FlaggedTile instead of a scala.Option. No internal caller used any
of the discarded return values.
Dropped TileCache$, TileCache$FlaggedTile$ and FlaggedTile's case-class
machinery. It is only ever a map value, never compared, hashed, printed or
destructured.
findTile is unchanged, including the branch the reference obscures: its
trailing 'case _ => null' is unreachable because Some(FlaggedTile(t, rem))
matches whatever the flag holds, so a tile flagged removed is returned like any
other and only the warning is suppressed. That is pinned by a functional test
written before the port.
114 plain-JVM tests and 13 Forge server tests pass; the only test change is the
two-line adapter that stopped unwrapping a scala.Option.
The constant-pool scan sees the 20 names guidenh reflects on but not the
members it looks up on them. Read from the checked-out source at 6137525.
Adds three constraints the ABI diff cannot see: MultipartGenerator$.MODULE$ is
the only route to generateCompositeTile because it is private[multipart] and
gets no static forwarder; MicroblockGenerator$.create is matched by exact
parameter types with MicroblockClass's FQN string-compared; and
TileMultipart.partList_$eq is reflectively load-bearing despite having no
Java-facing equivalent.
Verified the last of those survived the TileMultipart port already on this
branch, along with loadParts, notifyTileChange and markRender.
MultipartHelper, MultipartHelper$ and MultipartHelper$IPartTileConverter are
all public-member- and descriptor-identical to the reference, and the full
emitted class list is unchanged -- this port neither adds nor removes a class.
MultipartHelper gains a private constructor and its companion's class
initializer loses ACC_PUBLIC, neither of which is nameable by a caller.
MultipartHelper$ was kept deliberately. It is not among the 17 MODULE$
singletons read from bytecode and no jar links against it, but guidenh names it
as a reflective string, and removing a companion breaks that invisibly.
createTileFromParts now builds one JavaConversions wrapper for both calls
instead of one per call site, and convertMulti returns Collections.emptyList or
singletonList instead of a Scala Seq wrapper. The declared type was always
java.lang.Iterable.
107 plain-JVM tests and 10 Forge server tests pass unchanged.
TSlottedPart, IRandomDisplayTick, INeighborTileChange, TRandomUpdateTick,
ISidedHollowConnect and IMicroMaterialRender.
All six are member- and descriptor-identical to the reference. The seven
implementors and mixin tiles were diffed too and are unchanged member for
member. Five were already pure abstract interfaces in bytecode, so their
conversion has no bytecode consequence; exactly one class leaves the jar,
TRandomUpdateTick$class.
onWorldJoin cannot become a default: TMultiPart declares it, and a superclass
method beats an interface default, so the auto-registration would silently
never run. It stays abstract and implementors call TickScheduler.loadRandomTick
themselves, as RedstoneTorchPart already did.
No bridge was written for TRandomUpdateTick$class. No jar in the pack
references TRandomUpdateTick in any form, and the frozen baseline holds exactly
the eight helpers the inventory lists.
99 plain-JVM tests and 5 Forge server tests pass.
The plan still showed Phases 2, 3 and 8 as untouched while most of their
work is done or answered. Adds a current status section, marks the items
that are genuinely complete, and explains why the two open Phase 2 items
are open because conversion is in progress rather than because the
approach is undecided.
Records the working rules the conversions produced, since they are the
part worth carrying into the remaining areas: check the inventory before
writing a bridge, only emit a default when no superclass in the chain
declares the member, audit existing super call sites rather than only
missing overrides, and diff concrete implementors when a trait gains a
default.
Also adds JAVA_MIGRATION_MANUAL_CHECKS.md, closing a Phase 0 item. Each
port so far has deferred something to "the manual checklist" without one
existing; this collects those into rendering, placement and downstream
integration checks, and states what is still covered nowhere.
Notes that Phase 1 has not properly started: GTNHLib is present but was
added at api scope to satisfy a test compile rather than because a
migration change needed it.
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.
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.
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.
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.
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.
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.