Skip to content

Commit 7af613d

Browse files
committed
neo forge 1.20.6 port
1 parent e4e3409 commit 7af613d

76 files changed

Lines changed: 687 additions & 937 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Use Java 21 from the repository root:
8080

8181
```powershell
8282
.\gradlew.bat test processResources build javadoc --no-daemon
83-
.\gradlew.bat genEclipseRuns eclipse --no-daemon
83+
.\gradlew.bat eclipse --no-daemon
8484
```
8585

8686
Machine-specific `AGENTS.md` and `agent-notes/` files are intentionally ignored.

build.gradle

Lines changed: 152 additions & 455 deletions
Large diffs are not rendered by default.

docs/AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OreSpawn Integration Notes For Coding Agents
22

3-
OreSpawn 4.0 is a required Forge mod and declarative world-generation engine.
3+
OreSpawn 4.0 is a required NeoForge mod and declarative world-generation engine.
44
Public API major version 1 consists only of `zone.moddev.mc.orespawn.api`. Treat
55
every other Java package as internal and unstable.
66

@@ -32,7 +32,7 @@ Configuration contracts:
3232

3333
Lifecycle and ownership:
3434

35-
- Forge setup is parallel. Never mutate OreSpawn internals directly.
35+
- NeoForge setup is parallel. Never mutate OreSpawn internals directly.
3636
- A pack override file is authoritative over packaged and API definitions for
3737
the same provider. A malformed override fails closed.
3838
- Provider rule IDs use the provider namespace. A rule's `block` or weighted

docs/API.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ implementation detail. API major version is available as
66
`OreSpawn-API-Version`.
77

88
Provider mods must depend on the full OreSpawn mod at compile time and
9-
runtime. In `mods.toml` use a mandatory dependency, for example:
9+
runtime. In `neoforge.mods.toml` use a required dependency, for example:
1010

1111
```toml
1212
[[dependencies.examplemod]]
1313
modId="orespawn"
14-
mandatory=true
14+
type="required"
1515
versionRange="[4.0.0,5.0.0)"
1616
ordering="AFTER"
1717
side="BOTH"
@@ -34,7 +34,7 @@ patterns, and host tags, see `DEVELOPER_GUIDE.md`.
3434

3535
Definitions are immutable after `build()`. Registry references remain
3636
`ResourceLocation` values until OreSpawn validates and bakes them. Provider
37-
messages are processed through Forge IMC and frozen at load completion; direct
37+
messages are processed through NeoForge IMC and frozen at load completion; direct
3838
cross-mod mutation during parallel setup is unsupported.
3939

4040
Ore dimensions use `quantity(int)` for fixed budgets or
@@ -77,17 +77,25 @@ WorldgenProvider provider = WorldgenProvider.builder("examplemod", 1)
7777
`OilDefinition` and template `.oil(...)` remain deprecated migration adapters
7878
for one legacy oil rule. New integrations should use `FluidDepositDefinition`.
7979

80-
Register custom biomes with Forge as usual. `OreSpawnBiomes.copyAndRegister`
81-
provides a small optional convenience for cloning a known biome:
80+
NeoForge 20.6 biomes are data-driven registry entries. Package biome JSON under
81+
`data/<modid>/worldgen/biome/`, or generate it with a
82+
`DatapackBuiltinEntriesProvider`. `OreSpawnBiomes.copyAndRegister` is an
83+
optional bootstrap/datagen convenience for cloning a known biome:
8284

8385
```java
84-
RegistryObject<Biome> candyPlains = OreSpawnBiomes.copyAndRegister(
85-
BIOMES, "candy_plains",
86-
() -> ForgeRegistries.BIOMES.getValue(new ResourceLocation("minecraft", "plains")),
87-
builder -> builder.temperature(0.8F).downfall(0.4F));
86+
public static final ResourceKey<Biome> CANDY_PLAINS = ResourceKey.create(
87+
Registries.BIOME, new ResourceLocation("examplemod", "candy_plains"));
88+
89+
public static final RegistrySetBuilder BIOME_BUILDER = new RegistrySetBuilder()
90+
.add(Registries.BIOME, context -> {
91+
HolderGetter<Biome> biomes = context.lookup(Registries.BIOME);
92+
OreSpawnBiomes.copyAndRegister(context, CANDY_PLAINS, biomes, Biomes.PLAINS,
93+
builder -> builder.temperature(0.8F).downfall(0.4F));
94+
});
8895
```
8996

90-
Then declare placement and materials through the same provider:
97+
The generated biome JSON remains owned by the child mod. Declare placement and
98+
materials through the same OreSpawn provider:
9199

92100
```java
93101
WorldgenProvider provider = WorldgenProvider.builder("examplemod", 1)
@@ -130,7 +138,7 @@ Y query. Sampling is read-only and is intended for gameplay decisions,
130138
diagnostics, and compatible generation outside OreSpawn's block loops.
131139
Callbacks inside OreSpawn generation loops are intentionally unsupported.
132140

