use of net.minecraft.client.renderer.Tessellator in project LogisticsPipes by RS485.
the class GuiGraphics method renderIconAt.
public static void renderIconAt(Minecraft mc, int x, int y, float zLevel, IIcon icon) {
if (icon == null) {
return;
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
Tessellator var9 = Tessellator.instance;
var9.startDrawingQuads();
var9.addVertexWithUV(x, y + 16, zLevel, icon.getMinU(), icon.getMaxV());
var9.addVertexWithUV(x + 16, y + 16, zLevel, icon.getMaxU(), icon.getMaxV());
var9.addVertexWithUV(x + 16, y, zLevel, icon.getMaxU(), icon.getMinV());
var9.addVertexWithUV(x, y, zLevel, icon.getMinU(), icon.getMinV());
var9.draw();
}
use of net.minecraft.client.renderer.Tessellator in project LogisticsPipes by RS485.
the class GuiGraphics method drawLinesBackground.
public static void drawLinesBackground(Minecraft mc, int x, int y) {
GuiGraphics.zLevel = 0;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(GuiGraphics.LINES_ICON);
GL11.glEnable(GL11.GL_BLEND);
Tessellator var9 = Tessellator.instance;
var9.startDrawingQuads();
var9.addVertexWithUV(x, y + 16, GuiGraphics.zLevel, 0, 1);
var9.addVertexWithUV(x + 16, y + 16, GuiGraphics.zLevel, 1, 1);
var9.addVertexWithUV(x + 16, y, GuiGraphics.zLevel, 1, 0);
var9.addVertexWithUV(x, y, GuiGraphics.zLevel, 0, 0);
var9.draw();
}
use of net.minecraft.client.renderer.Tessellator in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class EventsClient method onDrawBlockHighlightEventFirst.
@SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
public void onDrawBlockHighlightEventFirst(DrawBlockHighlightEvent event) {
BlockPos pos = Minecraft.getMinecraft().objectMouseOver.getBlockPos();
if (pos != null) {
PhysicsWrapperEntity wrapper = ValkyrienWarfareMod.physicsManager.getObjectManagingPos(Minecraft.getMinecraft().theWorld, pos);
if (wrapper != null && wrapper.wrapping != null && wrapper.wrapping.renderer != null && wrapper.wrapping.centerCoord != null) {
// GL11.glPushMatrix();
float partialTicks = event.getPartialTicks();
Entity player = Minecraft.getMinecraft().thePlayer;
wrapper.wrapping.renderer.setupTranslation(partialTicks);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
double xOff = (player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getX();
double yOff = (player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getY();
double zOff = (player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getZ();
vertexbuffer.xOffset += xOff;
vertexbuffer.yOffset += yOff;
vertexbuffer.zOffset += zOff;
}
}
}
use of net.minecraft.client.renderer.Tessellator in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class CallRunnerClient method onDrawSelectionBox.
public static void onDrawSelectionBox(RenderGlobal renderGlobal, EntityPlayer player, RayTraceResult movingObjectPositionIn, int execute, float partialTicks) {
PhysicsWrapperEntity wrapper = ValkyrienWarfareMod.physicsManager.getObjectManagingPos(player.worldObj, movingObjectPositionIn.getBlockPos());
if (wrapper != null && wrapper.wrapping != null && wrapper.wrapping.renderer != null && wrapper.wrapping.renderer.offsetPos != null) {
;
wrapper.wrapping.renderer.setupTranslation(partialTicks);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
double xOff = (player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getX();
double yOff = (player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getY();
double zOff = (player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getZ();
vertexbuffer.xOffset += xOff;
vertexbuffer.yOffset += yOff;
vertexbuffer.zOffset += zOff;
renderGlobal.drawSelectionBox(player, movingObjectPositionIn, execute, partialTicks);
vertexbuffer.xOffset -= xOff;
vertexbuffer.yOffset -= yOff;
vertexbuffer.zOffset -= zOff;
wrapper.wrapping.renderer.inverseTransform(partialTicks);
} else {
renderGlobal.drawSelectionBox(player, movingObjectPositionIn, execute, partialTicks);
}
}
use of net.minecraft.client.renderer.Tessellator in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class EntityCannonBallRenderer method doRender.
@Override
public void doRender(EntityCannonBall entity, double x, double y, double z, float entityYaw, float partialTicks) {
IBlockState iblockstate = ValkyrienWarfareCombatMod.instance.fakecannonblock.getStateFromMeta(2);
double renderX = (entity.posX - entity.lastTickPosX) * partialTicks + entity.lastTickPosX;
double renderY = (entity.posY - entity.lastTickPosY) * partialTicks + entity.lastTickPosY;
double renderZ = (entity.posZ - entity.lastTickPosZ) * partialTicks + entity.lastTickPosZ;
if (iblockstate.getRenderType() == EnumBlockRenderType.MODEL) {
World world = entity.worldObj;
if (iblockstate != world.getBlockState(new BlockPos(entity)) && iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE) {
this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
if (this.renderOutlines) {
GlStateManager.enableColorMaterial();
GlStateManager.enableOutlineMode(this.getTeamColor(entity));
}
vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
// BlockPos blockpos = new BlockPos(renderX, renderY, renderZ);
GlStateManager.translate((float) (x - renderX + .25D), (float) (y - renderY - .07D), (float) (z - renderZ + .778D));
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
vertexbuffer.setTranslation(renderX - .5D, renderY, renderZ - .5D);
blockrendererdispatcher.getBlockModelRenderer().renderModel(world, blockrendererdispatcher.getModelForState(iblockstate), iblockstate, BlockPos.ORIGIN, vertexbuffer, false, 0);
tessellator.draw();
vertexbuffer.setTranslation(0, 0, 0);
if (this.renderOutlines) {
GlStateManager.disableOutlineMode();
GlStateManager.disableColorMaterial();
}
GlStateManager.enableLighting();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}
}
Aggregations