forked from GregTechCEu/GregTech-Modern
-
Notifications
You must be signed in to change notification settings - Fork 0
KubeJS
Drackion edited this page Jun 29, 2023
·
52 revisions
GTCEuStartupEvents.registry('gtceu:element', event => {
event.create('test_element', 27, 177, -1, null, 'test', false);
})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\
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)
event.create('andesite_alloy')
.ingot(1)
.components(GTMaterials.Andesite, 1, GTMaterials.Iron, 1)
.color(0x99B09F).iconSet(GTMaterialIconSet.DULL)
.flags(GTMaterialFlags.GENERATE_PLATE, GTMaterialFlags.GENERATE_GEAR, GTMaterialFlags.GENERATE_SMALL_GEAR)
})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
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')
.category('kinetic')
.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)
.setMaxTooltip(5) // if you may add a rpm condition, it will help adjust JEI layout
}
})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)
//Kinetic
if (GTCEU.isCreateLoaded()) {
event.create('test_simple_kinetic_machine', 'kinetic')
.recipeType('test_kinetic_recipe_type')
.tankScalingFunction(tier => 3200)
.tiers(GTValues.LV, GTValues.MV, GTValues.HV, GTValues.EV, GTValues.IV);
event.create('test_kinetic_multiblock', 'multiblock')
.rotationState(RotationState.NON_Y_AXIS)
.recipeType('test_kinetic_recipe_type')
.appearanceBlock(GTBlocks.CASING_STAINLESS_CLEAN)
.pattern(definition => FactoryBlockPattern.start()
.aisle("XXX", "XXX", "XXX")
.aisle("XXX", "X#X", "XXX")
.aisle("XXX", "XSX", "XXX")
.where('S', Predicates.controller(Predicates.blocks(definition.get())))
.where('X', Predicates.blocks(GTBlocks.CASING_STAINLESS_CLEAN.get()).setMinGlobalLimited(14)
.or(Predicates.autoAbilities(definition.getRecipeType()))
.or(Predicates.abilities(PartAbility.INPUT_KINETIC).setExactLimit(1)))
.where('#', Predicates.air())
.build())
.workableCasingRenderer("gtceu:block/casings/solid/machine_casing_clean_stainless_steel",
"gtceu:block/multiblock/implosion_compressor", false);
}
})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')
})GTCEuStartupEvents.registry('gtceu:tag_prefix', event => {
event.create('bedrock', 'ore')
.stateSupplier(() => Blocks.BEDROCK.defaultBlockState())
.material(Material.STONE)
.color(MaterialColor.STONE)
.sound(SoundType.STONE)
.unificationEnabled(true)
.materialIconType(GTMaterialIconType.ore)
.generationCondition(ItemGenerationCondition.hasOreProperty);
})ServerEvents.recipes(event => {
event.recipes.gtceu.alloy_smelter('recipe_id')
.itemInputs('gtceu:wire_single.copper', 'gtceu:wire_single.nickel')
.itemOutputs('2x gtceu:wire_single.cupronickel')
.duration(120)
.EUt(16)
if (GTCEU.isCreateLoaded()) {
event.recipes.test_kinetic_recipe_type(mod_id:recipe_id) //'gtceu:test'
.itemInputs('minecraft:dirt')
.itemOutputs('minecraft:diamond')
.duration(100)
.EUt(24)
.rpm(8);
}
})Additional values
- .inputFluids('minecraft:water 100')
- .outputFluids('minecraft:water 100')
- .inputStress(32)
- .rpm(8)
- .chancedOutput('minecraft:dirt', 5000, 500) //('item_id', primary chance, addition chance per overclock) 5000 = 50%