Skip to content

Commit 6124b98

Browse files
committed
tweak docs
1 parent f9eb85c commit 6124b98

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

docs/content/Modpacks/Changes/v7.5.0.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,32 @@ Addons with custom pipe implementations will have to tweak their code slightly t
1919
@Override
2020
-public PipeModel getPipeModel() {
2121
- return model;
22-
+public PipeModel createPipeModel() {
23-
+ return PipeModel.create(this, pipeType.getThickness(), [side texture], [end texture], null, null);
22+
+public PipeModel createPipeModel(GTBlockstateProvider provider) {
23+
+ return new PipeModel(this, pipeType.getThickness(), [side texture], [end texture], provider);
2424
}
2525
```
26-
27-
You must also add a **Forge bus** event listener for `RegisterDynamicResourcesEvent`, like so:
26+
If your pipe is generated from a material property (or equivalent), you should also call `PipeModel#dynamicModel()`
27+
to have models be generated at runtime.
28+
If so, must also add a **Mod bus** event listener for `RegisterDynamicResourcesEvent`, like so:
2829
```java
2930
@SubscribeEvent
3031
public static void registerDynamicResources(RegisterDynamicResourcesEvent event) {
31-
for (var block : MyBlocks.MY_PIPE_BLOCKS) block.get().createPipeModel();
32+
for (var block : MyBlocks.MY_PIPE_BLOCKS) block.get().createPipeModel(RuntimeExistingFileHelper.INSTANCE).dynamicModel();
3233
}
3334
```
3435
Replace `MyBlocks.MY_PIPE_BLOCKS` with a reference to your pipe block array/map value collection.
36+
37+
38+
Conversely, if the pipe is **not** generated, but has a constant set of variants (such as optical fiber cables or laser pipes),
39+
you should **NOT** use `PipeModel#dynamicModel()` and instead set the model with `GTBlockBuilder#gtBlockstate` as such:
40+
```java
41+
// on your pipe block builder
42+
... = REGISTRATE.block(...)
43+
.properties(...)
44+
.gtBlockstate(GTModels::createPipeBlockModel)
45+
...more builder things...
46+
.item(...)
47+
.model(NonNullBiConsumer.noop())
48+
...more builder things...
49+
```
50+
This makes the pipe model(s) be generated for you without having to process them at runtime.

src/main/java/com/gregtechceu/gtceu/client/model/pipe/PipeModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
* }
7474
* </pre>
7575
*
76-
* This makes the pipe model(s) be made for you without having to autogenerate them.
76+
* This makes the pipe model(s) be generated for you without having to process them at runtime.
7777
*
7878
*/
7979
public class PipeModel {

0 commit comments

Comments
 (0)