@@ -75,7 +75,6 @@ public void fieldDef(VariableElement variableElement, TypeElement typeElement) {
75
75
BasicItem typeBasicItem = typeElement .getAnnotation (BasicItem .class );
76
76
BasicItem basicItem = register (variableElement .getAnnotation (BasicItem .class ));
77
77
BasicBlockItem basicBlockItem = register (variableElement .getAnnotation (BasicBlockItem .class ));
78
- BasicBlockItemWithSuffix basicBlockItemWithSuffix = register (variableElement .getAnnotation (BasicBlockItemWithSuffix .class ));
79
78
CubeAll cube = register (variableElement .getAnnotation (CubeAll .class ));
80
79
CubeColumn cubeColumn = register (variableElement .getAnnotation (CubeColumn .class ));
81
80
Stairs stairs = register (variableElement .getAnnotation (Stairs .class ));
@@ -91,41 +90,67 @@ public void fieldDef(VariableElement variableElement, TypeElement typeElement) {
91
90
AllWood allWood = register (variableElement .getAnnotation (AllWood .class ));
92
91
AllSign allSign = register (variableElement .getAnnotation (AllSign .class ));
93
92
AllDoor allDoor = register (variableElement .getAnnotation (AllDoor .class ));
94
- if (typeBasicItem != null &&
95
- typeBasicItem .used () &&
96
- variableElement .getModifiers ().contains (Modifier .STATIC ) &&
97
- isAnnotation ()) {
98
- basicSet (typeElement .getQualifiedName () + "." + variableElement .getSimpleName (), typeBasicItem , typeBasicItem .value (), true , "" );
93
+ //item model gen
94
+ if (spawnEggItem != null ) {
95
+ checkAppend (typeElement , variableElement , "spawnEggItem" );
99
96
}
100
- if (basicItem != null && basicItem .used ()) {
101
- basicSet (typeElement .getQualifiedName () + "." + variableElement .getSimpleName (), basicItem , basicItem .value (), true , "" );
97
+ else if (parentItem != null ) {
98
+ check ();
99
+ MODEL .append ("\n \t \t " )
100
+ .append (".parentItem(" )
101
+ .append (typeElement .getQualifiedName ())
102
+ .append ("." )
103
+ .append (variableElement .getSimpleName ())
104
+ .append (", \" " )
105
+ .append (parentItem .parent ())
106
+ .append ("\" " );
107
+ if (parentItem .textures ().length > 0 ) {
108
+ MODEL .append ("," )
109
+ .append (Arrays
110
+ .stream (parentItem .textures ())
111
+ .map (kv -> "\" " + kv .key () + "\" " + ", \" " + kv .value () + "\" " )
112
+ .collect (Collectors .joining ("," )));
113
+ }
114
+ MODEL .append (")" );
115
+ }
116
+ else if (basicBlockItem != null ) {
117
+ if (basicBlockItem .suffix ().isEmpty ()) {
118
+ checkAppend (typeElement , variableElement ,"basicBlockItem" );
119
+ } else {
120
+ checkAppend (typeElement , variableElement , "basicBlockItemWithSuffix" , basicBlockItem .suffix ());
121
+ }
102
122
}
103
- if (basicBlockItem != null ) {
104
- checkAppend (typeElement , variableElement , "basicBlockItem " );
123
+ else if (basicItem != null && basicItem . used () ) {
124
+ basicSet (typeElement . getQualifiedName () + "." + variableElement . getSimpleName (), basicItem , basicItem . value (), true , " " );
105
125
}
106
- if (basicBlockItemWithSuffix != null ) {
107
- checkAppend (typeElement , variableElement , "basicBlockItemWithSuffix" , basicBlockItemWithSuffix .suffix ());
126
+ else if (typeBasicItem != null &&
127
+ typeBasicItem .used () &&
128
+ variableElement .getModifiers ().contains (Modifier .STATIC )) {
129
+ basicSet (typeElement .getQualifiedName () + "." + variableElement .getSimpleName (), typeBasicItem , typeBasicItem .value (), true , "" );
108
130
}
131
+ //block model gen
109
132
if (cube != null ) {
110
- checkAppend (typeElement , variableElement ,"cubeAll" , cube .item ());
133
+ checkAppend (typeElement , variableElement ,"cubeAll" , cube .texture (), cube . render_type (), cube . item ());
111
134
}
112
- if (cubeColumn != null ) {
113
- checkAppend (typeElement , variableElement , "cubeColumn" , cubeColumn .end (), cubeColumn .side (), cubeColumn .item (), cubeColumn .horizontal (), cubeColumn .horizontal ());
135
+ else if (cubeColumn != null ) {
136
+ checkAppend (typeElement , variableElement , "cubeColumn" , cubeColumn .end (), cubeColumn .side (), cubeColumn .item (), cubeColumn .horizontal (), cubeColumn .suffix ());
114
137
}
115
- if (allWood != null ) {
116
- checkAppend (typeElement , variableElement , "allWoodBlock" );
138
+ else if (log != null ) {
139
+ checkAppend (typeElement , variableElement , "logBlock" , log . item () );
117
140
}
118
- if (allDoor != null ) {
119
- checkAppend (typeElement , variableElement , "allDoorBlock" );
141
+ else if (wood != null ) {
142
+ checkAppend (typeElement , variableElement , "woodBlock" , wood . item () );
120
143
}
121
- if (allSign != null ) {
122
- checkAppend (typeElement , variableElement , "allSignBlock" );
144
+ else if (button != null ) {
145
+ checkAppend (typeElement , variableElement , "buttonBlock" , button . texture () );
123
146
}
124
- if ( pressurePlate != null ) {
125
- checkAppend (typeElement , variableElement , "pressurePlateBlock " , pressurePlate .texture (), pressurePlate .item ());
147
+ else if ( fence != null ) {
148
+ checkAppend (typeElement , variableElement , "fenceBlock " , fence .texture (), fence .item ());
126
149
}
127
-
128
- if (stairs != null ) {
150
+ else if (fenceGate != null ) {
151
+ checkAppend (typeElement , variableElement , "fenceGateBlock" , fenceGate .texture (), fenceGate .item ());
152
+ }
153
+ else if (stairs != null ) {
129
154
String all = stairs .all ();
130
155
checkAppend (typeElement , variableElement , "stairsBlock" ,
131
156
all .isEmpty () ? stairs .bottom () : all ,
@@ -134,7 +159,7 @@ public void fieldDef(VariableElement variableElement, TypeElement typeElement) {
134
159
stairs .item ()
135
160
);
136
161
}
137
- if (slab != null ) {
162
+ else if (slab != null ) {
138
163
String all = slab .all ();
139
164
checkAppend (typeElement , variableElement , "slabBlock" ,
140
165
all .isEmpty () ? slab .bottom () : all ,
@@ -143,43 +168,24 @@ public void fieldDef(VariableElement variableElement, TypeElement typeElement) {
143
168
slab .item ()
144
169
);
145
170
}
146
- if (log != null ) {
147
- checkAppend (typeElement , variableElement , "logBlock" , log .item ());
148
- }
149
- if (wood != null ) {
150
- checkAppend (typeElement , variableElement , "woodBlock" , wood .item ());
151
- }
152
- if (button != null ) {
153
- checkAppend (typeElement , variableElement , "buttonBlock" , button .texture ());
154
- }
155
- if (fence != null ) {
156
- checkAppend (typeElement , variableElement , "fenceBlock" , fence .texture (), fence .item ());
171
+ else if (pressurePlate != null ) {
172
+ checkAppend (typeElement , variableElement , "pressurePlateBlock" , pressurePlate .texture (), pressurePlate .item ());
157
173
}
158
- if (fenceGate != null ) {
159
- checkAppend (typeElement , variableElement , "fenceGateBlock" , fenceGate . texture (), fenceGate . item () );
174
+ else if (allSign != null ) {
175
+ checkAppend (typeElement , variableElement , "allSignBlock" );
160
176
}
161
- if (spawnEggItem != null ) {
162
- checkAppend (typeElement , variableElement , "spawnEggItem " );
177
+ else if (allDoor != null ) {
178
+ checkAppend (typeElement , variableElement , "allDoorBlock " );
163
179
}
164
- if (parentItem != null ) {
165
- check ();
166
- MODEL .append ("\n \t \t " )
167
- .append (".parentItem(" )
168
- .append (typeElement .getQualifiedName ())
169
- .append ("." )
170
- .append (variableElement .getSimpleName ())
171
- .append (", \" " )
172
- .append (parentItem .parent ())
173
- .append ("\" " );
174
- if (parentItem .textures ().length > 0 ) {
175
- MODEL .append ("," )
176
- .append (Arrays
177
- .stream (parentItem .textures ())
178
- .map (kv -> "\" " + kv .key () + "\" " + ", \" " + kv .value () + "\" " )
179
- .collect (Collectors .joining ("," )));
180
- }
181
- MODEL .append (")" );
180
+ else if (allWood != null ) {
181
+ checkAppend (typeElement , variableElement , "allWoodBlock" );
182
182
}
183
+
184
+
185
+
186
+
187
+
188
+
183
189
}
184
190
185
191
private static void basicSet (String name , BasicItem basicItem , Addition addition , boolean first , String prefix ) {
0 commit comments