-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed issues in proc plant * fixed extra curly bracket * Parallel hatch example * Renamed parallel hatch file * Added removing ore piles example * Reducing machines duration example
- Loading branch information
Showing
5 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: "Custom Parallel Hatch" | ||
--- | ||
|
||
|
||
# Custom Parallel Hatch Multi-Part (By Sparked) | ||
|
||
## Parallel Hatch | ||
|
||
```js title="extra_parallel_hatch.js" | ||
|
||
const $ParallelHatchPartMachine = Java.loadClass( | ||
'com.gregtechceu.gtceu.common.machine.multiblock.part.ParallelHatchPartMachine' | ||
) // (1) | ||
|
||
GTCEuStartupEvents.registry('gtceu:machine', event => { // (2) | ||
event.create( | ||
"uhv_parallel_hatch", // (3) | ||
"custom", | ||
(holder, tier) => { | ||
return new $ParallelHatchPartMachine(holder, tier); | ||
}, | ||
GTValues.UHV // (4) | ||
) | ||
.abilities(PartAbility.PARALLEL_HATCH) // (5) | ||
.workableTieredHullRenderer(GTCEu.id("block/machines/parallel_hatch_mk4")) // (6) | ||
}) | ||
``` | ||
|
||
1. Loading the java class that is required to build the parallel hatch multi part | ||
2. Using the GT registry event to register the multi part, which is part of machine registry | ||
3. The ID for the new parallel hatch | ||
4. The tier used for the parallel hatch | ||
5. Specifying the multipart to use parallel hatch ability | ||
6. 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: "Machines Duration Reduction" | ||
--- | ||
|
||
|
||
# Reducing Duration Of All Machine Recipes | ||
|
||
## Reducing Script | ||
|
||
```js title="Reduce_Duration.js" | ||
ServerEvents.recipes(event => { | ||
event.forEachRecipe({ mod: 'gtceu' }, recipe => { // (1) | ||
try { // (2) | ||
var newDuration = recipe.get("duration") // (3) | ||
recipe.set("duration", newDuration/10) // (4) | ||
} catch (err) { // (5) | ||
console.log(recipe.id + " has no duration field, skipped.") | ||
} | ||
}) | ||
}) | ||
``` | ||
|
||
1. A function to run code for every recipe in gregtech. | ||
2. Uses a try to avoid using recipes that don't have a duration, like crafting. | ||
3. Gets a variable of the duration current duration to change. | ||
4. Edits the recipes duration to a tenth of the old recipes duration. | ||
5. Catches the error if the recipe has no duration and logs it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: "Removing Surface Ore Indicators" | ||
--- | ||
|
||
|
||
# Removing Surface Ore Indicators | ||
|
||
## Removal Script | ||
|
||
```js title="remove_piles.js" | ||
GTCEuServerEvents.oreVeins(event => { | ||
event.modifyAll((veinId, vein) => { | ||
vein.surfaceIndicatorGenerator(indicator => indicator | ||
.block(Block.getBlock("minecraft:air")) // (1) | ||
.placement("above") | ||
.density(0.4) // Unsure if this matters | ||
.radius(5) // Unsure if this matters | ||
) | ||
}) | ||
}) | ||
``` | ||
|
||
1. Replacing where a ore pile would be with an air block, essentially removing it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters