mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
funky xray marker renderer thing
This commit is contained in:
parent
d6b741b54f
commit
3b938c5873
@ -755,6 +755,8 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
RenderOverhead.renderMarkers(event.partialTicks);
|
||||
|
||||
if(ArmorFSB.hasFSBArmor(player)) {
|
||||
ItemStack plate = player.inventory.armorInventory[2];
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
package com.hbm.render.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.Tuple.Triplet;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
@ -97,6 +103,86 @@ public class RenderOverhead {
|
||||
}
|
||||
}
|
||||
|
||||
public static final HashMap<Triplet<Integer, Integer, Integer>, Pair<double[], Integer>> markers = new HashMap();
|
||||
|
||||
public static void renderMarkers(float partialTicks) {
|
||||
|
||||
if(markers.isEmpty())
|
||||
return;
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
double x = player.prevPosX + (player.posX - player.prevPosX) * partialTicks;
|
||||
double y = player.prevPosY + (player.posY - player.prevPosY) * partialTicks;
|
||||
double z = player.prevPosZ + (player.posZ - player.prevPosZ) * partialTicks;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_COLOR_MATERIAL);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_POINT_SMOOTH);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawing(GL11.GL_LINES);
|
||||
|
||||
for(Entry<Triplet<Integer, Integer, Integer>, Pair<double[], Integer>> entry : markers.entrySet()) {
|
||||
Triplet<Integer, Integer, Integer> pos = entry.getKey();
|
||||
Pair<double[], Integer> pars = entry.getValue();
|
||||
|
||||
int pX = pos.getX();
|
||||
int pY = pos.getY();
|
||||
int pZ = pos.getZ();
|
||||
|
||||
int color = pars.getValue();
|
||||
double[] bounds = pars.getKey();
|
||||
double minX = bounds[0];
|
||||
double minY = bounds[1];
|
||||
double minZ = bounds[2];
|
||||
double maxX = bounds[3];
|
||||
double maxY = bounds[4];
|
||||
double maxZ = bounds[5];
|
||||
|
||||
tess.setColorOpaque_I(color);
|
||||
tess.addVertex(pX + minX - x, pY + maxY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + minY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + maxY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + maxY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + maxY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + minY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + minY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + minY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + minY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + minY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + maxY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + maxY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + maxY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + minY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + maxY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + maxY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + maxY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + minY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + maxY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + maxY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + minY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + maxX - x, pY + minY - y, pZ + maxZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + minY - y, pZ + minZ - z);
|
||||
tess.addVertex(pX + minX - x, pY + minY - y, pZ + maxZ - z);
|
||||
}
|
||||
|
||||
tess.draw();
|
||||
|
||||
tess.setColorOpaque_F(1F, 1F, 1F);
|
||||
|
||||
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_POINT_SMOOTH);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void renderThermalSight(float partialTicks) {
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/items/ball_dynamite.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/ball_dynamite.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 308 B |
BIN
src/main/resources/assets/hbm/textures/items/ball_tnt.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/ball_tnt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 283 B |
BIN
src/main/resources/assets/hbm/textures/items/clay_ball.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/clay_ball.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 177 B |
BIN
src/main/resources/assets/hbm/textures/items/ingot_c4.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/ingot_c4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 280 B |
Loading…
x
Reference in New Issue
Block a user