Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Dr misc fixes (#23)
Browse files Browse the repository at this point in the history
* fixes and additions part one

* new additions

* stuff

* Update docs/Modpacks/Other-Topics/Adding-and-Removing-Recipes.md

Co-authored-by: Mikerooni <139889766+mikerooni@users.noreply.github.com>

---------

Co-authored-by: Mikerooni <139889766+mikerooni@users.noreply.github.com>
Drackion and mikerooni authored Mar 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 3dddac9 commit 81e8e41
Showing 5 changed files with 195 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/Modpacks/Ore-Generation/03-Adding-Stone-Types.md
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ For example purposes, this guide uses the block "Blockium" (ID: `my_mod:blockium
Replace this with the block you want to add ores for.

```js title="startup_scripts/ore_types.js"
GTCEuStartupEvents.registry('gtceu:tag_prefix', e => {
e.create('blockium', 'ore') // (1)
GTCEuStartupEvents.registry('gtceu:tag_prefix', event => {
event.create('blockium', 'ore') // (1)
.stateSupplier(() => Block.getBlock('my_mod:blockium').defaultBlockState()) // (2)
.baseModelLocation('my_mod:block/blockium') // (3)
.unificationEnabled(true)
@@ -67,8 +67,8 @@ In this case you have to specify the actually generated block state in your ore
```js
let UtilsJS = Java.loadClass("dev.latvian.mods.kubejs.util.UtilsJS")

GTCEuStartupEvents.registry('gtceu:tag_prefix', e => {
e.create(type.path, 'ore')
GTCEuStartupEvents.registry('gtceu:tag_prefix', event => {
event.create(type.path, 'ore')
.stateSupplier(() => UtilsJS.parseBlockState("my_mod:blockium[some_blockstate_property=true]"))
})
```
5 changes: 3 additions & 2 deletions docs/Modpacks/Ore-Generation/Bedrock-Fluid-Veins.md
Original file line number Diff line number Diff line change
@@ -3,10 +3,11 @@ title: Bedrock Fluid Veins
---


Bedrock fluid veins can be pumped using fluid drills.
# Bedrock Fluid Veins

# Creating a Bedrock Fluid Vein
Bedrock Fluid Veins are invisable veins that exist under the bedrock, to find Fluid Veins you must have at least a HV tier Prospector. A Fluid Drilling Rig must be used to obtain the fluids out of the vein.

## Creating a Bedrock Fluid Vein

```js title="fluid_veins.js"
// In server events
105 changes: 104 additions & 1 deletion docs/Modpacks/Other-Topics/Adding-and-Removing-Recipes.md
Original file line number Diff line number Diff line change
@@ -5,4 +5,107 @@ title: "Adding & Removing Recipes"

# Adding and Removing Recipes

!!! failure "Not yet documented"
## Removing Recipes

Removing GTCEu Modern recipes with KubeJS works the same as any other recipe, meaning they can be removed by: ID, Mod, Input, Output, Type or a Mixture.

```js title="gtceu_removal.js"
ServerEvents.recipes(event => {
event.remove({ id: 'gtceu:smelting/sticky_resin_from_slime' }) // (1)
event.remove({ mod: 'gtceu' }) // (2)
event.remove({ type: 'gtceu:arc_furnace' }) // (3)
event.remove({ input: '#forge:ingots/iron' }) // (4)
event.remove({ output: 'minecraft:cobblestone' }) // (5)
event.remove({ type: 'gtceu:assembler', input: '#forge:plates/steel' }) // (6)
})
```

1. Targets the slime to sticky resin furnace recipe only for removal.
2. Targets all recipes under the gtceu mod id for removal.
3. Targets all recipes in the arc furnace for removal.
4. Targets all recipes that have an input of `#forge:ingots/iron` for removal.
5. Targets all recipes that have an output of `minecraft:cobblestone` for removal.
6. Targets all recipes in the gtceu assembler that have an input of `#forge:plates/steel` for removal.


## Modifiying Recipes

With KubeJS it is possible to modfiy the Inputs or Outputs of existing GTCEu Modern recipes, which uses the same method of targeting the recipes.

```js title="gtceu_modify.js"
ServerEvents.recipes(event => {
event.replaceInput({ mod: 'gtceu' }, 'minecraft:sand', '#forge:sand') // (1)
event.replaceOutput({ type: 'gtceu:arc_furnace' }, 'gtceu:wrought_iron_ingot', 'minecraft:dirt') // (2)
})
```

1. Targets all gtceu recipes that have and input of `minecraft:sand` and replaces it with `#forge:sand`.
2. Targets all gtceu arc furnace recipes that have and output of `gtceu:wrought_iron_ingot` and replaces it with `minecraft:dirt`.


## Adding Recipes

Syntax: `event.recipes.gtceu.RECIPE_TYPE(string: recipe id)`

```js title="gtceu_add.js"
ServerEvents.recipes(event => {
event.recipes.gtceu.assembler('test')
.itemInputs(
'64x minecraft:dirt',
'32x minecraft:diamond'
)
.inputFluids(
Fluid.of('minecraft:lava', 1500)
)
.itemOutputs(
'minecraft:stick'
)
.duration(100)
.EUt(30)
})
```

### Event Addons

- Inputs:
- Items:
- `.itemInput()`
- `.itemInputs()`
- `.chancedInput()`
- `.notConsumable()`
- Fluids:
- `.inputFluids()`
- `.chancedFluidInput()`
- Misc:
- `.circuit()`
- Outputs:
- Items:
- `.itemOutput()`
- `.itemOutputs()`
- `.chancedOutput()`
- Fluids:
- `.outputFluids`
- `.chancedFluidOutput()`
- Energy:



### Rhino Jank

!!! warning
Due to some Rhino Jank, when adding rock breaker recipes you will need to manually tell Rhino how to interpret `.addData()`.

```js title="rhino_jank_rock_breaker.js"
ServerEvents.recipes(event => {
const RockBreakerCondition = Java.loadClass("com.gregtechceu.gtceu.common.recipe.RockBreakerCondition")

event.recipes.gtceu.rock_breaker('rhino_jank')
.notConsumable('minecraft:dirt')
.itemOutputs('minecraft:dirt')
["addData(java.lang.String,java.lang.String)"]("fluidA", "minecraft:lava")
["addData(java.lang.String,java.lang.String)"]("fluidB", "minecraft:water")
.duration(16)
.EUt(30)
.addCondition(RockBreakerCondition.INSTANCE)
})
```
85 changes: 82 additions & 3 deletions docs/Modpacks/Other-Topics/Custom-Machines.md
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {
```js title="test_electric_machine.js"
GTCEuStartupEvents.registry('gtceu:machine', event => {
event.create('test_electric', 'simple', GTValues.LV, GTValues.MV, GTValues.HV) // (1)
.rotationState(RotationState.NON_Y_AXIS)
.recipeType('test_recipe_type')
.tankScalingFunction(tier => tier * 3200)
})
@@ -34,15 +35,93 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {

```js title="test_kinetic_machine.js"
GTCEuStartupEvents.registry('gtceu:machine', event => {

event.create('test_kinetic', 'kinetic', GTValues.LV, GTValues.MV, GTValues.HV)
.rotationState(RotationState.NON_Y_AXIS)
.recipeType('test_kinetic_recipe_type')
.tankScalingFunction(tier => tier * 3200)
})
```


## Creating Custom Generator

```js
```js title="test_generator.js"
GTCEuStartupEvents.registry('gtceu:machine', event => {
event.create('test_generator', 'generator', GTValues.LV, GTValues.MV, GTValues.HV) // (1)
.recipeType('test_generator_recipe_type')
.tankScalingFunction(tier => tier * 3200)
})
```


## Creating Custom Multiblock

```js title="test_multiblock.js"
GTCEuStartupEvents.registry('gtceu:machine', event => {
event.create('test_generator', 'multiblock')
.rotationState(RotationState.NON_Y_AXIS)
.appearanceBlock(GTBlocks.CASING_STEEL_SOLID)
.recipeTypes(['test_recipe_type_1', 'test_recipe_type_2'])
.pattern(definition => FactoryBlockPattern.start()
.aisle('CCC', 'GGG', 'CCC')
.aisle('CCC', 'GDG', 'CSC')
.aisle('CKC', 'GGG', 'CMC')
.where('K', Predicates.controller(Predicates.blocks(definition.get())))
.where('M', Predicates.abilities(PartAbility.MAINTENANCE))
.where('S', Predicates.abilities(PartAbility.MUFFLER))
.where('D', Predicates.blocks(GTBlocks.COIL_CUPRONICKEL.get()))
.where('G', Predicates.blocks('minecraft:glass'))
.where('C', Predicates.blocks(GTBlocks.CASING_STEEL_SOLID.get())
.or(Predicates.autoAbilities(definition.getRecipeTypes())))
.build())
.workableCasingRenderer(
"gtceu:block/casings/solid/machine_casing_inert_ptfe",
"gtceu:block/multiblock/large_chemical_reactor",
false
)
})
```

### Shape Info

Shape Info is used to manually define how your multiblock appears in the JEI/REI/EMI multiblock preview tab.

```js title="shape_info_test.js"
GTCEuStartupEvents.registry('gtceu:machine', event => {

event.create('test_generator', 'multiblock')
.rotationState(RotationState.NON_Y_AXIS)
.appearanceBlock(GTBlocks.CASING_STEEL_SOLID)
.recipeTypes(['test_recipe_type_1', 'test_recipe_type_2'])
.pattern(definition => FactoryBlockPattern.start()
.aisle('CCC', 'GGG', 'CCC')
.aisle('CCC', 'GDG', 'CSC')
.aisle('CKC', 'GGG', 'CMC')
.where('K', Predicates.controller(Predicates.blocks(definition.get())))
.where('M', Predicates.abilities(PartAbility.MAINTENANCE))
.where('S', Predicates.abilities(PartAbility.MUFFLER))
.where('D', Predicates.blocks(GTBlocks.COIL_CUPRONICKEL.get()))
.where('G', Predicates.blocks('minecraft:glass'))
.where('C', Predicates.blocks(GTBlocks.CASING_STEEL_SOLID.get())
.or(Predicates.autoAbilities(definition.getRecipeTypes())))
.build())
.shapeInfo(controller => MultiblockShapeInfo.builder()
.aisle('eCe', 'GGG', 'CCC')
.aisle('CCC', 'GDG', 'CSC')
.aisle('iKo', 'GGG', 'CMC')
.where('K', controller, Direction.SOUTH)
.where('C', GTBlocks.CASING_STEEL_SOLID.get())
.where('G', Block.getBlock('minecraft:glass'))
.where('D', GTBlocks.COIL_CUPRONICKEL.get())
.where('S', GTMachines.MUFFLER_HATCH[1], Direction.UP)
.where('M', GTMachines.MAINTENANCE_HATCH[1], Direction.SOUTH)
.where('e', GTMachines.ENERGY_INPUT_HATCH[1], Direction.NORTH)
.where('i', GTMachines.ITEM_IMPORT_BUS[1], Direction.SOUTH)
.where('0', GTMachines.ITEM_EXPORT_BUS[1], Direction.SOUTH)
.build())
.workableCasingRenderer(
"gtceu:block/casings/solid/machine_casing_inert_ptfe",
"gtceu:block/multiblock/large_chemical_reactor",
false
)
})
```
2 changes: 2 additions & 0 deletions docs/Modpacks/Other-Topics/Custom-Recipe-Types.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ title: Custom Recipe Type

## Creating a Recipe Type

!!! important "Recipe Types MUST be registered before the machines or multiblocks"

```js title="test_recipe_type.js"
GTCEuStartupEvents.registry('gtceu:recipe_type', event => {
event.create('test_recipe_type')

0 comments on commit 81e8e41

Please sign in to comment.