From 8e4b97e76022e13e739c19ae079bf4cf8a8ca5bc Mon Sep 17 00:00:00 2001 From: ThisIsALegitUsername Date: Tue, 27 Dec 2022 21:39:06 +0000 Subject: [PATCH] port reachdisplay --- .../resent/module/impl/hud/PotionHUD.class | Bin 2924 -> 3651 bytes .../resent/module/impl/hud/ReachDisplay.class | Bin 985 -> 3480 bytes .../dev/resent/module/impl/hud/PotionHUD.java | 20 +++++++----------- .../resent/module/impl/hud/ReachDisplay.java | 12 +++-------- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/bin/main/dev/resent/module/impl/hud/PotionHUD.class b/bin/main/dev/resent/module/impl/hud/PotionHUD.class index c720c3dfff6d306f3249d15628b207761f9533b9..08116c06c7ba2bac632f463864c8601de51d93b7 100644 GIT binary patch literal 3651 zcma)8>w6Se8ULMRH#56Aq#MY7?dRqWP?JdttQ*RjRA*()q+?9Fv1Hm(`VW>Famr0P0-LJKO%<%z zfSq-H&8DNo^Az8Fd-2hvkv3C@&Agp1D5v>J-EJ#uxqAg_+dGa51bXe1spB4j&`n$+ zEXTVvGzqM|4Y*#zHK%N6R-zdZs$wt%)(_o9Ivz$XR!G!irNGYip;N|;5lb7{so1FN zSlOxgT@@q}9Y@2s7i}6=39PwuI3-qNjewjo-J2m6xUapVdc1DR#6w`NB!Z|DxMzsj z87^cdOlQoPNSgvpLpGy&)Nm|CmzV)}+R6)Ttb$-^-7pK%@ycV!n6(S8K(JjQ3lUkn zLMj9n7liV>pJplMA_yCLkxUJZK$9;h1J#Wg7LFnR>)2M!I7JwDiy9QoFAhnJ;Qf3>h-D`j4uMD&`yF2FMkU6S z4V^Z;*lA#+blf%`i<>NrBX~qrIUV27ez#&%X%~1*B80FifDcHV#N$NhPMafXW7cGc zZ>g??!^3iCWBuOZ%Z`q)$qXblObA4)x?J@ui4<7dEsWB>q-)KX{xImDoHUaz3wtHI z#%ouOk#wxrPN&IN1En5Qurx5B&DGvZoWc_frRAEA;o8K~QlTkP;!{rswuUVG>m5Di zw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vyh#y2 z_z7BXJC{DdC6t`Agumjg9V{jdA(7Ddgtzg)zWVrPo4EHM;ZvSP9 ODh>OU40p;|?|ugcwd*7R diff --git a/src/main/java/dev/resent/module/impl/hud/PotionHUD.java b/src/main/java/dev/resent/module/impl/hud/PotionHUD.java index 207d6f1a..09784b54 100644 --- a/src/main/java/dev/resent/module/impl/hud/PotionHUD.java +++ b/src/main/java/dev/resent/module/impl/hud/PotionHUD.java @@ -4,16 +4,12 @@ import java.util.Collection; import dev.resent.module.base.Category; import dev.resent.module.base.RenderModule; -import net.lax1dude.eaglercraft.TextureLocation; -import net.lax1dude.eaglercraft.adapter.Tessellator; import net.minecraft.client.Minecraft; -import net.minecraft.src.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.src.GuiScreen; -import net.minecraft.src.Potion; -import net.minecraft.src.PotionEffect; -import net.minecraft.src.ScaledResolution; -import net.minecraft.src.StatCollector; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.StatCollector; @SuppressWarnings("all") public class PotionHUD extends RenderModule{ @@ -45,8 +41,8 @@ public class PotionHUD extends RenderModule{ @Override public void draw(){ this.setHeight(20); - this.setWidth(Minecraft.getMinecraft().fontRenderer.getStringWidth("Resistance VII") + 2); - sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); + this.setWidth(mc.fontRendererObj.getStringWidth("Resistance VII") + 2); + sr = new ScaledResolution(mc); Collection effects = mc.thePlayer.getActivePotionEffects(); int potcount = 0; @@ -77,7 +73,7 @@ public class PotionHUD extends RenderModule{ guiScreen.drawTexturedModalRect(this.x, this.y+ 4, 0 + var9 % 8 * 18, 198 + var9 / 8 * 18, 18, 18); }*/ - fr = Minecraft.getMinecraft().fontRenderer; + fr = mc.fontRendererObj; String toDraw = "§4" + eName + "§r §a" + ampString + " §9" + duration; fr.drawStringWithShadow(toDraw, this.x + 2, this.y + (potcount * 10) -5, -1); this.setHeight((potcount * 10) + 10); diff --git a/src/main/java/dev/resent/module/impl/hud/ReachDisplay.java b/src/main/java/dev/resent/module/impl/hud/ReachDisplay.java index a8a1bff6..7ffa9920 100644 --- a/src/main/java/dev/resent/module/impl/hud/ReachDisplay.java +++ b/src/main/java/dev/resent/module/impl/hud/ReachDisplay.java @@ -6,7 +6,7 @@ import dev.resent.Resent; import dev.resent.event.impl.EventAttack; import dev.resent.module.base.Category; import dev.resent.module.base.RenderModule; -import net.minecraft.src.Vec3; +import net.minecraft.util.Vec3; public class ReachDisplay extends RenderModule { @@ -17,14 +17,8 @@ public class ReachDisplay extends RenderModule { Resent.INSTANCE.events().subscribe(EventAttack.class, event -> { if (this.isEnabled()) { - Vec3 vec3 = this.mc.renderViewEntity.getPosition(1.0f); - range = range <= 3.0f - ? ((range >= 0.8) ? this.mc.objectMouseOver.hitVec.distanceTo(vec3) - 0.8 - : mc.objectMouseOver.hitVec.distanceTo(vec3)) - : 3.0; - if (mc.playerController.isInCreativeMode() && this.mc.objectMouseOver.hitVec.distanceTo(vec3) >= 6.0f) { - range = 6.0f; - } + 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; }