New Shield

This commit is contained in:
kirillsaint 2023-10-14 16:06:03 +06:00
parent cc64739dae
commit 6d9f8ec011
3 changed files with 242 additions and 5 deletions

View File

@ -406,25 +406,28 @@ public class AdminRender extends GuiScreen {
((AbstractClientPlayerExt) mc.thePlayer).silent$setWings(null); ((AbstractClientPlayerExt) mc.thePlayer).silent$setWings(null);
this.frames = 0; this.frames = 0;
this.currentFrame = 0; this.currentFrame = 0;
File [] pngFiles = adminRenderPath.listFiles(file -> file.isFile() && file.getName().toLowerCase().endsWith(".png"));
switch(type) { switch(type) {
case "cape": case "cape":
((AbstractClientPlayerExt) mc.thePlayer).silent$setCape(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length - 1, 150)); ((AbstractClientPlayerExt) mc.thePlayer).silent$setCape(new TestAnimatedResourceLocation(pngFiles.length - 1, 150));
((AbstractClientPlayerExt) mc.thePlayer).silent$setCapeShoulders(new StaticResourceLocation(FileUtils.fileToResourceLocation(new File(adminRenderPath, "0.png")).getResourcePath())); ((AbstractClientPlayerExt) mc.thePlayer).silent$setCapeShoulders(new StaticResourceLocation(FileUtils.fileToResourceLocation(new File(adminRenderPath, "0.png")).getResourcePath()));
this.frames = ((AbstractClientPlayerExt) mc.thePlayer).silent$getCape().getFrames(); this.frames = ((AbstractClientPlayerExt) mc.thePlayer).silent$getCape().getFrames();
this.currentFrame = 0; this.currentFrame = 0;
break; break;
case "wings": case "wings":
((AbstractClientPlayerExt) mc.thePlayer).silent$setWings(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length, 150)); ((AbstractClientPlayerExt) mc.thePlayer).silent$setWings(new TestAnimatedResourceLocation(pngFiles.length, 150));
this.frames = 1; this.frames = 1;
this.currentFrame = 0; this.currentFrame = 0;
break; break;
case "bandana": case "bandana":
((AbstractClientPlayerExt) mc.thePlayer).silent$setBandana(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length, 150)); ((AbstractClientPlayerExt) mc.thePlayer).silent$setBandana(new TestAnimatedResourceLocation(pngFiles.length, 150));
this.frames = ((AbstractClientPlayerExt) mc.thePlayer).silent$getBandana().getFrames(); this.frames = ((AbstractClientPlayerExt) mc.thePlayer).silent$getBandana().getFrames();
this.currentFrame = 0; this.currentFrame = 0;
break; break;
case "shield": case "shield":
((AbstractClientPlayerExt) mc.thePlayer).silent$setShield(new ShieldData(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length, 150), model)); ((AbstractClientPlayerExt) mc.thePlayer).silent$setShield(new ShieldData(new TestAnimatedResourceLocation(pngFiles.length, 150), model));
this.frames = ((AbstractClientPlayerExt) mc.thePlayer).silent$getShield().getTexture().getFrames(); this.frames = ((AbstractClientPlayerExt) mc.thePlayer).silent$getShield().getTexture().getFrames();
this.currentFrame = 0; this.currentFrame = 0;
break; break;
@ -438,6 +441,7 @@ public class AdminRender extends GuiScreen {
textures = new ResourceLocation[frames]; textures = new ResourceLocation[frames];
for(int i = 0; i < frames; i++) { for(int i = 0; i < frames; i++) {
Client.logger.info(new File(adminRenderPath, i + ".png").toString());
textures[i] = FileUtils.fileToResourceLocation(new File(adminRenderPath, i + ".png")); textures[i] = FileUtils.fileToResourceLocation(new File(adminRenderPath, i + ".png"));
} }
} }

View File

@ -62,7 +62,7 @@ public class AbstractShieldRenderer extends ModelBase implements LayerRenderer<A
} }
public double getShieldScale(String model) { public double getShieldScale(String model) {
if(model.equals("roundshield") || model.equals("hexagon_shield") || model.equals("shield_dollar") || model.equals("zzv4shield2")) { if(model.equals("roundshield") || model.equals("hexagon_shield") || model.equals("shield_dollar") || model.equals("zzv4shield2") || model.equals("shield_v4")) {
return 0.100; return 0.100;
} }
return 0.007; return 0.007;
@ -82,6 +82,7 @@ public class AbstractShieldRenderer extends ModelBase implements LayerRenderer<A
break; break;
case "roundshield": case "roundshield":
case "zzv4shield2": case "zzv4shield2":
case "shield_v4":
GlStateManager.translate(0.33, 0.35, 0); GlStateManager.translate(0.33, 0.35, 0);
BlcGlStateManager.b(-90.0F, 0.0F, 1.0F, 0.0F); BlcGlStateManager.b(-90.0F, 0.0F, 1.0F, 0.0F);
BlcGlStateManager.b(paramBoolean1 ? -0.10000000149011612D : 0.0D, paramBoolean1 ? 0.45D : 0.25D, paramBoolean2 ? -0.1399999964237213D : -0.2D); BlcGlStateManager.b(paramBoolean1 ? -0.10000000149011612D : 0.0D, paramBoolean1 ? 0.45D : 0.25D, paramBoolean2 ? -0.1399999964237213D : -0.2D);

View File

@ -0,0 +1,232 @@
# Blender v3.3.1 OBJ File: ''
# www.blender.org
mtllib shield(post).mtl
o cube
v -2.499985 -4.420000 -0.008727
v 2.499985 -4.420000 0.008727
v 2.499985 4.330000 0.008726
v -2.499985 4.330000 -0.008729
v -2.498894 -4.420000 -0.321225
v -2.498894 4.330000 -0.321227
v 2.501076 -4.420000 -0.303771
v 2.501076 4.330000 -0.303772
v -2.501076 4.330000 0.303770
v 2.498894 4.330000 0.321224
v 2.498894 4.955000 0.321224
v -2.501076 4.955000 0.303769
v -2.498894 4.330000 -0.321227
v -2.498894 4.955000 -0.321227
v 2.501076 4.330000 -0.303772
v 2.501076 4.955000 -0.303773
v -2.501076 -5.045000 0.303771
v 2.498894 -5.045000 0.321225
v 2.498894 -4.420000 0.321225
v -2.501076 -4.420000 0.303771
v -2.498894 -5.045000 -0.321225
v -2.498894 -4.420000 -0.321225
v 2.501076 -5.045000 -0.303771
v 2.501076 -4.420000 -0.303771
v -3.126072 -5.045000 0.301589
v -2.501076 -5.045000 0.303771
v -2.501076 4.955000 0.303769
v -3.126072 4.955000 0.301588
v -3.123890 -5.045000 -0.323407
v -3.123890 4.955000 -0.323408
v -2.498894 -5.045000 -0.321225
v -2.498894 4.955000 -0.321227
v 2.498894 -5.045000 0.321225
v 3.123890 -5.045000 0.323407
v 3.123890 4.955000 0.323405
v 2.498894 4.955000 0.321224
v 2.501076 -5.045000 -0.303771
v 2.501076 4.955000 -0.303773
v 3.126072 -5.045000 -0.301589
v 3.126072 4.955000 -0.301591
vt 0.250000 0.437500
vt 0.000000 0.000000
vt 0.000000 0.437500
vt 0.515625 0.625000
vt 0.500000 0.187500
vt 0.500000 0.625000
vt 0.500000 0.437500
vt 0.250000 0.000000
vt 0.250000 0.437500
vt 0.265625 0.937500
vt 0.250000 0.500000
vt 0.250000 0.937500
vt 0.515625 0.187500
vt 0.765625 0.203125
vt 0.765625 0.187500
vt 0.515625 0.218750
vt 0.765625 0.203125
vt 0.765625 0.218750
vt 0.500000 0.468750
vt 0.250000 0.437500
vt 0.250000 0.468750
vt 0.421875 0.531250
vt 0.390625 0.500000
vt 0.390625 0.531250
vt 0.500000 0.500000
vt 0.250000 0.468750
vt 0.250000 0.500000
vt 0.453125 0.531250
vt 0.421875 0.500000
vt 0.421875 0.531250
vt 0.500000 0.000000
vt 0.750000 0.031250
vt 0.750000 0.000000
vt 0.500000 0.062500
vt 0.750000 0.031250
vt 0.750000 0.062500
vt 0.750000 0.093750
vt 0.500000 0.062500
vt 0.500000 0.093750
vt 0.484375 0.531250
vt 0.453125 0.500000
vt 0.453125 0.531250
vt 0.750000 0.125000
vt 0.500000 0.093750
vt 0.500000 0.125000
vt 0.546875 0.250000
vt 0.515625 0.218750
vt 0.515625 0.250000
vt 0.500000 0.125000
vt 0.750000 0.156250
vt 0.750000 0.125000
vt 0.500000 0.187500
vt 0.750000 0.156250
vt 0.750000 0.187500
vt 0.031250 0.937500
vt 0.000000 0.437500
vt 0.000000 0.937500
vt 0.062500 0.937500
vt 0.031250 0.437500
vt 0.031250 0.937500
vt 0.093750 0.937500
vt 0.062500 0.437500
vt 0.062500 0.937500
vt 0.125000 0.937500
vt 0.093750 0.437500
vt 0.093750 0.937500
vt 0.265625 0.500000
vt 0.296875 0.531250
vt 0.296875 0.500000
vt 0.296875 0.531250
vt 0.328125 0.500000
vt 0.328125 0.531250
vt 0.156250 0.937500
vt 0.125000 0.437500
vt 0.125000 0.937500
vt 0.187500 0.937500
vt 0.156250 0.437500
vt 0.156250 0.937500
vt 0.218750 0.937500
vt 0.187500 0.437500
vt 0.187500 0.937500
vt 0.250000 0.937500
vt 0.218750 0.437500
vt 0.218750 0.937500
vt 0.328125 0.500000
vt 0.359375 0.531250
vt 0.359375 0.500000
vt 0.359375 0.531250
vt 0.390625 0.500000
vt 0.390625 0.531250
vt 0.250000 0.000000
vt 0.515625 0.187500
vt 0.500000 0.000000
vt 0.265625 0.500000
vt 0.515625 0.203125
vt 0.515625 0.203125
vt 0.500000 0.437500
vt 0.421875 0.500000
vt 0.500000 0.468750
vt 0.453125 0.500000
vt 0.500000 0.031250
vt 0.500000 0.031250
vt 0.750000 0.062500
vt 0.484375 0.500000
vt 0.750000 0.093750
vt 0.546875 0.218750
vt 0.500000 0.156250
vt 0.500000 0.156250
vt 0.031250 0.437500
vt 0.062500 0.437500
vt 0.093750 0.437500
vt 0.125000 0.437500
vt 0.265625 0.531250
vt 0.296875 0.500000
vt 0.156250 0.437500
vt 0.187500 0.437500
vt 0.218750 0.437500
vt 0.250000 0.437500
vt 0.328125 0.531250
vt 0.359375 0.500000
vn -0.0035 0.0000 1.0000
vn -1.0000 -0.0000 -0.0035
vn 0.0035 -0.0000 -1.0000
vn 1.0000 0.0000 0.0035
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 -0.0000
usemtl m_f0b9b360-eb8b-0fa8-2d3c-7c07ea796718
s 1
f 2/1/1 4/2/1 1/3/1
f 1/4/2 6/5/2 5/6/2
f 5/7/3 8/8/3 7/9/3
f 7/10/4 3/11/4 2/12/4
f 6/13/5 3/14/5 8/15/5
f 1/16/6 7/17/6 2/18/6
f 10/19/1 12/20/1 9/21/1
f 9/22/2 14/23/2 13/24/2
f 13/25/3 16/26/3 15/27/3
f 15/28/4 11/29/4 10/30/4
f 14/31/5 11/32/5 16/33/5
f 9/34/6 15/35/6 10/36/6
f 18/37/1 20/38/1 17/39/1
f 17/40/2 22/41/2 21/42/2
f 21/43/3 24/44/3 23/45/3
f 23/46/4 19/47/4 18/48/4
f 22/49/5 19/50/5 24/51/5
f 17/52/6 23/53/6 18/54/6
f 26/55/1 28/56/1 25/57/1
f 25/58/2 30/59/2 29/60/2
f 29/61/3 32/62/3 31/63/3
f 31/64/4 27/65/4 26/66/4
f 30/67/5 27/68/5 32/69/5
f 25/70/6 31/71/6 26/72/6
f 34/73/1 36/74/1 33/75/1
f 33/76/2 38/77/2 37/78/2
f 37/79/3 40/80/3 39/81/3
f 39/82/4 35/83/4 34/84/4
f 38/85/5 35/86/5 40/87/5
f 33/88/6 39/89/6 34/90/6
f 2/1/1 3/91/1 4/2/1
f 1/4/2 4/92/2 6/5/2
f 5/7/3 6/93/3 8/8/3
f 7/10/4 8/94/4 3/11/4
f 6/13/5 4/95/5 3/14/5
f 1/16/6 5/96/6 7/17/6
f 10/19/1 11/97/1 12/20/1
f 9/22/2 12/98/2 14/23/2
f 13/25/3 14/99/3 16/26/3
f 15/28/4 16/100/4 11/29/4
f 14/31/5 12/101/5 11/32/5
f 9/34/6 13/102/6 15/35/6
f 18/37/1 19/103/1 20/38/1
f 17/40/2 20/104/2 22/41/2
f 21/43/3 22/105/3 24/44/3
f 23/46/4 24/106/4 19/47/4
f 22/49/5 20/107/5 19/50/5
f 17/52/6 21/108/6 23/53/6
f 26/55/1 27/109/1 28/56/1
f 25/58/2 28/110/2 30/59/2
f 29/61/3 30/111/3 32/62/3
f 31/64/4 32/112/4 27/65/4
f 30/67/5 28/113/5 27/68/5
f 25/70/6 29/114/6 31/71/6
f 34/73/1 35/115/1 36/74/1
f 33/76/2 36/116/2 38/77/2
f 37/79/3 38/117/3 40/80/3
f 39/82/4 40/118/4 35/83/4
f 38/85/5 36/119/5 35/86/5
f 33/88/6 37/120/6 39/89/6