本文整理匯總了Java中net.minecraft.client.renderer.RenderGlobal.drawSelectionBoundingBox方法的典型用法代碼示例。如果您正苦於以下問題:Java RenderGlobal.drawSelectionBoundingBox方法的具體用法?Java RenderGlobal.drawSelectionBoundingBox怎麽用?Java RenderGlobal.drawSelectionBoundingBox使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.RenderGlobal
的用法示例。
在下文中一共展示了RenderGlobal.drawSelectionBoundingBox方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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();
}
示例2: 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();
}
}
}
示例3: 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();
}
示例4: 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();
}
示例5: 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();
}
示例6: renderBlockOutlines
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
private void renderBlockOutlines(Mode mode, EntityPlayer player, BlockPosEU posStart, BlockPosEU posEnd, float partialTicks)
{
GlStateManager.glLineWidth(2.0f);
float expand = mode == Mode.REPLACE ? 0.001f : 0f;
for (int i = 0; i < this.positions.size(); i++)
{
BlockPosEU pos = this.positions.get(i);
if (pos.equals(posStart) == false && pos.equals(posEnd) == false)
{
AxisAlignedBB aabb = createAABB(pos.getX(), pos.getY(), pos.getZ(), expand, partialTicks, player);
RenderGlobal.drawSelectionBoundingBox(aabb, 1.0f, 1.0f, 1.0f, 1.0f);
}
}
}
示例7: renderPositions
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
private void renderPositions(EntityPlayer clientPlayer, BlockPosEU posStart, BlockPosEU posEnd, int color, float partialTicks)
{
GlStateManager.glLineWidth(2.0f);
for (int a = 0; a < 3; a++)
{
List<BlockPosEU> column = this.positions.get(a);
if (column != null)
{
final int size = column.size();
for (int i = 0; i < size; i++)
{
BlockPosEU pos = column.get(i);
//if (pos.equals(posStart) == false && (posEnd == null || posEnd.equals(pos) == false))
{
AxisAlignedBB aabb = BuildersWandRenderer.createAABB(pos.getX(), pos.getY(), pos.getZ(), 0, partialTicks, clientPlayer);
RenderGlobal.drawSelectionBoundingBox(aabb, ((color >>> 16) & 0xFF) / 255f, ((color >>> 8) & 0xFF) / 255f, (color & 0xFF) / 255f, 1.0f);
}
}
}
}
}
示例8: drawOutlinedBoundingBox
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
public static void drawOutlinedBoundingBox(AxisAlignedBB bb, float r,
float g, float b, float width) {
GlStateManager.depthMask(false);
GlStateManager.glLineWidth(width);
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GlStateManager.disableCull();
GlStateManager.disableBlend();
RenderGlobal.drawSelectionBoundingBox(bb, r, g, b, 1.0f);
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.enableCull();
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
/*GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(r, g, b, 0.4F);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
float hw = width/2;
drawCuboid((float)bb.minX, (float)bb.minY-hw, (float)bb.minZ-hw, (float)bb.maxX, (float)bb.minY+hw, (float)bb.minZ+hw);
drawCuboid((float)bb.minX, (float)bb.maxY-hw, (float)bb.minZ-hw, (float)bb.maxX, (float)bb.maxY+hw, (float)bb.minZ+hw);
drawCuboid((float)bb.minX, (float)bb.minY-hw, (float)bb.maxZ-hw, (float)bb.maxX, (float)bb.minY+hw, (float)bb.maxZ+hw);
drawCuboid((float)bb.minX, (float)bb.maxY-hw, (float)bb.maxZ-hw, (float)bb.maxX, (float)bb.maxY+hw, (float)bb.maxZ+hw);
drawCuboid((float)bb.minX-hw, (float)bb.minY, (float)bb.minZ-hw, (float)bb.minX+hw, (float)bb.maxY, (float)bb.minZ+hw);
drawCuboid((float)bb.maxX-hw, (float)bb.minY, (float)bb.minZ-hw, (float)bb.maxX+hw, (float)bb.maxY, (float)bb.minZ+hw);
drawCuboid((float)bb.minX-hw, (float)bb.minY, (float)bb.maxZ-hw, (float)bb.minX+hw, (float)bb.maxY, (float)bb.maxZ+hw);
drawCuboid((float)bb.maxX-hw, (float)bb.minY, (float)bb.maxZ-hw, (float)bb.maxX+hw, (float)bb.maxY, (float)bb.maxZ+hw);
drawCuboid((float)bb.minX-hw, (float)bb.minY-hw, (float)bb.minZ, (float)bb.minX+hw, (float)bb.minY+hw, (float)bb.maxZ);
drawCuboid((float)bb.minX-hw, (float)bb.maxY-hw, (float)bb.minZ, (float)bb.minX+hw, (float)bb.maxY+hw, (float)bb.maxZ);
drawCuboid((float)bb.maxX-hw, (float)bb.minY-hw, (float)bb.minZ, (float)bb.maxX+hw, (float)bb.minY+hw, (float)bb.maxZ);
drawCuboid((float)bb.maxX-hw, (float)bb.maxY-hw, (float)bb.minZ, (float)bb.maxX+hw, (float)bb.maxY+hw, (float)bb.maxZ);
GL11.glDisable(GL11.GL_BLEND);*/
}
示例9: doRender
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
@Override
public void doRender(EntityPoster poster, double x, double y, double z, float yaw, float partial) {
final Minecraft mc = Minecraft.getMinecraft();
final MovingObjectPosition mop = mc.objectMouseOver;
boolean selected = mop != null && mop.entityHit == poster;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
if (selected && !mc.gameSettings.hideGUI) {
GL11.glPushMatrix();
// They ordinarily don't move, so no need to bother w/ interpolation
GL11.glTranslated(-poster.posX, -poster.posY, -poster.posZ + 1 / 16.0);
GL11.glDisable(GL11.GL_TEXTURE_2D);
RenderGlobal.drawSelectionBoundingBox(poster.getEntityBoundingBox());
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
}
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glEnable(GL11.GL_ALPHA_TEST); // This should always be enabled; some other mod's derping things up tho; we can leave it on
GL11.glDisable(GL11.GL_BLEND); // seems to fix that 'no alpha' issue I was having?
poster.rot.glRotate();
double s = poster.scale;
GL11.glScaled(s, s, s);
try {
renderItem(poster.inv);
} catch (Throwable t) {
t.printStackTrace();
poster.inv = new ItemStack(Blocks.fire); // Hopefully fire doesn't also somehow error out.
} finally {
GL11.glPopAttrib();
}
GL11.glPopMatrix();
}
示例10: drawAABB
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
public static void drawAABB(AxisAlignedBB aabb, EntityPlayer player, float partialTicks, float[] colorARGB, float[] hiddenColorARGB)
{
double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks;
double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
aabb = aabb.expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D);
if(hiddenColorARGB != null)
{
GlStateManager.glLineWidth(1.0F);
GlStateManager.disableDepth();
RenderGlobal.drawSelectionBoundingBox(aabb.offset(-d0, -d1, -d2), hiddenColorARGB[1], hiddenColorARGB[2], hiddenColorARGB[3], hiddenColorARGB[0]);
GlStateManager.enableDepth();
}
GlStateManager.glLineWidth(2.0F);
RenderGlobal.drawSelectionBoundingBox(aabb.offset(-d0, -d1, -d2), colorARGB[1], colorARGB[2], colorARGB[3], colorARGB[0]);
GlStateManager.depthMask(true);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
}
示例11: drawSelectionBoundingBox
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
/**
* Draw a single selection box at the given bounding box.
*
* @param player
* @param partialTicks
* @param lineWidth
* @param colorR
* @param colorG
* @param colorB
* @param colorA
* @param box
*/
public static void drawSelectionBoundingBox(EntityPlayer player, float partialTicks, float lineWidth, float colorR, float colorG, float colorB, float colorA, AxisAlignedBB box) {
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.color(colorR, colorG, colorB, colorA);
GL11.glLineWidth(lineWidth);
// For whatever reason, we need to enable, THEN disable. Otherwise color gets somewhat garbled..
GlStateManager.enableTexture2D();
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks;
double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;
GL11.glTranslated(-d0, -d1, -d2);
RenderGlobal.drawSelectionBoundingBox(box.expand(boundingBoxExpand, boundingBoxExpand, boundingBoxExpand));
GlStateManager.depthMask(true);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
示例12: drawOutlinedBoundingBox
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
void drawOutlinedBoundingBox(AxisAlignedBB box) {
RenderGlobal.drawSelectionBoundingBox(box);
}
示例13: renderStackedArea
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
private void renderStackedArea(Area3D area, EntityPlayer player, BlockPosEU posStart, BlockPosEU posEnd, float partialTicks)
{
if (posStart == null || posEnd == null)
{
return;
}
int xp = area.getXPos();
int yp = area.getYPos();
int zp = area.getZPos();
int xn = area.getXNeg();
int yn = area.getYNeg();
int zn = area.getZNeg();
int sx = Math.abs(posEnd.getX() - posStart.getX()) + 1;
int sy = Math.abs(posEnd.getY() - posStart.getY()) + 1;
int sz = Math.abs(posEnd.getZ() - posStart.getZ()) + 1;
AxisAlignedBB originalBox = createEnclosingAABB(posStart, posEnd, player, partialTicks);
GlStateManager.glLineWidth(2.0f);
// Non-empty area on at least one axis
if ((xp + xn + yp + yn + zp + zn) != 0)
{
for (int y = -yn; y <= yp; y++)
{
for (int x = -xn; x <= xp; x++)
{
for (int z = -zn; z <= zp; z++)
{
AxisAlignedBB aabb = originalBox.offset(x * sx, y * sy, z * sz);
if (x != 0 || y != 0 || z != 0)
{
RenderGlobal.drawSelectionBoundingBox(aabb, 1f, 1f, 1f, 0xCC / 255f);
}
else
{
RenderGlobal.drawSelectionBoundingBox(aabb, 0.5f, 1f, 0.5f, 0xCC / 255f);
}
}
}
}
}
}