Skip to content

Commit 271ebaf

Browse files
authored
Copy PR 43 from the old docs repo (GregTechCEu#2739)
1 parent 01b652a commit 271ebaf

File tree

5 files changed

+250
-130
lines changed

5 files changed

+250
-130
lines changed

docs/content/Modpacks/Materials-and-Elements/Material-Properties.md

Lines changed: 51 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,54 @@ title: Material Properties
55

66
# Material Properties (WIP)
77

8-
```js
9-
10-
BlastProperty.blastTemp() // (1)
11-
BlastProperty.gasTier() // (2)
12-
BlastProperty.durationOverride() // (3)
13-
BlastProperty.eutOverride() // (4)
14-
- DustProperty:
15-
- .dust() // (5)
16-
- FluidPipeProperty:
17-
- .fluidPipeProperties() // (6)
18-
- FluidProperty:
19-
- .fluid() // (7)
20-
- .isGas() // (8)
21-
- .hasBlock()
22-
- GemProperty:
23-
- .gem()
24-
- IngotProperty:
25-
- .ingot() // (9)
26-
- .smeltInto()
27-
- .arcSmeltInto()
28-
- .magneticMaterial()
29-
- .macerateInto()
30-
- OreProperty:
31-
- .ore() // (10)
32-
```
33-
34-
1. Sets the Blast Furnace Temperature of the material. If the temperature is below 1000K recipes will be generated in the Primitive Blast Furnace. If above 1750K recipes for the Hot Ingot will be created along with the Vacuum Freezer Recipe to cool the ingot. Example: `.blastTemp(2750)`
35-
36-
2. Sets the Gas Tier which determins what GAS EBF recipes will be generated. Example: `.gasTier(LOW)`
37-
38-
3. Overrides the EBF's default behaviour for recipe durations.
39-
40-
4. Overrides the EBF's default behaviour for EU/t.
41-
42-
5. Used for creating a dust material. The haverst level and burn time can be specified in the brackets. Example: `.dust(2, 4000)`
43-
44-
6. Creates a fluid pipe out of the material it is added to. The possible values are: Max Fluid Temperature, Throughput, Gas Proof, Acid Proof, Cyro Proof, Plasma Proof,
45-
Channels. Example: `.fluidPipeProperties(9620, 850, false, false, false, false, 1)`
8+
## Blast Furnace Properties
9+
10+
### `BlastProperty.blastTemp()`
11+
Sets the Blast Furnace Temperature of the material. If the temperature is below 1000K recipes will be generated in the Primitive Blast Furnace. If above 1750K recipes for the Hot Ingot will be created along with the Vacuum Freezer Recipe to cool the ingot. Example: `.blastTemp(2750)`
12+
13+
### `BlastProperty.gasTier()`
14+
Sets the Gas Tier which determins what GAS EBF recipes will be generated. Example: `.gasTier(LOW)`
15+
16+
### `BlastProperty.durationOverride()`
17+
Overrides the EBF's default behaviour for recipe durations.
18+
19+
### `BlastProperty.eutOverride()`
20+
Overrides the EBF's default behaviour for EU/t.
21+
22+
23+
## `DustProperty.dust()`
24+
Used for creating a dust material. The haverst level and burn time can be specified in the brackets. Example: `.dust(2, 4000)`
25+
26+
27+
## `FluidPipeProperty.fluidPipeProperties()`
28+
Creates a fluid pipe out of the material it is added to. The possible values are: Max Fluid Temperature, Throughput, Gas Proof, Acid Proof, Cyro Proof, Plasma Proof,
29+
Channels. Example: `.fluidPipeProperties(9620, 850, false, false, false, false, 1)`
30+
31+
32+
## Fluid Properties
33+
34+
### `FluidProperty.fluid()`
35+
!!! failure "Not yet documented"
36+
37+
### `FluidProperty.isGas()`
38+
!!! failure "Not yet documented"
39+
40+
### `FluidProperty.hasBlock()`
41+
!!! failure "Not yet documented"
42+
43+
44+
## `GemProperty.gem()`
45+
!!! failure "Not yet documented"
46+
47+
48+
## `IngotProperty.ingot()`
49+
!!! failure "Not yet documented"
50+
51+
- `.smeltInto()`
52+
- `.arcSmeltInto()`
53+
- `.magneticMaterial()`
54+
- `.macerateInto()`
55+
56+
57+
## `OreProperty.ore()`
58+
!!! failure "Not yet documented"
Lines changed: 62 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,78 @@
11
---
2-
title: TagPrefixes and the power of .setIgnored()
2+
title: TagPrefixes and .setIgnored()
33
---
4+
5+
6+
# TagPrefixes And The Power Of `.setIgnored()`
7+
48
## What is a TagPrefix?
5-
TagPrefixes are GTCEu Modern's way of streamlining applying item and block tags to Materials, along with some other functions. The `TagPrefix` class,
6-
available for use in startup and server scripts, contains a number of predefined TagPrefixes that
7-
associate potentially everything from drill heads to flawless gemstones with a material. A common and easy-to-understand example is `TagPrefix.ingot`,
8-
which associates with all Materials that have an IngotProperty and thus an associated ingot item, including custom ones defined via KubeJS.
9-
TagPrefixes provide localization, item and block tagging, and influence many crafting recipes, and are integral to the functioning of GTCEu's material definition system.
9+
10+
TagPrefixes are GTCEu Modern's way of streamlining applying item and block tags to Materials, along with some other
11+
functions. The `TagPrefix` class, available for use in startup and server scripts, contains a number of predefined
12+
TagPrefixes that associate potentially everything from drill heads to flawless gemstones with a material.
13+
14+
A common and easy-to-understand example is `TagPrefix.ingot`, which associates with all Materials that have an
15+
IngotProperty and thus an associated ingot item, including custom ones defined via KubeJS.
16+
TagPrefixes provide localization, item and block tagging, and influence many crafting recipes, and are integral to the
17+
functioning of GTCEu's material definition system.
1018

1119
!!! tip "What TagPrefixes are there?"
12-
A list of all availabe TagPrefixes can be found in GTCEu Modern's GitHub or in the .JAR file, in the class `TagPrefix`.
20+
A list of all available TagPrefixes can be found in GTCEu Modern's GitHub, in the class `TagPrefix`.
21+
1322

14-
## What is .setIgnored()?
23+
## What is `.setIgnored()`?
24+
25+
While trawling through GTCEu Modern's codebase, or simply by playing Minecraft, you may have noticed that GTCEu Modern
26+
treats some vanilla materials differently. For example, iron ingots are a vanilla item, yet GTCEu Modern does not create
27+
a duplicate iron ingot, as its Material definition would suggest it is meant to do.
28+
29+
Instead, the GTCEu Modern Material entry for iron treats the vanilla iron ingot as the material's ingot, and thus
30+
produces no duplicates.
31+
This functionality is governed by TagPrefixes, and can also be harnessed by packmakers for their own custom items, or
32+
when writing compatibility between GTCEu Modern and another mod.
1533

16-
While trawling thorugh GTCEu Modern's codebase, or simply by playing Minecraft, you may have noticed that GTCEu Modern treats some vanilla materials differently.
17-
For example, iron ingots are a vanilla item, yet GTCEu Modern does not create a duplicate iron ingot, as its Material definition would suggest it is meant to do.
18-
Instead, the GTCEu Modern Material entry for iron treats the vanilla iron ingot as the material's ingot, and thus produces no duplicates.
19-
This functionality is governed by TagPrefixes, and can also be harnessed by packmakers for their own custom items, or when writing compatibility between GTCEu Modern and another mod.
2034

2135
## Okay, but how do I use this?
2236

2337
This functionality can be leveraged in the material modification event, which is a startup event.
24-
The material modification event occurs in Minecraft's boot sequence after Material registration is finalized, but before the Material registry is closed; you won't be able to define any new Materials using it.
38+
The material modification event occurs in Minecraft's boot sequence after Material registration is finalized, but before
39+
the Material registry is closed; you won't be able to define any new Materials using it.
40+
2541
The following calls are available for each TagPrefix:
26-
- `.setIgnored()` with one input parameter: Takes a `Material` as input and prevents GTCEu from associating that specific TagPrefix with that Material.
27-
- `.setIgnored()` with two input parameters: Takes a `Material` and an `Item` or `Block` (or any class that that implements the `ItemLike` interface) as input; causes GTCEu to treat the passed `ItemLike` as whatever item the TagPrefix would have originally generated for the Material. An `ItemLike...` varargs in the form of a JS array may also be passed to perform the action on multiple blocks and/or items at once.
28-
- `.removeIgnored()`: takes a `Material` as input and re-enables generation of the item associated with the TagPrefix for that material.
2942

30-
!!! caution "Beware of `Item.of()`!" The classic way to retrieve an `Item` in KubeJS, namely the `Item.of()` wrapper, doesn't work here. You will need to directly pass an `ItemLike` from a Java class for `.setIgnored()` to work correctly.
43+
- `.setIgnored()` with one input parameter:
44+
Takes a `Material` as input and prevents GTCEu from associating that specific TagPrefix with that Material.
45+
- `.setIgnored()` with two input parameters:
46+
Takes a `Material` and an `Item` or `Block` (or any class that that implements the `ItemLike` interface) as input;
47+
causes GTCEu to treat the passed `ItemLike` as whatever item the TagPrefix would have originally generated for the
48+
Material. An `ItemLike...` varargs in the form of a JS array may also be passed to perform the action on multiple
49+
blocks and/or items at once.
50+
- `.removeIgnored()`:
51+
Takes a `Material` as input and re-enables generation of the item associated with the TagPrefix for that material.
52+
53+
!!! caution "Beware of `Item.of()`!"
54+
The classic way to retrieve an `Item` in KubeJS, namely the `Item.of()` wrapper, doesn't work here.
55+
You will need to directly pass an `ItemLike` from a Java class for `.setIgnored()` to work correctly.
3156

3257
A more illustrative example, using some Applied Energistics 2 items:
3358

34-
```js title="setignored_usage_example.js"
35-
GTCEuStartupEvents.materialModification(event => { // (1)
36-
TagPrefix.gemChipped.setIgnored(GTMaterialRegistry.getMaterial("fluix_crystal")) // (2)
37-
TagPrefix.rock.setIgnored(GTMaterialRegistry.getMaterial("sky_stone"), AEBlocks.SKY_STONE_BLOCK) // (3)
38-
TagPrefix.ingot.removeIgnored(GTMaterials.Iron) // (4)
39-
})
40-
```
41-
1. This event has no methods such as `event.create()`, as it is not intended to be used to create anything, only tweak pre-existing Material associations. In fact, this event has no accessible methods whatsoever.
42-
2. This call prevents GTCEu Modern from creating a chipped gem variant of the custom 'fluix_crystal' Material.
43-
3. This call makes GTCEu Modern associate AE2's Sky Stone block as a rock type (like vanilla stone is associated with the GTCEu Modern stone `Material`) with the custom 'sky_stone' Material. It may be necessary to manually load whatever data definition class contains the `ItemLike` you wish to associate with your `Material`, depending on how the mod's author has provided KubeJS access to the modn's classes.
44-
4. This call makes GTCEu Modern de-associate vanilla iron ingots from GTCEu Modern's iron Material entry, causing it to generate a duplicate iron ingot.
45-
46-
The `Material` for which you are adjusting the TagPrefix must be registered in GTCEu Modern's material registry; if this material is custom, this is done using `GTCEuStartupEvents.registry()`, as depicted in these docs.
59+
```js title="setignored_usage_example.js"
60+
GTCEuStartupEvents.materialModification(event => { // (1)
61+
TagPrefix.gemChipped.setIgnored(GTMaterialRegistry.getMaterial("fluix_crystal")) // (2)
62+
TagPrefix.rock.setIgnored(GTMaterialRegistry.getMaterial("sky_stone"), AEBlocks.SKY_STONE_BLOCK) // (3)
63+
TagPrefix.ingot.removeIgnored(GTMaterials.Iron) // (4)
64+
})
65+
```
66+
67+
1. This event has no methods such as `event.create()`, as it is not intended to be used to create anything, only tweak
68+
pre-existing Material associations. In fact, this event has no accessible methods whatsoever.
69+
2. This call prevents GTCEu Modern from creating a chipped gem variant of the custom `fluix_crystal` Material.
70+
3. This call makes GTCEu Modern associate AE2's Sky Stone block as a rock type (like vanilla stone is associated with
71+
the GTCEu Modern stone `Material`) with the custom `sky_stone` Material. It may be necessary to manually load
72+
whatever data definition class contains the `ItemLike` you wish to associate with your `Material`, depending on how
73+
the mod's author has provided KubeJS access to the mod's classes.
74+
4. This call makes GTCEu Modern de-associate vanilla iron ingots from GTCEu Modern's iron Material entry, causing it to
75+
generate a duplicate iron ingot.
76+
77+
The `Material` for which you are adjusting the TagPrefix must be registered in GTCEu Modern's material registry; if this
78+
material is custom, this is done using `GTCEuStartupEvents.registry()`, as depicted in these docs.

