Skip to content
Drackion edited this page May 26, 2023 · 52 revisions

GTCEU Kubejs Scripts

Startup Scripts

Element Creation

GTCEuStartupEvents.registry('gtceu:element', event => {
event.create(27, 177, -1, null, 'test_element', 'test', false);
})

Material Creation

GTCEuStartupEvents.registry('gtceu:material', event => {
   event.create("test")
        .ingot(1)
        .element(GTElements.get("test_element"))
        .color(0x2176ff).iconSet(GTMaterialIconSet.METALLIC)
        .flags(GTMaterialFlags.GENERATE_PLATE, GTMaterialFlags.GENERATE_ROD, GTMaterialFlags.GENERATE_FRAME)
})

Recipe Type Creation

GTCEuStartupEvents.registry('gtceu:recipe_type', event => {
        event.create("test_recipe_type")
                .category('test') //Used in the GTlib / LDlib Recipe type ui editor
		.setEUIO("IN")
		.setMaxIOSize(3, 4, 2, 0) //Min Input, Max Output, Min Fluid Input, Max Fluid Input
		.setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
		.setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
	.setSound(GTSoundEntries.COOLING);

    if (GTCEu.isCreateLoaded()) {
        event.create("test_kinetic_recipe_type", "kinetic") // name, category
            .setMaxIOSize(3, 1, 2, 1) // maxInputs, maxOutputs, maxFluidInputs, maxFluidOutputs
            .setSlotOverlay(false, false, GuiTextures.DUST_OVERLAY)
            .setSlotOverlay(true, false, GuiTextures.DUST_OVERLAY)
            .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
            .setSound(GTSoundEntries.FIRE)
            .setMaxConditions(1) // if you may add a rpm condition, it will help adjust JEI layout
    }
})

Machine & Multiblock Creation

GTCEuStartupEvents.registry('gtceu:machine', event => {
//steam
       event.create("test_simple_steam_machine", "steam").recipeType(testType)
//electric
       event.create("test_electric", 'simple')
            .recipeType('test_recipe_type')
            .tankScalingFunction(tier => 3200)
            .tiers(GTValues.LV, GTValues.MV, GTValues.HV, GTValues.EV, GTValues.IV);
//multi
     event.create("test_simple_multiblock", "multiblock")
            .rotationState(RotationState.NON_Y_AXIS)
            .recipeType(testType)
            .appearanceBlock(GTBlocks.CASING_STAINLESS_CLEAN)
            .pattern(definition => FactoryBlockPattern.start()
                .aisle("BBB", "XXX", "XXX")
                .aisle("BBB", "X#X", "XMX")
                .aisle("BBB", "XSX", "XXX")
                .where('S', Predicates.controller(Predicates.blocks(definition.get())))
                .where('B', Predicates.blocks("minecraft:stone"))
                .where('X', Predicates.blocks(GTBlocks.CASING_STAINLESS_CLEAN.get()).setMinGlobalLimited(5)
                    .or(Predicates.autoAbilities(definition.getRecipeType())))
                .where('M', Predicates.abilities(PartAbility.MUFFLER).setExactLimit(1))
                .where('#', Predicates.air())
                .build())
            .workableCasingRenderer("gtceu:block/casings/solid/machine_casing_clean_stainless_steel",
                "gtceu:block/multiblock/implosion_compressor", false)
            .register();


})

Server Scripts

Recipe Additions

ServerEvents.recipes(event => {

//Note if on v1.0.3 use:event.recipes.gtceu.gt_recipe_serializer('alloy_smelter', 'recipe_id') instead      

event.recipes.gtceu.alloy_smelter('recipe_id')             
            .inputItems('gtceu:wire_single.copper', 'gtceu:wire_single.nickel')
            .outputItems('2x gtceu:wire_single.cupronickel')
            .duration(120)
            .EUt(16)
})

Clone this wiki locally