File tree 3 files changed +28
-19
lines changed
fabric-model-loading-api-v1/src
client/java/net/fabricmc/fabric/mixin/client/model/loading
testmodClient/resources/assets/fabric-model-loading-api-v1-testmod/models
3 files changed +28
-19
lines changed Original file line number Diff line number Diff line change 26
26
import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
27
27
28
28
import net .minecraft .client .render .model .ReferencedModelsCollector ;
29
+ import net .minecraft .client .render .model .ResolvableModel ;
29
30
import net .minecraft .client .render .model .UnbakedModel ;
30
31
import net .minecraft .util .Identifier ;
31
32
@@ -37,6 +38,9 @@ abstract class ReferencedModelsCollectorMixin {
37
38
@ Nullable
38
39
private ModelLoadingEventDispatcher fabric_eventDispatcher ;
39
40
41
+ @ Shadow
42
+ public abstract void add (ResolvableModel model );
43
+
40
44
@ Shadow
41
45
abstract UnbakedModel computeResolvedModel (Identifier id );
42
46
@@ -45,7 +49,7 @@ private void onReturnInit(CallbackInfo ci) {
45
49
fabric_eventDispatcher = ModelLoadingEventDispatcher .CURRENT .get ();
46
50
47
51
if (fabric_eventDispatcher != null ) {
48
- fabric_eventDispatcher .forEachExtraModel (this :: computeResolvedModel );
52
+ fabric_eventDispatcher .forEachExtraModel (id -> add ( computeResolvedModel ( id )) );
49
53
}
50
54
}
51
55
Original file line number Diff line number Diff line change 1
1
{
2
+ "parent" : " fabric-model-loading-api-v1-testmod:template_half" ,
2
3
"textures" : {
3
- "sand" : " minecraft:block/sand" ,
4
- "red_sand" : " minecraft:block/red_sand" ,
5
- "particle" : " #sand"
6
- },
7
- "elements" : [
8
- {
9
- "from" : [ 0 , 0 , 0 ],
10
- "to" : [ 16 , 16 , 16 ],
11
- "faces" : {
12
- "down" : { "texture" : " #sand" },
13
- "up" : { "texture" : " #red_sand" },
14
- "north" : { "texture" : " #sand" },
15
- "south" : { "texture" : " #red_sand" },
16
- "west" : { "texture" : " #sand" },
17
- "east" : { "texture" : " #red_sand" }
18
- }
19
- }
20
- ]
4
+ "half1" : " minecraft:block/sand" ,
5
+ "half2" : " minecraft:block/red_sand"
6
+ }
21
7
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "textures" : {
3
+ "particle" : " #half1"
4
+ },
5
+ "elements" : [
6
+ {
7
+ "from" : [ 0 , 0 , 0 ],
8
+ "to" : [ 16 , 16 , 16 ],
9
+ "faces" : {
10
+ "down" : { "texture" : " #half1" },
11
+ "up" : { "texture" : " #half2" },
12
+ "north" : { "texture" : " #half1" },
13
+ "south" : { "texture" : " #half2" },
14
+ "west" : { "texture" : " #half1" },
15
+ "east" : { "texture" : " #half2" }
16
+ }
17
+ }
18
+ ]
19
+ }
You can’t perform that action at this time.
0 commit comments