Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- import net.minecraft.client.Minecraft;
- import org.lwjgl.input.*;
- public class mod_FPS extends BaseMod
- {
- public boolean OnTickInGame(Minecraft minecraft)
- {
- ScaledResolution scaledresolution = new ScaledResolution(minecraft.gameSettings,
- minecraft.displayWidth, minecraft.displayHeight);
- int width = scaledresolution.getScaledWidth();
- int height = scaledresolution.getScaledHeight();
- FontRenderer fontRenderer = minecraft.fontRenderer;
- if (!minecraft.gameSettings.showDebugInfo && ModLoader.isGUIOpen(null))
- {
- fontRenderer.drawStringWithShadow((new StringBuilder()).append(minecraft.debug)
- .toString(), 2, 10, 0xe0e0e0);
- double iX = minecraft.thePlayer.posX;
- double iY = minecraft.thePlayer.posY;
- double iZ = minecraft.thePlayer.posZ;
- Vec3D vec3D = Vec3D.createVector(iX, 0, iZ);
- fontRenderer.drawStringWithShadow((new StringBuilder()).append("Pos: ")
- .append((int) iX).append(", ").append((int) iY).append(", ").append((int) iZ)
- .toString(), 2, 18, 0xe0e0e0);
- // if (Keyboard.isKeyDown(15))
- // {
- if ((minecraft.thePlayer instanceof EntityClientPlayerMP))
- {
- for (int i = 0; i < minecraft.theWorld.playerEntities.size(); i++)
- {
- if ((minecraft.theWorld.playerEntities.get(i) instanceof EntityOtherPlayerMP))
- {
- minecraft.renderEngine.bindTexture(minecraft.renderEngine
- .getTexture("/gui/ArrowIcons.png"));
- double jX = ((EntityPlayer) minecraft.theWorld.playerEntities.get(i)).posX;
- double jY = ((EntityPlayer) minecraft.theWorld.playerEntities.get(i)).posY;
- double jZ = ((EntityPlayer) minecraft.theWorld.playerEntities.get(i)).posZ;
- Vec3D vec3D1 = Vec3D.createVector(jX, 0, jZ);
- double dis = Math.sqrt(((iX-jX)*(iX-jX))+((iY-jY)*(iY-jY))+((iZ-jZ)*(iZ-jZ)));
- Vec3D vec3D2 = vec3D.subtract(vec3D1);
- vec3D2 = vec3D2.normalize();
- Vec3D vec3D3 = Vec3D.createVector(0, 0, 1);
- double a1 = minecraft.thePlayer.rotationYaw;
- double a2 = vec3D2.func_35612_b(vec3D3);
- double a3 = ((Math.acos(a2) * 180D) / Math.PI);
- if (jX > iX) a3 *= -1;
- double a5;
- for (a5 = a3 - a1; a5 >= 180D; a5 -= 360D)
- {
- }
- for (; a5 < -180D; a5 += 360D)
- {
- }
- //System.out.printf("me: %.0f you: %.0f both: %.0f\n", a1, a3, a5);
- String s = (new StringBuilder())
- .append(((EntityPlayer) minecraft.theWorld.playerEntities.get(i)).username)
- .append((int) jX).append(", ").append((int) jY).append(", ")
- .append((int) jZ).append(" D: ").append((int) dis).toString();
- fontRenderer.drawStringWithShadow(s, 14, (i * 10) + 20, 0xe0e0e0);
- byte byte1 = 0;
- byte byte2 = (byte) (i%8);
- if (a5 <= 22.5D && a5 >= -22.5D) {byte1 = 0;}
- else if (a5 >= 22.5D && a5 < 67.5D) {byte1 = 1;}
- else if (a5 >= 67.5D && a5 < 112.5D) {byte1 = 2;}
- else if (a5 >= 112.5D && a5 < 157.5D) {byte1 = 3;}
- else if ((a5 >= 157.5D && a5 < 180D) || (a5 >= -180.5D && a5 < -157.5D))
- {byte1 = 4;}
- else if (a5 >= -157.5D && a5 < -112.5D) {byte1 = 5;}
- else if (a5 >= -112.5D && a5 < -67.5D) {byte1 = 6;}
- else if (a5 >= -67.5D && a5 < -22.5D) {byte1 = 7;}
- minecraft.renderEngine.bindTexture(minecraft.renderEngine
- .getTexture("/gui/ArrowIcons.png"));
- minecraft.ingameGUI.drawTexturedModalRect(4, (i * 10) + 20, byte2 * 8,
- byte1 * 8, 8, 8);
- }
- }
- }
- }
- return true;
- }
- public String Version()
- {
- return "1.8.1";
- }
- public mod_FPS()
- {
- ModLoader.SetInGameHook(this, true, false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement