Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions docs/CLIENT-CHECKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,7 @@ Use Java 26.3 with the matching Fabric companion, the Saints Dragons server mod
- Connect two connectors, then a Street Light. Verify the released sagging wire geometry, held-wire preview and sounds against NeoForge. These visual and selected-inventory auto-unbind behaviors remain pending; saved connection data alone does not implement the renderer.
- With energy present, compare street-light levels 1, 5, 10 and 15 and the original brightness model ranges. Verify the wrench scroll-value control when its client integration is implemented. [Issue #68](https://github.com/devmogged/moddedMC-rust/issues/68)
- Place a single Lamp Post, stack another vertically, and attach a third horizontally. Compare caps, collars, reciprocal arms, texture seams and collision to the original release. Wrench each connected horizontal face to toggle its arm and verify the adjacent arm follows; vertical wrench clicks must not toggle arms. Check the original wrench sound and repeat across a chunk boundary. These real-client checks remain pending.

## Create: New Age machine and thermal draft (issue #68)

Pending until the combined server can start: compare released models/orientations and collision for coils, brushes, each motor and extension, energisers, pipes, heater, Stirling engine, reactor rod/vent/fuel acceptor, casing/glass, ores and corium. Check powered rotation sign, magnet-dependent generation, wire delivery, motor redstone and extension scroll controls, energiser head animation and actual held-stack conversion, heat transport and boiler use. Check reactor active lighting, fuel insertion/extraction, shielded/unshielded radiation, active break/explosion and corium falling/solidification. Compare solar in partial shade/day/night/weather and all 384 pump states after implementation. The coil model is currently an approximation; client visuals and omitted behaviors are not verified by unit tests.
10 changes: 10 additions & 0 deletions docs/ws/create-addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,13 @@ Release data inventory (paths relative to jar; listing is scope, not implementat
World generation: magnetite and thorium configured/placed features. Current W2 implementation: native connector and four wire types, 12 connector states and 12 wire-block states; two-endpoint saved NBT, binding, consumption, break recovery, loaded reciprocal topology and bandwidth budgets. Street lights add 32 states and the released 10,000 FE storage/tick logic. The fresh packed wiring and street-light scenarios passed on port 25620, seed 20261126: reciprocal wire NBT and item conservation through restart and break, lit/unlit carrier transitions, restart persistence, and exact depletion to 0 FE. The street-light test injects energy using NBT; it does not prove generator-to-light transfer. Remaining: wire renderer and selected-inventory auto-unbind, energy producers and Create integration, other machines, radiation, full recipes, world generation, client checks and source/runtime differential evidence.

W2 connected lamp posts add 64 source property states (120 additional states cumulatively), vertical caps, reciprocal horizontal arms, wrench toggling and release-derived multipart models flattened into 34 variants. Source recipe and loot are included. Fresh packed scenario on port 25620, seed 20261126, passed exact carrier assertions for stacked caps, reciprocal horizontal arms, restart and removal after correcting the host placement-face convention and deferred neighbor updates. Strict Clippy and 22 unit tests passed. Wrench, cross-chunk and real-client checks remain pending. Generator and brush power delivery remains outstanding.

### W2 generation, thermal and reactor draft (issue #68)

The following is **compiled/unit-tested, not live-verified**. Native coil/brush power generation uses the shared Create kinetics service and commits accepted receiver energy before charging edge bandwidth. Motors and extensions implement the release's capacities, stress/speed and redstone behavior. The thermal implementation includes connected pipes, heater thresholds, Stirling kinetic generation, reactor fuel insertion/extraction via host item transfer, contiguous-rod fuel distribution, fuel burn/heat, vent extraction, and partial corium ticks. Exact release bytecode establishes rod capacity 345,600 ticks and cooling even when unfueled (the newer source branch differs). The three energiser tiers accept generated FE and register kinetic consumers; their rate/refund model does not implement transported-item conversion. Native server config uses release defaults, with startup overrides for implemented operations. Pipe phase staggering is position-derived, rather than the release's sequential global phase assignment.

State budget: 266 additional states (120 previously merged + 9 coil/brush + 30 motors/extensions + 72 pipe/heater/Stirling + 3 casing/glass/ore + 20 nuclear + 12 energiser), 33/36 block IDs, 18/18 standalone item IDs. The remaining heat pump requires 384 exact states and two solar plates require two more: 652 additional states would exceed the assigned 400. 52 recipe files (30 vanilla crafting, 22 custom), 33 loot tables, 12 tags and six worldgen files are packaged. The ore placements drop the unsupported Create config filter as in native Create zinc; their runtime generation is unverified. Active rods' no-drop behavior is expressed as a state-predicate loot condition, also unverified live.

Evidence on base eab4b13c, engine ecd25fd6148262b41ab8656cfe9b6674d1dcad96: targeted formatting, strict Clippy and 29/29 unit tests passed through the shared gate; optimized Create and New Age packages built, latter 494253 bytes, SHA-256 8eb4ff9ae0489f664bbfc6259b9351a72f4308903ee62f76b67158a359a6d9ff, ZIP integrity check clean, manifest dependency create present. Combined startup on port 25620, seed 20261126, in run/w2-generation-first and run/w2-generation-thermal failed before world registration with `custom block carrier slots exhausted`; Create alone started. Latest package has not been rerun against the same unchanged allocator. Earlier standalone wiring/light/lamp regressions remain valid evidence for their respective merged packages only.

Pending verification: combined generation (magnet strength, wire delivery, removal/restart), motors, Stirling/heat, hopper-fed reactor, energiser storage, all earlier regressions and ore generation; client checks listed separately. Blockers: #72 stock-client carrier capacity and explicit W2 budget increase or equivalent source-preserving representation; shared Create transported-stack processor/hold/atomic conversion and custom assembly integration; raw sky-light and world sky-darkening reads; shared boiler heat-source query; host post-destroy and TNT-style explosion, falling-block/resistance queries and persistent custom radiation effect hooks. Owner-local completion after interfaces includes actual pump/solar registration and ticks, complete energising processing, remaining data and nuclear behavior, controls/rendering/collision/sounds, and live validation. Multi-entity guarded writes are not crash-atomic across saves. No claim of full port or runtime parity.
4 changes: 3 additions & 1 deletion mods/create-new-age/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "create-new-age"
version = "0.1.0"
edition.workspace = true
license = "BSD-3-Clause"
description = "Create: New Age 1.2.0+mc1.21.1: generator coil logic (incomplete port)"
description = "Create: New Age 1.2.0+mc1.21.1: native electrical and thermal mechanics (incomplete port)"
publish = false

[lib]
Expand All @@ -12,3 +12,5 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
moddedmc-api.workspace = true
fastnbt = "2.6.3"
toml = "1.2.1"
rand = "0.9"
17 changes: 13 additions & 4 deletions mods/create-new-age/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Create: New Age

Partial native port of **Create: New Age `1.2.0+mc1.21.1`** (NeoForge), licensed BSD-3-Clause (Antarctic Gardens). The exact release jar supplies original art locally through `MODDEDMC_ASSET_JARS`; no original game or Create art is bundled. See `docs/ws/create-addons.md` for release inventory and outstanding parity work.
Partial native port of **Create: New Age `1.2.0+mc1.21.1`** (NeoForge), BSD-3-Clause (Antarctic Gardens). Source reference: the exact released jar, not the newer public branch. Supply original release assets locally via `MODDEDMC_ASSET_JARS`; no original game or Create art is bundled. See `docs/ws/create-addons.md` for the release inventory.

Implemented gameplay: ten passive items, five magnetic blocks, four wire items and their storage blocks, electrical connector binding, reciprocal saved links, wire consumption and break recovery, loaded electrical topology, street-light storage and depletion, and connected lamp posts with vertical caps and reciprocal horizontal arms. Original recipes, loot tables and tags are included for supported content. The current state allocation is 120 additional states (56 wiring/light, 64 lamp post). Native lamp-post composite models retain the source credits.
## Implementation and evidence

The generator-coil, network and storage models have source-backed tests; generator-to-receiver delivery is not yet integrated with Create kinetics. Seeded street-light energy exercises the actual consumer but is not evidence of generated power. Wire rendering, inventory auto-unbinding, complete config behavior, machines, energising, thermal/solar/nuclear content, radiation, world generation, and real-client parity checks remain incomplete. Magnet material properties are approximated by host templates.
- Merged wiring, reciprocal connections and restart persistence, street-light storage/depletion, passive items/magnets, and connected lamp posts were live verified in the earlier standalone packages (#75, #114). Client rendering and wrench parity still require manual checks.
- The generation branch implements actual Create kinetic consumers and generators, coil/brush energy production, committed electrical delivery, motor tiers and extensions, heat transport, heater/Stirling ticks, reactor fuel acceptance/distribution and vent extraction, corium thermal random ticks, and energiser storage/kinetic consumers. These paths compile and have unit coverage but are **not yet live verified**.
- 33/36 released block IDs and all 18 standalone items are represented; 266 additional states are allocated out of the assigned 400. Registration is not equivalent to full gameplay parity.
- 52/55 recipe files, 33/36 loot tables, 12 tag files and six ore-generation resource files are included. Vanilla crafting files use the native datapack path. Create custom recipes and energising/assembly steps require end-to-end verification. The ore placements omit the unsupported Create-only config filter, following the native zinc convention.

Build with the repository packer (`scripts/pack-mod.ps1 -Crate create-new-age`), following the active workspace build gate and isolated target rules. Unit tests: `cargo test -p create-new-age`; lint: `cargo clippy -p create-new-age --all-targets -- -D warnings`. Live scenario files in `tests/scenarios/` cover `create-new-age-wiring`, `create-new-age-street-light`, `create-new-age-lamp-post`, `ws4-new-age-items`, `ws4-new-age-magnets` and `ws4-new-age-magnet-crafting`. See `docs/CLIENT-CHECKS.md` for client-only checks still to run.
The package depends on `create`. Use the repository packer with `-Crate create-new-age -Dependencies create`, the active shared build gate, pack profile and isolated target. Settings load once at startup from `config/create-new-age/server.toml`, seeded from `server-defaults.toml`. Implemented settings cover wire limits, conductivity, network depth, street-light storage, coil/motor and thermal/reactor arithmetic. Configuration for missing mechanisms is recorded but does not enable those mechanisms.

## Open parity work

The combined server currently fails before gameplay with `custom block carrier slots exhausted` (issue #72); widening runtime IDs alone does not expand the stock-client carrier pool. Heat pump alone needs 384 states (six directions times six connection bits); full exact registration needs about 652 additional states, beyond the assigned cap of 400. Solar needs raw sky light and world sky darkening. Energising requires a public Create transported-stack processor, hold/pass and atomic whole-stack conversion/assembly integration. Heater-to-boiler integration requires a shared heat-source provider. Nuclear radiation effects, active-rod destruction/explosions, falling corium/resistance behavior, cross-entity crash-atomic transactions, wire rendering, selected-inventory auto-unbinding, scroll controls, and exact models/collision/sounds remain incomplete. Some physical templates and generated coil geometry are approximations. Do not ship this as full parity.

Verification: targeted fmt, strict Clippy and 29 unit tests pass; both optimized packages build. Pending combined live scenarios: `create-new-age-generation`, `create-new-age-motors`, `create-new-age-thermal`, `create-new-age-reactor`, `create-new-age-energiser-storage`, plus earlier wiring/light/lamp/item/magnet regressions. See `docs/CLIENT-CHECKS.md`.
47 changes: 47 additions & 0 deletions mods/create-new-age/generate_machine_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import zipfile, pathlib, json, sys
z=zipfile.ZipFile(sys.argv[1])
root=pathlib.Path(__file__).parent / 'resources'
def put(n,obj):
p=root/n;p.parent.mkdir(parents=True,exist_ok=True);p.write_text(json.dumps(obj,separators=(',',':'))+'\n',encoding='utf8')
def box(a,b,uv,rotation=None):
d={'from':a,'to':b,'faces':{f:{'uv':uv,'texture':'#0'} for f in ['north','east','south','west','up','down']}}
if rotation:d['rotation']=rotation
return d
# An octagonal cage and copper windings based on the released OBJ bounds.
# Vanilla resource packs cannot parse the NeoForge OBJ loader.
prefix='assets/create_new_age/models/'
coil=json.loads(z.read(prefix+'block/generator_coil/block.json'))
for k in ('loader','flip_v','model'):coil.pop(k,None)
coil['credit']='Native cuboid approximation of the released Blockbench OBJ (Antarctic Gardens)'
elems=[box([6,0,6],[10,16,10],[0,0,2,8])]
for i in range(8):
angle=i*45
# Minecraft only permits small element rotations on older clients; use
# equivalent north/east/south/west coordinates for quarter turns.
r=angle%90
for a,b,uv in [([3,2,-4],[13,14,-3],[2.5,0,5,3]),([5.5,3,-3],[10.5,13,0],[0,8,5,11]),([6.5,6.5,1],[9.5,9.5,6],[0,0,2,2])]:
# diagonal sides at 45 degrees, quarter turns applied to coordinates.
if r: a=[a[0],a[1],a[2]+3.5];b=[b[0],b[1],b[2]+3.5]
for _ in range(i//2):a=[16-a[2],a[1],a[0]];b=[16-b[2],b[1],b[0]]
lo=[min(x,y) for x,y in zip(a,b)];hi=[max(x,y) for x,y in zip(a,b)]
elems.append(box(lo,hi,uv,{'origin':[8,8,8],'axis':'y','angle':45} if r else None))
coil['elements']=elems
put(prefix+'block/generator_coil/native.json',coil)
item=json.loads(z.read(prefix+'block/generator_coil/item.json'))
for k in ('loader','flip_v','model'):item.pop(k,None)
item['parent']='create_new_age:block/generator_coil/native'
put(prefix+'item/generator_coil_native.json',item)
brush=json.loads(z.read(prefix+'block/carbon_brushes/coil.json'))
brush['elements'].append(box([6,0,6],[10,16,10],[8,0,10,8]))
brush.pop('groups',None)
put(prefix+'block/carbon_brushes/native_rotor.json',brush)
for name in ['generator_coil','carbon_brushes']:
for path in ['recipe/shaped','loot_table/blocks']:
n=f'data/create_new_age/{path}/{name}.json'; p=root/n;p.parent.mkdir(parents=True,exist_ok=True);p.write_bytes(z.read(n))
for n in ['data/minecraft/tags/block/mineable/pickaxe.json','data/minecraft/tags/block/needs_stone_tool.json','data/minecraft/tags/block/needs_iron_tool.json']:
if n in z.namelist():
vals=json.loads(z.read(n))['values'];p=root/n
if p.exists(): obj=json.loads(p.read_text())
else: obj={'replace':False,'values':[]}
obj['values']+= [x for x in vals if x in ['create_new_age:generator_coil','create_new_age:carbon_brushes'] and x not in obj['values']]
if any(x in vals for x in ['create_new_age:generator_coil','create_new_age:carbon_brushes']): put(n,obj)
86 changes: 86 additions & 0 deletions mods/create-new-age/generate_thermal_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
"""Flatten the released heat-pipe multipart model into vanilla state models.

Usage: py -3 mods/create-new-age/generate_thermal_models.py exact-release.jar
The released New Age art is BSD-3-Clause; preserve its license and credits.
"""
import copy
import json
import sys
import zipfile
from pathlib import Path

ROOT = Path(__file__).parent / "resources"
DIR = "assets/create_new_age/models/block/heat_pipe"
FACES = ["down", "up", "north", "south", "west", "east"]
NORMALS = [(0,-1,0),(0,1,0),(0,0,-1),(0,0,1),(-1,0,0),(1,0,0)]
# Local face texture axes, before rotation.
U = [(1,0,0),(1,0,0),(-1,0,0),(1,0,0),(0,0,1),(0,0,-1)]
V = [(0,0,-1),(0,0,1),(0,-1,0),(0,-1,0),(0,-1,0),(0,-1,0)]
ROTATIONS = [(2,0),(0,0),(1,0),(1,2),(1,3),(1,1)]


def rotate(vec, rx, ry):
x,y,z=vec
for _ in range(rx):
y,z=z,-y
for _ in range(ry):
x,z=-z,x
return x,y,z


def point(p, rx, ry):
return [v+8 for v in rotate([v-8 for v in p],rx,ry)]


def neg(v):
return tuple(-x for x in v)


def arm(elements, rx, ry):
result=copy.deepcopy(elements)
for e in result:
a,b=point(e["from"],rx,ry),point(e["to"],rx,ry)
e["from"],e["to"]=list(map(min,zip(a,b))),list(map(max,zip(a,b)))
# The release's three side elements use only zero element rotation.
rotation=e.pop("rotation",None)
assert rotation is None or rotation["angle"]==0
faces={}
for name,face in e["faces"].items():
i=FACES.index(name)
j=NORMALS.index(rotate(NORMALS[i],rx,ry))
u=rotate(U[i],rx,ry)
quarter=(U[j],V[j],neg(U[j]),neg(V[j])).index(u)
r=(face.get("rotation",0)+quarter*90)%360
if r: face["rotation"]=r
else: face.pop("rotation",None)
faces[FACES[j]]=face
e["faces"]=faces
return result


def write(path,data):
dest=ROOT/path
dest.parent.mkdir(parents=True,exist_ok=True)
dest.write_bytes(data)


with zipfile.ZipFile(sys.argv[1]) as jar:
center=json.loads(jar.read(f"{DIR}/center.json"))
side=json.loads(jar.read(f"{DIR}/side.json"))
for mask in range(64):
model=copy.deepcopy(center)
model.pop("groups",None)
model["credit"]=side.get("credit","")
for face,(rx,ry) in enumerate(ROTATIONS):
if mask&(1<<face):
model["elements"]+=arm(side["elements"],rx,ry)
write(f"{DIR}/native_{mask}.json",(json.dumps(model,separators=(",",":"))+"\n").encode())
for name in ["heat_pipe","heat_pipe_mirrored","heater","stirling_engine"]:
write(f"data/create_new_age/recipe/shaped/{name}.json",jar.read(f"data/create_new_age/recipe/shaped/{name}.json"))
for name in ["heat_pipe","heater","stirling_engine"]:
path=f"data/create_new_age/loot_table/blocks/{name}.json"
write(path,jar.read(path))
path="data/minecraft/tags/block/mineable/pickaxe.json"
tag=json.loads((ROOT/path).read_text())
tag["values"]=list(dict.fromkeys(tag["values"]+[f"create_new_age:{n}" for n in ["heat_pipe","heater","stirling_engine"]]))
write(path,(json.dumps(tag,separators=(",",":"))+"\n").encode())
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"format_version":"1.21.6","credit":"Made with Blockbench by ProfBones","parent":"block/block","texture_size":[32,32],"textures":{"0":"create_new_age:block/carbon_brushes","particle":"create_new_age:block/carbon_brushes"},"elements":[{"name":"coil","from":[5,3,5],"to":[11,13,11],"rotation":{"angle":45,"axis":"y","origin":[8,8,8]},"faces":{"north":{"uv":[0,8,5,11],"rotation":90,"texture":"#0"},"east":{"uv":[0,8,5,11],"rotation":90,"texture":"#0"},"south":{"uv":[0,8,5,11],"rotation":90,"texture":"#0"},"west":{"uv":[0,8,5,11],"rotation":90,"texture":"#0"}}},{"from":[6,0,6],"to":[10,16,10],"faces":{"north":{"uv":[8,0,10,8],"texture":"#0"},"east":{"uv":[8,0,10,8],"texture":"#0"},"south":{"uv":[8,0,10,8],"texture":"#0"},"west":{"uv":[8,0,10,8],"texture":"#0"},"up":{"uv":[8,0,10,8],"texture":"#0"},"down":{"uv":[8,0,10,8],"texture":"#0"}}}]}
Loading