Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
56bf833
add held item as grid overlay param
gustovafing Jun 22, 2026
a7830ca
Merge branch '1.20.1' into gus/forge-registries
gustovafing Jun 23, 2026
e74ddf0
i love registries
gustovafing Jun 23, 2026
90249af
remove test print
gustovafing Jun 23, 2026
9e20bd1
test switching pattern errors to a mc registry
gustovafing Jun 23, 2026
a4f49bf
store placeholders in registry
gustovafing Jun 23, 2026
ef8f161
fix invalid reslocs
gustovafing Jun 23, 2026
110383d
switch world gen layers to store resource keys
gustovafing Jun 25, 2026
9b7add1
switch dimension markers to store resource keys
gustovafing Jun 25, 2026
2b5dd75
switch dimension markers to mc registry
gustovafing Jun 25, 2026
ca62a87
switch medical conditions to mc registry
gustovafing Jun 25, 2026
d577d09
switch recipe conditions and covers to mc registry
gustovafing Jun 25, 2026
130dbb2
switch recipe caps and chance logic to native regs
gustovafing Jun 25, 2026
a033d57
add more registrate builders
gustovafing Jun 25, 2026
83ecea9
switch machines to forge registry
gustovafing Jun 25, 2026
c342edd
convert tag prefixes and icon sets to native regs
gustovafing Jun 25, 2026
70a2313
convert material registry to native registry
gustovafing Jun 25, 2026
4e20cab
Update GameDataMixin.java
gustovafing Jun 25, 2026
468f03a
tag prefix fixes
gustovafing Jun 26, 2026
1b1925a
why is my late register event not being fired
gustovafing Jun 26, 2026
ebc5bad
remove gt recipe type register
gustovafing Jun 26, 2026
d4ac652
switch recipe categories to native registry
gustovafing Jun 26, 2026
7bf5999
fix register events firing in the wrong order
gustovafing Jun 26, 2026
7e01b36
YAY I GET TO THE MAIN MENU NOW :lfg:
gustovafing Jun 26, 2026
b8644c0
remove all gt registries except datapack worldgen
gustovafing Jun 26, 2026
98c8634
fix sound registry crashing
gustovafing Jun 26, 2026
c80baf8
clean up some GTRegistries stuff
gustovafing Jun 26, 2026
86cf074
fix fluid registration
gustovafing Jun 26, 2026
4c1e3c5
start fixing up kjs support
gustovafing Jun 26, 2026
a1b7417
finish all kjs builders except machine builders
gustovafing Jun 26, 2026
899a132
fix up some kjs registry stuff
gustovafing Jun 28, 2026
3ee5773
fully fix kjs registration
gustovafing Jun 28, 2026
bc9acea
finish kjs machine support
gustovafing Jun 28, 2026
e887ee0
spotless
gustovafing Jun 28, 2026
f1baa4c
write docs
gustovafing Jun 28, 2026
ddcb616
todo
gustovafing Jun 28, 2026
7c645f5
fix element registration
gustovafing Jun 28, 2026
57462ca
update docs
gustovafing Jun 28, 2026
42d7f7d
Merge branch '1.20.1' into gus/forge-registries
gustovafing Jun 28, 2026
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
64 changes: 63 additions & 1 deletion docs/content/Modpacks/Changes/v8.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,66 @@ title: "Version 8.0.0"

# Updating from `7.4.0` to `8.0.0`

## Registration Changes

GregTech content is now registered in standard forge/minecraft registries instead of using a custom registry implementation.

### For KJS

- Find and replace `GTCEuStartupEvents.registry` with `StartupEvents.registry`
- Register material icon types with `GTCEuStartupEvents.materialIconType`

### For addons

**All content should now be registered via either your addon's registrate instance, or via a [deferred register](https://docs.minecraftforge.net/en/1.20.1/concepts/registries/#deferredregister).**

The `GTCEuAPI.RegisterEvent` event has been removed, as content should now use registrate or deferred registers.

#### Content registered via registrate.

The following should be registered via registrate:
- Materials - Use `REGISTRATE.material(String name)` to access the material builder.
- Elements - Use `REGISTRATE.element(...)` to register an element.
- Tag prefixes - Use the following methods:
- `REGISTRATE.tagPrefix(String name)`
- `REGISTRATE.tagPrefix(String name, boolean invertedName)`
- `REGISTRATE.oreTagPrefix(String name, TagKey<Block> miningToolTag)`
- Material icon sets - Use the following methods:
- `REGISTRATE.materialIconSet(String id)`
- `REGISTRATE.materialIconSet(String id, MaterialIconSet parent)`
- `REGISTRATE.materialIconSet(String id, @Nullable MaterialIconSet parent, boolean isRoot)`
- Recipe types - Use `REGISTRATE.recipeType(String name, String group, RecipeType<?>... proxyRecipes)`
- Recipe categories - Use `REGISTRATE.recipeCategory(String categoryName, GTRecipeType recipeType)`
- World gen layers - Use `REGISTRATE.simpleWorldGenLayer(...)`
- Medical conditions - Use `REGISTRATE.medicalCondition(...)`

