Commit Graph
483 Commits
Author SHA1 Message Date
Algent f2f1870931 refactor: port TItemMultiPart to Java
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.
2026-08-14 21:25:57 +02:00
Algent 6813144d84 test: characterize TItemMultiPart
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.
2026-08-14 21:23:45 +02:00
Algent 7843f13792 refactor: port TIconHitEffects to Java
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.
2026-08-14 21:16:28 +02:00
Algent 07ffc01db1 test: characterize TIconHitEffects
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.
2026-08-14 21:12:52 +02:00
Algent 57130a6955 refactor: port TFacePart to Java
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.
2026-08-14 21:00:18 +02:00
Algent d71a4b893d test: characterize TFacePart
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.
2026-08-14 20:56:55 +02:00
Algent a1bf3c8c86 refactor: port TNormalOcclusion to Java
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.
2026-08-14 20:30:11 +02:00
Algent 75900d0602 test: characterize TNormalOcclusion
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.
2026-08-14 20:24:28 +02:00
Algent cd6420f7f2 refactor: port TCuboidPart to Java
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.
2026-08-14 20:12:22 +02:00
Algent 8294240659 test: characterize TCuboidPart
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.
2026-08-14 20:03:33 +02:00
Algent 246dafffda refactor: drop unused IDWriter and JPartialOcclusion Scala bridges
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.
2026-08-14 19:52:28 +02:00
Algent 78959e70e9 docs: inventory downstream ForgeMultipart ABI consumers 2026-08-14 19:48:01 +02:00
Algent 5c087c50b5 run spotless 2026-08-14 19:44:56 +02:00
Algent 224380b708 Revert "Disable spotless for now"
This reverts commit 1da31d9ab2.
2026-08-14 19:44:09 +02:00
Algent a0428b9994 refactor: port partial occlusion to Java
Keep the Scala trait helper so reference-compiled implementations remain linkable.
2026-08-14 18:24:59 +02:00
Algent 60818853e3 test: freeze Scala partial-occlusion ABI
Load a reference-compiled consumer so the Java bridge must retain the Scala trait helper.
2026-08-14 18:19:18 +02:00
Algent 2c610bdb48 refactor: port IDWriter to Java
Keep Scala function descriptors as deprecated bridges while adding primitive Java entry points.
2026-08-14 18:02:03 +02:00
Algent 07530d93bf test: characterize partial occlusion
Freeze voxel ownership and visibility rules before the Java port.
2026-08-14 17:46:30 +02:00
Algent a69f846775 test: characterize normal occlusion
Freeze contact tolerance and partial-box delegation before the Java port.
2026-08-14 17:38:53 +02:00
Algent 4ae2a6d0fa test: add Forge server characterization
Run JUnit after FML server startup and gate the task on fresh XML because Forge can exit zero after a test-mod exception.
2026-08-14 17:27:18 +02:00
Algent e33d3b2493 Add first characterization tests 2026-08-14 16:52:22 +02:00
Algent 1da31d9ab2 Disable spotless for now 2026-08-14 16:49:50 +02:00
Algent cc02aca44e Migration Plan 2026-08-14 16:48:43 +02:00
Ryan Nasers f10595d062 Isbrh interface fmp (#53) 1.7.12 2026-08-13 12:14:59 +02:00
Jason Mitchell 7221176efd Maybe more thread safe renderpass (#50) 1.7.11 2026-07-22 15:30:42 -07:00
DarkShadow44andRecursivePineapple aa7d02cfb0 Don't use rock material (#45)
Co-authored-by: RecursivePineapple <[email protected]>
1.7.9 1.7.10
2026-07-05 00:05:47 +00:00
FourIsTheNumber d2ce5b7362 Add postea transformer for microblock items (#48) 2026-07-04 20:02:17 -04:00
Caedis 09e2b847fc fix(microblock): prevent microblocks becoming blood rune slabs (#47) 1.7.8 2026-06-21 09:20:32 +02:00
Dan faa052f70c fix npe on chunk unload when tile is null (#46) 1.7.7 2026-06-05 20:58:04 +02:00
Alexdoruandboubou19 15298cb677 [Memory-opti:fix leak] fix world client leak in renderer (#44)
Co-authored-by: boubou19 <[email protected]>
1.7.6
2026-04-30 11:18:51 +02:00
Alexdoru d3054211db [Memory-opti:fix leak] fix world client from keybind handler (#43) 2026-04-30 11:13:22 +02:00
Martin Robertz 732f64a1b4 update+gradle+deps+bs 1.7.5 2026-04-27 13:42:24 +02:00
UltraProdigy 2a5e2a150f Optimize Images & Workflow (#42) 2026-04-26 08:39:13 +02:00
Alexdoru 1a4edfbc89 fix world server leak (#41) 1.7.4 2026-04-14 14:48:23 +00:00
Worive 525fcc56ad Update buildscript to v2 (#40) 1.7.3 2026-03-08 19:23:42 +01:00
Woriveandgithub-actions[bot] a36120fc91 Add dynamic render option without relying on doesTick (#38)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1.7.2
2025-12-08 10:50:16 +01:00
Worive 238b041f12 Revert light value caching, applying better iteration to avoid null exceptions (#37) 2025-12-08 10:04:49 +01:00
Worive 0b0e99024d Optimize FMP Rendering and memory leaks (#35) 1.7.1 2025-12-06 12:07:08 +01:00
Martin Robertz a1db9a100e update 1.7.0 2025-10-24 23:00:37 +02:00
DarkShadow44 3c42abd7ac Allow y coordinates bigger 255 (#32) 2025-10-24 05:34:05 +00:00
Alexdoru f3a0ab0568 Delete DepLoader and declare depency properly (#31) 1.6.8 2025-08-01 00:42:50 +02:00
Caedis a0af5e19cf Force render return type to Unit (#30) 1.6.7 2025-07-02 01:16:53 +00:00
Alexdoru 3f27188181 Fix crash introduced by memory leak fix (#29) 1.6.6 2025-06-07 11:55:43 +02:00
Martin Robertz 4fc6b9cff2 sa 2025-06-05 21:45:59 +02:00
Maya ef67761bc3 update 1.6.4 2025-06-03 12:52:42 -06:00
Alexdoru d50ec43d76 Fix WorldClient leak (#28) 2025-06-03 12:52:09 -06:00
David Lindström 05eb683a33 Forward material to shader (#27) 1.6.3 2025-05-27 23:22:56 +02:00
Dream Master 11b6142320 update 1.6.2 2025-01-15 12:39:45 +01:00
Glease de264540d2 fix rare client world leak (#26) 2025-01-13 00:12:45 -06:00
Martin Robertz bc3542efd2 fix Instance() 1.6.0 2024-12-31 15:41:21 +01:00