Custom Parallel Hatch Multi-Part (By Sparked)
Parallel Hatch
extra_parallel_hatch.js
const $ParallelHatchPartMachine = Java.loadClass(
"com.gregtechceu.gtceu.common.machine.multiblock.part.ParallelHatchPartMachine"
); // (1)
GTCEuStartupEvents.registry("gtceu:machine", (event) => {
event
.create("parallel_hatch", "custom") // (2)
.tiers(GTValues.UHV, GTValues.UIV, GTValues.UEV, GTValues.UXV) // (3)
.machine((holder, tier, tankScaling) => {
return new $ParallelHatchPartMachine(holder, tier); // (4)
})
.definition((tier, builder) => {
let name = "Simple";
switch (tier) {
case GTValues.UHV:
name = "Epic";
break;
case GTValues.UIV:
name = "Legendary";
break;
case GTValues.UEV:
name = "Spectral";
break;
case GTValues.UXV:
name = "Universal";
break;
}
const $RecipeLogic = Java.loadClass(
"com.gregtechceu.gtceu.api.machine.trait.RecipeLogic"
);
builder
.langValue(name + " Parallel Control Hatch")
.rotationState(RotationState.ALL)
.abilities(PartAbility.PARALLEL_HATCH) // (5)
.modelProperty($RecipeLogic.STATUS_PROPERTY, $RecipeLogic.Status.IDLE)
.model(
GTMachineModels.createWorkableTieredHullMachineModel(
GTCEu.id("block/machines/parallel_hatch_mk4") // (6)
)[
"andThen(com.gregtechceu.gtceu.api.registry.registrate.MachineBuilder$ModelInitializer)"
]((ctx, prov, model) => {
model.addReplaceableTextures("bottom", "top", "side");
})
)
}); // (7)
});
- Loading the parallel hatch's java class is required
- Using the GT registry event to register a tiered custom machine
- The tiers to register the machine for
Here, GT will generate items and blocks named
gtceu:uhv_parallel_hatch
,gtceu:uev_parallel_hatch
,gtceu:uiv_parallel_hatch
, andgtceu:uxv_parallel_hatch
- Use the loaded class for creating the machines in the world
- Specifying the multipart to use parallel hatch ability
- The texture to use for the multipart, this example just uses the t4 texture as a placeholder You can look at gtm's assets to see the animations and textures to edit
- You can just refer to the code in GCYMMachines.PARALLEL_HATCH here