Advertisement
GeradesoLukas

Untitled

Sep 27th, 2022
722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.49 KB | None | 0 0
  1.  protected void renderGuiItem(ItemStack pStack, int pX, int pY, BakedModel pBakedModel) {
  2.       this.textureManager.getTexture(TextureAtlas.LOCATION_BLOCKS).setFilter(false, false);
  3.       RenderSystem.setShaderTexture(0, TextureAtlas.LOCATION_BLOCKS);
  4.       RenderSystem.enableBlend();
  5.       RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
  6.       RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
  7.       PoseStack posestack = RenderSystem.getModelViewStack();
  8.       posestack.pushPose();
  9.       posestack.translate((double)pX, (double)pY, (double)(100.0F + this.blitOffset));
  10.       posestack.translate(8.0D, 8.0D, 0.0D);
  11.       posestack.scale(1.0F, -1.0F, 1.0F);
  12.       posestack.scale(16.0F, 16.0F, 16.0F);
  13.       RenderSystem.applyModelViewMatrix();
  14.       PoseStack posestack1 = new PoseStack();
  15.       MultiBufferSource.BufferSource multibuffersource$buffersource = Minecraft.getInstance().renderBuffers().bufferSource();
  16.       boolean flag = !pBakedModel.usesBlockLight();
  17.       if (flag) {
  18.          Lighting.setupForFlatItems();
  19.       }
  20.  
  21.       this.render(pStack, ItemTransforms.TransformType.GUI, false, posestack1, multibuffersource$buffersource, 15728880,
  22.       OverlayTexture.NO_OVERLAY, pBakedModel);
  23.       multibuffersource$buffersource.endBatch();
  24.       RenderSystem.enableDepthTest();
  25.       if (flag) {
  26.          Lighting.setupFor3DItems();
  27.       }
  28.  
  29.       posestack.popPose();
  30.       RenderSystem.applyModelViewMatrix();
  31.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement