本文整理匯總了Java中net.minecraft.client.renderer.RenderGlobal類的典型用法代碼示例。如果您正苦於以下問題:Java RenderGlobal類的具體用法?Java RenderGlobal怎麽用?Java RenderGlobal使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RenderGlobal類屬於net.minecraft.client.renderer包,在下文中一共展示了RenderGlobal類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: RenderChunk
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
public RenderChunk(World worldIn, RenderGlobal renderGlobalIn, BlockPos blockPosIn, int indexIn)
{
this.world = worldIn;
this.renderGlobal = renderGlobalIn;
this.index = indexIn;
if (!blockPosIn.equals(this.getPosition()))
{
this.setPosition(blockPosIn);
}
if (OpenGlHelper.useVbo())
{
for (int i = 0; i < EnumWorldBlockLayer.values().length; ++i)
{
this.vertexBuffers[i] = new VertexBuffer(DefaultVertexFormats.BLOCK);
}
}
}
示例2: update
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
public static void update(RenderGlobal p_update_0_)
{
long i = System.currentTimeMillis();
if (i >= timeUpdateMs + 50L)
{
timeUpdateMs = i;
synchronized (mapDynamicLights)
{
updateMapDynamicLights(p_update_0_);
if (mapDynamicLights.size() > 0)
{
for (DynamicLight dynamiclight : mapDynamicLights.values())
{
dynamiclight.update(p_update_0_);
}
}
}
}
}
示例3: drawOutlinedBoundingBox
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
public static void drawOutlinedBoundingBox(AxisAlignedBB bb, int color) {
float[] color1;
float red = (color >> 16 & 0xFF) / 255.0F;
float blue = (color >> 8 & 0xFF) / 255.0F;
float green = (color & 0xFF) / 255.0F;
float alpha = (color >> 24 & 0xFF) / 255.0F;
color1 = new float[] { red, blue, green, alpha };
GL11.glLineWidth(1.0F);
GL11.glColor4f(color1[0], color1[1], color1[2], 0.8F);
RenderGlobal.func_181561_a(bb);
GlStateManager.disableDepth();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
}
示例4: render
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
public void render(float p_190060_1_, long p_190060_2_)
{
this.field_191313_b = this.field_191312_a.player;
this.field_191314_c = this.field_191313_b.lastTickPosX + (this.field_191313_b.posX - this.field_191313_b.lastTickPosX) * (double)p_190060_1_;
this.field_191315_d = this.field_191313_b.lastTickPosY + (this.field_191313_b.posY - this.field_191313_b.lastTickPosY) * (double)p_190060_1_;
this.field_191316_e = this.field_191313_b.lastTickPosZ + (this.field_191313_b.posZ - this.field_191313_b.lastTickPosZ) * (double)p_190060_1_;
World world = this.field_191312_a.player.world;
List<AxisAlignedBB> list = world.getCollisionBoxes(this.field_191313_b, this.field_191313_b.getEntityBoundingBox().expand(4.0D, 4.0D, 4.0D));
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.glLineWidth(2.0F);
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
for (AxisAlignedBB axisalignedbb : list)
{
RenderGlobal.drawSelectionBoundingBox(axisalignedbb.expandXyz(0.002D).offset(-this.field_191314_c, -this.field_191315_d, -this.field_191316_e), 1.0F, 1.0F, 1.0F, 1.0F);
}
GlStateManager.depthMask(true);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
}
示例5: RenderChunk
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
public RenderChunk(World p_i47120_1_, RenderGlobal p_i47120_2_, int p_i47120_3_)
{
for (int i = 0; i < this.mapEnumFacing.length; ++i)
{
this.mapEnumFacing[i] = new BlockPos.MutableBlockPos();
}
this.world = p_i47120_1_;
this.renderGlobal = p_i47120_2_;
this.index = p_i47120_3_;
if (OpenGlHelper.useVbo())
{
for (int j = 0; j < BlockRenderLayer.values().length; ++j)
{
this.vertexBuffers[j] = new VertexBuffer(DefaultVertexFormats.BLOCK);
}
}
}
示例6: drawHighlight
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public boolean drawHighlight(final MovingObjectPosition hit, final EntityPlayer player, final float frame) {
GL11.glEnable(3042);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
GL11.glLineWidth(2.0f);
GL11.glDisable(3553);
GL11.glDepthMask(false);
final float f1 = 0.002f;
final double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * frame;
final double d2 = player.lastTickPosY + (player.posY - player.lastTickPosY) * frame;
final double d3 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * frame;
RenderGlobal.drawOutlinedBoundingBox(this.getBounds().add(new Vector3((double)this.x(), (double)this.y(), (double)this.z())).toAABB().expand((double)f1, (double)f1, (double)f1).getOffsetBoundingBox(-d0, -d2, -d3), -1);
GL11.glDepthMask(true);
GL11.glEnable(3553);
GL11.glDisable(3042);
return true;
}
示例7: renderBlockSelection
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
private void renderBlockSelection(Entity viewEntity) {
RenderHelper.enableStandardItemLighting();
ServerBlockSystemHandler structureHandler = BlockSystems.PROXY.getBlockSystemHandler(this.blockSystem.getMainWorld());
if (viewEntity instanceof EntityPlayer && structureHandler.getMousedOver((EntityPlayer) viewEntity) == this.blockSystem) {
BlockSystemPlayerHandler handler = structureHandler.get(this.blockSystem, MC.player);
if (handler != null) {
RayTraceResult result = handler.getMouseOver();
BlockPos pos = result.getBlockPos();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.glLineWidth(2.0F);
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
IBlockState state = this.blockSystem.getBlockState(pos);
if (state.getMaterial() != Material.AIR) {
RenderGlobal.drawSelectionBoundingBox(state.getSelectedBoundingBox(this.blockSystem, pos).expandXyz(0.002), 0.0F, 0.0F, 0.0F, 0.4F);
}
GlStateManager.depthMask(true);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
}
}
}
示例8: render
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
@Override
public void render (TileEntityEnderTether te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
if (!te.showBorder || te.area == null) {
return;
}
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.glLineWidth(25.0F);
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
RenderUtils.translateAgainstPlayer(te.getPos(), false);
// drawSelectionBoundingBox
RenderGlobal.drawSelectionBoundingBox(te.area, 1f, 0f, 1f, 0.5f);
GlStateManager.depthMask(true);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}
示例9: render
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
@Override
public void render (TileEntityEnderHopper te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
if (!te.showBorder || te.area == null) {
return;
}
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.glLineWidth(25.0F);
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
RenderUtils.translateAgainstPlayer(te.getPos(), false);
// drawSelectionBoundingBox
RenderGlobal.drawSelectionBoundingBox(te.area, 1f, 0f, 1f, 0.5f);
GlStateManager.depthMask(true);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}
示例10: doRender
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
@Override
public void doRender(FlatRayTarget entity, double x, double y, double z, float entityYaw, float partialTicks) {
if (entity.box == null) return;
final Minecraft mc = Minecraft.getMinecraft();
if (mc.objectMouseOver.entityHit != entity) return;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
AxisAlignedBB offBox = entity.box.offset(-entity.posX, -entity.posY, -entity.posZ);
RenderGlobal.drawSelectionBoundingBox(offBox);
GlStateManager.disableTexture2D();
int c = 0xB0;
GL11.glLineWidth(4);
RenderGlobal.drawOutlinedBoundingBox(offBox, c, c, c, 0xFF);
GlStateManager.enableTexture2D();
GL11.glPopMatrix();
}
示例11: drawESP
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
public static void drawESP(double d, double d1, double d2, double r, double b, double g) {
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glLineWidth(1.5F);
// GL11.glDisable( GL11.GL_LIGHTING );
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glDisable(2929);
GL11.glDepthMask(false);
GL11.glColor4d(r, g, b, 0.1825F);
RenderUtils.drawColorBox(new AxisAlignedBB(d, d1, d2, d + 1.0, d1 + 1.0, d2 + 1.0));
GL11.glColor4d(r, g, b, 1.0F);
RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(d, d1, d2, d + 1.0, d1 + 1.0, d2 + 1.0),
new Color(1f, 0.25f, 0.25f).getRGB());
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GL11.glEnable(GL11.GL_TEXTURE_2D);
// GL11.glEnable( GL11.GL_LIGHTING );
GL11.glEnable(2929);
GL11.glDepthMask(true);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
示例12: box
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
/**
* Renders a box with any size and any color.
*/
public static void box(double x, double y, double z, double x2, double y2, double z2, Color color) {
x = x - Minecraft.getMinecraft().getRenderManager().renderPosX;
y = y - Minecraft.getMinecraft().getRenderManager().renderPosY;
z = z - Minecraft.getMinecraft().getRenderManager().renderPosZ;
x2 = x2 - Minecraft.getMinecraft().getRenderManager().renderPosX;
y2 = y2 - Minecraft.getMinecraft().getRenderManager().renderPosY;
z2 = z2 - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(2.0F);
RenderUtil.setColor(color);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
drawColorBox(new AxisAlignedBB(x, y, z, x2, y2, z2));
GL11.glColor4d(0, 0, 0, 0.5F);
RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2), -1);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
}
示例13: frame
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
/**
* Renders a frame with any size and any color.
*/
public static void frame(double x, double y, double z, double x2, double y2, double z2, Color color) {
x = x - Minecraft.getMinecraft().getRenderManager().renderPosX;
y = y - Minecraft.getMinecraft().getRenderManager().renderPosY;
z = z - Minecraft.getMinecraft().getRenderManager().renderPosZ;
x2 = x2 - Minecraft.getMinecraft().getRenderManager().renderPosX;
y2 = y2 - Minecraft.getMinecraft().getRenderManager().renderPosY;
z2 = z2 - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
RenderUtil.setColor(color);
RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2), -1);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
}
示例14: blockESPBox
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
/**
* Renders an ESP box with the size of a normal block at the specified
* coordinates.
*/
public static void blockESPBox(BlockPos blockPos) {
double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(1.0F);
GL11.glColor4d(0, 1, 0, 0.15F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
GL11.glColor4d(0, 0, 0, 0.5F);
RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), -1);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
}
示例15: emptyBlockESPBox
import net.minecraft.client.renderer.RenderGlobal; //導入依賴的package包/類
public static void emptyBlockESPBox(BlockPos blockPos) {
double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glColor4d(0, 0, 0, 0.5F);
RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), -1);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
}