133-
Custom pattern mods create a Forge `DeferredRegister<OrePatternType>` using
141+
Custom pattern mods create a NeoForge `DeferredRegister<OrePatternType>` using
134142
`OreSpawnPatternRegistry.REGISTRY_NAME`. An `OrePatternType` contains a codec
135143
and a compiler from decoded settings to `CompiledOrePattern`. Reference it from
136144
an ore dimension with `pattern(patternId, settingsJson)`. OreSpawn decodes and

docs/BIOMES.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
OreSpawn can place provider biomes and replace their visible world materials.
44
It does not register biomes for a child mod: the provider still registers
5-
ordinary Forge `Biome` objects, then supplies declarative placement and
6-
material rules to OreSpawn.
5+
ordinary NeoForge data-driven `Biome` entries, then supplies declarative
6+
placement and material rules to OreSpawn.
77

88
This feature is optional. Ore-only providers and existing Mineralogy profiles
99
with no biome palettes use Minecraft's original biome source unchanged.
@@ -93,20 +93,28 @@ default states contain real fluids.
9393

9494
## Registration Helper
9595

96-
`OreSpawnBiomes.copyAndRegister` copies a known biome's complete builder before
97-
applying small changes. This is useful for a simple content mod:
96+
Biomes are loaded from `data/<modid>/worldgen/biome/` when a world loads. A
97+
child mod may write those JSON files directly or generate them with
98+
`DatapackBuiltinEntriesProvider`. `OreSpawnBiomes.copyAndRegister` copies a
99+
known biome's complete builder inside a `RegistrySetBuilder` bootstrap:
98100

99101
```java
100-
RegistryObject<Biome> candyPlains = OreSpawnBiomes.copyAndRegister(
101-
BIOMES, "candy_plains",
102-
() -> ForgeRegistries.BIOMES.getValue(new ResourceLocation("minecraft", "plains")),
103-
builder -> builder.temperature(0.8F).downfall(0.4F));
102+
public static final ResourceKey<Biome> CANDY_PLAINS = ResourceKey.create(
103+
Registries.BIOME, new ResourceLocation("examplemod", "candy_plains"));
104+
105+
public static final RegistrySetBuilder BIOME_BUILDER = new RegistrySetBuilder()
106+
.add(Registries.BIOME, context -> {
107+
HolderGetter<Biome> biomes = context.lookup(Registries.BIOME);
108+
OreSpawnBiomes.copyAndRegister(context, CANDY_PLAINS, biomes, Biomes.PLAINS,
109+
builder -> builder.temperature(0.8F).downfall(0.4F));
110+
});
104111
```
105112

106113
`blankAndRegister` starts from an empty builder and is intended for advanced
107-
providers that deliberately supply every required climate, effects, spawn, and
108-
generation field. Both helpers only register content; placement belongs in the
109-
provider declaration.
114+
datagen that deliberately supplies every required climate, effects, spawn, and
115+
generation field. Both helpers create datapack content; live placement belongs
116+
in the provider declaration. Do not use a static `DeferredRegister<Biome>`:
117+
NeoForge 20.6 biomes belong to the dynamic world registry.
110118

111119
## Surfaces And Materials
112120

docs/CONFIGURATION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ world. Restart after editing JSON by hand.
2525
| `geology_mode` | `geome`, `legacy` | Sky/geome engine or Cyano legacy engine |
2626
| `place_fluid_deposits` | boolean | Master switch for configured fluid-deposit rules |
2727
| `manage_vanilla_ores` | boolean | Lets OreSpawn suppress and replace claimed vanilla ore features |
28-
| `suppress_all_ore_features` | boolean | Suppresses all standard Forge ore features; use only in complete packs |
28+
| `suppress_all_ore_features` | boolean | Suppresses all standard NeoForge ore features; use only in complete packs |
2929
| `default_template` | registry ID or empty string | Template selected for newly created server worlds |
3030
| `formations` | object | Shape controls used only when terrain strata are active |
3131
| `rocks` | object keyed by rule ID | Eligible rock definitions |
3232
| `geomes` | object keyed by geome ID | Geological province weights |
3333
| `biomes` | object keyed by biome ID | Explicit biome-to-geome weights |
34-
| `biome_dictionary` | object keyed by Forge biome type | Fallback biome-to-geome weights |
34+
| `biome_dictionary` | object keyed by NeoForge biome tag/type name | Fallback biome-to-geome weights |
3535
| `terrain_dimensions` | object keyed by dimension ID | Dimensions and hosts eligible for terrain replacement |
3636
| `biome_palettes` | object keyed by provider-owned rule ID | Optional native-biome overlays and surfaces |
3737
| `dimension_materials` | object keyed by provider-owned rule ID | Aquifer fluid, snow, and ice substitutions |

