15
15
import com .github .alexthe666 .iceandfire .entity .props .SirenProperties ;
16
16
import com .github .alexthe666 .iceandfire .entity .util .ICustomMoveController ;
17
17
import com .github .alexthe666 .iceandfire .enums .EnumParticles ;
18
+ import com .github .alexthe666 .iceandfire .item .IafArmorMaterial ;
18
19
import com .github .alexthe666 .iceandfire .message .MessageDragonControl ;
19
20
import com .github .alexthe666 .iceandfire .pathfinding .raycoms .WorldEventContext ;
20
21
import net .minecraft .client .CameraType ;
21
22
import net .minecraft .client .Minecraft ;
22
23
import net .minecraft .client .gui .screens .TitleScreen ;
24
+ import net .minecraft .client .model .HumanoidModel ;
25
+ import net .minecraft .client .model .PlayerModel ;
23
26
import net .minecraft .client .renderer .GameRenderer ;
24
27
import net .minecraft .resources .ResourceLocation ;
25
28
import net .minecraft .world .entity .Entity ;
29
+ import net .minecraft .world .entity .EquipmentSlot ;
26
30
import net .minecraft .world .entity .LivingEntity ;
27
31
import net .minecraft .world .entity .player .Player ;
32
+ import net .minecraft .world .item .ArmorItem ;
33
+ import net .minecraft .world .item .ItemStack ;
28
34
import net .minecraftforge .api .distmarker .Dist ;
29
35
import net .minecraftforge .api .distmarker .OnlyIn ;
30
36
import net .minecraftforge .client .event .RenderLevelStageEvent ;
38
44
import net .minecraftforge .fml .common .Mod ;
39
45
import org .jetbrains .annotations .NotNull ;
40
46
47
+ import java .util .List ;
41
48
import java .util .Random ;
42
49
43
50
@ OnlyIn (Dist .CLIENT )
@@ -69,7 +76,7 @@ public void onCameraSetup(ViewportEvent.ComputeCameraAngles event) {
69
76
int currentView = IceAndFire .PROXY .getDragon3rdPersonView ();
70
77
float scale = ((EntityDragonBase ) player .getVehicle ()).getRenderSize () / 3 ;
71
78
if (Minecraft .getInstance ().options .getCameraType () == CameraType .THIRD_PERSON_BACK ||
72
- Minecraft .getInstance ().options .getCameraType () == CameraType .THIRD_PERSON_FRONT ) {
79
+ Minecraft .getInstance ().options .getCameraType () == CameraType .THIRD_PERSON_FRONT ) {
73
80
if (currentView == 1 ) {
74
81
event .getCamera ().move (-event .getCamera ().getMaxZoom (scale * 1.2F ), 0F , 0 );
75
82
} else if (currentView == 2 ) {
@@ -163,6 +170,39 @@ public void onPreRenderLiving(RenderLivingEvent.Pre event) {
163
170
if (shouldCancelRender (event .getEntity ())) {
164
171
event .setCanceled (true );
165
172
}
173
+ for (EquipmentSlot slot : List .of (EquipmentSlot .HEAD , EquipmentSlot .CHEST , EquipmentSlot .LEGS , EquipmentSlot .FEET )) {
174
+ ItemStack stack = event .getEntity ().getItemBySlot (slot );
175
+ if (stack .getItem () instanceof ArmorItem armorStack && armorStack .getMaterial () instanceof IafArmorMaterial ) {
176
+ switch (slot ) {
177
+ case HEAD -> {
178
+ if (event .getRenderer ().getModel () instanceof HumanoidModel <?> humanoidModel ) {
179
+ humanoidModel .hat .visible = false ;
180
+ }
181
+ }
182
+ case CHEST -> {
183
+ if (event .getRenderer ().getModel () instanceof PlayerModel <?> playerModel ) {
184
+ playerModel .jacket .visible = false ;
185
+ playerModel .leftSleeve .visible = false ;
186
+ playerModel .rightSleeve .visible = false ;
187
+ }
188
+ }
189
+ case LEGS -> {
190
+ if (event .getRenderer ().getModel () instanceof PlayerModel <?> playerModel ) {
191
+ playerModel .leftPants .visible = false ;
192
+ playerModel .rightPants .visible = false ;
193
+ }
194
+ }
195
+ case FEET -> {
196
+ if (event .getRenderer ().getModel () instanceof PlayerModel <?> playerModel ) {
197
+ playerModel .leftLeg .visible = false ;
198
+ playerModel .rightLeg .visible = false ;
199
+ }
200
+ }
201
+ }
202
+
203
+ }
204
+ }
205
+
166
206
}
167
207
168
208
@ SubscribeEvent
@@ -189,6 +229,7 @@ public void onGuiOpened(ScreenEvent.Opening event) {
189
229
190
230
// TODO: add this to client side config
191
231
public final boolean AUTO_ADAPT_3RD_PERSON = true ;
232
+
192
233
@ SubscribeEvent
193
234
public void onEntityMount (EntityMountEvent event ) {
194
235
0 commit comments