2
2
3
3
import net .minecraft .client .multiplayer .ClientLevel ;
4
4
import net .minecraft .client .renderer .block .model .BakedQuad ;
5
- import net .minecraft .client .renderer .block .model .BlockModel ;
6
5
import net .minecraft .client .renderer .block .model .ItemOverrides ;
7
6
import net .minecraft .client .renderer .block .model .ItemTransforms ;
8
7
import net .minecraft .client .renderer .texture .TextureAtlasSprite ;
16
15
17
16
import vazkii .patchouli .common .book .Book ;
18
17
import vazkii .patchouli .common .item .ItemModBook ;
19
- import vazkii .patchouli .mixin .client .AccessorModelBakery ;
20
18
21
19
import org .jetbrains .annotations .NotNull ;
22
20
import org .jetbrains .annotations .Nullable ;
@@ -29,42 +27,10 @@ public class BookModel implements BakedModel {
29
27
private final BakedModel original ;
30
28
private final ItemOverrides itemHandler ;
31
29
32
- public BookModel (BakedModel original , ModelBakery loader , Function <ResourceLocation , BakedModel > modelGetter ) {
30
+ public BookModel (BakedModel original , Function <ResourceLocation , BakedModel > modelGetter ) {
33
31
this .original = original ;
34
- BlockModel missing = (BlockModel ) ((AccessorModelBakery ) loader ).invokeGetModel (ModelBakery .MISSING_MODEL_LOCATION );
35
-
36
- this .itemHandler = new ItemOverrides (new ModelBaker () {
37
- // soft implement IModelBakerExtension
38
- public Function <Material , TextureAtlasSprite > getModelTextureGetter () {
39
- return null ;
40
- }
41
-
42
- // soft implement IModelBakerExtension
43
- public BakedModel bake (ResourceLocation location , ModelState state , Function <Material , TextureAtlasSprite > sprites ) {
44
- return null ;
45
- }
46
-
47
- // soft implement IModelBakerExtension
48
- public BakedModel bakeUncached (UnbakedModel model , ModelState state , Function <Material , TextureAtlasSprite > sprites ) {
49
- return null ;
50
- }
51
-
52
- // soft implement IModelBakerExtension
53
- public UnbakedModel getTopLevelModel (ModelResourceLocation location ) {
54
- return null ;
55
- }
56
32
57
- @ Override
58
- public UnbakedModel getModel (ResourceLocation resourceLocation ) {
59
- return null ;
60
- }
61
-
62
- @ Nullable
63
- @ Override
64
- public BakedModel bake (ResourceLocation resourceLocation , ModelState modelState ) {
65
- return null ;
66
- }
67
- }, missing , Collections .emptyList ()) {
33
+ this .itemHandler = new ItemOverrides (DummyModelBaker .INSTANCE , null , Collections .emptyList ()) {
68
34
@ Override
69
35
public BakedModel resolve (@ NotNull BakedModel original , @ NotNull ItemStack stack ,
70
36
@ Nullable ClientLevel world , @ Nullable LivingEntity entity , int seed ) {
@@ -119,4 +85,38 @@ public TextureAtlasSprite getParticleIcon() {
119
85
public ItemTransforms getTransforms () {
120
86
return original .getTransforms ();
121
87
}
88
+
89
+ private static class DummyModelBaker implements ModelBaker {
90
+ static ModelBaker INSTANCE = new DummyModelBaker ();
91
+ // soft implement IModelBakerExtension
92
+ public Function <Material , TextureAtlasSprite > getModelTextureGetter () {
93
+ return null ;
94
+ }
95
+
96
+ // soft implement IModelBakerExtension
97
+ public BakedModel bake (ResourceLocation location , ModelState state , Function <Material , TextureAtlasSprite > sprites ) {
98
+ return null ;
99
+ }
100
+
101
+ // soft implement IModelBakerExtension
102
+ public BakedModel bakeUncached (UnbakedModel model , ModelState state , Function <Material , TextureAtlasSprite > sprites ) {
103
+ return null ;
104
+ }
105
+
106
+ // soft implement IModelBakerExtension
107
+ public UnbakedModel getTopLevelModel (ModelResourceLocation location ) {
108
+ return null ;
109
+ }
110
+
111
+ @ Override
112
+ public UnbakedModel getModel (ResourceLocation resourceLocation ) {
113
+ return null ;
114
+ }
115
+
116
+ @ Nullable
117
+ @ Override
118
+ public BakedModel bake (ResourceLocation resourceLocation , ModelState modelState ) {
119
+ return null ;
120
+ }
121
+ }
122
122
}
0 commit comments