public static void renderBoundingBox(@Nonnull BoundingBox bb, @Nonnull IBlockState state) { renderBoundingBox(bb, getTexture(state)); }
public static void renderBoundingBox(@Nonnull BoundingBox bb, @Nonnull TextureAtlasSprite tex) { renderBoundingBox(bb, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV()); }
@Override protected void renderTileEntity(@Nonnull TileTransceiver te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) { TextureAtlasSprite icon = ((BlockTransceiver) block_transceiver.getBlockNN()).getPortalIcon(); if (icon == null) { return; } float time = Math.abs(50 - (EnderIO.proxy.getTickCount() % 100)) / 50f; float localScale = scale + 0.05f - time * 0.1f; float alpha = 0.7f + time * 0.25f; BoundingBox bb = BoundingBox.UNIT_CUBE.scale(localScale, localScale, localScale); GlStateManager.color(1, 1, 1, alpha); GlStateManager.enableNormalize(); RenderUtil.renderBoundingBox(bb, icon); GlStateManager.disableNormalize(); }
@Override public void renderParticle(@Nonnull BufferBuilder worldRendererIn, @Nonnull Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { GlStateManager.pushMatrix(); GlStateManager.enableLighting(); GlStateManager.disableLighting(); GlStateManager.disableCull(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); RenderUtil.bindBlockTexture(); GlStateManager.depthMask(false); float scale = Math.min((age + partialTicks) / INIT_TIME, 1); // Vanilla bug? Particle.interpPosX/Y/Z variables are always one frame behind double x = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * partialTicks; double y = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * partialTicks; double z = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * partialTicks; GlStateManager.translate(-x, -y, -z); GlStateManager.color(color.x, color.y, color.z, color.w); RenderUtil.renderBoundingBox(scale(owner.getPos(), getBounds(), scale).expand(0.01, 0.01, 0.01), IconUtil.instance.whiteTexture); GlStateManager.depthMask(true); GlStateManager.disableBlend(); GlStateManager.enableCull(); GlStateManager.enableLighting(); GlStateManager.popMatrix(); }
@Override public void renderParticle(@Nonnull BufferBuilder worldRendererIn, @Nonnull Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { if (particleAge < 0) { return; } GlStateManager.pushMatrix(); GlStateManager.enableLighting(); GlStateManager.disableLighting(); GlStateManager.disableCull(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); RenderUtil.bindBlockTexture(); GlStateManager.depthMask(false); float scale = Math.min((particleAge + partialTicks) / INIT_TIME, 1); float fade = particleAge < FADE_TIME ? 1f : ((particleMaxAge - particleAge) / (float) (particleMaxAge - FADE_TIME)); GlStateManager.translate(-interpPosX, -interpPosY, -interpPosZ); GlStateManager.color(getRedColorF(), getGreenColorF(), getBlueColorF(), particleAlpha * fade); RenderUtil.renderBoundingBox((new BoundingBox(getBoundingBox())).scale(scale), IconUtil.instance.whiteTexture); GlStateManager.depthMask(true); GlStateManager.disableBlend(); GlStateManager.enableCull(); GlStateManager.enableLighting(); GlStateManager.popMatrix(); }
@Override public void renderParticle(@Nonnull BufferBuilder worldRendererIn, @Nonnull Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { if (!isAlive()) { return; } GlStateManager.pushMatrix(); GlStateManager.enableLighting(); GlStateManager.disableLighting(); GlStateManager.disableCull(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); RenderUtil.bindBlockTexture(); GlStateManager.depthMask(false); GlStateManager.translate(-interpPosX, -interpPosY, -interpPosZ); float fade = tolive / (float) maxage; GlStateManager.color(color.x, color.y, color.z, color.w * fade); RenderUtil.renderBoundingBox(new BoundingBox(pos).expand(0.01, 0.01, 0.01), IconUtil.instance.whiteTexture); GlStateManager.depthMask(true); GlStateManager.disableBlend(); GlStateManager.enableCull(); GlStateManager.enableLighting(); GlStateManager.popMatrix(); }