#### Ore veins, bedrock ores and bedrock fluids

TODO
~~Ore veins, bedrock ores and bedrock fluids are datapack content. They can be registered in JSON or KubeJS. (Datapack JSON can be generated with datagen, see `com.gregtechceu.gtceu.data.DataGenerators`)~~

#### Other content

All other content should be registered via deferred registers.
Content that can be registered via registrate can also be registered via deferred registers, but registrate is recommended.

An exmaple of using a deferred register is shown below.
```java
class AddonCovers {

private static final COVER_REGISTER = DeferredRegister.create(GTRegistries.Keys.COVER, ADDON_MOD_ID);

public static final RegistryObject<CoverDefinition> CUSTOM_COVER = COVER_REGISTER.create("addon_custom_cover",
() -> new CoverDefinition(ADDON.id("addon_custom_cover"), AddonCustomCover::new))

// The init function should be called at some point during your mod's construction (e.g. in your main mod file or mod startup file)
public static void init(IEventBus modBus) {
COVER_REGISTER.register(modBus);
}
}

```

## New Data Save/Sync System

A new system for saving and syncing object fields has been added. See [this page](../../Development/Data-Sync-System/Migrating-From-LDLib-SyncData.md) for migration instructions.
Expand Down Expand Up @@ -156,4 +216,6 @@ As a recipe-matching optimization, input handlers whose `getTotalContentAmount()
- Calling the battery buffer constructor with the following args gives the same behaviour as a charger machine: `(info, tier, inventorySize, BatteryBufferMachine.AMPS_PER_BATTERY_CHARGER, 0)`
- Refactored Jade provider code. Use the `MachineInfoProvider` class for jade providers for a specific machine type, and `MachineTraitProvider` for providers for a specific machine trait.
- `GTUtil.getMoltenFluid(Material)` has been moved to `Material.getHotFluid()`.
- `ICopyable::copyConfig`'s `CompoundTag` argument should now be mutated by reference instead of a new one returned (and thus, the return type has been changed to `void`).
- `ICopyable::copyConfig`'s `CompoundTag` argument should now be mutated by reference instead of a new one returned (and thus, the return type has been changed to `void`).
- World gen layers now store their dimensions as `ResourceKey<Level>` rather than `ResourceLocation`
- Dimension markers now store their dimension as a `ResourceKey<Level>` rather than `ResourceLocation`
36 changes: 9 additions & 27 deletions docs/content/Modpacks/Examples/Custom-Recipe-Condition.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,23 @@ They are registered using
@Mod(ExampleMod.MOD_ID)
public class ExampleMod {

// in 1.20.1
public static RecipeConditionType<ExampleCondition> EXAMPLE_CONDITION;
private static final DeferredRegister<RecipeConditionType<?>> RECIPE_CONDITION = DeferredRegister
.create(GTRegistries.Keys.RECIPE_CONDITION, ExampleMod.MOD_ID);

// On 1.21, the registry object has type DeferredHolder<RecipeConditionType<?>, RecipeConditionType<ExampleCondition>>
public static RegistryObject<RecipeConditionType<ExampleCondition>> EXAMPLE_CONDITION = RECIPE_CONDITION.register("example_condition", // (1)
() ->new RecipeConditionType<>(ExampleCondition::new, ExampleCondition.CODEC));

public ExampleMod() {
IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
modBus.addGenericListener(RecipeConditionType.class, this::registerConditions);

// Register the deferred registry to the mod bus, so that the recipe condition is registered during registration.
RECIPE_CONDITION.register(modBus);
}

public void registerConditions(GTCEuAPI.RegisterEvent<String, RecipeConditionType<?>> event) {
EXAMPLE_CONDITION = GTRegistries.RECIPE_CONDITIONS.register("example_condition", // (1)
new RecipeConditionType<>(ExampleCondition::new, ExampleCondition.CODEC));
}
// end 1.20.1

// in 1.21.1
public static final RecipeConditionType<ExampleCondition> EXAMPLE_CONDITION = GTRegistries.register(GTRegistries.RECIPE_CONDITIONS,
ResourceLocation.fromNamespaceAndPath(ExampleMod.MOD_ID, "example_condition"), // (2)
new RecipeConditionType<>(ExampleCondition::new, ExampleCondition.CODEC));

public ExampleMod(IEventBus modBus, FMLModContainer container) {
modBus.addListener(CommonInit::onRegister);
bus.addListener(RecipeConditionType.class, this::registerConditions);
}

public void registerConditions(GTCEuAPI.RegisterEvent<String, RecipeConditionType<?>> event) {
EXAMPLE_CONDITION = GTRegistries.RECIPE_CONDITIONS.register("example_condition",
new RecipeConditionType<>(ExampleCondition::new, ExampleCondition.CODEC));
}
// end 1.21.1
}
```