docs/DEVELOPER_GUIDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
| Add ores to vanilla stone | Ore-only provider with explicit host tags |
88
| Let a modpack tune another mod's rules | `config/<modid>-orespawn.json` |
99
| Ship rocks, geomes, or custom terrain | Full packaged provider |
10-
| Construct definitions in Java | API provider sent through Forge IMC |
10+
| Construct definitions in Java | API provider sent through NeoForge IMC |
1111
| Offer an optional world style | Named template in a provider |
1212
| Add covered underground oil or another fluid | Provider schema 3 fluid deposit |
1313
| Add or place biomes without a framework dependency | Provider schema 4 biome palette |
@@ -65,12 +65,12 @@ a custom dimension, a biome palette, world materials, and a selectable template.
6565

6666
## Java API Quick Start
6767

68-
Declare OreSpawn as a mandatory dependency in `mods.toml`:
68+
Declare OreSpawn as a required dependency in `neoforge.mods.toml`:
6969

7070
```toml
7171
[[dependencies.examplemod]]
7272
modId="orespawn"
73-
mandatory=true
73+
type="required"
7474
versionRange="[4.0.0,5.0.0)"
7575
ordering="AFTER"
7676
side="BOTH"
@@ -86,7 +86,7 @@ import zone.moddev.mc.orespawn.api.OrePattern;
8686
import zone.moddev.mc.orespawn.api.OreSpawnApi;
8787
import zone.moddev.mc.orespawn.api.WorldgenProvider;
8888
import net.minecraft.resources.ResourceLocation;
89-
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
89+
import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent;
9090

9191
private void enqueueWorldgen(InterModEnqueueEvent event) {
9292
ResourceLocation tin = new ResourceLocation("examplemod", "tin_ore");

docs/FEATURES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ the codec object below are equivalent:
2929
}
3030
```
3131

32-
Other mods may register `OrePatternType` values in the Forge registry named by
32+
Other mods may register `OrePatternType` values in the NeoForge registry named by
3333
`OreSpawnPatternRegistry.REGISTRY_NAME`. Each type supplies a Mojang `Codec`
3434
and compiles decoded settings into a `CompiledOrePattern`. Compilation occurs
3535
during profile baking. The generation loop invokes only the compiled object.
@@ -58,5 +58,5 @@ Retrogen records a deterministic profile revision in chunk NBT under
5858
bounded by `chunks_per_tick`; no terrain strata retrogen exists.
5959

6060
Flat bedrock is disabled by default. When enabled it flattens the configured
61-
number of bottom layers and, in the Nether, the ceiling. It uses normal Forge
61+
number of bottom layers and, in the Nether, the ceiling. It uses normal NeoForge
6262
features and chunk events, with no reflection.

docs/PROVIDERS.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Worldgen Providers
22

3-
Provider mods may contribute through Forge IMC, a packaged resource at
3+
Provider mods may contribute through NeoForge IMC, a packaged resource at
44
`data/<provider-modid>/orespawn/provider.json`, or a pack override at
55
`config/<provider-modid>-orespawn.json`. A valid override is authoritative. A
66
present malformed override leaves that provider inactive instead of silently
@@ -81,8 +81,8 @@ An enabled ore dimension requires a Y range, expected attempts per chunk in
8181
quantity and a complete range are both present, the range is authoritative; a
8282
lone range bound is invalid. Host arrays accept either registry-ID strings or weighted
8383
objects such as `{ "block": "minecraft:stone", "weight": 1.0 }` and
84-
`{ "tag": "forge:stone", "weight": 0.5 }`. Biome include/exclude IDs and
85-
Forge biome-dictionary names may further restrict a rule.
84+
`{ "tag": "c:stones", "weight": 0.5 }`. Biome include/exclude IDs and
85+
NeoForge biome tag/type names may further restrict a rule.
8686

8787
For OS3-compatible placement in ordinary modded dimensions, put a rule under
8888
`dimension_selectors.orespawn:all_except_nether_end`. It applies to every
@@ -105,11 +105,11 @@ Existing worlds merge newly introduced provider rule IDs but do not overwrite
105105
world edits. Disabled and unassigned rules remain tombstones; removed provider
106106
rules remain in the self-contained snapshot.
107107

108-
Biome providers can add Forge biomes normally, then declare where those biomes
109-
belong through `biome_palettes`. The overlay wraps the dimension's existing
110-
biome source, so it composes after vanilla or another installed source instead
111-
of taking a compile-time dependency on it. Use `minecraft_only` scope when the
112-
provider should leave other mods' biomes alone.
108+
Biome providers package their biomes in the standard dynamic-registry path
109+
`data/<modid>/worldgen/biome/`, then declare where those IDs belong through
110+
`biome_palettes`. The overlay wraps the dimension's existing biome source, so
111+
it composes after vanilla or another installed source. Use `minecraft_only`
112+
scope when the provider should leave other mods' biomes alone.
113113
Use `required_similar_biomes` only when an output truly cannot work without a
114114
referenced biome; ordinary compatibility hints belong in `similar_biomes`.
115115

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OreSpawn 4 Documentation
22

3-
OreSpawn is a required Forge mod and a declarative world-generation engine.
3+
OreSpawn is a required NeoForge mod and a declarative world-generation engine.
44
The normal jar is both the compile-time and runtime dependency; there is no
55
shaded or embeddable engine artifact.
66

0 commit comments

Comments
 (0)