docs/content/Modpacks/Materials-and-Elements/The-ChemicalHelper-class.md

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,76 @@
11
---
2-
title: The ChemicalHelper class
2+
title: ChemicalHelper
33
---
44

5-
It may behoove a packmaker working with GTCEu Modern to learn about the ChemicalHelper class. This class, available for use in server scripts,
6-
contains a number of useful methods that can ease working with GTCEu Materials in contexts where it might not be possible, or it might be unsafe, to work with item or block tags.
5+
6+
# The `ChemicalHelper` Class
7+
8+
It may behoove a packmaker working with GTCEu Modern to learn about the ChemicalHelper class.
9+
10+
This class, available for use in server scripts, contains a number of useful methods that can ease working with GTCEu
11+
Materials in contexts where it might not be possible, or it might be unsafe, to work with item or block tags.
12+
713

814
## Useful functions that ChemicalHelper offers
15+
916
The following functions are available for use by packmakers:
10-
- `.getMaterial()`: can take almost any form of item reference (`Item`, `ItemStack`, `Ingredient` and so on) and will return the `Material` entry associated with it.
11-
If there is no associated Material, the method returns `null`. A `Fluid` may also be passed as input.
12-
- `.getPrefix()`: Takes an item reference as input and will return the TagPrefix it is associated with it. If there is non associated, the method will return `null`.
13-
- `.getIngot()`
14-
- `.getDust()`
15-
- These two methods take two parameters each as input: a `Material`, and a number representing a material amount, and will return an ItemStack representation of the respective Material's dust or ingot form, if it has one.
16-
The material amount is usually very large; it is generally an integer multiple or fraction of the predefined value `GTValues.M`, which is the commonly agreed-upon material amount of one (1) ingot or regular dust.
17-
Depending on the amount passed, the functions will return different items: `.getIngot()`, for example, will return
18-
an ItemStack representation of a block or nugget of the associated Material if the passed amount is large or small enough.
19-
`.getDust()`, in similar fashion, will return regular, small or tiny dust ItemStack representations depending on the material amount passed.
20-
- `.getTag()`
21-
- `.getBlockTag()`
22-
- `.getTags()`
23-
- `.getBlockTags()`
24-
- Takes a `TagPrefix` and a non-`null` `Material` as input and returns the first item or block tag
25-
(or a Java array of all item or block tags if the plural functions are used) possessed by the item represented by that `TagPrefix`-`Material` combination.
26-
- `.get()`: Takes a `TagPrefix`, a `Material` and optionally an item count that otherwise defaults to 1, and returns an ItemStack representing that `TagPrefix`-`Material` combination with the specified item count.
27-
28-
Some usage examples:
17+
18+
19+
### `.getMaterial()`
20+
21+
Can take almost any form of item reference (`Item`, `ItemStack`, `Ingredient` and so on) and will return the
22+
`Material` entry associated with it. If there is no associated Material, the method returns `null`.
23+
A `Fluid` may also be passed as input.
24+
25+
26+
### `.getPrefix()`
27+
28+
Takes an item reference as input and will return the TagPrefix it is associated with it. If there is
29+
non associated, the method will return `null`.
30+
31+
32+
### `.getIngot()` / `.getDust()`
33+
34+
These two methods take two parameters each as input: a `Material`, and a number representing a material amount,
35+
and will return an ItemStack representation of the respective Material's dust or ingot form, if it has one.
36+
37+
The material amount is usually very large; it is generally an integer multiple or fraction of the predefined value
38+
`GTValues.M`, which is the commonly agreed-upon material amount of one (1) ingot or regular dust.
39+
40+
Depending on the amount passed, the functions will return different items:
41+
42+
- `.getIngot()`, for example, will return an ItemStack representation of a block or nugget of the associated Material if
43+
the passed amount is large or small enough.
44+
- `.getDust()`, in similar fashion, will return regular, small or tiny dust ItemStack representations depending on the
45+
material amount passed.
46+
47+
48+
### `.getTag()` / `.getBlockTag()` / `.getTags()` / `.getBlockTags()`
49+
50+
Takes a `TagPrefix` and a non-`null` `Material` as input and returns the first item or block tag
51+
(or a Java array of all item or block tags if the plural functions are used) possessed by the item represented by
52+
that `TagPrefix`-`Material` combination.
53+
54+
55+
### `.get()`
56+
57+
Takes a `TagPrefix`, a `Material` and optionally an item count that otherwise defaults to 1, and returns an
58+
ItemStack representing that `TagPrefix`-`Material` combination with the specified item count.
59+
60+
61+
## Usage Examples
2962

