Archive eaglercraft-archive-resent-3-3-source (source, 1.8.8, clean)
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"slug": "eaglercraft-archive-resent-3-3-source",
|
||||||
|
"name": "Resent Client 3.3 Source (Eaglercraft-Archive)",
|
||||||
|
"category": "source",
|
||||||
|
"mc_version": "1.8.8",
|
||||||
|
"author": "The Resent Team",
|
||||||
|
"license": "unknown",
|
||||||
|
"upstream_ref": "3.3",
|
||||||
|
"sha256": "9b4186b4ac72e0f9e5debcddeacca3dd7e351d005ee94f1552e71fa35395f6f2",
|
||||||
|
"size": 103512,
|
||||||
|
"storage": {
|
||||||
|
"git_path": null,
|
||||||
|
"fs_url": null
|
||||||
|
},
|
||||||
|
"play": null,
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/Eaglercraft-Archive/Resent-3.3-source",
|
||||||
|
"retrieved_at": "2026-11-28T03:10:00Z",
|
||||||
|
"type": "archive",
|
||||||
|
"notes": "Archived Resent 3.3 source snapshot."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"vetting": {
|
||||||
|
"verdict": "clean",
|
||||||
|
"tools": [
|
||||||
|
"vet-static.mjs",
|
||||||
|
"virustotal-hash"
|
||||||
|
],
|
||||||
|
"date": "2026-11-28",
|
||||||
|
"notes": "Static scan: 0 flagged patterns across 42 files; VirusTotal hash lookup: 0 detections.",
|
||||||
|
"reviewer": "vet-static (automated)"
|
||||||
|
},
|
||||||
|
"large_files_omitted_from_git": []
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Resent Client 3.3 Source (Eaglercraft-Archive)
|
||||||
|
|
||||||
|
Archived source code snapshot for Resent Client 3.3, a popular EaglercraftX 1.8.8 PvP client fork.
|
||||||
|
|
||||||
|
- **Archive page:** https://archive.eaglercraft.tech/entries/eaglercraft-archive-resent-3-3-source.html
|
||||||
|
- **MC Version:** 1.8.8
|
||||||
|
- **Author:** The Resent Team
|
||||||
|
- **License:** unknown
|
||||||
|
- **SHA-256:** `9b4186b4ac72e0f9e5debcddeacca3dd7e351d005ee94f1552e71fa35395f6f2`
|
||||||
|
- **Vetting:** clean (2026-11-28)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"files": {
|
||||||
|
"util/misc/W.java": [
|
||||||
|
{
|
||||||
|
"id": "fdd134a2-af2b-4837-926d-1bac047f089d",
|
||||||
|
"line": 5,
|
||||||
|
"version": 1,
|
||||||
|
"index": 121
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"nonce":7157977372841225517,"last_updated":{"seconds":1687433248,"nanos":943380000}}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
2jmj7l5rSw0yVb_vlWAYkK_YBwk=
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,63 @@
|
|||||||
|
compile = "javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')"
|
||||||
|
run = "java -classpath .:target/dependency/* Main"
|
||||||
|
entrypoint = "Main.java"
|
||||||
|
hidden = ["**/*.class"]
|
||||||
|
|
||||||
|
[packager]
|
||||||
|
language = "java"
|
||||||
|
|
||||||
|
[packager.features]
|
||||||
|
packageSearch = true
|
||||||
|
|
||||||
|
[languages.java]
|
||||||
|
pattern = "**/*.java"
|
||||||
|
|
||||||
|
[languages.java.languageServer]
|
||||||
|
start = "jdt-language-server"
|
||||||
|
|
||||||
|
[unitTest]
|
||||||
|
language = "java"
|
||||||
|
|
||||||
|
[nix]
|
||||||
|
channel = "stable-22_11"
|
||||||
|
|
||||||
|
[debugger]
|
||||||
|
support = true
|
||||||
|
|
||||||
|
[debugger.compile]
|
||||||
|
command = "javac -classpath .:/run_dir/junit-4.12.jar:target/dependency/* -g -d . $(find . -type f -name '*.java')"
|
||||||
|
|
||||||
|
[debugger.interactive]
|
||||||
|
transport = "localhost:0"
|
||||||
|
connectTimeout = 60
|
||||||
|
startCommand = "java-debug"
|
||||||
|
|
||||||
|
[debugger.interactive.initializeMessage]
|
||||||
|
command = "initialize"
|
||||||
|
type = "request"
|
||||||
|
|
||||||
|
[debugger.interactive.initializeMessage.arguments]
|
||||||
|
adapterID = "cppdbg"
|
||||||
|
clientID = "replit"
|
||||||
|
clientName = "replit.com"
|
||||||
|
columnsStartAt1 = true
|
||||||
|
linesStartAt1 = true
|
||||||
|
locale = "en-us"
|
||||||
|
pathFormat = "path"
|
||||||
|
supportsInvalidatedEvent = true
|
||||||
|
supportsProgressReporting = true
|
||||||
|
supportsRunInTerminalRequest = true
|
||||||
|
supportsVariablePaging = true
|
||||||
|
supportsVariableType = true
|
||||||
|
|
||||||
|
[debugger.interactive.launchMessage]
|
||||||
|
command = "launch"
|
||||||
|
type = "request"
|
||||||
|
|
||||||
|
[debugger.interactive.launchMessage.arguments]
|
||||||
|
classPaths = ["."]
|
||||||
|
mainClass = "Main"
|
||||||
|
|
||||||
|
[deployment]
|
||||||
|
build = "javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')"
|
||||||
|
run = "java -classpath .:target/dependency/* Main"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"version":2,"languages":{"java-maven":{"specfileHash":"3ff69d18804bae1a389cb7ea263f0c5b","lockfileHash":"3ff69d18804bae1a389cb7ea263f0c5b"}}}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Resent-3.3-source
|
||||||
|
the source code of resent client version 3.3
|
||||||
|
## This repository will be deleted imminently. Create a fresh fork ASAP to preserve it, you MUST fork a 100% fresh copy in order for the repository to be considered genuine
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package dev.resent;
|
||||||
|
|
||||||
|
import dev.resent.event.impl.Event;
|
||||||
|
import dev.resent.module.base.ModManager;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
|
public class Resent {
|
||||||
|
|
||||||
|
static {
|
||||||
|
INSTANCE = new Resent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String NAME = "Resent";
|
||||||
|
public static double VERSION = 3.3;
|
||||||
|
public static Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
public static Resent INSTANCE;
|
||||||
|
public ModManager modManager;
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
Resent.INSTANCE.modManager = new ModManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onEvent(Event e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package dev.resent.event.impl;
|
||||||
|
|
||||||
|
public abstract class Event{
|
||||||
|
|
||||||
|
public abstract boolean isCancelled();
|
||||||
|
public abstract void setCancelled(boolean cancelled);
|
||||||
|
public void setType(EventType type) { this.type = type; }
|
||||||
|
public EventType getType() { return type; }
|
||||||
|
|
||||||
|
public EventType type;
|
||||||
|
|
||||||
|
public boolean isPre(){
|
||||||
|
if(type == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return type == EventType.pre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPost(){
|
||||||
|
if(type == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return type == EventType.post;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum EventType {
|
||||||
|
pre,
|
||||||
|
post;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package dev.resent.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
public class EventAttack extends Event{
|
||||||
|
public Entity target;
|
||||||
|
public boolean cancelled;
|
||||||
|
|
||||||
|
public EventAttack(Entity target) { this.target = target; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() { return cancelled; }
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancelled) { this.cancelled = cancelled; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package dev.resent.module.base;
|
||||||
|
|
||||||
|
public enum Category {
|
||||||
|
HUD("Hud"),
|
||||||
|
MOVEMENT("Movement"),
|
||||||
|
MISC("Misc");
|
||||||
|
|
||||||
|
public final String name;
|
||||||
|
Category(String name){
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package dev.resent.module.base;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import dev.resent.Resent;
|
||||||
|
import dev.resent.event.impl.Event;
|
||||||
|
import dev.resent.setting.Setting;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
|
public class Mod {
|
||||||
|
|
||||||
|
public Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
public int keyCode;
|
||||||
|
|
||||||
|
public String name;
|
||||||
|
public Category category;
|
||||||
|
public boolean enabled = false;
|
||||||
|
public boolean hasSetting;
|
||||||
|
|
||||||
|
public List<Setting> settings = new ArrayList<>();
|
||||||
|
|
||||||
|
public Mod(String name, Category cat) {
|
||||||
|
this.name = name;
|
||||||
|
this.category = cat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mod(String name, Category cat, boolean hasSetting) {
|
||||||
|
this.name = name;
|
||||||
|
this.category = cat;
|
||||||
|
this.hasSetting = hasSetting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addSetting(Setting... settings) {
|
||||||
|
this.settings.addAll(Arrays.asList(settings));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onEnable() { }
|
||||||
|
public void onDisable() { }
|
||||||
|
|
||||||
|
public void toggle() {
|
||||||
|
this.enabled = !this.enabled;
|
||||||
|
if (this.enabled){
|
||||||
|
onEnable();
|
||||||
|
}else{
|
||||||
|
onDisable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onEvent(Event e){
|
||||||
|
for(int i = 0; i < Resent.INSTANCE.modManager.modules.size(); i++){
|
||||||
|
if(!Resent.INSTANCE.modManager.modules.get(i).isEnabled())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Resent.INSTANCE.modManager.modules.get(i).onEvent(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void setEnabled(boolean state) {
|
||||||
|
this.enabled = state;
|
||||||
|
if (this.enabled)
|
||||||
|
onEnable();
|
||||||
|
else
|
||||||
|
onDisable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package dev.resent.module.base;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import dev.resent.module.impl.hud.ArmorHud;
|
||||||
|
import dev.resent.module.impl.hud.CPS;
|
||||||
|
import dev.resent.module.impl.hud.ComboCounter;
|
||||||
|
import dev.resent.module.impl.hud.FPS;
|
||||||
|
import dev.resent.module.impl.hud.Freelook;
|
||||||
|
import dev.resent.module.impl.hud.Health;
|
||||||
|
import dev.resent.module.impl.hud.Hitboxes;
|
||||||
|
import dev.resent.module.impl.hud.Info;
|
||||||
|
import dev.resent.module.impl.hud.KeyStrokes;
|
||||||
|
import dev.resent.module.impl.hud.Ping;
|
||||||
|
import dev.resent.module.impl.hud.PotCounter;
|
||||||
|
import dev.resent.module.impl.hud.PotionHUD;
|
||||||
|
import dev.resent.module.impl.hud.ReachDisplay;
|
||||||
|
import dev.resent.module.impl.hud.ServerInfo;
|
||||||
|
import dev.resent.module.impl.hud.Watermark;
|
||||||
|
import dev.resent.module.impl.misc.Animations;
|
||||||
|
import dev.resent.module.impl.misc.AutoGG;
|
||||||
|
import dev.resent.module.impl.misc.AutoRespawn;
|
||||||
|
import dev.resent.module.impl.misc.ClearChat;
|
||||||
|
import dev.resent.module.impl.misc.Crosshair;
|
||||||
|
import dev.resent.module.impl.misc.DynamicFOV;
|
||||||
|
import dev.resent.module.impl.misc.FPSB;
|
||||||
|
import dev.resent.module.impl.misc.Fullbright;
|
||||||
|
import dev.resent.module.impl.misc.MinimalViewBobbing;
|
||||||
|
import dev.resent.module.impl.misc.NoHurtCam;
|
||||||
|
import dev.resent.module.impl.misc.NoParticles;
|
||||||
|
import dev.resent.module.impl.misc.NoRain;
|
||||||
|
import dev.resent.module.impl.misc.NoSwingDelay;
|
||||||
|
import dev.resent.module.impl.misc.Scoreboard;
|
||||||
|
import dev.resent.module.impl.misc.SelfNametag;
|
||||||
|
import dev.resent.module.impl.misc.Tooltips;
|
||||||
|
import dev.resent.module.impl.movement.Sprint;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
|
public class ModManager {
|
||||||
|
|
||||||
|
public List<Mod> modules = new ArrayList<>();
|
||||||
|
public Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
|
||||||
|
public static String currentModDragging = null;
|
||||||
|
|
||||||
|
public static Sprint sprint;
|
||||||
|
public static CPS cps;
|
||||||
|
public static KeyStrokes keyStrokes;
|
||||||
|
public static Fullbright fullbright;
|
||||||
|
public static ArmorHud armorHud;
|
||||||
|
public static NoRain noRain = new NoRain();
|
||||||
|
public static DynamicFOV dynamicFOV = new DynamicFOV();
|
||||||
|
public static PotionHUD potionHud;
|
||||||
|
public static NoHurtCam noHurtCam = new NoHurtCam();
|
||||||
|
public static Info coordinate;
|
||||||
|
public static FPS fps;
|
||||||
|
public static ReachDisplay reachDisplay;
|
||||||
|
public static AutoGG autoGG;
|
||||||
|
public static Freelook freelook;
|
||||||
|
public static ComboCounter comboCounter = new ComboCounter();
|
||||||
|
public static Hitboxes hitboxes = new Hitboxes();
|
||||||
|
public static Health health;
|
||||||
|
public static AutoRespawn autoRespawn;
|
||||||
|
//public static ChunkBorders chunkBorders;
|
||||||
|
public static NoParticles noParticles = new NoParticles();
|
||||||
|
public static Scoreboard scoreboard = new Scoreboard();
|
||||||
|
public static SelfNametag selfNametag = new SelfNametag();
|
||||||
|
public static ClearChat clearChat = new ClearChat();
|
||||||
|
public static Tooltips tooltips;
|
||||||
|
public static FPSB fpsb = new FPSB();
|
||||||
|
public static Animations animations = new Animations();
|
||||||
|
public static MinimalViewBobbing minimalViewBobbing = new MinimalViewBobbing();
|
||||||
|
public static Watermark watermark;
|
||||||
|
public static NoSwingDelay noSwingDelay;
|
||||||
|
public static PotCounter potCounter;
|
||||||
|
public static Ping ping;
|
||||||
|
public static ServerInfo serverInfo;
|
||||||
|
public static Crosshair crosshair = new Crosshair();
|
||||||
|
|
||||||
|
public ModManager() {
|
||||||
|
|
||||||
|
//Hud
|
||||||
|
register(ping = new Ping());
|
||||||
|
register(serverInfo = new ServerInfo());
|
||||||
|
register(watermark = new Watermark());
|
||||||
|
register(freelook = new Freelook());
|
||||||
|
register(fpsb);
|
||||||
|
register(keyStrokes = new KeyStrokes());
|
||||||
|
register(armorHud = new ArmorHud());
|
||||||
|
register(cps = new CPS());
|
||||||
|
register(potionHud = new PotionHUD());
|
||||||
|
register(reachDisplay = new ReachDisplay());
|
||||||
|
register(comboCounter);
|
||||||
|
register(coordinate = new Info());
|
||||||
|
register(fps = new FPS());
|
||||||
|
register(health = new Health());
|
||||||
|
register(potCounter = new PotCounter());
|
||||||
|
|
||||||
|
|
||||||
|
//Mechanic
|
||||||
|
register(crosshair);
|
||||||
|
register(autoRespawn = new AutoRespawn());
|
||||||
|
register(fullbright = new Fullbright());
|
||||||
|
register(noSwingDelay = new NoSwingDelay());
|
||||||
|
register(minimalViewBobbing);
|
||||||
|
register(noRain);
|
||||||
|
register(dynamicFOV);
|
||||||
|
register(sprint = new Sprint());
|
||||||
|
register(noHurtCam);
|
||||||
|
register(autoGG = new AutoGG());
|
||||||
|
register(hitboxes);
|
||||||
|
//register(chunkBorders = new ChunkBorders());
|
||||||
|
register(noParticles);
|
||||||
|
register(scoreboard );
|
||||||
|
//register(selfNametag = new SelfNametag());
|
||||||
|
register(clearChat);
|
||||||
|
register(tooltips = new Tooltips());
|
||||||
|
register(animations);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void register(Mod m) {
|
||||||
|
this.modules.add(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package dev.resent.module.base;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
|
||||||
|
public class RenderModule extends Mod {
|
||||||
|
|
||||||
|
public int x, y, width, height;
|
||||||
|
public int lastX;
|
||||||
|
public int lastY;
|
||||||
|
private boolean dragging;
|
||||||
|
public boolean hasSetting;
|
||||||
|
|
||||||
|
public RenderModule(String name, Category cat, int x, int y) {
|
||||||
|
super(name, cat);
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderModule(String name, Category cat, int x, int y, boolean hasSetting) {
|
||||||
|
super(name, cat, hasSetting);
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.hasSetting = hasSetting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void draw() { }
|
||||||
|
|
||||||
|
public void resize() {
|
||||||
|
if ((getX() + getWidth()) > GuiScreen.width) {
|
||||||
|
this.x = GuiScreen.width - getWidth();
|
||||||
|
dragging = false;
|
||||||
|
} else if ((getY() + getHeight()) > GuiScreen.height) {
|
||||||
|
this.y = GuiScreen.height - getHeight();
|
||||||
|
dragging = false;
|
||||||
|
} else if ((getX()) < 0) {
|
||||||
|
this.x = 0;
|
||||||
|
dragging = false;
|
||||||
|
} else if ((getY()) < 0) {
|
||||||
|
this.y = 0;
|
||||||
|
dragging = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void draggingFix(int mouseX, int mouseY) {
|
||||||
|
if (this.dragging) {
|
||||||
|
this.x = mouseX + this.lastX;
|
||||||
|
this.y = mouseY + this.lastY;
|
||||||
|
if(!Mouse.isButtonDown(0)) this.dragging = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderLayout(int mouseX, int mouseY) {
|
||||||
|
|
||||||
|
resize();
|
||||||
|
draw();
|
||||||
|
draggingFix(mouseX, mouseY);
|
||||||
|
|
||||||
|
boolean hovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + getWidth()
|
||||||
|
&& mouseY < getY() + this.getHeight();
|
||||||
|
|
||||||
|
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), hovered ? 0x50FFFFFF : 0x40FFFFFF);
|
||||||
|
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + 1, -1);
|
||||||
|
Gui.drawRect(this.x, this.y, this.x + 1, this.y + getHeight(), -1);
|
||||||
|
Gui.drawRect(this.x + this.getWidth() - 1, this.y, this.x + getWidth(), this.y + this.getHeight(), -1);
|
||||||
|
Gui.drawRect(this.x, this.y + this.getHeight() - 1, this.x + getWidth(), this.y + this.getHeight(), -1);
|
||||||
|
|
||||||
|
boolean mouseOverX = (mouseX >= this.getX() && mouseX <= this.getX()+this.getWidth());
|
||||||
|
boolean mouseOverY = (mouseY >= this.getY() && mouseY <= this.getY()+this.getHeight());
|
||||||
|
if(mouseOverX && mouseOverY){
|
||||||
|
if(Mouse.isButtonDown(0)){
|
||||||
|
if (!this.dragging) {
|
||||||
|
this.lastX = x - mouseX;
|
||||||
|
this.lastY = y - mouseY;
|
||||||
|
this.dragging = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getX() {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setX(int x) {
|
||||||
|
this.x = x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getY() {
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setY(int y) {
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWidth() {
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWidth(int width) {
|
||||||
|
this.width = width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHeight() {
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeight(int height) {
|
||||||
|
this.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package dev.resent.setting;
|
||||||
|
|
||||||
|
public class BooleanSetting extends Setting{
|
||||||
|
public boolean value;
|
||||||
|
|
||||||
|
public BooleanSetting(String name, String description, boolean value) {
|
||||||
|
super(name, description);
|
||||||
|
this.value = value;
|
||||||
|
this.gameSetting = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getValue() { return value; }
|
||||||
|
public void setValue(boolean value) { this.value = value; }
|
||||||
|
public void toggle(){ this.value = !this.value;}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package dev.resent.setting;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ModeSetting extends Setting{
|
||||||
|
public List<String> modes = new ArrayList<>();
|
||||||
|
|
||||||
|
public String current;
|
||||||
|
|
||||||
|
public int curr = 0;
|
||||||
|
|
||||||
|
public ModeSetting(String name, String description, String... modes) {
|
||||||
|
super(name, description);
|
||||||
|
Collections.addAll(this.modes, modes);
|
||||||
|
if (curr == this.modes.size()) {
|
||||||
|
curr = 0;
|
||||||
|
}
|
||||||
|
current = this.modes.get(curr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onChange() { }
|
||||||
|
|
||||||
|
public void setValue(String val) {
|
||||||
|
if (this.modes.contains(val)) {
|
||||||
|
this.current = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void next() {
|
||||||
|
++curr;
|
||||||
|
if (curr >= this.modes.size()) {
|
||||||
|
curr = 0;
|
||||||
|
}
|
||||||
|
current = this.modes.get(curr);
|
||||||
|
onChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void back() {
|
||||||
|
--curr;
|
||||||
|
if (curr <= this.modes.size()) {
|
||||||
|
curr = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
current = this.modes.get(curr);
|
||||||
|
onChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() { return current; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package dev.resent.setting;
|
||||||
|
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
|
||||||
|
public class NumberSetting extends Setting {
|
||||||
|
public float value;
|
||||||
|
public float increment;
|
||||||
|
public float decrement;
|
||||||
|
public float min;
|
||||||
|
public float max;
|
||||||
|
|
||||||
|
public NumberSetting(String name, String description, float value, float min, float max, float increment, float decrement) {
|
||||||
|
super(name, description);
|
||||||
|
this.value = value;
|
||||||
|
this.increment = increment;
|
||||||
|
this.decrement = decrement;
|
||||||
|
this.min = min;
|
||||||
|
this.max = max;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void incr() {
|
||||||
|
if (value + increment >= max) {
|
||||||
|
value = max;
|
||||||
|
} else {
|
||||||
|
value += increment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void decr() {
|
||||||
|
if (value - decrement <= min) {
|
||||||
|
value = min;
|
||||||
|
} else {
|
||||||
|
value -= decrement;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getIncrement() {
|
||||||
|
return increment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncrement(float increment) {
|
||||||
|
this.increment = increment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getDecrement() {
|
||||||
|
return decrement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDecrement(float decrement) {
|
||||||
|
this.decrement = decrement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getMin() {
|
||||||
|
return min;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMin(float min) {
|
||||||
|
this.min = min;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getMax() {
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMax(float max) {
|
||||||
|
this.max = max;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(float value) {
|
||||||
|
float newValue = 0;
|
||||||
|
for (float i = 0; (i - 1) * increment < value; i++) {
|
||||||
|
newValue = (i) * increment;
|
||||||
|
}
|
||||||
|
this.value = MathHelper.clamp_float(newValue, min, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package dev.resent.setting;
|
||||||
|
|
||||||
|
public class Setting {
|
||||||
|
|
||||||
|
public String name;
|
||||||
|
public boolean gameSetting;
|
||||||
|
public String description;
|
||||||
|
|
||||||
|
public Setting(String name, String description) {
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Setting(String name, String description, boolean gameSetting) {
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.gameSetting = gameSetting;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,278 @@
|
|||||||
|
package dev.resent.ui.mods;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import dev.resent.Resent;
|
||||||
|
import dev.resent.module.base.Mod;
|
||||||
|
import dev.resent.setting.BooleanSetting;
|
||||||
|
import dev.resent.setting.ModeSetting;
|
||||||
|
import dev.resent.setting.Setting;
|
||||||
|
import dev.resent.util.render.Color;
|
||||||
|
import dev.resent.util.render.RenderUtils;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
|
||||||
|
public class ClickGUI extends GuiScreen {
|
||||||
|
|
||||||
|
public Mod modWatching = null;
|
||||||
|
public ScaledResolution sr;
|
||||||
|
public int x, y, width, height;
|
||||||
|
public int offset = 0;
|
||||||
|
public FontRenderer fr;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||||
|
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
|
||||||
|
int xo = 0;
|
||||||
|
int xy = -30;
|
||||||
|
|
||||||
|
sr = new ScaledResolution(mc);
|
||||||
|
fr = Minecraft.getMinecraft().fontRendererObj;
|
||||||
|
width = GuiScreen.width - x;
|
||||||
|
height = GuiScreen.height - y;
|
||||||
|
x = sr.getScaledWidth() / 8 + xo;
|
||||||
|
y = sr.getScaledHeight() - 10 + xy;
|
||||||
|
int off = 0;
|
||||||
|
|
||||||
|
for (Mod m: Resent.INSTANCE.modManager.modules) {
|
||||||
|
int fh = fr.FONT_HEIGHT;
|
||||||
|
|
||||||
|
if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 - 1 - offset, this.x + 90 + xo - 1 + 21, height + 30 - fh * (-off) + 30 - 1 + 2 - 1 - offset) && m.hasSetting) {
|
||||||
|
// Open settings
|
||||||
|
this.modWatching = m;
|
||||||
|
} else if (isMouseInside(mouseX, mouseY, x - fr.FONT_HEIGHT + 2, height + 27 + fr.FONT_HEIGHT + 2, x - fr.FONT_HEIGHT + 6 + fr.getStringWidth("<"), height + 33 + fr.FONT_HEIGHT + 2 + fr.getStringWidth("<")) && mouseButton == 0) {
|
||||||
|
// Close settings
|
||||||
|
this.modWatching = null;
|
||||||
|
} else if (isMouseInside(mouseX, mouseY, width + 15, height - 10, width + 25, height + 7)) {
|
||||||
|
// Close ui
|
||||||
|
mc.displayGuiScreen(null);
|
||||||
|
this.modWatching = null;
|
||||||
|
} else if (isMouseInside(mouseX, mouseY, this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset) && mouseButton == 0 && modWatching == null) {
|
||||||
|
// Toggle mod
|
||||||
|
m.toggle();
|
||||||
|
} else if (isMouseInside(mouseX, mouseY, GuiScreen.width/2-fr.getStringWidth("Edit Layout")/2-5, GuiScreen.height-y-fr.FONT_HEIGHT, GuiScreen.width/2-fr.getStringWidth("Edit Layout")/2+5+fr.getStringWidth("Edit Layout"), GuiScreen.height-y+5) && mouseButton == 0){
|
||||||
|
mc.displayGuiScreen(new HUDConfigScreen());
|
||||||
|
this.modWatching = null;
|
||||||
|
}
|
||||||
|
if (xo > width / 2) {
|
||||||
|
xo = 0;
|
||||||
|
off += 3;
|
||||||
|
} else {
|
||||||
|
xo += 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modWatching != null) {
|
||||||
|
int var = 0;
|
||||||
|
fr.drawString("<", x - fr.FONT_HEIGHT + 4, height + 29 + fr.FONT_HEIGHT + 2, -1);
|
||||||
|
for (int asdf = 0; asdf < this.modWatching.settings.size(); asdf++) {
|
||||||
|
|
||||||
|
BooleanSetting b;
|
||||||
|
ModeSetting m;
|
||||||
|
Setting s = this.modWatching.settings.get(asdf);
|
||||||
|
|
||||||
|
if (s instanceof BooleanSetting) {
|
||||||
|
b = (BooleanSetting) s;
|
||||||
|
if (isMouseInside(mouseX, mouseY, this.x + 6 + 1 + 6, height - fr.FONT_HEIGHT + 50 - offset + var + 1, this.x + 15 - 1 + 6, height - fr.FONT_HEIGHT + 50 + fr.FONT_HEIGHT - offset + var - 1) && mouseButton == 0){
|
||||||
|
b.toggle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s instanceof ModeSetting) {
|
||||||
|
m = (ModeSetting) s;
|
||||||
|
if(isMouseInside(mouseX, mouseY, this.x+24, height-fr.FONT_HEIGHT+50+var, this.x+24+fr.getStringWidth(s.name+": "+m.getValue()), height-fr.FONT_HEIGHT+50+var+fr.FONT_HEIGHT) && mouseButton == 0)
|
||||||
|
m.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var += fr.FONT_HEIGHT + 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float par3) {
|
||||||
|
sr = new ScaledResolution(mc);
|
||||||
|
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
|
||||||
|
int xo = 0;
|
||||||
|
int xy = -30;
|
||||||
|
|
||||||
|
fr = Minecraft.getMinecraft().fontRendererObj;
|
||||||
|
width = GuiScreen.width - x;
|
||||||
|
height = GuiScreen.height - y;
|
||||||
|
x = sr.getScaledWidth() / 8 + xo;
|
||||||
|
y = sr.getScaledHeight() - 10 + xy;
|
||||||
|
int off = 0;
|
||||||
|
|
||||||
|
// background
|
||||||
|
Gui.drawRect(x - 10, y + 20, width + 35, height - 10, new Color(35, 39, 42, 200).getRGB());
|
||||||
|
fr.drawString(Resent.NAME + " Client " + Resent.VERSION, x + 8, height - 2, -1);
|
||||||
|
RenderUtils.drawRectOutline(GuiScreen.width/2-fr.getStringWidth("Edit Layout")/2-5, GuiScreen.height - y - fr.FONT_HEIGHT, GuiScreen.width / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), GuiScreen.height - y + 5, -1);
|
||||||
|
Gui.drawRect(GuiScreen.width/2-fr.getStringWidth("Edit Layout")/2-4,
|
||||||
|
GuiScreen.height - y - fr.FONT_HEIGHT+1,
|
||||||
|
GuiScreen.width / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout")-1,
|
||||||
|
GuiScreen.height - y + 4, isMouseInside(mouseX, mouseY, GuiScreen.width/2-fr.getStringWidth("Edit Layout")/2-4,
|
||||||
|
GuiScreen.height - y - fr.FONT_HEIGHT+1,
|
||||||
|
GuiScreen.width / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout")-1,
|
||||||
|
GuiScreen.height - y + 4) ? new Color(105, 105, 105, 65).getRGB()
|
||||||
|
: new Color(211, 211, 211, 65).getRGB());
|
||||||
|
|
||||||
|
fr.drawStringWithShadow("Edit Layout", GuiScreen.width / 2 - fr.getStringWidth("Edit Layout") / 2 + 1,
|
||||||
|
GuiScreen.height - y - fr.FONT_HEIGHT + fr.FONT_HEIGHT / 2 - 1, -1);
|
||||||
|
|
||||||
|
// close
|
||||||
|
// RenderUtils.drawRectOutline(width+15, height-5, width+26, height+8, new Color(200, 200, 200, 90).getRGB());
|
||||||
|
fr.drawString("X", width + 18, height - 2, -1);
|
||||||
|
|
||||||
|
// white line
|
||||||
|
Gui.drawRect(x - 8, height + 29, width + 33, height + 30, -1);
|
||||||
|
|
||||||
|
for (Mod m : Resent.INSTANCE.modManager.modules) {
|
||||||
|
if (this.modWatching == null) {
|
||||||
|
int fh = fr.FONT_HEIGHT;
|
||||||
|
if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29
|
||||||
|
&& height + 30 - fh * (-off) + 30 + 2 - offset < y + 20){
|
||||||
|
|
||||||
|
// Enabled outline
|
||||||
|
RenderUtils.drawRectOutline(this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset,
|
||||||
|
this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset,
|
||||||
|
m.isEnabled() ? Color.GREEN.getRGB()
|
||||||
|
: Color.RED.getRGB());
|
||||||
|
Gui.drawRect(this.x + 10 + xo - 1 + 10, height - 2 - fh * -(off) + 50 - 1 - offset,
|
||||||
|
this.x + 90 + xo - 1 + 22, height + 30 - fh * (-off) + 30 - 1 + 2 - offset,
|
||||||
|
isMouseInside(mouseX, mouseY, this.x + 10 + xo - 1 + 10,
|
||||||
|
height - 2 - fh * -(off) + 50 - 1 - offset, this.x + 90 + xo - 1 + 22,
|
||||||
|
height + 30 - fh * (-off) + 30 - 1 + 2 - offset)
|
||||||
|
? new Color(105, 105, 105, 65).getRGB()
|
||||||
|
: new Color(211, 211, 211, 65).getRGB());
|
||||||
|
|
||||||
|
if (m.hasSetting) {
|
||||||
|
fr.drawString("o", this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 + 1 - offset, isMouseInside(mouseX, mouseY, this.x+90+xo-1+10, height-2-fh*-(off)+51+1-offset, this.x+90+xo-1+10+fr.getStringWidth("o"), height-2-fh*-(off)+51+1-offset+fr.FONT_HEIGHT) ? new Color(105, 105, 105, 65).getRGB() : -1);
|
||||||
|
//RenderUtils.drawRectOutline(this.x+90+xo-1+10, height-2-fh*-(off)+51+1-offset, this.x+90+xo-1+10+fr.getStringWidth("o"), height-2-fh*-(off)+51+1-offset+fr.FONT_HEIGHT, -1);
|
||||||
|
//fr.drawString("+", this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 + 1 - offset, -1);
|
||||||
|
//fr.drawString(" x", this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 + 1 - offset, -1);
|
||||||
|
// Gui.drawRect(this.x+90+xo-1+10, height-2-fh*-(off)+51-1-offset,
|
||||||
|
// this.x+90+xo-1+21, height+30-fh*(-off)+30-1+2-1-offset, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
fr.drawStringWithShadow(m.name,
|
||||||
|
this.x + 15 + 7 + xo, height - fh * -(off) + 50 - offset, -1);
|
||||||
|
}
|
||||||
|
} else if (this.modWatching != null) {
|
||||||
|
|
||||||
|
int var = 0;
|
||||||
|
fr.drawString("<", x - fr.FONT_HEIGHT + 4, height + 29 + fr.FONT_HEIGHT + 2, -1);
|
||||||
|
fr.drawStringWithShadow("Resent - " + modWatching.name,
|
||||||
|
GuiScreen.width / 2 - (fr.getStringWidth("Resent - " + modWatching.name) / 2),
|
||||||
|
height + 29 - fr.FONT_HEIGHT - 2, -1);
|
||||||
|
|
||||||
|
for (int amogus = 0; amogus < this.modWatching.settings.size(); amogus++) {
|
||||||
|
BooleanSetting b;
|
||||||
|
ModeSetting mo = null;
|
||||||
|
Setting s = this.modWatching.settings.get(amogus);
|
||||||
|
if (s instanceof BooleanSetting) {
|
||||||
|
b = (BooleanSetting) s;
|
||||||
|
RenderUtils.drawRectOutline(this.x + 6 + 6, height - fr.FONT_HEIGHT + 50 + var, this.x + 15 + 6, height - fr.FONT_HEIGHT + 50 + fr.FONT_HEIGHT + var, b.getValue() ? Color.GREEN.getRGB() : Color.RED.getRGB());
|
||||||
|
Gui.drawRect(this.x + 6 + 1 + 6, height - fr.FONT_HEIGHT + 50 + var + 1, this.x + 15 - 1 + 6, height - fr.FONT_HEIGHT + 50 + fr.FONT_HEIGHT + var - 1,
|
||||||
|
isMouseInside(mouseX, mouseY, this.x + 6 + 1 + 6, height - fr.FONT_HEIGHT + 50 + var + 1, this.x + 15 - 1 + 6, height - fr.FONT_HEIGHT + 50 + fr.FONT_HEIGHT + var - 1) ? new Color(211, 211, 211, 65).getRGB() : new Color(105, 105, 105, 65).getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s instanceof ModeSetting) {
|
||||||
|
mo = (ModeSetting) s;
|
||||||
|
//RenderUtils.drawRectOutline(this.x+18+6-2, height-fr.FONT_HEIGHT+50+var, this.x+18+6+fr.getStringWidth(this.modWatching.settings.get(amogus).name + ": " + m.getValue() + 2), height-fr.FONT_HEIGHT+50+var+fr.FONT_HEIGHT, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s instanceof ModeSetting) {
|
||||||
|
/*RenderUtils.drawRectOutline(this.x+24-fr.FONT_HEIGHT-2,
|
||||||
|
this.height-fr.FONT_HEIGHT+50+var, this.x+24,
|
||||||
|
this.height-fr.FONT_HEIGHT+50+var+fr.FONT_HEIGHT, -1);
|
||||||
|
RenderUtils.drawRectOutline(
|
||||||
|
this.x + 24,
|
||||||
|
this.height - fr.FONT_HEIGHT + 50 + var,
|
||||||
|
this.x + 24
|
||||||
|
+ fr.getStringWidth(
|
||||||
|
s.name + ": " + m.getValue())
|
||||||
|
+ 2,
|
||||||
|
this.height - fr.FONT_HEIGHT + 50 + var + fr.FONT_HEIGHT, -1);*/
|
||||||
|
//RenderUtils.drawRectOutline(this.x+24, height-fr.FONT_HEIGHT+50+var, this.x+24+fr.getStringWidth(s.name+": "+m.getValue()), height-fr.FONT_HEIGHT+50+var+fr.FONT_HEIGHT, -1);
|
||||||
|
fr.drawStringWithShadow(s.name + ": " + mo.getValue(),
|
||||||
|
this.x + 18 + 6, height - fr.FONT_HEIGHT + 50 + var, -1);
|
||||||
|
} else {
|
||||||
|
fr.drawStringWithShadow(s.name, this.x + 18 + 6,
|
||||||
|
height - fr.FONT_HEIGHT + 50 + var, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var += fr.FONT_HEIGHT + 2;
|
||||||
|
}
|
||||||
|
// RenderUtils.drawRectOutline(x-fr.FONT_HEIGHT+2,
|
||||||
|
// height+27+fr.FONT_HEIGHT+2,x-fr.FONT_HEIGHT+6+fr.getStringWidth("<"),
|
||||||
|
// height+33+fr.FONT_HEIGHT+2+fr.getStringWidth("<"), new Color(200, 200,
|
||||||
|
// 200,90).getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (xo > width / 2) {
|
||||||
|
xo = 0;
|
||||||
|
off += 3;
|
||||||
|
} else {
|
||||||
|
xo += 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean doesGuiPauseGame() { return false; }
|
||||||
|
public boolean isMouseInside(int mouseX, int mouseY, int x, int y, int width, int height) { return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height); }
|
||||||
|
public void onGuiClosed() { Keyboard.enableRepeatEvents(true); mc.gameSettings.saveOptions(); }
|
||||||
|
@Override
|
||||||
|
public void initGui(){ mc.gameSettings.loadOptions(); }
|
||||||
|
protected void keyTyped(char par1, int par2) { if (par2 == 0x01 || par2 == Minecraft.getMinecraft().gameSettings.keyBindClickGui.keyCode) { mc.displayGuiScreen(null); } }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMouseInput() {
|
||||||
|
if (getListMaxScroll() + this.height >= this.height) {
|
||||||
|
int wheel = Mouse.getEventDWheel();
|
||||||
|
if (wheel < 0) {
|
||||||
|
new Thread(() -> {
|
||||||
|
for (int i = 0; i < 20; i++) {
|
||||||
|
offset = MathHelper.clamp_int(offset + 1, 0, getListMaxScroll());
|
||||||
|
try {
|
||||||
|
Thread.sleep(1);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
} else if (wheel > 0) {
|
||||||
|
new Thread(() -> {
|
||||||
|
for (int i = 0; i < 20; i++) {
|
||||||
|
offset = MathHelper.clamp_int(offset - 1, 0, getListMaxScroll());
|
||||||
|
try {
|
||||||
|
Thread.sleep(1);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
super.handleMouseInput();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getListMaxScroll() {
|
||||||
|
return 60 + 70 - this.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
/*package dev.resent.ui.mods;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import dev.resent.Resent;
|
||||||
|
import dev.resent.module.base.Mod;
|
||||||
|
import dev.resent.setting.BooleanSetting;
|
||||||
|
import dev.resent.setting.Setting;
|
||||||
|
import dev.resent.util.misc.Keyboard;
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.src.GuiButton;
|
||||||
|
import net.minecraft.src.GuiScreen;
|
||||||
|
import net.minecraft.src.GuiTextField;
|
||||||
|
import net.minecraft.src.MathHelper;
|
||||||
|
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
public class GuiScreenModule extends GuiScreen {
|
||||||
|
|
||||||
|
protected String screenTitle = "Resent";
|
||||||
|
public int mcount = 0;
|
||||||
|
public ArrayList<Mod> modules = new ArrayList<>();
|
||||||
|
public boolean watchingMod = false;
|
||||||
|
public Mod modWatching = null;
|
||||||
|
public String searchString = "";
|
||||||
|
public GuiTextField search;
|
||||||
|
public int offset = 0;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void mouseClicked(int mouseX, int mouseY, int par3) {
|
||||||
|
if (watchingMod == false && modWatching == null) {
|
||||||
|
this.search.mouseClicked(mouseX, mouseY, par3);
|
||||||
|
int i = 0;
|
||||||
|
for (int z = 0; z < Resent.INSTANCE.modManager.modules.size(); z++) {
|
||||||
|
Mod m = Resent.INSTANCE.modManager.modules.get(z);
|
||||||
|
if (m.name.toLowerCase().contains(this.searchString.toLowerCase())) {
|
||||||
|
int x = 10;
|
||||||
|
int y = (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 10 - offset;
|
||||||
|
int width = MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10 - x;
|
||||||
|
int height = (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 60 - offset - y;
|
||||||
|
if ((mouseX >= x && mouseX <= x + width && mouseY >= y && mouseY <= y + height && par3 == 0)
|
||||||
|
&& !(mouseX >= x + 5 && mouseX <= x + width - 5 && mouseY >= y + height - 5 - 15
|
||||||
|
&& mouseY <= y + height - 5))
|
||||||
|
m.toggle();
|
||||||
|
if (par3 == 0 && mouseX >= x + 5 && mouseX <= x + width - 5 && mouseY >= y + height - 5 - 15
|
||||||
|
&& mouseY <= y + height - 5) {
|
||||||
|
this.modWatching = m;
|
||||||
|
this.watchingMod = true;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Mod m1 = this.modWatching;
|
||||||
|
if (par3 == 0 && mouseX >= (10 + fontRenderer.FONT_HEIGHT + 6) / 2 / 2
|
||||||
|
&& mouseX <= (10 + fontRenderer.FONT_HEIGHT + 6) / 2 / 2 + (10 + fontRenderer.FONT_HEIGHT + 6) / 2
|
||||||
|
&& mouseY >= (10 + fontRenderer.FONT_HEIGHT + 6) / 2 / 2
|
||||||
|
&& mouseY <= (10 + fontRenderer.FONT_HEIGHT + 6) / 2 / 2
|
||||||
|
+ (10 + fontRenderer.FONT_HEIGHT + 6) / 2) {
|
||||||
|
watchingMod = false;
|
||||||
|
modWatching = null;
|
||||||
|
}else {
|
||||||
|
int i = 0;
|
||||||
|
Mod m = this.modWatching;
|
||||||
|
for (int amongus = 0; amongus < m.settings.size(); amongus++) {
|
||||||
|
Setting s = m.settings.get(amongus);
|
||||||
|
BooleanSetting bS = null;
|
||||||
|
if (s instanceof BooleanSetting) {
|
||||||
|
bS = (BooleanSetting) s;
|
||||||
|
}
|
||||||
|
|
||||||
|
int x = 10;
|
||||||
|
int y = (fontRenderer.FONT_HEIGHT * 2 + 45) + 60 * i + 10 - offset;
|
||||||
|
int width = MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10 - x;
|
||||||
|
int height = (fontRenderer.FONT_HEIGHT * 2 + 45) + 60 * i + 60 - offset - y;
|
||||||
|
if (isMouseInside(mouseX, mouseY, 10, (fontRenderer.FONT_HEIGHT*2+45)+60*i+10-offset,
|
||||||
|
MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10,
|
||||||
|
(10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 60 - offset) && par3 == 0) {
|
||||||
|
if (bS != null) {
|
||||||
|
bS.setValue(!bS.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.mouseClicked(mouseX, mouseY, par3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawScreen(int mx, int my, float par3) {
|
||||||
|
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
|
||||||
|
|
||||||
|
Gui.drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4), this.height, 0xFF090909);
|
||||||
|
if (!this.watchingMod && this.modWatching == null) {
|
||||||
|
int i = 0;
|
||||||
|
for (int z = 0; z < Resent.INSTANCE.modManager.modules.size(); z++) {
|
||||||
|
Mod m = Resent.INSTANCE.modManager.modules.get(z);
|
||||||
|
if (m.name.toLowerCase().contains(this.searchString.toLowerCase())) {
|
||||||
|
int frho = (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10 + 60 * i + 60 - offset);
|
||||||
|
int x = 10;
|
||||||
|
int y = (fontRenderer.FONT_HEIGHT*2+45) + 60 * i + 10 - offset;
|
||||||
|
int width = MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10 - x;
|
||||||
|
int height = frho - y;
|
||||||
|
Gui.drawRect(10, (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 10 - offset,
|
||||||
|
MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10,
|
||||||
|
frho, 0xff1c1c1c);
|
||||||
|
fontRenderer.drawString(m.name, 20,
|
||||||
|
(10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 10 - offset + 10, -1);
|
||||||
|
|
||||||
|
Gui.drawRect(x, y, x + width, y + 1, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
|
||||||
|
Gui.drawRect(x, y, x + 1, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
|
||||||
|
Gui.drawRect(x + width - 1, y, x + width, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
|
||||||
|
Gui.drawRect(x, y + height - 1, x + width, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
|
||||||
|
|
||||||
|
Gui.drawRect(x + 5, y + height - 5 - 15, x + width - 5, y + height - 5, 0xff333333);
|
||||||
|
fontRenderer.drawString("Settings",
|
||||||
|
(x + width / 2) - fontRenderer.getStringWidth("Settings") / 2,
|
||||||
|
y + height - 5 - 15 + fontRenderer.FONT_HEIGHT / 2, -1);
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Gui.drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4),
|
||||||
|
10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10, 0xFF090909);
|
||||||
|
this.search.drawTextBox();
|
||||||
|
fontRenderer.drawString(screenTitle + " - ClickGui", this.width / 4 / 2 - fontRenderer.getStringWidth(screenTitle + "") / 2,
|
||||||
|
10,
|
||||||
|
-1);
|
||||||
|
} else {
|
||||||
|
int frho3 = (10+fontRenderer.FONT_HEIGHT+6)/2/2;
|
||||||
|
Gui.drawRect(frho3, frho3, frho3+(10+fontRenderer.FONT_HEIGHT+6)/2, frho3+(10+fontRenderer.FONT_HEIGHT+6)/2,0xff1c1c1c);
|
||||||
|
fontRenderer.drawString("<", frho3+frho3-fontRenderer.getStringWidth("<")/2, frho3+frho3-fontRenderer.FONT_HEIGHT/2, -1);
|
||||||
|
fontRenderer.drawString(screenTitle + " - "+modWatching.name, MathHelper.clamp_int(this.width/4, 200, this.width/4)/2-fontRenderer.getStringWidth(screenTitle + " - "+modWatching.name)/2, 10, -1);
|
||||||
|
Gui.drawRect(0, 10+fontRenderer.FONT_HEIGHT+6, MathHelper.clamp_int(this.width/4, 200, this.width/4), 10+fontRenderer.FONT_HEIGHT+7, -1);
|
||||||
|
int i = 0;
|
||||||
|
Mod m = this.modWatching;
|
||||||
|
for (int amongus = 0; amongus < m.settings.size(); amongus++) {
|
||||||
|
Setting s = m.settings.get(amongus);
|
||||||
|
BooleanSetting bS = null;
|
||||||
|
if (s instanceof BooleanSetting) {
|
||||||
|
bS = (BooleanSetting)s;
|
||||||
|
}
|
||||||
|
|
||||||
|
int x = 10;
|
||||||
|
int y = (fontRenderer.FONT_HEIGHT*2+45)+60*i+10-offset;
|
||||||
|
int frho1 = (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10);
|
||||||
|
int width = MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10 - x;
|
||||||
|
int height = (fontRenderer.FONT_HEIGHT*2+45)+60*i+60-offset-y;
|
||||||
|
Gui.drawRect(10, y,
|
||||||
|
MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10,
|
||||||
|
frho1 + 60 * i + 60 - offset, 0xff1c1c1c);
|
||||||
|
fontRenderer.drawString(s.name, 20,frho1 + 60 * i + 10 - offset + 10, -1);
|
||||||
|
|
||||||
|
if (bS != null) {
|
||||||
|
Gui.drawRect(x, y, x + width, y + 1, bS.getValue() ? 0xff009e00 : 0xff9e0000);
|
||||||
|
Gui.drawRect(x, y, x + 1, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
|
||||||
|
Gui.drawRect(x + width - 1, y, x + width, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
|
||||||
|
Gui.drawRect(x, y + height - 1, x + width, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.drawScreen(mx, my, par3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||||
|
if (par1GuiButton.id == 200) {
|
||||||
|
this.mc.displayGuiScreen(null);
|
||||||
|
}else if (par1GuiButton.id == 5) {
|
||||||
|
mc.displayGuiScreen(new HUDConfigScreen());
|
||||||
|
}else if (par1GuiButton.id == 2) {
|
||||||
|
mc.displayGuiScreen(new ClickGUI());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (par1GuiButton.id != 200 && par1GuiButton.id != 5 && par1GuiButton.id != 2) {
|
||||||
|
this.mc.displayGuiScreen(new GuiScreenModule());
|
||||||
|
}
|
||||||
|
super.actionPerformed(par1GuiButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean doesGuiPauseGame() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateScreen() {
|
||||||
|
this.search.updateCursorCounter();
|
||||||
|
super.updateScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void keyTyped(char par1, int par2) {
|
||||||
|
this.search.textboxKeyTyped(par1, par2);
|
||||||
|
searchString = this.search.getText();
|
||||||
|
if (par2 == Keyboard.KEY_ESCAPE || par2 == Minecraft.getMinecraft().gameSettings.keyBindClickGui.keyCode)
|
||||||
|
mc.displayGuiScreen(null);
|
||||||
|
super.keyTyped(par1, par2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMouseInput() {
|
||||||
|
if (getListMaxScroll() + this.height >= this.height) {
|
||||||
|
int wheel = EaglerAdapter.mouseGetEventDWheel();
|
||||||
|
if (wheel < 0) {
|
||||||
|
for (int i = 0; i < 20; i++) {
|
||||||
|
offset = MathHelper.clamp_int(offset + 1, 0, getListMaxScroll());
|
||||||
|
}
|
||||||
|
} else if (wheel > 0) {
|
||||||
|
for (int i = 0; i < 20; i++) {
|
||||||
|
offset = MathHelper.clamp_int(offset - 1, 0, getListMaxScroll());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.handleMouseInput();
|
||||||
|
}
|
||||||
|
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getListMaxScroll() {
|
||||||
|
int mods = 0;
|
||||||
|
int i = 0;
|
||||||
|
for (int z = 0; z < Resent.INSTANCE.modManager.modules.size(); z++) {
|
||||||
|
Mod m = Resent.INSTANCE.modManager.modules.get(z);
|
||||||
|
if (m.name.toLowerCase().contains(this.searchString.toLowerCase())) {
|
||||||
|
mods++;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 60 * mods + 70 - this.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initGui() {
|
||||||
|
this.buttonList.add(new GuiButton(200, this.width - 200, this.height - 20, 100, 20, "Back"));
|
||||||
|
this.buttonList.add(new GuiButton(5, this.width - 100, this.height - 20, 100, 20, "Modify HUD"));
|
||||||
|
this.buttonList.add(new GuiButton(2, this.width - 300, this.height - 20, 100, 20, "Test"));
|
||||||
|
search = new GuiTextField(fontRenderer, 10, 10 + fontRenderer.FONT_HEIGHT * 2,
|
||||||
|
MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 20, 15);
|
||||||
|
this.search.custom = true;
|
||||||
|
this.search.setText(searchString);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onGuiClosed() {
|
||||||
|
EaglerAdapter.enableRepeatEvents(false);
|
||||||
|
mc.gameSettings.saveOptions();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMouseInside(int mouseX, int mouseY, int x, int y, int width, int height) {
|
||||||
|
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
|
||||||
|
}
|
||||||
|
|
||||||
|
}*/
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package dev.resent.ui.mods;
|
||||||
|
|
||||||
|
import dev.resent.Resent;
|
||||||
|
import dev.resent.module.base.RenderModule;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||||
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
public class HUDConfigScreen extends GuiScreen {
|
||||||
|
|
||||||
|
public void initGui() {
|
||||||
|
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 148, "Back"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onGuiClosed() {
|
||||||
|
Keyboard.enableRepeatEvents(false); mc.gameSettings.saveOptions();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawScreen(int mx, int my, float par3) {
|
||||||
|
this.drawDefaultBackground();
|
||||||
|
for (int i = 0; i < Resent.INSTANCE.modManager.modules.size(); i++) {
|
||||||
|
if (Resent.INSTANCE.modManager.modules.get(i).isEnabled() && (Resent.INSTANCE.modManager.modules.get(i) instanceof RenderModule)) {
|
||||||
|
((RenderModule)Resent.INSTANCE.modManager.modules.get(i)).renderLayout(mx, my);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.drawScreen(mx, my, par3);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||||
|
if (par1GuiButton.id == 200) {
|
||||||
|
this.mc.displayGuiScreen(new ClickGUI());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean doesGuiPauseGame() { return false; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/*package dev.resent.ui.mods;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import dev.resent.setting.BooleanSetting;
|
||||||
|
import dev.resent.setting.Setting;
|
||||||
|
import dev.resent.util.misc.Keyboard;
|
||||||
|
import dev.resent.util.render.Color;
|
||||||
|
import dev.resent.util.render.RenderUtils;
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
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.MathHelper;
|
||||||
|
import net.minecraft.src.ScaledResolution;
|
||||||
|
|
||||||
|
public class Settings extends GuiScreen {
|
||||||
|
|
||||||
|
public ScaledResolution sr;
|
||||||
|
|
||||||
|
public List<Setting> settings = new ArrayList<>(); //TODO: bind module class arrays with setting arrays
|
||||||
|
public int x, y, width, height;
|
||||||
|
public int offset = 0;
|
||||||
|
public float offsety = 20;
|
||||||
|
public FontRenderer fr;
|
||||||
|
|
||||||
|
//Temporary test settings
|
||||||
|
public static BooleanSetting rain = new BooleanSetting("Rain", "", false);
|
||||||
|
public static BooleanSetting scoreboard = new BooleanSetting("Scoreboard", "", true);
|
||||||
|
public static BooleanSetting nametag = new BooleanSetting("Self Nametags", "", true);
|
||||||
|
|
||||||
|
public Settings() {
|
||||||
|
addSetting(rain, scoreboard, nametag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addSetting(Setting... setting) {
|
||||||
|
for (Setting s : setting)
|
||||||
|
this.settings.add(s);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||||
|
int ox = 10;
|
||||||
|
int oy = -30;
|
||||||
|
sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||||
|
fr = Minecraft.getMinecraft().fontRenderer;
|
||||||
|
width = GuiScreen.width-x;
|
||||||
|
height = GuiScreen.height-y;
|
||||||
|
x = sr.getScaledWidth()/8 + ox;
|
||||||
|
y = sr.getScaledHeight()/(int)1.1-10+oy;
|
||||||
|
int off = 0;
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < settings.size(); i++) {
|
||||||
|
|
||||||
|
//bolean setting
|
||||||
|
if (mouseButton == 0 && isMouseInside(mouseX, mouseY, this.x+3+5, height-2-fr.FONT_HEIGHT*-(off), this.x+12+5, height-2-fr.FONT_HEIGHT*(-off)+fr.FONT_HEIGHT) && settings.get(i) instanceof BooleanSetting) {
|
||||||
|
Setting s = settings.get(i);
|
||||||
|
BooleanSetting b = (BooleanSetting) s;
|
||||||
|
b.setValue(!b.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
off += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float par3) {
|
||||||
|
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
|
||||||
|
int xo = 10;
|
||||||
|
int xy = -30;
|
||||||
|
|
||||||
|
sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||||
|
fr = Minecraft.getMinecraft().fontRenderer;
|
||||||
|
width = GuiScreen.width-x;
|
||||||
|
height = GuiScreen.height-y;
|
||||||
|
x = sr.getScaledWidth()/8+xo;
|
||||||
|
y = sr.getScaledHeight()/(int)1.1-10+xy;
|
||||||
|
int off = 0;
|
||||||
|
|
||||||
|
//background
|
||||||
|
RenderUtils.drawRoundedRect(x, y, width, height, 4, Color.DARK_GRAY.getRGB());
|
||||||
|
|
||||||
|
//for each settings it will do this, i dont use i as offset because it made it weird idk
|
||||||
|
for (int i = 0; i < settings.size(); i++) {
|
||||||
|
|
||||||
|
Setting s = settings.get(i);
|
||||||
|
int fh = fr.FONT_HEIGHT;
|
||||||
|
|
||||||
|
//booleansetting
|
||||||
|
|
||||||
|
//if its current module is a boolean setting
|
||||||
|
if (settings.get(i) instanceof BooleanSetting) {
|
||||||
|
BooleanSetting b = (BooleanSetting) s;
|
||||||
|
//Draw enabled outline
|
||||||
|
RenderUtils.drawRectOutline(this.x+3+5, height-2-fh*-(off)-offset, this.x+12+5,
|
||||||
|
height-2-fh*(-off)+fh-offset,
|
||||||
|
b.getValue() ? Color.GREEN.getRGB() : Color.RED.getRGB());
|
||||||
|
|
||||||
|
//Draw outline fill
|
||||||
|
Gui.drawRect(this.x+4+5, height-1-fh*-(off)-offset, this.x+11+5,
|
||||||
|
height-3-fh*(-off)+fh-offset, isMouseInside(mouseX, mouseY, this.x+4+5,
|
||||||
|
height-1-fh*-(off)-offset, this.x+11+5,
|
||||||
|
height-3-fh*(-off)+fh-offset) ? Color.LIGHT_GRAY.getRGB() : Color.GRAY.getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Sort settings based on length
|
||||||
|
settings.sort(Comparator.comparingInt(set -> fr.getStringWidth(((Setting) set).name)).reversed());
|
||||||
|
|
||||||
|
|
||||||
|
//Draw setting name
|
||||||
|
fr.drawStringWithShadow(settings.get(i).name, this.x+15+5, height-2-fh*-(off)-offset,-1);
|
||||||
|
|
||||||
|
off += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean doesGuiPauseGame() { return false; }
|
||||||
|
public boolean isMouseInside(int mouseX, int mouseY, int x, int y, int width, int height) { return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height); }
|
||||||
|
public void onGuiClosed() { EaglerAdapter.enableRepeatEvents(false); mc.gameSettings.saveOptions(); }
|
||||||
|
protected void keyTyped(char par1, int par2) { if (par2 == Keyboard.KEY_ESCAPE || par2 == Minecraft.getMinecraft().gameSettings.keyBindClickGui.keyCode) { mc.displayGuiScreen(null); } }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMouseInput() {
|
||||||
|
if (getListMaxScroll() + this.height >= this.height) {
|
||||||
|
int wheel = EaglerAdapter.mouseGetEventDWheel();
|
||||||
|
if (wheel < 0) {
|
||||||
|
for (int i = 0; i < 20; i++) {
|
||||||
|
offset = MathHelper.clamp_int(offset + 1, 0, getListMaxScroll());
|
||||||
|
}
|
||||||
|
} else if (wheel > 0) {
|
||||||
|
for (int i = 0; i < 20; i++) {
|
||||||
|
offset = MathHelper.clamp_int(offset - 1, 0, getListMaxScroll());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.handleMouseInput();
|
||||||
|
}
|
||||||
|
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getListMaxScroll() {
|
||||||
|
return 70 - this.height;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package dev.resent.util.misc;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
public class FuncUtils {
|
||||||
|
public static <T> boolean removeIf(Collection<T> collection, Predicate<T> pre) {
|
||||||
|
boolean ret = false;
|
||||||
|
Iterator<T> itr = collection.iterator();
|
||||||
|
while (itr.hasNext()) {
|
||||||
|
if (pre.test(itr.next())) {
|
||||||
|
itr.remove();
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package dev.resent.util.misc;
|
||||||
|
|
||||||
|
import dev.resent.module.base.ModManager;
|
||||||
|
import dev.resent.module.impl.hud.ComboCounter;
|
||||||
|
import dev.resent.module.impl.hud.Freelook;
|
||||||
|
import dev.resent.module.impl.hud.Hitboxes;
|
||||||
|
import dev.resent.module.impl.misc.AutoGG;
|
||||||
|
import dev.resent.module.impl.misc.ClearChat;
|
||||||
|
import dev.resent.module.impl.misc.DynamicFOV;
|
||||||
|
import dev.resent.module.impl.misc.FPSB;
|
||||||
|
import dev.resent.module.impl.misc.NoHurtCam;
|
||||||
|
import dev.resent.module.impl.misc.NoParticles;
|
||||||
|
import dev.resent.module.impl.misc.NoRain;
|
||||||
|
import dev.resent.module.impl.misc.Scoreboard;
|
||||||
|
import dev.resent.module.impl.misc.SelfNametag;
|
||||||
|
|
||||||
|
public class W {
|
||||||
|
|
||||||
|
public static NoRain noRain(){ return ModManager.noRain; }
|
||||||
|
public static DynamicFOV dynamicFOV(){ return ModManager.dynamicFOV; }
|
||||||
|
public static NoHurtCam noHurtCam(){ return ModManager.noHurtCam; }
|
||||||
|
public static AutoGG autoGG() { return ModManager.autoGG; }
|
||||||
|
public static Freelook freelook(){ return ModManager.freelook; }
|
||||||
|
public static ComboCounter comboCounter(){ return ModManager.comboCounter; }
|
||||||
|
public static Hitboxes hitboxes(){ return ModManager.hitboxes; }
|
||||||
|
public static NoParticles noParticles(){ return ModManager.noParticles; }
|
||||||
|
public static Scoreboard scoreboard(){ return ModManager.scoreboard; }
|
||||||
|
public static SelfNametag selfNametag(){ return ModManager.selfNametag; }
|
||||||
|
public static ClearChat clearChat(){ return ModManager.clearChat; }
|
||||||
|
public static FPSB fpsb() { return ModManager.fpsb; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,316 @@
|
|||||||
|
package dev.resent.util.render;
|
||||||
|
|
||||||
|
public class Color {
|
||||||
|
|
||||||
|
public static final Color white = new Color(255, 255, 255);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color white. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public static final Color WHITE = white;
|
||||||
|
|
||||||
|
public final static Color lightGray = new Color(192, 192, 192);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color light gray. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color LIGHT_GRAY = lightGray;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color gray. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color gray = new Color(128, 128, 128);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color gray. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color GRAY = gray;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color dark gray. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color darkGray = new Color(64, 64, 64);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color dark gray. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color DARK_GRAY = darkGray;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color black. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color black = new Color(0, 0, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color black. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color BLACK = black;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color red. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color red = new Color(255, 0, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color red. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color RED = red;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color pink. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color pink = new Color(255, 175, 175);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color pink. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color PINK = pink;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color orange. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color orange = new Color(255, 165, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color orange. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color ORANGE = orange;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color yellow. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color yellow = new Color(255, 255, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color yellow. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color YELLOW = yellow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color green. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color green = new Color(0, 255, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color green. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color GREEN = green;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color magenta. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color magenta = new Color(255, 0, 255);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color magenta. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color MAGENTA = magenta;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color cyan. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color cyan = new Color(0, 255, 255);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color cyan. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color CYAN = cyan;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color blue. In the default sRGB space.
|
||||||
|
*/
|
||||||
|
public final static Color blue = new Color(0, 0, 255);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color blue. In the default sRGB space.
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public final static Color BLUE = blue;
|
||||||
|
|
||||||
|
int value;
|
||||||
|
|
||||||
|
public Color(int r, int g, int b, int a) {
|
||||||
|
value = ((a & 0xFF) << 24) |
|
||||||
|
((r & 0xFF) << 16) |
|
||||||
|
((g & 0xFF) << 8) |
|
||||||
|
((b & 0xFF) << 0);
|
||||||
|
testColorValueRange(r,g,b,a);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Color(int r, int g, int b) {
|
||||||
|
this(r, g, b, 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void testColorValueRange(int r, int g, int b, int a) {
|
||||||
|
boolean rangeError = false;
|
||||||
|
String badComponentString = "";
|
||||||
|
|
||||||
|
if ( a < 0 || a > 255) {
|
||||||
|
rangeError = true;
|
||||||
|
badComponentString = badComponentString + " Alpha";
|
||||||
|
}
|
||||||
|
if ( r < 0 || r > 255) {
|
||||||
|
rangeError = true;
|
||||||
|
badComponentString = badComponentString + " Red";
|
||||||
|
}
|
||||||
|
if ( g < 0 || g > 255) {
|
||||||
|
rangeError = true;
|
||||||
|
badComponentString = badComponentString + " Green";
|
||||||
|
}
|
||||||
|
if (b < 0 || b > 255) {
|
||||||
|
rangeError = true;
|
||||||
|
badComponentString = badComponentString + " Blue";
|
||||||
|
}
|
||||||
|
if (rangeError) {
|
||||||
|
throw new IllegalArgumentException("Color parameter outside of expected range:"
|
||||||
|
+ badComponentString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int HSBtoRGB(float hue, float saturation, float brightness) {
|
||||||
|
int r = 0, g = 0, b = 0;
|
||||||
|
if (saturation == 0) {
|
||||||
|
r = g = b = (int) (brightness * 255.0f + 0.5f);
|
||||||
|
} else {
|
||||||
|
float h = (hue - (float)Math.floor(hue)) * 6.0f;
|
||||||
|
float f = h - (float)java.lang.Math.floor(h);
|
||||||
|
float p = brightness * (1.0f - saturation);
|
||||||
|
float q = brightness * (1.0f - saturation * f);
|
||||||
|
float t = brightness * (1.0f - (saturation * (1.0f - f)));
|
||||||
|
switch ((int) h) {
|
||||||
|
case 0:
|
||||||
|
r = (int) (brightness * 255.0f + 0.5f);
|
||||||
|
g = (int) (t * 255.0f + 0.5f);
|
||||||
|
b = (int) (p * 255.0f + 0.5f);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
r = (int) (q * 255.0f + 0.5f);
|
||||||
|
g = (int) (brightness * 255.0f + 0.5f);
|
||||||
|
b = (int) (p * 255.0f + 0.5f);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
r = (int) (p * 255.0f + 0.5f);
|
||||||
|
g = (int) (brightness * 255.0f + 0.5f);
|
||||||
|
b = (int) (t * 255.0f + 0.5f);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
r = (int) (p * 255.0f + 0.5f);
|
||||||
|
g = (int) (q * 255.0f + 0.5f);
|
||||||
|
b = (int) (brightness * 255.0f + 0.5f);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
r = (int) (t * 255.0f + 0.5f);
|
||||||
|
g = (int) (p * 255.0f + 0.5f);
|
||||||
|
b = (int) (brightness * 255.0f + 0.5f);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
r = (int) (brightness * 255.0f + 0.5f);
|
||||||
|
g = (int) (p * 255.0f + 0.5f);
|
||||||
|
b = (int) (q * 255.0f + 0.5f);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0xff000000 | (r << 16) | (g << 8) | (b << 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRGB() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRed() {
|
||||||
|
return (getRGB() >> 16) & 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the green component in the range 0-255 in the default sRGB
|
||||||
|
* space.
|
||||||
|
* @return the green component.
|
||||||
|
* @see #getRGB
|
||||||
|
*/
|
||||||
|
public int getGreen() {
|
||||||
|
return (getRGB() >> 8) & 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the blue component in the range 0-255 in the default sRGB
|
||||||
|
* space.
|
||||||
|
* @return the blue component.
|
||||||
|
* @see #getRGB
|
||||||
|
*/
|
||||||
|
public int getBlue() {
|
||||||
|
return (getRGB() >> 0) & 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the alpha component in the range 0-255.
|
||||||
|
* @return the alpha component.
|
||||||
|
* @see #getRGB
|
||||||
|
*/
|
||||||
|
public int getAlpha() {
|
||||||
|
return (getRGB() >> 24) & 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Color brighter() {
|
||||||
|
int r = getRed();
|
||||||
|
int g = getGreen();
|
||||||
|
int b = getBlue();
|
||||||
|
int alpha = getAlpha();
|
||||||
|
|
||||||
|
/* From 2D group:
|
||||||
|
* 1. black.brighter() should return grey
|
||||||
|
* 2. applying brighter to blue will always return blue, brighter
|
||||||
|
* 3. non pure color (non zero rgb) will eventually return white
|
||||||
|
*/
|
||||||
|
int i = (int)(1.0/(1.0-FACTOR));
|
||||||
|
if ( r == 0 && g == 0 && b == 0) {
|
||||||
|
return new Color(i, i, i, alpha);
|
||||||
|
}
|
||||||
|
if ( r > 0 && r < i ) r = i;
|
||||||
|
if ( g > 0 && g < i ) g = i;
|
||||||
|
if ( b > 0 && b < i ) b = i;
|
||||||
|
|
||||||
|
return new Color(Math.min((int)(r/FACTOR), 255),
|
||||||
|
Math.min((int)(g/FACTOR), 255),
|
||||||
|
Math.min((int)(b/FACTOR), 255),
|
||||||
|
alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new {@code Color} that is a darker version of this
|
||||||
|
* {@code Color}.
|
||||||
|
* <p>
|
||||||
|
* This method applies an arbitrary scale factor to each of the three RGB
|
||||||
|
* components of this {@code Color} to create a darker version of
|
||||||
|
* this {@code Color}.
|
||||||
|
* The {@code alpha} value is preserved.
|
||||||
|
* Although {@code brighter} and
|
||||||
|
* {@code darker} are inverse operations, the results of a series
|
||||||
|
* of invocations of these two methods might be inconsistent because
|
||||||
|
* of rounding errors.
|
||||||
|
* @return a new {@code Color} object that is
|
||||||
|
* a darker version of this {@code Color}
|
||||||
|
* with the same {@code alpha} value.
|
||||||
|
* @see Color#brighter
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
public Color darker() {
|
||||||
|
return new Color(Math.max((int)(getRed() *FACTOR), 0),
|
||||||
|
Math.max((int)(getGreen()*FACTOR), 0),
|
||||||
|
Math.max((int)(getBlue() *FACTOR), 0),
|
||||||
|
getAlpha());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final double FACTOR = 0.7;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package dev.resent.util.render;
|
||||||
|
|
||||||
|
public class RainbowUtil {
|
||||||
|
public static int getRainbow(float seconds,float saturation, float brightness) {
|
||||||
|
float hue = (System.currentTimeMillis()) % (int) (seconds * 1000) / (seconds * 1000);
|
||||||
|
int color = Color.HSBtoRGB(hue, saturation, brightness);
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int astolfoColorsDraw(int yOffset, int yTotal) {
|
||||||
|
return astolfoColorsDraw(yOffset, yTotal, 50000f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int astolfoColorsDraw(int yOffset, int yTotal, float speed) {
|
||||||
|
float hue = (float) (System.currentTimeMillis() % (int)speed) + ((yTotal - yOffset) * 9);
|
||||||
|
while (hue > speed) {
|
||||||
|
hue -= speed;
|
||||||
|
}
|
||||||
|
hue /= speed;
|
||||||
|
if (hue > 0.5) {
|
||||||
|
hue = 0.5F - (hue - 0.5f);
|
||||||
|
}
|
||||||
|
hue += 0.5F;
|
||||||
|
return Color.HSBtoRGB(hue, 0.5f, 1F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getRainbow1(int delay) {
|
||||||
|
double rainbowState = Math.ceil((System.currentTimeMillis() + delay) / 20.0);
|
||||||
|
rainbowState %= 360;
|
||||||
|
return Color.HSBtoRGB((float) (rainbowState / 360.0f), 0.8f, 0.7f);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package dev.resent.util.render;
|
||||||
|
|
||||||
|
import dev.resent.setting.ModeSetting;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
|
||||||
|
public class RenderUtils {
|
||||||
|
|
||||||
|
public static int getColor(ModeSetting asdf) {
|
||||||
|
|
||||||
|
switch (asdf.getValue()) {
|
||||||
|
case "Red":
|
||||||
|
return new Color(255, 0, 0, 95).getRGB();
|
||||||
|
case "Yellow":
|
||||||
|
return new Color(255, 255, 0, 95).getRGB();
|
||||||
|
case "Green":
|
||||||
|
return new Color(0, 255, 0, 95).getRGB();
|
||||||
|
case "Blue":
|
||||||
|
return new Color(0, 0, 255, 95).getRGB();
|
||||||
|
case "Orange":
|
||||||
|
return new Color(255, 165, 0, 95).getRGB();
|
||||||
|
case "Pink":
|
||||||
|
return new Color(255, 102, 255, 95).getRGB();
|
||||||
|
case "Black":
|
||||||
|
return new Color(0, 0, 0, 95).getRGB();
|
||||||
|
case "White":
|
||||||
|
return new Color(255, 255, 255, 95).getRGB();
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Color getColorWithoutRGB(ModeSetting asdf) {
|
||||||
|
switch (asdf.getValue()) {
|
||||||
|
case "Red":
|
||||||
|
return Color.RED;
|
||||||
|
case "Yellow":
|
||||||
|
return Color.YELLOW;
|
||||||
|
case "Green":
|
||||||
|
return Color.GREEN;
|
||||||
|
case "Blue":
|
||||||
|
return Color.BLUE;
|
||||||
|
case "Orange":
|
||||||
|
return Color.ORANGE;
|
||||||
|
case "Pink":
|
||||||
|
return new Color(255, 102, 255);
|
||||||
|
case "Black":
|
||||||
|
return Color.BLACK;
|
||||||
|
case "White":
|
||||||
|
return Color.WHITE;
|
||||||
|
}
|
||||||
|
return Color.WHITE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void drawRectOutline(int x, int y, int width, int height, int color) {
|
||||||
|
Gui.drawRect(x, y, width, y + 1, color);
|
||||||
|
Gui.drawRect(x, y, x + 1, height, color);
|
||||||
|
Gui.drawRect(width - 1, y, width, height, color);
|
||||||
|
Gui.drawRect(x, height - 1, width, height, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user