SHARE
TWEET

Untitled

a guest Aug 19th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Override
  2.     public void doRender(FireflyEntity entity, double x, double y, double z, float entityYaw, float partialTicks) {
  3.         GlStateManager.pushMatrix();
  4.  
  5.         GlStateManager.translatef((float) x, (float) y + 0.4f, (float) z);
  6.  
  7.         RgbColor color = ColorUtil.fireflyColors.get(entity.getFireflyType());
  8.         GlStateManager.color4f(color.getRed()/255f, color.getGreen()/255f, color.getBlue()/255f, 1f);
  9.  
  10.  
  11.         GlStateManager.enableAlphaTest();
  12.         GlStateManager.enableBlend();
  13.         GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE );
  14.         GlStateManager.disableLighting();
  15.  
  16.         GlStateManager.rotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
  17.         GlStateManager.rotatef(180, 1.0F, 0.0F, 0.0F);
  18.  
  19.         bindTexture(new ResourceLocation(Firefly.MODID, "textures/particle/particle_glow.png"));
  20.  
  21.  
  22.  
  23.         Tessellator tessellator = Tessellator.getInstance();
  24.         BufferBuilder buffer = tessellator.getBuffer();
  25.         buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
  26.         buffer.pos(-0.5D / 4, 0.0D, 0.0D).tex(0D, 0.0D).endVertex();
  27.         buffer.pos(0.5D / 4, 0.0D, 0.0D).tex(1D, 0.0D).endVertex();
  28.         buffer.pos(0.5D / 4, 1.0D / 4, 0.0D).tex(1D, 1D).endVertex();
  29.         buffer.pos(-0.5D / 4, 1.0D / 4, 0.0D).tex(0.0D, 1D).endVertex();
  30.         GLX.lastBrightnessX = 240;
  31.         GLX.lastBrightnessY = 240;
  32.         tessellator.draw();
  33.  
  34.  
  35.         GlStateManager.enableLighting();
  36.         GlStateManager.disableBlend();
  37.         GlStateManager.enableAlphaTest();
  38.         GlStateManager.popMatrix();
  39.  
  40.         super.doRender(entity, x, y, z, entityYaw, partialTicks);
  41.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top