3063
```js title="chemicalhelper_example_script.js"
3164
var ironMaterial = ChemicalHelper.getMaterial(Item.of("gtceu:double_iron_plate").asItem()) // (1)
3265
var rawOrePrefix = ChemicalHelper.getPrefix(Item.of("gtceu:raw_platinum").asItem()) // (2)
3366
var cobaltIngotStack = ChemicalHelper.get(TagPrefix.ingot, GTMaterials.Cobalt, 32) // (3)
3467

35-
var goldNugget = ChemicalHelper.getIngot(GTMaterials.Gold, GTValues.M / 9)// (4)
68+
var goldNugget = ChemicalHelper.getIngot(GTMaterials.Gold, GTValues.M / 9) // (4)
3669
var steelBlock = ChemicalHelper.getIngot(GTMaterials.Steel, GTValues.M * 9)
3770

38-
var ashSmallDust = ChemicalHelper.getDust(GTMaterials.Ash, GTValues.M / 4)// (5)
71+
var ashSmallDust = ChemicalHelper.getDust(GTMaterials.Ash, GTValues.M / 4) // (5)
3972
```
73+
4074
1. `ironMaterial` is now a reference to `GTMaterials.Iron`.
4175
2. `rawOrePrefix` is now a reference to `TagPrefix.rawOre`.
4276
3. `cobaltIngotStack` is now an ItemStack representing half a stack of cobalt ingots.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Bedrock Ore Veins
3+
---
4+
5+
6+
# Bedrock Ore Veins
7+
8+
While not enabled by default, GTCEu Modern contains bedrock ore veins and bedrock ore miners.
9+
10+
To enable this feature, you need to enable the config option **Machines -> doBedrockOres** and restart your game.
11+
12+
!!! warning "No recipes by default"
13+
The various tiers of bedrock ore miners don't have any recipes by default. It is up to modpack developers to create
14+
crafting recipes for these machines.
15+
16+
17+
## Adding Bedrock Veins
18+
19+
By default, the mod doesn't include any bedrock ore veins.
20+
21+
You can add them using the `bedrockOreVeins` server event:
22+
23+
```js
24+
GTCEuServerEvents.bedrockOreVeins(event => {
25+
event.add('kubejs:overworld_bedrock_ore_vein_iron', vein => {
26+
vein.weight(100)
27+
.size(3) // (1)
28+
.yield(10, 20)
29+
.material(GTMaterials.Goethite, 5) // (2)
30+
.material(GTMaterials.YellowLimonite, 2)
31+
.material(GTMaterials.Hematite, 2)
32+
.material(GTMaterials.Malachite, 1)
33+
.dimensions('minecraft:overworld')
34+
})
35+
})
36+
```
37+
38+
1. The diameter of the bedrock vein in chunks
39+
2. The second parameter defines the chance of each material being mined on each cycle

0 commit comments

Comments
 (0)