1. The 1.20.1 version doesn't require a namespace, so make sure you don't use the same ID as someone else!
2. You may use a helper method akin to `GTCEu.id` for creating the ResourceLocation, but you **must** use your own namespace for it.

We will set up a condition that requires that the power buffer of the machine is above a certain Y level.
```java
public class ExampleCondition extends RecipeCondition<ExampleCondition> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Below is an example of a multiblock using the CoilWorkableElectricMultiblockMach
// In order to use multiblock logic extending beyond the normal WorkableElectricMultiblockMachine, (This is the multiblock type used by default for kubejs) you need to load a class. Coil multiblocks such as the Electric Blast Furnace, Pyrolyse Oven, and the Cracker use this class.
const CoilWorkableElectricMultiblockMachine = Java.loadClass("com.gregtechceu.gtceu.api.machine.multiblock.CoilWorkableElectricMultiblockMachine")

GTCEuStartupEvents.registry('gtceu:machine', event => {
StartupEvents.registry('gtceu:machine', event => {
event.create("superheated_pyrolyzing_oven", "multiblock")
.machine((holder) => new CoilWorkableElectricMultiblockMachine(holder))
.rotationState(RotationState.NON_Y_AXIS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Steam multiblocks such as the Steam Grinder and Steam Oven use this class.
// In order to use multiblock logic extending beyond the default multiblock type for KJS (WorkableElectricMultiblockMachine), you need to load a class.
const $SteamMulti = Java.loadClass('com.gregtechceu.gtceu.common.machine.multiblock.steam.SteamParallelMultiblockMachine');

GTCEuStartupEvents.registry('gtceu:machine', event => {
StartupEvents.registry('gtceu:machine', event => {
event.create('large_steam_compressor', 'multiblock')
.machine((holder) => new $SteamMulti(holder, 4))
// The number in holder is the max amount of parallel it can use.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/Modpacks/Examples/Example_Turbine.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Below is an example of a multiblock using the LargeTurbineMachine class for maki
// In order to use multiblock logic extending beyond the normal WorkableElectricMultiblockMachine, (This is the multiblock type used by default for kubejs) you need to load a class. LargeTurbineMachines such as the gas, steam, and plasma turbines use this class.
const $LargeTurbineMachine = Java.loadClass("com.gregtechceu.gtceu.common.machine.multiblock.generator.LargeTurbineMachine")

GTCEuStartupEvents.registry('gtceu:machine', event => {
StartupEvents.registry('gtceu:machine', event => {
event.create('hyper_gas_turbine', 'multiblock')
.machine((holder) => new $LargeTurbineMachine(holder, GTValues.LuV)) // The value shows one rotor holder tier above the recommended minimum rotor holder. The tier of rotor holder provides a boost based on the efficiency stat.
.rotationState(RotationState.NON_Y_AXIS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Below is an example of a multiblock using the CoilWorkableElectricMultiblockMach
// In order to use multiblock logic extending beyond the normal WorkableElectricMultiblockMachine, (This is the multiblock type used by default for kubejs) you need to load a class. Coil multiblocks such as the Electric Blast Furnace, Pyrolyse Oven, and the Cracker use this class.
const CoilWorkableElectricMultiblockMachine = Java.loadClass("com.gregtechceu.gtceu.api.machine.multiblock.CoilWorkableElectricMultiblockMachine")

GTCEuStartupEvents.registry('gtceu:machine', event => {
StartupEvents.registry('gtceu:machine', event => {
event.create("superheated_pyrolyzing_oven", "multiblock")
.machine((holder) => new CoilWorkableElectricMultiblockMachine(holder))
.rotationState(RotationState.NON_Y_AXIS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Steam multiblocks such as the Steam Grinder and Steam Oven use this class.
// In order to use multiblock logic extending beyond the default multiblock type for KJS (WorkableElectricMultiblockMachine), you need to load a class.
const $SteamMulti = Java.loadClass('com.gregtechceu.gtceu.common.machine.multiblock.steam.SteamParallelMultiblockMachine');

GTCEuStartupEvents.registry('gtceu:machine', event => {
StartupEvents.registry('gtceu:machine', event => {
event.create('large_steam_compressor', 'multiblock')
.machine((holder) => new $SteamMulti(holder, 4))
// The number in holder is the max amount of parallel it can use.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Below is an example of a multiblock using the LargeTurbineMachine class for maki
// In order to use multiblock logic extending beyond the normal WorkableElectricMultiblockMachine, (This is the multiblock type used by default for kubejs) you need to load a class. LargeTurbineMachines such as the gas, steam, and plasma turbines use this class.
const $LargeTurbineMachine = Java.loadClass("com.gregtechceu.gtceu.common.machine.multiblock.generator.LargeTurbineMachine")

GTCEuStartupEvents.registry('gtceu:machine', event => {
StartupEvents.registry('gtceu:machine', event => {
event.create('hyper_gas_turbine', 'multiblock')
.machine((holder) => new $LargeTurbineMachine(holder, GTValues.LuV)) // The value shows one rotor holder tier above the recommended minimum rotor holder. The tier of rotor holder provides a boost based on the efficiency stat.
.rotationState(RotationState.NON_Y_AXIS)
Expand Down
4 changes: 2 additions & 2 deletions docs/content/Modpacks/Examples/Multiblocks/Greenhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: "Greenhouse"

=== "JavaScript"
```js title="greenhouse_recipe_type.js"
GTCEuStartupEvents.registry('gtceu:recipe_type', event => {
StartupEvents.registry('gtceu:recipe_type', event => {
event.create('greenhouse')
.category('drack')
.setEUIO('in')
Expand All @@ -35,7 +35,7 @@ title: "Greenhouse"
const $RecipeLogic = Java.loadClass('com.gregtechceu.gtceu.api.machine.trait.RecipeLogic')
const $List = Java.loadClass('java.util.List')

GTCEuStartupEvents.registry('gtceu:machine', event => {
StartupEvents.registry('gtceu:machine', event => {
event.create('greenhouse', 'multiblock')
.rotationState(RotationState.NON_Y_AXIS)
.recipeType('greenhouse')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "Ore Processing Plant"

=== "JavaScript"
```js title="ore_processing_plant.js"
GTCEuStartupEvents.registry('gtceu:recipe_type', event => {
StartupEvents.registry('gtceu:recipe_type', event => {
event.create('ore_processing_plant')
.category('ore_processing_plant')
.setEUIO('in')
Expand All @@ -30,7 +30,7 @@ title: "Ore Processing Plant"
## Multiblock
=== "JavaScript"
```js title="ore_processing_plant.js"
GTCEuStartupEvents.registry('gtceu:machine', event => {
StartupEvents.registry('gtceu:machine', event => {
event.create('ore_processing_plant', 'multiblock')
.rotationState(RotationState.NON_Y_AXIS)
.recipeType('ore_processing_plant')
Expand Down
2 changes: 1 addition & 1 deletion docs/content/Modpacks/Examples/Parallel-Hatch-Part.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const $ParallelHatchPartMachine = Java.loadClass(
"com.gregtechceu.gtceu.common.machine.multiblock.part.ParallelHatchPartMachine"
); // (1)

GTCEuStartupEvents.registry("gtceu:machine", (event) => {
StartupEvents.registry("gtceu:machine", (event) => {
event
.create("parallel_hatch", "custom") // (2)
.tiers(GTValues.UHV, GTValues.UIV, GTValues.UEV, GTValues.UXV) // (3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ You can change the properties of the material by adding any combination of the f

=== "JavaScript"
```js title="ingot.js"
GTCEuStartupEvents.registry('gtceu:material', event => {
StartupEvents.registry('gtceu:material', event => {
event.create('andesite_alloy')
.ingot()
.components('1x andesite', '1x iron')
Expand All @@ -76,8 +76,7 @@ You can change the properties of the material by adding any combination of the f
```java title="Ingot.java"
public static Material ANDESITE_ALLOY;
public static void register() {
ANDESITE_ALLOY = new Material.Builder(
your_mod_id.id("andesite_alloy"))
ANDESITE_ALLOY = REGISTRATE.material("andesite_alloy")
.ingot()
.components("1x andesite", "1x iron")
.color(0xFF0000).secondaryColor(0x840707).iconSet(GTMaterialIconSet.DULL)
Expand All @@ -90,7 +89,7 @@ You can change the properties of the material by adding any combination of the f

=== "JavaScript"
```js title="dust.js"
GTCEuStartupEvents.registry('gtceu:material', event => {
StartupEvents.registry('gtceu:material', event => {
event.create('mysterious_dust')
.dust() // The harvest level and burn time can be specified in the brackets. Example: `.dust(2, 4000)`
.color(0x7D2DDB)
Expand All @@ -101,8 +100,7 @@ You can change the properties of the material by adding any combination of the f
```java title="Dust.java"
public static Material MYSTERIOUS_DUST;
public static void register() {
MYSTERIOUS_DUST = new Material.Builder(
your_mod_id.id("mysterious_dust"))
MYSTERIOUS_DUST = REGISTRATE.material("mysterious_dust")
.dust() // The harvest level and burn time can be specified in the brackets. Example: `.dust(2, 4000)`
.color(0x7D2DDB)
.buildAndRegister();
Expand All @@ -113,7 +111,7 @@ You can change the properties of the material by adding any combination of the f

=== "JavaScript"
```js title="gem.js"
GTCEuStartupEvents.registry('gtceu:material', event => {
StartupEvents.registry('gtceu:material', event => {
event.create('purple_coal')
.gem(2, 4000)
.element(GTElements.C)
Expand All @@ -127,8 +125,7 @@ You can change the properties of the material by adding any combination of the f
```java title="Gem.java"
public static Material PURPLE_COAL;
public static void register() {
PURPLE_COAL = new Material.Builder(
your_mod_id.id("purple_coal"))
PURPLE_COAL = REGISTRATE.material("purple_coal")
.gem(2, 4000)
.element(GTElements.C)
.ore(2, 3)
Expand All @@ -142,7 +139,7 @@ You can change the properties of the material by adding any combination of the f
=== "JavaScript"
```js title="fluid.js"
// const $FluidBuilder = Java.loadClass('com.gregtechceu.gtceu.api.fluids.FluidBuilder'); Uncomment if you want to use the Fluid Builder.
GTCEuStartupEvents.registry('gtceu:material', event => {
StartupEvents.registry('gtceu:material', event => {
event.create('mysterious_ooze')
.fluid() // Or .liquid(Int Temperature)
.color(0x500bbf)
Expand All @@ -153,8 +150,7 @@ You can change the properties of the material by adding any combination of the f
```java title="Fluid.java"
public static Material MYSTERIOUS_OOZE;
public static void register() {
MYSTERIOUS_OOZE = new Material.Builder(
your_mod_id.id("mysterious_ooze"))
MYSTERIOUS_OOZE = REGISTRATE.material("mysterious_ooze")
.fluid() // Or .liquid(Int Temperature)
.color(0x500bbf)
.buildAndRegister();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Element Creation
Elements are the base of GT materials. Registering an element WILL NOT add any items.

```js
GTCEuStartupEvents.registry('gtceu:element', event => {
StartupEvents.registry('gtceu:element', event => {
event.create('test_element')
.protons(27)
.neutrons(177)
Expand All @@ -21,6 +21,15 @@ GTCEuStartupEvents.registry('gtceu:element', event => {
})
```

=== "Java"
```java title="AddonElements.java"
public static Element TEST_ELEMENT;
public static void register() {
TEST_ELEMENT = REGISTRATE.element("test_element", 27, 177, -1, null, "test", false);
}
```


1. `.create(String name)` -> The element name.
2. `.protons(int protons)` -> Proton Count. Use `-1` if it is an element that will not get a material.
3. `.neutrons(int neutrons)` -> Neutron Count. Use `-1` if it is an element that will not get a material
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ can influence how the material behaves, as well as which items are generated for

=== "Javascript"
```js
GTCEuStartupEvents.registry('gtceu:material', event => {
StartupEvents.registry('gtceu:material', event => {
event.create('my_material')
// ...
.flags(GTMaterialFlags.FLAMMABLE)
Expand All @@ -20,8 +20,7 @@ can influence how the material behaves, as well as which items are generated for
```java
public static Material MY_MATERIAL;
public static void register() {
MY_MATERIAL = new Material.Builder(
your_mod_id.id('my_material'))
MY_MATERIAL = REGISTRATE.material('my_material')
// ...
.flags(GTMaterialFlags.FLAMMABLE)
.buildAndRegister();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The following icon sets are available by default:
Custom iconsets can be specified as well, using the `gtceu:matieral_icon_set` event:

```js title="custom_iconsets.js"
GTCEuStartupEvents.registry('gtceu:material_icon_set', event => {
StartupEvents.registry('gtceu:material_icon_set', event => {
event.create('starry')
.parent('shiny')
})
Expand Down
Loading
Loading