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

Startup Scripts

Element Creation

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

Custom Icon Sets

GTCEuStartupEvents.registry('gtceu:material_icon_set', event => {
   event.create('test').parent(GTMaterialIconSet.SHINY)
})

Kubejs Items:
kubejs\assets\gtceu\textures\item\material_sets\test\
kubejs\assets\gtceu\models\item\material_sets\test\
Kubejs Blocks/Frames:
kubejs\assets\gtceu\textures\block\material_sets\test\

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)
})

Material Flags

  • GENERATE_BOLT_SCREW
  • GENERATE_DENSE
  • GENERATE_FINE_WIRE
  • GENERATE_FOIL
  • GENERATE_FRAME
  • GENERATE_GEAR
  • GENERATE_LENS
  • GENERATE_LONG_ROD
  • GENERATE_PLATE
  • GENERATE_RING
  • GENERATE_ROD
  • GENERATE_ROTOR
  • GENERATE_ROUND
  • GENERATE_SMALL_GEAR
  • GENERATE_SPRING
  • GENERATE_SPRING_SMALL

Icon Sets

  • BRIGHT
  • CERTUS
  • DIAMOND
  • DULL
  • EMERALD
  • FINE
  • FLINT
  • FLUID
  • GAS
  • GEM_HORIZONTAL
  • GEM_VERTICAL
  • GLASS
  • LAPIS
  • LIGNITE
  • MAGNETIC
  • METALLIC
  • NETHERSTAR
  • OPAL
  • QUARTZ
  • ROUGH
  • RUBY
  • SAND
  • SHINY
  • WOOD
  • Custom Icon Sets

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 Slots, Max Output Slots, Min Fluid Input Slots, Max Fluid Input Slots
		.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) 
            .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("test_recipe_type")
//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("test_recipe_type")
            .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();


})

Coil Creation

StartupEvents.registry('block', event => {
    event.create('infinity_coil_block', 'gtceu:coil')
        .temperature(100)
        .level(0)
        .energyDiscount(0)
        .tier(10)
        .coilMaterial(GTMaterials.get('infinity'))
        .texture('kubejs:block/example_block')
        .tagBlock('forge:mineable/wrench')
        .hardness(5)
        .requiresTool(true)
        .material('metal')
        .model('kubejs:block/example_block')
})

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