From 15c062ec0428f94255c4a023bde8e3b8bf4313df Mon Sep 17 00:00:00 2001 From: Darto KLoning Date: Sat, 3 Oct 2026 16:57:41 +0700 Subject: [PATCH] Handcrafted 4.0.16 --- PORTING-NOTES.md | 132 ------------------------ README.md | 255 ++++++++++++++++++++++++++++++++++++++++++++-- gradle.properties | 2 +- 3 files changed, 250 insertions(+), 139 deletions(-) delete mode 100644 PORTING-NOTES.md diff --git a/PORTING-NOTES.md b/PORTING-NOTES.md deleted file mode 100644 index 15f653f..0000000 --- a/PORTING-NOTES.md +++ /dev/null @@ -1,132 +0,0 @@ -## 4.0.12 — Minecraft 26.2 riding gate fix -- Diagnostic 4.0.11 isolated the failure to `player.startRiding(seat)`: the Seat spawned successfully but mounting returned false. -- Verified against Minecraft 26.2 `Entity.startRiding`: server-side riding is rejected when the vehicle entity type reports `canSerialize() == false`. -- Handcrafted registered `Seat` with `EntityType.Builder.noSave()`, which makes the Seat non-serializable and therefore impossible to ride on 26.2. -- Removed `.noSave()` from the Seat entity registration. The Seat still self-discards when it has no passenger or its furniture block is gone, so it remains ephemeral during normal gameplay. -- Kept the 4.0.11 diagnostic logging for this test build so the result can be confirmed from the next log. - -## 4.0.9 — Seat synchronization fix -- Compared the Fabric 26.2 port directly against the original 1.21.x seating implementation. -- The current debug log proves server-side mounting already succeeds: the client reports `Received passengers for unknown entity`. This means the failure is no longer the chair/bench/couch interaction callback; the invisible `Seat` vehicle is not known client-side when the passenger update arrives. -- Removed the legacy custom `ClientboundAddEntityPacket`/`recreateFromPacket` override from `Seat` so Minecraft 26.2 uses its native entity spawn/tracking packet path. -- Kept one-passenger acceptance and the 26.2 passenger attachment implementation. -- `compile.bat` and `compile.sh` now read both `mod_version` and `archives_base_name` from `gradle.properties` when detecting an already-built JAR. Existing-JAR Compile/Git-only behavior and first-time Git guidance are preserved. - -# Handcrafted Fabric 26.2 port - -Target: Minecraft 26.2 / Fabric only / Java 25. - -Dependencies: -- Fabric Loader 0.19.3 -- Fabric API 0.161.0+26.2 -- Resourceful Lib 5.0.4 for Fabric 26.2 - -This workspace collapses the old common+Fabric Architectury build into one Fabric Loom project while preserving the original source/resource trees. -The Architectury `@ExpectPlatform` client renderer bridge has been replaced by its direct Fabric implementation. -NeoForge is intentionally excluded. - -## Windows -- `compile.bat` : clean build using Java 25 / Gradle 9.7.1 -- `test.bat` : run development client or dedicated server - -## Important -Minecraft 26.2 contains substantial source/API changes relative to 1.21.1. The project configuration is ported to the 26.2 toolchain, but source-level migration must be driven by compiler errors against the real 26.2 dependencies. If a build error remains, keep the complete compiler output so the affected APIs can be migrated precisely. - -## port.2 -- Updated Gradle from 9.5.1 to 9.7.1 because the current Fabric Loom 1.18-SNAPSHOT resolves to Loom 1.18.2, whose plugin metadata requires Gradle Plugin API 9.7.x. -- Kept Loom 1.18-SNAPSHOT, matching the current Fabric 26.2 example project. - -## port.6 -- Migrated 26.2 `BlockBehaviour#updateShape` signatures to `LevelReader` + `ScheduledTickAccess` + `RandomSource`. -- Migrated removed `onRemove` overrides to `affectNeighborsAfterRemoval` for server-side removal cleanup. -- Migrated `Painting` / `PaintingVariant` package to `world.entity.decoration.painting`. -- Replaced removed `ItemNameBlockItem` with `BlockItem` (same constructor role in 26.x). -- Migrated registry lookups from holder-returning `get` to value-returning `getValue` where an `Item` is required. -- Migrated Crockery block-entity persistence to `ValueInput` / `ValueOutput` and `ItemStack.CODEC`. -- Removed obsolete code-side chunk render-layer registration; 26.x determines chunk layer from model/material/texture transparency. -- Removed legacy `javax.annotation.ParametersAreNonnullByDefault` usage. -- Updated `Level#getMaxBuildHeight()` usage to `getMaxY()` for 26.x. - -The remaining major migration area is the 26.2 extract/submit rendering pipeline for FancyPainting and Crockery renderers. - - -## port.7 -- Fixed malformed braces introduced during the port.6 removal-hook migration. -- Removed stale `newState` comparisons from `affectNeighborsAfterRemoval`, whose 26.2 signature no longer supplies a replacement state. - -## port.8 -- Added missing 26.2 imports for `LevelReader`, `ScheduledTickAccess`, and `RandomSource`. -- Migrated container persistence to `ValueInput` / `ValueOutput`. -- Migrated furnace fuel duration signature to `FuelValues`. -- Migrated block entity registration to FabricBlockEntityTypeBuilder (vanilla builder is no longer public). -- Migrated entity type construction to `ResourceKey>`. -- Updated comparator output methods for the new Direction parameter. -- Started entity persistence migration (`Seat`, `FancyPainting`). -- Replaced removed direct vanilla block constants used as property templates with registry lookups. -- Fixed Unix helper scripts for macOS Bash 3.2 case handling. - -## port.9 -- Removed stale `net.minecraft.world.tick.ScheduledTickAccess` imports left alongside the 26.2 `net.minecraft.world.level.ScheduledTickAccess` type. -- Updated shift-key detection to `Minecraft.getInstance().hasShiftDown()`. -- Added the required 26.2 `Entity#hurtServer` implementation for seat entities. -- Migrated custom painting entity data to `TypedEntityData`, `EntityTypes.PAINTING`, lookup-based painting variant access, and component-backed painting variant mutation. -- Updated client/server interaction result handling and POI holder lookup for 26.2. -- Removed obsolete FancyBed block-entity factory override and stale container open/close override annotations. -- Renderer migration remains the next major compile category (26.2 render-state/submit pipeline). - - -## port.10 -- Migrated renderer class signatures to the 26.2 render-state/submit API to expose remaining compile errors. -- FancyPainting and Crockery custom drawing is temporarily no-op during compile isolation; it must be restored before final release. -- Removed obsolete TypedEntityData application from CustomPaintingItem pending final data-component migration. - - -## port.11 -- Fixed Minecraft 26.2 strict block/item instantiation: every Handcrafted BlockBehaviour.Properties / Item.Properties now receives its ResourceKey via setId before the object constructor runs. -- This addresses the runtime crash `NullPointerException: Block id not set` seen first at OvenBlock. -- Retains the Bash 3.2-safe compile.sh/test.sh scripts from port.10. - -## 4.0.4-fabric-26.2 -- Migrated legacy model resources rejected by Minecraft 26.2 model baking. -- Normalized negative/out-of-range UV coordinates in all stackable-book base models. -- Normalized the same legacy negative UVs in pillager/vindicator trophy models. -- Rescaled witch trophy Y geometry to the modern cuboid boundary while preserving its proportions. -- Removed the block-model dependency on the item-atlas `minecraft:item/bow` sprite in skeleton trophy. -- Replaced the missing `minecraft:block/chain` reference in phantom trophy with an existing Handcrafted block-atlas texture. - -## 4.0.4-fabric-26.2 -- Added Minecraft 26.2 client item definitions under `assets/handcrafted/items/` for every legacy `models/item` entry. This fixes items that render as the magenta/black missing-model placeholder in inventory/hand while their placed block model renders normally. -- Restored empty-hand seating interaction through `useWithoutItem(...)` for chairs, modular seats (benches/couches), and dining benches. On modern Minecraft, an empty-hand block interaction does not enter the item-specific `useItemOn(...)` path, which previously contained the only call to `sitOn(...)`. -- Kept item-held interaction behavior intact so cushion customization still runs through `useItemOn(...)`. - - -## Port 14 runtime/data fixes -- Migrated legacy recipe ingredient objects (`{item: ...}` / `{tag: ...}`) to the Minecraft 26.x ingredient string syntax. -- Added `item.handcrafted.*` translation aliases for registered block-items so tooltips no longer expose raw translation keys. -- Empty-hand seating now reports client-side success before the authoritative server creates the seat entity. -- Retargeted the legacy oversized-model mixin to `CuboidModelElement.Deserializer#getPosition` used by 26.2. -- Added missing particle references to fancy-bed item models. - - -## 4.0.4-fabric-26.2 -- Switched from temporary port-number versioning to release-style `4.0.4-fabric-26.2`. -- Updated Phantom Trophy recipe from removed `minecraft:chain` to `minecraft:iron_chain`. -- Removed stale Java 21 compatibility declarations from Mixin configs; Minecraft 26.2 runs on Java 25. -- Restored Seat.makeBoundingBox() lost during the API migration and made seating success conditional on Player.startRiding(). -- Seat occupancy is now tracked after a successful mount. -- Added missing Handcrafted item-tag display translations. - -## 4.0.4 Fabric 26.2 build fix -- Removed the legacy `Seat.makeBoundingBox()` override. In Minecraft 26.2, `Entity.makeBoundingBox()` is final and cannot be overridden. -- The seat-specific AABB is still retained for seat height/passenger attachment calculations and is refreshed by the wrapped level callback. - - -## 4.0.11-fabric-26.2 -- Reworked seat interaction dispatch to mirror Refurbished Furniture: seating is performed from `useWithoutItem`; held-item paths return `TRY_WITH_EMPTY_HAND` after Handcrafted-specific cushion handling. -- Removed client-side fake success from `SittableBlock.sitOn`; `Seat.sit` is server-authoritative like the reference implementation. -- Seat blocks now return `SUCCESS` after the empty-hand interaction attempt, matching the reference block behavior. -- Added concise server-side Seat attempt/result diagnostics so a failed mount is visible in `latest.log`. - -## 4.0.15-fabric-26.2 -- Dining Bench now captures the player's horizontal facing when sitting, instead of creating a free-rotation seat with a fixed initial world yaw. -- This lets the same Dining Bench be used from either side: face north and sit north, face south and sit south, independent of the bench's placement facing. diff --git a/README.md b/README.md index ae68191..13d9b2f 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,254 @@ -# Handcrafted +# Handcrafted — Fabric 26.2 Port -To add this library to your project, do the following: +A Fabric-only port of **Handcrafted** for **Minecraft 26.2**, migrated from the original Architectury-based Minecraft 1.21.x project. + +This repository keeps the original Handcrafted content and resources while adapting the build, APIs, data formats, models, entities, and interactions required by Minecraft 26.2. + +## Platform + +- Minecraft: **26.2** +- Mod Loader: **Fabric** +- Java: **25** +- Fabric Loader: **0.19.3** +- Fabric API: **0.161.0+26.2** +- Resourceful Lib: **5.0.4** +- Gradle: **9.7.1** +- Fabric Loom: **1.18-SNAPSHOT** + +NeoForge is intentionally excluded from this port. + +## Project Structure + +The original common + Fabric Architectury project has been collapsed into a single Fabric Loom project while preserving the original source and resource trees as much as practical. + +The Architectury `@ExpectPlatform` client renderer bridge has been replaced by a direct Fabric implementation. + +## Development Workflow + +Development uses the unified workflow scripts: + +- Windows: `workflow.bat` +- Linux/macOS: `workflow.sh` + +The workflow reads `mod_version`, `minecraft_version`, and `archives_base_name` from `gradle.properties`. It handles the normal development cycle from one script: + +1. Compile when the JAR for the current version does not exist. +2. Push source changes to Git. +3. Launch the development client for mod testing. +4. Create the Gitea release and upload the built JAR. + +A release artifact follows the version in `gradle.properties`, for example: + +```text +build/libs/handcrafted-4.0.15.jar +``` + +## Porting Overview + +Minecraft 26.2 contains substantial API and runtime changes compared with the original Minecraft 1.21.x codebase. This port therefore required source-level migration in addition to updating the build system. + +### Build and Fabric migration + +- Migrated to a direct Fabric Loom project. +- Updated Gradle to 9.7.1 for the current Fabric Loom 1.18 toolchain. +- Migrated the project to Java 25. +- Removed obsolete Java 21 Mixin compatibility declarations. +- Replaced Architectury-specific platform bridges with direct Fabric implementations. +- Updated block-entity and entity registration for current Minecraft/Fabric APIs. +- Updated Unix helper scripts for macOS Bash 3.2 compatibility. + +### Minecraft 26.2 API migration + +- Migrated `BlockBehaviour#updateShape` to the current `LevelReader`, `ScheduledTickAccess`, and `RandomSource` signatures. +- Migrated removed `onRemove` behavior to current removal hooks where required. +- Migrated `Painting` / `PaintingVariant` to the current painting package. +- Replaced removed `ItemNameBlockItem` usage. +- Updated registry lookups for current value/holder behavior. +- Migrated Crockery and container persistence to `ValueInput` / `ValueOutput`. +- Migrated item stack persistence to codec-based APIs. +- Migrated furnace fuel duration handling to `FuelValues`. +- Migrated block entity registration to `FabricBlockEntityTypeBuilder`. +- Migrated entity type construction to `ResourceKey>`. +- Updated comparator output signatures. +- Added the required Minecraft 26.2 `Entity#hurtServer` implementation for Seat. +- Updated client/server interaction results and POI holder lookup. +- Migrated custom painting entity data toward the current typed entity-data/component APIs. + +### Resources, models, recipes, and translations + +- Migrated legacy model resources rejected by Minecraft 26.2 model baking. +- Normalized invalid negative/out-of-range UV coordinates in stackable-book and trophy models. +- Rescaled Witch Trophy Y geometry to the modern cuboid boundary. +- Removed invalid block-model dependencies on item-atlas textures. +- Added Minecraft 26.2 client item definitions under `assets/handcrafted/items/` for legacy item models. +- Migrated legacy recipe ingredient objects to the Minecraft 26.x ingredient string syntax. +- Updated the Phantom Trophy recipe from removed `minecraft:chain` to `minecraft:iron_chain`. +- Added missing `item.handcrafted.*` translation aliases. +- Added missing Handcrafted item-tag display translations. +- Added missing Fancy Bed item-model particle references. +- Retargeted the oversized-model Mixin to `CuboidModelElement.Deserializer#getPosition`. + +## Seating System + +The seating system required several migration passes because Minecraft 26.2 changed both block interaction dispatch and entity riding behavior. + +### Interaction handling + +Empty-hand seating now runs through `useWithoutItem(...)`. Held-item interactions still use the item-specific path so Handcrafted's cushion customization remains functional. + +### Seat entity synchronization + +Legacy custom Seat spawn-packet handling was removed so Minecraft 26.2 can use its native entity spawn/tracking and passenger synchronization. + +The Seat remains an invisible temporary vehicle and self-discards when it no longer has a passenger or its furniture block is gone. + +### Minecraft 26.2 riding gate + +Diagnostics eventually isolated the seating failure to `player.startRiding(seat)`: the Seat spawned successfully but mounting returned `false`. + +The Seat entity type had been registered with: + +```java +.noSave() +``` + +On Minecraft 26.2 this makes the entity type non-serializable, which prevents it from being used as the riding vehicle. Removing `.noSave()` restored functional seating while retaining the Seat's normal automatic cleanup. + +### Final seating behavior + +After mounting was restored, seating behavior was refined by furniture type: + +- Chairs and sofas with backrests orient the player to the furniture. +- Supported chairs with an optional cushion raise the seating position slightly to reduce visual intersection with the cushion. +- Benches with backrests retain furniture-facing seating. +- Dining Benches use the player's horizontal facing at the moment of sitting, allowing them to be used naturally from either side. + +As of **4.0.15**, the tested seating behavior for chairs, sofas, benches, cushions, and Dining Benches is functional. + +## Release History + +### 4.0.15 — Dining Bench facing + +- Dining Bench captures the player's horizontal facing when sitting. +- Sitting from opposite sides now produces the corresponding opposite seating direction. +- Seating direction is independent of the Dining Bench's placement facing. + +### 4.0.14 — Bench facing + +- Restored furniture-facing orientation for benches with backrests. +- Prevented free rotation from making the seated player visually intersect the backrest. +- Dining Bench behavior remained separate because it has no backrest. + +### 4.0.13 — Seating polish + +- Preserved the existing chair/sofa vertical seating position when no optional cushion is installed. +- Raised the player slightly when sitting on supported furniture with an added cushion. +- Refined rotation behavior for backless seating. + +### 4.0.12 — Minecraft 26.2 riding gate fix + +- Diagnostics isolated the failure to `player.startRiding(seat)`. +- Identified `EntityType.Builder.noSave()` as the Minecraft 26.2 riding blocker. +- Removed `.noSave()` while retaining automatic Seat cleanup. + +### 4.0.11 — Seat interaction diagnostics + +- Reworked seating interaction dispatch around `useWithoutItem(...)`. +- Preserved Handcrafted cushion handling in the held-item path. +- Made `Seat.sit(...)` server-authoritative. +- Added concise server-side Seat attempt/result diagnostics. + +### 4.0.10 — Seat rework + +- Reworked the invisible Seat entity toward the modern riding implementation. +- Removed the previous delayed-mount workaround. +- Simplified the Seat passenger flow. + +### 4.0.9 — Seat synchronization + +- Removed legacy custom Seat spawn-packet handling. +- Switched to Minecraft 26.2 native entity spawn/tracking. +- Continued migration of passenger attachment behavior. + +### 4.0.4 — Runtime, resource, and data migration + +The early release-style builds combined several migration passes: + +- Migrated legacy models and Minecraft 26.2 item definitions. +- Fixed recipe identifiers and ingredient syntax. +- Added missing translations. +- Restored empty-hand seating dispatch. +- Updated the oversized-model Mixin. +- Added Fancy Bed particle references. +- Fixed strict Minecraft 26.2 block/item ResourceKey initialization. +- Removed the legacy `Seat.makeBoundingBox()` override after confirming the method is final in Minecraft 26.2. + +## Earlier Porting Milestones + +Before release-style versioning, development used temporary `port.N` milestones. + +### port.2 + +- Updated the Gradle/Fabric Loom toolchain for Minecraft 26.2. + +### port.6 + +- Migrated block update signatures, removal hooks, painting packages, registry access, Crockery persistence, render-layer handling, annotations, and build-height access. + +### port.7 + +- Corrected malformed braces and stale state comparisons introduced during the removal-hook migration. + +### port.8 + +- Migrated container persistence, fuel APIs, block/entity registration, comparator signatures, and initial entity persistence. +- Fixed macOS Bash 3.2 helper-script compatibility. + +### port.9 + +- Migrated shift-key handling, Seat damage behavior, painting entity data, interaction results, and POI access. +- Isolated the Minecraft 26.2 renderer pipeline as the next major compile category. + +### port.10 + +- Migrated renderer class signatures to the Minecraft 26.2 render-state/submit API. +- Temporarily reduced custom Fancy Painting and Crockery renderer drawing while isolating compile errors. +- Removed obsolete Custom Painting typed-entity-data application pending migration. + +### port.11 + +- Fixed strict Minecraft 26.2 block/item ID initialization (`Block id not set`). + +### Port 14 runtime/data fixes + +- Migrated recipe ingredient syntax. +- Added missing block-item translations. +- Updated seating interaction response behavior. +- Retargeted the oversized-model Mixin. +- Added missing Fancy Bed particle references. + +## Original Maven Coordinates + +The previous README documented these upstream dependency coordinates. + +### Kotlin DSL -Kotlin DSL: ```kotlin repositories { maven(url = "https://maven.teamresourceful.com/repository/maven-public/") } dependencies { - modImplementation(group = "earth.terrarium.handcrafted", name = "handcrafted-$modLoader-$minecraftVersion", version = handcraftedVersion) + modImplementation( + group = "earth.terrarium.handcrafted", + name = "handcrafted-$modLoader-$minecraftVersion", + version = handcraftedVersion + ) } ``` -Groovy DSL: +### Groovy DSL + ```groovy repositories { maven { @@ -22,6 +257,14 @@ repositories { } dependencies { - modImplementation group: "earth.terrarium.handcrafted", name: "handcrafted-$modLoader-$minecraftVersion", version: handcraftedVersion + modImplementation group: "earth.terrarium.handcrafted", + name: "handcrafted-$modLoader-$minecraftVersion", + version: handcraftedVersion } ``` + +These coordinates are retained as an upstream project reference; they do not by themselves indicate publication of this Fabric 26.2 port to that Maven repository. + +## Credits + +Handcrafted is originally developed by its upstream authors. This repository documents the Minecraft 26.2 Fabric port and its compatibility changes. diff --git a/gradle.properties b/gradle.properties index f97567d..fa1eb8a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx4G org.gradle.parallel=true org.gradle.caching=true -mod_version=4.0.15 +mod_version=4.0.16 maven_group=earth.terrarium.handcrafted archives_base_name=handcrafted