Archive eaglercraft-archive-resent-3-3-source (source, 1.8.8, clean)

This commit is contained in:
2026-11-27 22:14:40 -06:00
parent b5363c89d9
commit a9c9aad05a
44 changed files with 2649 additions and 0 deletions
@@ -0,0 +1,92 @@
package dev.resent.module.impl.hud;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.item.ItemStack;
public class ArmorHud extends RenderModule {
public ScaledResolution sr;
public ArmorHud() {
super("ArmorHud", Category.HUD, 50, 4, true);
addSetting(helm, chestp, leg, boot, item);
}
public static BooleanSetting helm = new BooleanSetting("Helmet", "", true);
public static BooleanSetting chestp = new BooleanSetting("Chestplate", "", true);
public static BooleanSetting leg = new BooleanSetting("Leggings", "", true);
public static BooleanSetting boot = new BooleanSetting("Boots", "", true);
public static BooleanSetting item = new BooleanSetting("Item", "", true);
public int getWidth(){
return 20;
}
public int getHeight(){
return 96;
}
@Override
public void draw() {
GlStateManager.enableLighting();
ItemStack boots = mc.thePlayer.inventory.armorInventory[0];
ItemStack legs = mc.thePlayer.inventory.armorInventory[1];
ItemStack chest = mc.thePlayer.inventory.armorInventory[2];
ItemStack helmet = mc.thePlayer.inventory.armorInventory[3];
ItemStack hand = mc.thePlayer.inventory.getCurrentItem();
if (helmet != null && helm.getValue()) {
ItemStack displayhelmet = helmet.copy();
displayhelmet.stackSize = 1;
GuiIngame.itemRenderer.renderItemAndEffectIntoGUI( displayhelmet, this.x+3, this.y+2);
GuiIngame.itemRenderer.renderItemOverlayIntoGUI(mc.fontRendererObj, displayhelmet,
this.x + 3, this.y + 2, "");
//16
}
if (chest != null && chestp.getValue()) {
ItemStack displaychest = chest.copy();
displaychest.stackSize = 1;
GuiIngame.itemRenderer.renderItemAndEffectIntoGUI( displaychest,
this.x + 3, this.y+18);
GuiIngame.itemRenderer.renderItemOverlayIntoGUI(mc.fontRendererObj, displaychest,
this.x + 3, this.y+18, "");
}
if (legs != null && leg.getValue()) {
ItemStack displaylegs = legs.copy();
displaylegs.stackSize = 1;
GuiIngame.itemRenderer.renderItemAndEffectIntoGUI( displaylegs,
this.x + 3, this.y+34);
GuiIngame.itemRenderer.renderItemOverlayIntoGUI(mc.fontRendererObj, displaylegs, this.x + 3,
this.y+34, "");
}
if (boots != null && boot.getValue()) {
ItemStack displayboots = boots.copy();
displayboots.stackSize = 1;
GuiIngame.itemRenderer.renderItemAndEffectIntoGUI( displayboots,
this.x + 3, this.y + 50);
GuiIngame.itemRenderer.renderItemOverlayIntoGUI(mc.fontRendererObj, displayboots, this.x + 3,
this.y + 50, "");
}
if (hand != null && item.getValue()){
ItemStack displayhand = hand.copy();
displayhand.stackSize = 1;
GuiIngame.itemRenderer.renderItemAndEffectIntoGUI( displayhand, this.x + 3,
this.y + 66);
GuiIngame.itemRenderer.renderItemOverlayIntoGUI(mc.fontRendererObj, displayhand, this.x + 3,
this.y + 66, "");
}
GlStateManager.disableLighting();
}
}
@@ -0,0 +1,45 @@
package dev.resent.module.impl.hud;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import dev.resent.util.misc.FuncUtils;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import java.util.ArrayList;
import java.util.List;
public class CPS extends RenderModule {
public CPS() {
super("CPS", Category.HUD, 50, 4, true);
addSetting(tshadow);
}
private final List<Long> clicks = new ArrayList<>();
private boolean wasPressed;
private long lastPressed;
public BooleanSetting tshadow = new BooleanSetting("Text shadow", "", true);
public int getWidth() { return mc.fontRendererObj.getStringWidth("[CPS: 00]") + 4; }
public int getHeight() { return mc.fontRendererObj.FONT_HEIGHT+4; }
@Override
public void draw() {
final boolean pressed = Mouse.isButtonDown(0) || Mouse.isButtonDown(1);
if(pressed != wasPressed){
lastPressed = System.currentTimeMillis();
wasPressed = pressed;
if(pressed){
this.clicks.add(lastPressed);
}
}
final long time = System.currentTimeMillis();
FuncUtils.removeIf(clicks, aLong -> aLong + 1000 < time);
mc.fontRendererObj.drawString("CPS: " + clicks.size(), this.x+2, this.y+2, -1, tshadow.getValue());
}
}
@@ -0,0 +1,47 @@
package dev.resent.module.impl.hud;
import dev.resent.event.impl.Event;
import dev.resent.event.impl.EventAttack;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import net.minecraft.network.play.server.S19PacketEntityStatus;
public class ComboCounter extends RenderModule {
public static boolean attacked = false;
public static int combo = 0;
public BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", true);
public ComboCounter() {
super("ComboCounter", Category.HUD, 4, 4, true);
addSetting(tshadow);
}
public void onEvent(Event e){
if(e instanceof EventAttack && isEnabled()){
attacked = true;
}
}
public void onEntityHit(S19PacketEntityStatus event) {
if (this.isEnabled() && attacked && event.logicOpcode == 2) {
combo++;
attacked = false;
}
}
public int getWidth() {
return mc.fontRendererObj.getStringWidth("[0 Combo]") + 4;
}
public int getHeight() {
return mc.fontRendererObj.FONT_HEIGHT + 4;
}
@Override
public void draw() {
mc.fontRendererObj.drawString(combo + " Combo", this.x + 2, this.y + 2, -1, tshadow.getValue());
}
}
@@ -0,0 +1,30 @@
package dev.resent.module.impl.hud;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import net.minecraft.client.Minecraft;
public class FPS extends RenderModule{
public Minecraft mc = Minecraft.getMinecraft();
public FPS(){
super("FPS", Category.HUD, 4, 24, true);
addSetting(tshadow);
}
public BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", true);
public int getWidth(){ return mc.fontRendererObj.getStringWidth("[FPS: "+ Minecraft.debugFPS + "]") + 4;}
public int getHeight(){ return mc.fontRendererObj.FONT_HEIGHT+4;}
@Override
public void draw(){
if (mc.thePlayer != null) {
if(this.isEnabled()){
mc.fontRendererObj.drawString("[FPS: " + Minecraft.debugFPS + "]", this.x + 2, this.y + 2, -1, tshadow.getValue());
}
}
}
}
@@ -0,0 +1,68 @@
package dev.resent.module.impl.hud;
import dev.resent.Resent;
import dev.resent.module.base.Category;
import dev.resent.module.base.Mod;
import dev.resent.util.misc.W;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.minecraft.client.Minecraft;
@SuppressWarnings("all")
public class Freelook extends Mod {
public static float cameraYaw = 0.0F;
public static float cameraPitch = 0.0F;
public static int previousePrespective = 0;
public static boolean perspectiveToggled = false;
public static boolean returnOnRelease = false;
public Freelook() {
super("FreeLook", Category.HUD);
}
public void smh(){
if(W.freelook().isEnabled())
perspectiveToggled = !perspectiveToggled;
cameraYaw = Minecraft.getMinecraft().thePlayer.rotationYaw;
cameraPitch = Minecraft.getMinecraft().thePlayer.rotationPitch;
if (perspectiveToggled && W.freelook().isEnabled()) {
previousePrespective = Minecraft.getMinecraft().gameSettings.thirdPersonView;
Minecraft.getMinecraft().gameSettings.thirdPersonView = 1;
} else {
Minecraft.getMinecraft().gameSettings.thirdPersonView = previousePrespective;
}
if (Keyboard.getEventKey() == 6 && Minecraft.getMinecraft().gameSettings.keyBindFunction.pressed) {
perspectiveToggled = false;
}
}
public float getCameraYaw() {
return perspectiveToggled ? cameraYaw : Minecraft.getMinecraft().thePlayer.rotationYaw;
}
public float getCameraPitch() {
return perspectiveToggled ? cameraPitch : Minecraft.getMinecraft().thePlayer.rotationPitch;
}
public boolean overriderMouse() {
if (Minecraft.getMinecraft().inGameHasFocus) {
if (!perspectiveToggled)
return true;
Minecraft.getMinecraft().mouseHelper.mouseXYChange();
float f1 = Minecraft.getMinecraft().gameSettings.mouseSensitivity * 0.6F + 0.2F;
float f2 = f1 * f1 * f1 * 8.0F;
float f3 = Minecraft.getMinecraft().mouseHelper.deltaX * f2;
float f4 = Minecraft.getMinecraft().mouseHelper.deltaY * f2;
cameraYaw += f3 * 0.15F;
cameraPitch += f4 * 0.15F;
if (cameraPitch > 90.0F)
cameraPitch = -90.0F;
if (cameraPitch < -90.0F)
cameraPitch = 90.0F;
}
return false;
}
}
@@ -0,0 +1,24 @@
package dev.resent.module.impl.hud;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
public class Health extends RenderModule {
public Health(){
super("Health Display", Category.HUD, 4, 34, true);
addSetting(tshadow);
}
public BooleanSetting tshadow = new BooleanSetting("Text shadow", "", true);
public int getHeight(){ return mc.fontRendererObj.FONT_HEIGHT + 4;}
public int getWidth(){ return mc.fontRendererObj.getStringWidth("[" + mc.thePlayer.getHealth() + " Health]") + 4; }
@Override
public void draw() {
mc.fontRendererObj.drawString("[" + mc.thePlayer.getHealth() + " Health]", this.x+2, this.y+2, -1, tshadow.getValue());
}
}
@@ -0,0 +1,50 @@
package dev.resent.module.impl.hud;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import dev.resent.util.render.Color;
import net.minecraft.client.gui.Gui;
import net.minecraft.util.BlockPos;
public class Info extends RenderModule{
public Info(){
super("Info", Category.HUD, 4, 14);
//addSetting(direction);
}
public BooleanSetting direction = new BooleanSetting("Direction", "", true);
public static int yes = 6;
public int getWidth() {
return mc.fontRendererObj.getStringWidth("X: -99999999 + ");
}
public int getHeight() {
return mc.fontRendererObj.FONT_HEIGHT * yes;
}
@Override
public void draw() {
int px = (int) mc.thePlayer.posX;
int py = (int) mc.thePlayer.posY;
int pz = (int) mc.thePlayer.posZ;
//int rot = MathHelper.floor_double(this.mc.thePlayer.rotationYaw*4/360+0.5) & 3;
if (mc.thePlayer != null) {
Gui.drawRect(this.x, this.y, this.x+this.getWidth(), this.y+this.getHeight(), new Color(0, 0, 0, 200).getRGB());
mc.fontRendererObj.drawStringWithShadow(" X: " + px, this.x+5, this.y + 14, -1);
mc.fontRendererObj.drawStringWithShadow(" Y: " + py, this.x+5, this.y + 24, -1);
mc.fontRendererObj.drawStringWithShadow(" Z: " + pz, this.x+5, this.y + 34, -1);
if (!direction.getValue())
yes = 6;
//if (direction.getValue()) {
// mc.fontRendererObj.drawStringWithShadow(" Dir: " + Direction.directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth(" X: " + px), this.y + 14, -1);
mc.fontRendererObj.drawStringWithShadow(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(px, py, pz)).biomeName, this.x+5, this.y+44, -1);
//mc.fontRendererObj.drawStringWithShadow(" A: " + MathHelper.floor_double((double)mc.thePlayer.rotationYaw>360 || mc.thePlayer.rotationYaw<-360 ? mc.thePlayer.rotationYaw-360 : mc.thePlayer.rotationYaw) + "°", this.x + mc.fontRendererObj.getStringWidth(" D: N "), this.y + 44, -1);
yes = 7;
//}
}
}
}
@@ -0,0 +1,158 @@
package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import dev.resent.setting.ModeSetting;
import dev.resent.util.misc.FuncUtils;
import dev.resent.util.render.RainbowUtil;
import dev.resent.util.render.RenderUtils;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
public class KeyStrokes extends RenderModule{
public static KeyStrokes INSTANCE = new KeyStrokes();
private final Minecraft mc = Minecraft.getMinecraft();
public KeyStrokes(){
super("Keystrokes", Category.HUD, 25, 4, true);
addSetting(chroma, sneak, transparent, lmbcps, rmbcps, tshadow, jump, color, colorp, gcolor, gcolorp, size);
}
public BooleanSetting chroma = new BooleanSetting("Rainbow", "", false);
public BooleanSetting sneak = new BooleanSetting("Sneak", "", false);
public BooleanSetting transparent = new BooleanSetting("Transparent", "", false);
public BooleanSetting jump = new BooleanSetting("Jump", "", true);
public BooleanSetting lmbcps = new BooleanSetting("LMB cps counter", "", true);
public BooleanSetting rmbcps = new BooleanSetting("RMB cps counter", "", true);
public BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", false);
public ModeSetting size = new ModeSetting("Size", "", "Small", "Normal", "Large");
public ModeSetting color = new ModeSetting("Unpressed text color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black");
public ModeSetting colorp = new ModeSetting("Pressed text color", "", "Black", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "White");
public ModeSetting gcolor = new ModeSetting("Pressed button color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black");
public ModeSetting gcolorp = new ModeSetting("Unpressed button color", "", "Black", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "White");
public List<Long> clicks = new ArrayList<>();
public boolean wasPressed;
public long lastPressed;
private final List<Long> clicks2 = new ArrayList<>();
public boolean wasPressed2;
public long lastPressed2;
public float getSize(ModeSetting size) {
if (size.getValue() == "Small")
return 0.75f;
if (size.getValue() == "Normal")
return 1.0f;
if (size.getValue() == "Large")
return 1.25f;
return 1.0f;
}
public int getLeftCPS() { final long leftTime = System.currentTimeMillis() + 100L;
FuncUtils.removeIf(clicks, beenLeftTime -> beenLeftTime + 1200L < leftTime + 200L);
return this.clicks.size();
}
public int getRightCPS() {
final long rightTime = System.currentTimeMillis() + 100L;
FuncUtils.removeIf(clicks2, beenRightTime -> beenRightTime + 1200L < rightTime + 200L);
return this.clicks2.size();
}
@Override
public void draw() {
boolean pressed = mc.gameSettings.keyBindAttack.pressed;
boolean rpressed = mc.gameSettings.keyBindUseItem.pressed;
if (pressed != this.wasPressed) {
this.lastPressed = System.currentTimeMillis();
this.wasPressed = pressed;
if (pressed)
this.clicks.add(Long.valueOf(this.lastPressed));
}
if (rpressed != this.wasPressed2) {
this.lastPressed2 = System.currentTimeMillis() + 10L;
this.wasPressed2 = rpressed;
if (rpressed)
this.clicks2.add(Long.valueOf(this.lastPressed2));
}
GlStateManager.pushMatrix();
GlStateManager.translate(this.x + 1, this.y + 1, 0);
GlStateManager.scale(getSize(this.size), getSize(this.size), getSize(this.size));
GlStateManager.translate(-(this.x + 1), -(this.y + 1), 0);
if (!transparent.getValue()) {
//W
Gui.drawRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3,
mc.gameSettings.keyBindForward.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// S
Gui.drawRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55,
mc.gameSettings.keyBindBack.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// A
Gui.drawRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55,
mc.gameSettings.keyBindLeft.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// D
Gui.drawRect(this.x + 60 - 3, this.y + 30, this.x + 85 - 3, this.y + 25 + 5 + 25,
mc.gameSettings.keyBindRight.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// LMB
Gui.drawRect(this.x+3, this.y+57, this.x+41, this.y+82,
mc.gameSettings.keyBindAttack.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// RMB
Gui.drawRect(this.x + 45 - 1, this.y + 60 - 3, this.x + 85 - 3, this.y + 85 - 3,
mc.gameSettings.keyBindUseItem.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// Jump
if(jump.getValue())
Gui.drawRect(this.x + 3, this.y+84, this.x+85-3,
this.y + 105 - 6, mc.gameSettings.keyBindJump.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// Sneak
if (sneak.getValue())
Gui.drawRect(this.x + 3, jump.getValue() ? this.y+102 : this.y+84, this.x+85-3,
jump.getValue() ? this.y+120-3 : this.y+105-6, mc.gameSettings.keyBindSneak.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
}
mc.fontRendererObj.drawString("W", this.x+25+5+(25/2-mc.fontRendererObj.getStringWidth("W") + 4), this.y+8+3, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : mc.gameSettings.keyBindForward.pressed ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("S", this.x+25+5+(25/2-mc.fontRendererObj.getStringWidth("S") + 4), this.y+38, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : mc.gameSettings.keyBindBack.pressed ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("A", this.x+3+(25/2-mc.fontRendererObj.getStringWidth("A") + 4), this.y+38, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : mc.gameSettings.keyBindLeft.pressed ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("D", this.x+-3+25+25+10+(25/2-mc.fontRendererObj.getStringWidth("D") + 4), this.y+38, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : mc.gameSettings.keyBindRight.pressed ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color), tshadow.getValue());
if(jump.getValue())
mc.fontRendererObj.drawString("\u00A7m-------", this.x+85+(25/2-mc.fontRendererObj.getStringWidth("u00A7m-------") + 4), this.y+92-3, (chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : mc.gameSettings.keyBindJump.pressed ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color)), tshadow.getValue());
if(sneak.getValue())
mc.fontRendererObj.drawString("Sneak", this.x+38+3+(25/2-mc.fontRendererObj.getStringWidth("Sneak") + 4), jump.getValue() ? this.y+92+15+1-3 : this.y+92-4, (chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : mc.gameSettings.keyBindSneak.pressed ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color)), tshadow.getValue());
mc.fontRendererObj.drawString("LMB", this.x+3+40/2-mc.fontRendererObj.getStringWidth("LMB")/2, (this.y+60+25/2)-mc.fontRendererObj.FONT_HEIGHT/2-3, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : Mouse.isButtonDown(0) ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("RMB", this.x+40+3+40/2-mc.fontRendererObj.getStringWidth("RMB")/2, (this.y+60+25/2)-mc.fontRendererObj.FONT_HEIGHT/2-3, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : Mouse.isButtonDown(1) ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color), tshadow.getValue());
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(this.x + 1, this.y + 1, 0);
GlStateManager.scale(getSize(this.size), getSize(this.size), getSize(this.size));
GlStateManager.translate(-(this.x + 1), -(this.y + 1), 0);
GlStateManager.translate(this.x+41, this.y+82, 0);
GlStateManager.scale(0.5f, 0.5f, 0);
GlStateManager.translate(-(this.x+41), -(this.y+82), 0);
if(lmbcps.getValue())
mc.fontRendererObj.drawString(getLeftCPS() + " CPS", this.x-10, this.y+72, Mouse.isButtonDown(0) ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color), tshadow.getValue());
if(rmbcps.getValue())
mc.fontRendererObj.drawString(getRightCPS() + " CPS", this.x+70, this.y+72, Mouse.isButtonDown(1) ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color), tshadow.getValue());
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(this.x + 1, this.y + 1, 0);
GlStateManager.translate(-(this.x + 1), -(this.y + 1), 0);
this.setHeight((25 + 5 + 25 + 5 + 25 + 25));
this.setWidth((25 + 5 + 25 + 5 + 30));
GlStateManager.popMatrix();
}
}
@@ -0,0 +1,28 @@
package dev.resent.module.impl.hud;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
public class Ping extends RenderModule{
public Ping(){
super("Ping Display", Category.HUD, 4, 74, true);
addSetting(tshadow);
}
public BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", true);
@Override
public void draw(){
int ms = 0;
if(mc.isSingleplayer()){
ms = -1;
}
ms = (int)mc.getCurrentServerData().pingToServer;
this.setHeight(mc.fontRendererObj.FONT_HEIGHT+4);
this.setWidth(mc.fontRendererObj.getStringWidth("[" + ms + " ms]")+4);
mc.fontRendererObj.drawString("[" + ms + " ms]", this.x+2, this.y+2, -1, tshadow.getValue());
}
}
@@ -0,0 +1,34 @@
package dev.resent.module.impl.hud;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class PotCounter extends RenderModule{
public PotCounter(){
super("PotCounter", Category.HUD, 4, 64, true);
addSetting(tshadow);
}
public int potinv = 0;
public BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", true);
public int getWidth(){ return mc.fontRendererObj.getStringWidth("[" + potinv + " Pots]")+4;}
public int getHeight(){ return mc.fontRendererObj.FONT_HEIGHT+4; }
@Override
public void draw(){
ItemStack potion = new ItemStack(Items.potionitem, 1, 16421);
potinv = 0;
for(int i = 0; i < mc.thePlayer.inventory.getSizeInventory(); i++) {
if(mc.thePlayer.inventory.getStackInSlot(i) != null && ItemStack.areItemStacksEqual(mc.thePlayer.inventory.getStackInSlot(i), potion)) {
potinv++;
}
}
mc.fontRendererObj.drawString("[" + potinv + " Pots]", this.x+2, this.y+2, -1, tshadow.getValue());
}
}
@@ -0,0 +1,71 @@
package dev.resent.module.impl.hud;
import java.util.Collection;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.resources.I18n;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
@SuppressWarnings("all")
public class PotionHUD extends RenderModule{
int i2 = 16;
public PotionHUD() {
super("PotionHUD", Category.HUD, 4, 350);
}
public int getWidth() {
return 100;
}
public int getHeight() {
return i2+10;
}
public void draw() {
Collection<PotionEffect> collection = mc.thePlayer.getActivePotionEffects();
if (!collection.isEmpty()) {
int l = 33;
if (collection.size() > 5)
l = 132 / (collection.size() - 1);
for (PotionEffect potioneffect : mc.thePlayer.getActivePotionEffects()) {
Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
GlStateManager.enableAlpha();
if (potion.hasStatusIcon()) {
GuiIngame guiIngame = new GuiIngame(mc);
mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/inventory.png"));
int i3 = potion.getStatusIconIndex();
//GlStateManager.tryBlendFuncSeparate(1, 1, 1, 0);
guiIngame.drawTexturedModalRect(getX() + 1, getY() + i2 - 14, 0 + i3 % 8 * 18, 198 + i3 / 8 * 18, 18, 18);
}
String s1 = I18n.format(potion.getName(), new Object[0]);
if (potioneffect.getAmplifier() == 1) {
s1 = s1 + I18n.format("enchantment.level.2", new Object[0]);
} else if (potioneffect.getAmplifier() == 2) {
s1 = s1 + I18n.format("enchantment.level.3", new Object[0]);
} else if (potioneffect.getAmplifier() == 3) {
s1 = s1 + I18n.format("enchantment.level.4", new Object[0]);
}
mc.fontRendererObj.drawString(s1, (getX() + 21), (getY() + i2 - 14), -1, true);
String s2 = Potion.getDurationString(potioneffect);
mc.fontRendererObj.drawString(s2, (getX() + 21), (getY() + i2 + 10 - 14), -1, true);
i2 += l;
}
}
}
}
@@ -0,0 +1,38 @@
package dev.resent.module.impl.hud;
import java.text.DecimalFormat;
import dev.resent.event.impl.Event;
import dev.resent.event.impl.EventAttack;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import net.minecraft.util.Vec3;
public class ReachDisplay extends RenderModule {
public static final DecimalFormat df2 = new DecimalFormat("0.00");
public static double range;
public ReachDisplay() {
super("ReachDisplay", Category.HUD, 4, 34);
}
public int getWidth(){ return mc.fontRendererObj.getStringWidth("[" + df2.format(range) + " Blocks]")+4; }
public int getHeight(){ return mc.fontRendererObj.FONT_HEIGHT + 4; }
@Override
public void draw() {
mc.fontRendererObj.drawStringWithShadow("[" + df2.format(range) + " Blocks]", this.x + 2, this.y + 2, -1);
}
@Override
public void onEvent(Event e){
if(e instanceof EventAttack && e.isPre() && isEnabled()){
Vec3 vec3 = this.mc.getRenderViewEntity().getPositionEyes(1.0f);
range = this.mc.objectMouseOver.hitVec.distanceTo(vec3);
if (range > 3.0f && !mc.playerController.isInCreativeMode()) {
range = 3.0f;
}
}
}
}
@@ -0,0 +1,33 @@
package dev.resent.module.impl.hud;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
public class ServerInfo extends RenderModule{
public ServerInfo(){
super("Server info", Category.HUD, 4, 84, true);
addSetting(tshadow);
}
public BooleanSetting tshadow = new BooleanSetting("Text shadow", "", true);
public int getWidth(){
return mc.fontRendererObj.getStringWidth(getText())+4;
}
public int getHeight(){
return mc.fontRendererObj.FONT_HEIGHT+4;
}
public void draw(){
mc.fontRendererObj.drawString(getText(), this.x+2, this.y+2, -1, tshadow.getValue());
}
public String getText(){
if(mc.getCurrentServerData() != null){
return "[Playing on: " + mc.getCurrentServerData().serverIP + "]";
}
return "[Playing on: Not connected]";
}
}
@@ -0,0 +1,36 @@
package dev.resent.module.impl.hud;
import dev.resent.Resent;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.util.render.Color;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.gui.FontRenderer;
public class Watermark extends RenderModule{
public FontRenderer fr;
public Watermark() {
super("Watermark", Category.HUD, 300, 4);
}
@Override
public void draw() {
fr = mc.fontRendererObj;
this.setHeight(fr.FONT_HEIGHT*2 + 4);
this.setWidth(fr.getStringWidth(Resent.NAME + " client 3.2 ")*2);
GlStateManager.pushMatrix();
GlStateManager.translate(this.x + 1, this.y + 1, 0);
GlStateManager.translate(-(this.x + 1), -(this.y + 1), 0);
GlStateManager.scale(2f, 2f, 2f);
int i = fr.drawString(Resent.NAME + " client", (this.x+1)/2, (this.y+1)/2, Color.RED.getRGB(), true);
GlStateManager.scale(0.5f, 0.5f, 0.5f);
fr.drawString(Resent.VERSION + "", (i*2), this.y+(fr.FONT_HEIGHT*2-7), -1, true);
GlStateManager.popMatrix();
}
}
@@ -0,0 +1,22 @@
package dev.resent.module.impl.misc;
import dev.resent.module.base.Category;
import dev.resent.module.base.Mod;
public class Tooltips extends Mod{
public Tooltips() {
super("Tooltips", Category.MISC);
}
@Override
public void onEnable() {
if(mc.theWorld != null)
mc.gameSettings.advancedItemTooltips = true;
}
@Override
public void onDisable() {
if(mc.theWorld != null)
mc.gameSettings.advancedItemTooltips = false;
}
}