1
1
package com .emeraldodin .minecraft .pcmod .client .entities .render ;
2
2
3
- import java .util .UUID ;
4
-
5
3
import com .emeraldodin .minecraft .pcmod .Utils ;
4
+ import com .emeraldodin .minecraft .pcmod .client .PCModClient ;
6
5
import com .emeraldodin .minecraft .pcmod .entities .EntityFlatScreen ;
7
6
import com .emeraldodin .minecraft .pcmod .item .ItemList ;
8
7
import com .mojang .blaze3d .systems .RenderSystem ;
23
22
import net .minecraft .util .math .Matrix4f ;
24
23
import net .minecraft .util .math .Quaternion ;
25
24
25
+ import java .util .UUID ;
26
+
26
27
public class FlatScreenRender extends EntityRenderer <EntityFlatScreen >{
27
28
protected static final RenderPhase .Transparency TRANSLUCENT_TRANSPARENCY = new RenderPhase .Transparency ("translucent_transparency" , () -> {
28
29
RenderSystem .enableBlend ();
@@ -49,22 +50,22 @@ public void render(EntityFlatScreen entity, float yaw, float tickDelta, MatrixSt
49
50
Quaternion look = Utils .lookAt (entity .getPos (), entity .getLookAtPos ());
50
51
matrices .multiply (look );
51
52
MinecraftClient .getInstance ().getItemRenderer ().renderItem (new ItemStack (ItemList .ITEM_FLATSCREEN ), Mode .NONE , light , OverlayTexture .DEFAULT_UV , matrices , vertexConsumers );
52
- // if(ClientMod .vmScreenTextures.containsKey(UUID.fromString(entity.getOwnerUUID()))) {
53
- // matrices.push();
54
- // matrices.scale(0.006f, 0.006f, 0.006f);
55
- // matrices.multiply(new Quaternion(0f, 0f, 0f, true));
56
- // matrices.multiply(new Quaternion(0, 0, 180, true));
57
- // matrices.translate(-59.4f, -18.3f, -13f);
58
- // matrices.scale(0.8079f, 0.488f, 1f);
59
- // matrices.translate(10, 5.4f, 7.76f);
60
- // Matrix4f matrix4f = matrices.peek().getModel();
61
- // VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.of("vmscreen", VertexFormats.POSITION_COLOR_TEXTURE, 7, 256, false, true, RenderLayer.MultiPhaseParameters.builder().texture(new RenderPhase.Texture(ClientMod .vmScreenTextures.get(UUID.fromString(entity.getOwnerUUID())), false, false)).alpha(ONE_TENTH_ALPHA).transparency(TRANSLUCENT_TRANSPARENCY).build(false)));
62
- // vertexConsumer.vertex(matrix4f, 0.0F, 128.0F, -0.01F).color(255, 255, 255, 255).texture(0.0F, 1.0F).next();
63
- // vertexConsumer.vertex(matrix4f, 128.0F, 128.0F, -0.01F).color(255, 255, 255, 255).texture(1.0F, 1.0F).next();
64
- // vertexConsumer.vertex(matrix4f, 128.0F, 0.0F, -0.01F).color(255, 255, 255, 255).texture(1.0F, 0.0F).next();
65
- // vertexConsumer.vertex(matrix4f, 0.0F, 0.0F, -0.01F).color(255, 255, 255, 255).texture(0.0F, 0.0F).next();
66
- // matrices.pop();
67
- // }
53
+ if (PCModClient .vmScreenTextures .containsKey (UUID .fromString (entity .getOwnerUUID ()))) {
54
+ matrices .push ();
55
+ matrices .scale (0.006f , 0.006f , 0.006f );
56
+ matrices .multiply (new Quaternion (0f , 0f , 0f , true ));
57
+ matrices .multiply (new Quaternion (0 , 0 , 180 , true ));
58
+ matrices .translate (-59.4f , -18.3f , -13f );
59
+ matrices .scale (0.8079f , 0.488f , 1f );
60
+ matrices .translate (10 , 5.4f , 7.76f );
61
+ Matrix4f matrix4f = matrices .peek ().getModel ();
62
+ VertexConsumer vertexConsumer = vertexConsumers .getBuffer (RenderLayer .of ("vmscreen" , VertexFormats .POSITION_COLOR_TEXTURE , 7 , 256 , false , true , RenderLayer .MultiPhaseParameters .builder ().texture (new RenderPhase .Texture (PCModClient .vmScreenTextures .get (UUID .fromString (entity .getOwnerUUID ())), false , false )).alpha (ONE_TENTH_ALPHA ).transparency (TRANSLUCENT_TRANSPARENCY ).build (false )));
63
+ vertexConsumer .vertex (matrix4f , 0.0F , 128.0F , -0.01F ).color (255 , 255 , 255 , 255 ).texture (0.0F , 1.0F ).next ();
64
+ vertexConsumer .vertex (matrix4f , 128.0F , 128.0F , -0.01F ).color (255 , 255 , 255 , 255 ).texture (1.0F , 1.0F ).next ();
65
+ vertexConsumer .vertex (matrix4f , 128.0F , 0.0F , -0.01F ).color (255 , 255 , 255 , 255 ).texture (1.0F , 0.0F ).next ();
66
+ vertexConsumer .vertex (matrix4f , 0.0F , 0.0F , -0.01F ).color (255 , 255 , 255 , 255 ).texture (0.0F , 0.0F ).next ();
67
+ matrices .pop ();
68
+ }
68
69
matrices .pop ();
69
70
}
70
71
0 commit comments