port reachdisplay
This commit is contained in:
parent
15d2fbb127
commit
8e4b97e760
Binary file not shown.
Binary file not shown.
|
@ -4,16 +4,12 @@ import java.util.Collection;
|
||||||
|
|
||||||
import dev.resent.module.base.Category;
|
import dev.resent.module.base.Category;
|
||||||
import dev.resent.module.base.RenderModule;
|
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.client.Minecraft;
|
||||||
import net.minecraft.src.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.Gui;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.src.GuiScreen;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.src.Potion;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.src.PotionEffect;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.src.ScaledResolution;
|
|
||||||
import net.minecraft.src.StatCollector;
|
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public class PotionHUD extends RenderModule{
|
public class PotionHUD extends RenderModule{
|
||||||
|
@ -45,8 +41,8 @@ public class PotionHUD extends RenderModule{
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
this.setHeight(20);
|
this.setHeight(20);
|
||||||
this.setWidth(Minecraft.getMinecraft().fontRenderer.getStringWidth("Resistance VII") + 2);
|
this.setWidth(mc.fontRendererObj.getStringWidth("Resistance VII") + 2);
|
||||||
sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
sr = new ScaledResolution(mc);
|
||||||
Collection<PotionEffect> effects = mc.thePlayer.getActivePotionEffects();
|
Collection<PotionEffect> effects = mc.thePlayer.getActivePotionEffects();
|
||||||
int potcount = 0;
|
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);
|
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;
|
String toDraw = "§4" + eName + "§r §a" + ampString + " §9" + duration;
|
||||||
fr.drawStringWithShadow(toDraw, this.x + 2, this.y + (potcount * 10) -5, -1);
|
fr.drawStringWithShadow(toDraw, this.x + 2, this.y + (potcount * 10) -5, -1);
|
||||||
this.setHeight((potcount * 10) + 10);
|
this.setHeight((potcount * 10) + 10);
|
||||||
|
|
|
@ -6,7 +6,7 @@ import dev.resent.Resent;
|
||||||
import dev.resent.event.impl.EventAttack;
|
import dev.resent.event.impl.EventAttack;
|
||||||
import dev.resent.module.base.Category;
|
import dev.resent.module.base.Category;
|
||||||
import dev.resent.module.base.RenderModule;
|
import dev.resent.module.base.RenderModule;
|
||||||
import net.minecraft.src.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
|
|
||||||
public class ReachDisplay extends RenderModule {
|
public class ReachDisplay extends RenderModule {
|
||||||
|
|
||||||
|
@ -17,14 +17,8 @@ public class ReachDisplay extends RenderModule {
|
||||||
|
|
||||||
Resent.INSTANCE.events().subscribe(EventAttack.class, event -> {
|
Resent.INSTANCE.events().subscribe(EventAttack.class, event -> {
|
||||||
if (this.isEnabled()) {
|
if (this.isEnabled()) {
|
||||||
Vec3 vec3 = this.mc.renderViewEntity.getPosition(1.0f);
|
Vec3 vec3 = this.mc.getRenderViewEntity().getPositionEyes(1.0f);
|
||||||
range = range <= 3.0f
|
range = this.mc.objectMouseOver.hitVec.distanceTo(vec3);
|
||||||
? ((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;
|
|
||||||
}
|
|
||||||
if (range > 3.0f && !mc.playerController.isInCreativeMode()) {
|
if (range > 3.0f && !mc.playerController.isInCreativeMode()) {
|
||||||
range = 3.0f;
|
range = 3.0f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user