Port resent
This commit is contained in:
parent
b64cc00f71
commit
d887b3ba78
0
CompileEPK.sh
Normal file → Executable file
0
CompileEPK.sh
Normal file → Executable file
|
@ -71,10 +71,10 @@ teavm {
|
|||
targetType = "JAVASCRIPT"; //org.teavm.tooling.TeaVMTargetType.JAVASCRIPT;
|
||||
cacheDirectory = null;
|
||||
wasmVersion = "V_0x1"; //org.teavm.backend.wasm.render.WasmBinaryVersion.V_0x1;
|
||||
minHeapSize = 4;
|
||||
maxHeapSize = 128;
|
||||
minHeapSize = 256;
|
||||
maxHeapSize = 256;
|
||||
outOfProcess = false;
|
||||
processMemory = 512;
|
||||
processMemory = 1024;
|
||||
longjmpSupported = true;
|
||||
heapDump = false;
|
||||
|
||||
|
|
32078
javascript/EaglercraftX_1.8_Offline_International.html
Normal file
32078
javascript/EaglercraftX_1.8_Offline_International.html
Normal file
File diff suppressed because one or more lines are too long
32078
javascript/EaglercraftX_1.8_Offline_en_US.html
Normal file
32078
javascript/EaglercraftX_1.8_Offline_en_US.html
Normal file
File diff suppressed because one or more lines are too long
|
@ -28,7 +28,7 @@ Compile it yourself here: https://gitlab.com/lax1dude/eaglercraftx-1.8/
|
|||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="EaglercraftX 1.8 Offline" />
|
||||
<meta name="description" content="Resent client 1.8" />
|
||||
<meta name="keywords" content="eaglercraft, eaglercraftx, minecraft, 1.8, 1.8.8" />
|
||||
<title>EaglercraftX 1.8</title>
|
||||
<meta property="og:locale" content="en-US" />
|
||||
|
|
BIN
javascript/assets.epk
Normal file
BIN
javascript/assets.epk
Normal file
Binary file not shown.
31926
javascript/classes.js
Normal file
31926
javascript/classes.js
Normal file
File diff suppressed because it is too large
Load Diff
1
javascript/classes.js.map
Normal file
1
javascript/classes.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,45 +1,68 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="EaglercraftX 1.8 test directory HTML page" />
|
||||
<meta name="keywords" content="eaglercraft, eaglercraftx, minecraft, 1.8, 1.8.8" />
|
||||
<title>EaglercraftX 1.8</title>
|
||||
<meta property="og:locale" content="en-US" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="EaglercraftX 1.8" />
|
||||
<meta property="og:description" content="test directory HTML page" />
|
||||
<link type="image/png" rel="shortcut icon" href="favicon.png" />
|
||||
<script type="text/javascript" src="classes.js"></script>
|
||||
<head>
|
||||
<script async src="https://arc.io/widget.min.js#AcyRg5M7"></script>
|
||||
<title>Resent Client</title>
|
||||
<meta charset="application/javascript" />
|
||||
<!--meta content="IMAGE" property="og:image"/>-->
|
||||
<meta content="Eaglercraft pvp client. Currently developed by hooman#1196/Nitwit in-game. Over 100 texture packs for 1.5 and 40+ mods. 1.8 currently in development." property="og:description" />
|
||||
<link rel="icon" type="image/x-icon" href="/images/favicon.ico" />
|
||||
<script type="text/javascript" src="classes.js"></script>
|
||||
<script type="text/javascript" src="fix-webm-duration.js"></script>
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
window.addEventListener("load", () => {
|
||||
if(document.location.href.startsWith("file:")) {
|
||||
alert("HTTP please, do not open this file locally, run a local HTTP server and load it via HTTP");
|
||||
}else {
|
||||
window.eaglercraftXOpts = {
|
||||
<link rel="stylesheet" href="styles.css" />
|
||||
</head>
|
||||
|
||||
<body id="game_frame">
|
||||
<div class="stuff" id="changelog">
|
||||
<h3>Changelog and Updates</h3>
|
||||
<div>
|
||||
<br/>
|
||||
<br />
|
||||
<p>too lazy to update changelog cope</p>
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="stuff" id="quickstart">
|
||||
<h3>Quick Guide</h3>
|
||||
<br/>
|
||||
<br/>
|
||||
<p>- Press "Y" in game to open the GUI</p>
|
||||
<br />
|
||||
<p>- Set hotkeys and other keybinds in controls</p>
|
||||
<br />
|
||||
<p>- Press "Modify HUD" to change the layout</p>
|
||||
</div>
|
||||
|
||||
<div id="Selection">
|
||||
<div background-color: light-grey;>
|
||||
<h1>Resent Client 1.8</h1>
|
||||
<br/>
|
||||
<div class="container">
|
||||
<button onclick="Start();" class="btn"><a href="#">Launch</a></button>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
if (document.location.href.startsWith("file:")) {
|
||||
alert(
|
||||
"You cannot 'open' this file in your browser, the code doesn't work. Upload this folder to your HTTP(s) server and access it via the internet to launch the stable-download game. This is not a bug, please read the documentation."
|
||||
);
|
||||
} else {
|
||||
function Start() {
|
||||
document.getElementById("Selection").style.display = "none";
|
||||
document.getElementById("changelog").style.display = "none";
|
||||
document.getElementById("quickstart").style.display = "none";
|
||||
window.eaglercraftXOpts = {
|
||||
container: "game_frame",
|
||||
assetsURI: "assets.epk",
|
||||
localesURI: "lang/",
|
||||
servers: [
|
||||
{ addr: "ws://localhost:8081/", name: "Local test server" }
|
||||
/* example: { addr: "ws://localhost:8081/", name: "Local test server" } */ {addr: "wss://blobcraft.minecraft.pe", name: "BlobCraft"}
|
||||
]
|
||||
};
|
||||
|
||||
var q = window.location.search;
|
||||
if(typeof q === "string" && q.startsWith("?")) {
|
||||
q = new URLSearchParams(q);
|
||||
var s = q.get("server");
|
||||
if(s) window.eaglercraftXOpts.joinServer = s;
|
||||
}
|
||||
|
||||
main();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin:0px;width:100vw;height:100vh;overflow:hidden;" id="game_frame">
|
||||
</body>
|
||||
main();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
240
javascript/styles.css
Normal file
240
javascript/styles.css
Normal file
|
@ -0,0 +1,240 @@
|
|||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-weight: 390;
|
||||
letter-spacing: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
background: red;
|
||||
margin: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: red;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
#changelog {
|
||||
top: 35%;
|
||||
right: 15%;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
background-color: rgb(49, 51, 54);
|
||||
height: 30vh;
|
||||
width: 13vw;
|
||||
padding-left: 1vw;
|
||||
padding-right: 1vw;
|
||||
padding-top: 1vw;
|
||||
padding-bottom: 1vw;
|
||||
border-radius: 1vw;
|
||||
color: white;
|
||||
max-width: 30vw;
|
||||
text-align: center;
|
||||
font-size: calc(1.2vw);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
#quickstart {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
bottom: 2px;
|
||||
overflow-y: scroll;
|
||||
top: 35%;
|
||||
left: 15%;
|
||||
right: 10vw;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
background-color: rgb(49, 51, 54);
|
||||
height: 30vh;
|
||||
width: 13vw;
|
||||
padding-left: 1vw;
|
||||
padding-right: 1vw;
|
||||
padding-top: 1vw;
|
||||
padding-bottom: 1vw;
|
||||
border-radius: 1vw;
|
||||
color: white;
|
||||
max-width: 30vw;
|
||||
font-size: calc(1.2vw);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stuff {
|
||||
padding-bottom: 1vw;
|
||||
transition: 1s ease-in-out;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#Packs {
|
||||
height: 3vh;
|
||||
width: 9vw;
|
||||
font-size: 0.8vw;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#Selection {
|
||||
vertical-align: center;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: rgb(49, 51, 54);
|
||||
padding: 1vw;
|
||||
border-radius: 1vw;
|
||||
color: white;
|
||||
width: 20vw;
|
||||
height: 40vh;
|
||||
text-align: center;
|
||||
overflow-y: scroll;
|
||||
font-size: calc(1.1vw);
|
||||
transition: 1s ease-in-out;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
border: none;
|
||||
border-radius: 50px;
|
||||
background: none;
|
||||
padding: 25px 75px;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
.btn a {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: rgb(255, 255, 255, 0.05);
|
||||
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 30px;
|
||||
color: white;
|
||||
z-index: 1;
|
||||
letter-spacing: 1px;
|
||||
text-decoration: none;
|
||||
backdrop-filter: blur(15px);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.btn:hover a {
|
||||
letter-spacing: 3px;
|
||||
}
|
||||
|
||||
.btn a::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
background: linear-gradient(to left, rgba(255, 255, 255, 0.15), transparent);
|
||||
transform: skewX(40deg) translateX(0);
|
||||
transition: all 0.5s ease-out;
|
||||
}
|
||||
|
||||
.btn:hover a::before {
|
||||
transform: skewX(40deg) translateX(200%);
|
||||
}
|
||||
|
||||
.btn::before,
|
||||
.btn::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 30px;
|
||||
height: 10px;
|
||||
border-radius: 10px;
|
||||
background: #9e4444;
|
||||
transition: all 0.4s ease-in-out;
|
||||
transition-delay: 0s;
|
||||
}
|
||||
|
||||
.btn::before {
|
||||
bottom: -5px;
|
||||
}
|
||||
|
||||
.btn::after {
|
||||
top: -5px;
|
||||
}
|
||||
|
||||
.btn:hover::before,
|
||||
.btn:hover::after {
|
||||
height: 50%;
|
||||
width: 80%;
|
||||
border-radius: 30px;
|
||||
transition-delay: 0.3s;
|
||||
}
|
||||
|
||||
.btn:hover::before {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.btn:hover::after {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.btn:nth-child(1)::before,
|
||||
.btn:nth-child(1)::after {
|
||||
background: #2bd2ff;
|
||||
box-shadow: 0 0 5px #2bd2ff, 0 0 15px #2bd2ff, 0 0 30px #2bd2ff,
|
||||
0 0 60px #2bd2ff;
|
||||
}
|
||||
|
||||
.btn:nth-child(2)::before,
|
||||
.btn:nth-child(2)::after {
|
||||
background: #2bd2ff;
|
||||
box-shadow: 0 0 5px #2bd2ff, 0 0 15px #2bd2ff, 0 0 30px #2bd2ff,
|
||||
0 0 60px #2bd2ff;
|
||||
}
|
||||
|
||||
.btn:nth-child(3)::before,
|
||||
.btn:nth-child(3)::after {
|
||||
background: #1eff45;
|
||||
box-shadow: 0 0 5px #1eff45, 0 0 15px #1eff45, 0 0 30px #1eff45,
|
||||
0 0 60px #1eff45;
|
||||
}
|
||||
|
||||
.btn:nth-child(4)::before,
|
||||
.btn:nth-child(4)::after {
|
||||
background: #fffa65;
|
||||
box-shadow: 0 0 5px #fffa65, 0 0 15px #fffa65, 0 0 30px #fffa65,
|
||||
0 0 60px #fffa65;
|
||||
}
|
||||
|
||||
#Selection:hover {
|
||||
box-shadow: 1vw 1vw rgb(24, 8, 33);
|
||||
transition-delay: 1s;
|
||||
transition: box-shadow 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.stuff:hover {
|
||||
box-shadow: 1vw 1vw rgb(24, 8, 33);
|
||||
transition-delay: 1s;
|
||||
transition: box-shadow 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
|
7
offline.sh
Executable file
7
offline.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
cd javascript
|
||||
rm EaglercraftX_1.8_Offline_en_US.html
|
||||
rm EaglercraftX_1.8_Offline_International.html
|
||||
../MakeOfflineDownload.sh
|
||||
mv EaglercraftX_1.8_Offline_en_US.html Resent_EaglercraftX_1.8_US.html
|
||||
mv EaglercraftX_1.8_Offline_International.html Resent_EaglercraftX_1.8_International.html
|
27
src/main/java/dev/resent/Resent.java
Normal file
27
src/main/java/dev/resent/Resent.java
Normal file
|
@ -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){
|
||||
|
||||
}
|
||||
|
||||
}
|
31
src/main/java/dev/resent/event/impl/Event.java
Normal file
31
src/main/java/dev/resent/event/impl/Event.java
Normal file
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
16
src/main/java/dev/resent/event/impl/EventAttack.java
Normal file
16
src/main/java/dev/resent/event/impl/EventAttack.java
Normal file
|
@ -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; }
|
||||
|
||||
}
|
12
src/main/java/dev/resent/module/base/Category.java
Normal file
12
src/main/java/dev/resent/module/base/Category.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
74
src/main/java/dev/resent/module/base/Mod.java
Normal file
74
src/main/java/dev/resent/module/base/Mod.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
127
src/main/java/dev/resent/module/base/ModManager.java
Normal file
127
src/main/java/dev/resent/module/base/ModManager.java
Normal file
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
114
src/main/java/dev/resent/module/base/RenderModule.java
Normal file
114
src/main/java/dev/resent/module/base/RenderModule.java
Normal file
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
92
src/main/java/dev/resent/module/impl/hud/ArmorHud.java
Normal file
92
src/main/java/dev/resent/module/impl/hud/ArmorHud.java
Normal file
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
45
src/main/java/dev/resent/module/impl/hud/CPS.java
Normal file
45
src/main/java/dev/resent/module/impl/hud/CPS.java
Normal file
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
47
src/main/java/dev/resent/module/impl/hud/ComboCounter.java
Normal file
47
src/main/java/dev/resent/module/impl/hud/ComboCounter.java
Normal file
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
30
src/main/java/dev/resent/module/impl/hud/FPS.java
Normal file
30
src/main/java/dev/resent/module/impl/hud/FPS.java
Normal file
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
68
src/main/java/dev/resent/module/impl/hud/Freelook.java
Normal file
68
src/main/java/dev/resent/module/impl/hud/Freelook.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
24
src/main/java/dev/resent/module/impl/hud/Health.java
Normal file
24
src/main/java/dev/resent/module/impl/hud/Health.java
Normal file
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
26
src/main/java/dev/resent/module/impl/hud/Hitboxes.java
Normal file
26
src/main/java/dev/resent/module/impl/hud/Hitboxes.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package dev.resent.module.impl.hud;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.setting.BooleanSetting;
|
||||
import dev.resent.setting.ModeSetting;
|
||||
|
||||
public class Hitboxes extends Mod{
|
||||
public Hitboxes() {
|
||||
super("Hitboxes", Category.HUD, true);
|
||||
addSetting(color, old);
|
||||
}
|
||||
|
||||
public static ModeSetting color = new ModeSetting("Color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black");
|
||||
public BooleanSetting old = new BooleanSetting("1.7 Hitboxes", "", true);
|
||||
|
||||
public void onEnable(){
|
||||
if(!old.getValue())
|
||||
mc.getRenderManager().setDebugBoundingBox(true);
|
||||
}
|
||||
|
||||
public void onDisable(){
|
||||
if(!old.getValue())
|
||||
mc.getRenderManager().setDebugBoundingBox(false);
|
||||
}
|
||||
}
|
50
src/main/java/dev/resent/module/impl/hud/Info.java
Normal file
50
src/main/java/dev/resent/module/impl/hud/Info.java
Normal file
|
@ -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;
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
158
src/main/java/dev/resent/module/impl/hud/KeyStrokes.java
Normal file
158
src/main/java/dev/resent/module/impl/hud/KeyStrokes.java
Normal file
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
28
src/main/java/dev/resent/module/impl/hud/Ping.java
Normal file
28
src/main/java/dev/resent/module/impl/hud/Ping.java
Normal file
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
34
src/main/java/dev/resent/module/impl/hud/PotCounter.java
Normal file
34
src/main/java/dev/resent/module/impl/hud/PotCounter.java
Normal file
|
@ -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());
|
||||
}
|
||||
}
|
71
src/main/java/dev/resent/module/impl/hud/PotionHUD.java
Normal file
71
src/main/java/dev/resent/module/impl/hud/PotionHUD.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
38
src/main/java/dev/resent/module/impl/hud/ReachDisplay.java
Normal file
38
src/main/java/dev/resent/module/impl/hud/ReachDisplay.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
33
src/main/java/dev/resent/module/impl/hud/ServerInfo.java
Normal file
33
src/main/java/dev/resent/module/impl/hud/ServerInfo.java
Normal file
|
@ -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]";
|
||||
}
|
||||
|
||||
}
|
36
src/main/java/dev/resent/module/impl/hud/Watermark.java
Normal file
36
src/main/java/dev/resent/module/impl/hud/Watermark.java
Normal file
|
@ -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();
|
||||
|
||||
}
|
||||
|
||||
}
|
10
src/main/java/dev/resent/module/impl/misc/Animations.java
Normal file
10
src/main/java/dev/resent/module/impl/misc/Animations.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class Animations extends Mod{
|
||||
public Animations(){
|
||||
super("Animations", Category.MISC);
|
||||
}
|
||||
}
|
17
src/main/java/dev/resent/module/impl/misc/AutoGG.java
Normal file
17
src/main/java/dev/resent/module/impl/misc/AutoGG.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.setting.BooleanSetting;
|
||||
|
||||
public class AutoGG extends Mod{
|
||||
public AutoGG() {
|
||||
super("AutoGG", Category.MISC, true);
|
||||
addSetting(rep, onLose, onWin);
|
||||
}
|
||||
|
||||
public static BooleanSetting rep = new BooleanSetting("Repetition bypass", "", true);
|
||||
public static BooleanSetting onLose = new BooleanSetting("On Lose", "", true);
|
||||
public static BooleanSetting onWin = new BooleanSetting("On Win", "", true);
|
||||
|
||||
}
|
19
src/main/java/dev/resent/module/impl/misc/AutoRespawn.java
Normal file
19
src/main/java/dev/resent/module/impl/misc/AutoRespawn.java
Normal file
|
@ -0,0 +1,19 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class AutoRespawn extends Mod{
|
||||
public AutoRespawn() {
|
||||
super("AutoRespawn", Category.MISC);
|
||||
}
|
||||
|
||||
public void onTick(){
|
||||
if(this.isEnabled()){
|
||||
if (mc.thePlayer.isDead) {
|
||||
mc.thePlayer.respawnPlayer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
10
src/main/java/dev/resent/module/impl/misc/ClearChat.java
Normal file
10
src/main/java/dev/resent/module/impl/misc/ClearChat.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class ClearChat extends Mod{
|
||||
public ClearChat(){
|
||||
super("Clear Chat", Category.MISC);
|
||||
}
|
||||
}
|
15
src/main/java/dev/resent/module/impl/misc/Crosshair.java
Normal file
15
src/main/java/dev/resent/module/impl/misc/Crosshair.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.setting.ModeSetting;
|
||||
|
||||
public class Crosshair extends Mod{
|
||||
public Crosshair(){
|
||||
super("Crosshair", Category.MISC, true);
|
||||
addSetting(color);
|
||||
}
|
||||
|
||||
public static ModeSetting color = new ModeSetting("Hovered crosshair color", "", "White", "Red", "Yellow", "Green", "Blue", "Black");
|
||||
|
||||
}
|
10
src/main/java/dev/resent/module/impl/misc/DynamicFOV.java
Normal file
10
src/main/java/dev/resent/module/impl/misc/DynamicFOV.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class DynamicFOV extends Mod {
|
||||
public DynamicFOV() {
|
||||
super("NoDynamicFOV", Category.MISC);
|
||||
}
|
||||
}
|
23
src/main/java/dev/resent/module/impl/misc/FPSB.java
Normal file
23
src/main/java/dev/resent/module/impl/misc/FPSB.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class FPSB extends Mod{
|
||||
|
||||
public static boolean yes = false;
|
||||
|
||||
public FPSB(){
|
||||
super("Fast math", Category.MISC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable(){
|
||||
yes = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable(){
|
||||
yes = false;
|
||||
}
|
||||
}
|
27
src/main/java/dev/resent/module/impl/misc/Fullbright.java
Normal file
27
src/main/java/dev/resent/module/impl/misc/Fullbright.java
Normal file
|
@ -0,0 +1,27 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class Fullbright extends Mod {
|
||||
|
||||
public static Fullbright INSTANCE = new Fullbright();
|
||||
|
||||
public Fullbright(){
|
||||
super("FullBright", Category.MISC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
if(mc.thePlayer != null && mc.theWorld != null && mc.gameSettings != null){
|
||||
mc.gameSettings.gammaSetting = 100;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
if (mc.thePlayer != null && mc.theWorld != null && mc.gameSettings != null) {
|
||||
mc.gameSettings.gammaSetting = 1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class MinimalViewBobbing extends Mod{
|
||||
public MinimalViewBobbing() {
|
||||
super("Minimal Bobbing", Category.MISC);
|
||||
}
|
||||
|
||||
|
||||
}
|
10
src/main/java/dev/resent/module/impl/misc/NoHurtCam.java
Normal file
10
src/main/java/dev/resent/module/impl/misc/NoHurtCam.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class NoHurtCam extends Mod{
|
||||
public NoHurtCam(){
|
||||
super("NoHurtCam", Category.MISC);
|
||||
}
|
||||
}
|
10
src/main/java/dev/resent/module/impl/misc/NoParticles.java
Normal file
10
src/main/java/dev/resent/module/impl/misc/NoParticles.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class NoParticles extends Mod{
|
||||
public NoParticles() {
|
||||
super("NoParticles", Category.MISC);
|
||||
}
|
||||
}
|
10
src/main/java/dev/resent/module/impl/misc/NoRain.java
Normal file
10
src/main/java/dev/resent/module/impl/misc/NoRain.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class NoRain extends Mod{
|
||||
public NoRain(){
|
||||
super("NoRain", Category.MISC);
|
||||
}
|
||||
}
|
10
src/main/java/dev/resent/module/impl/misc/NoSwingDelay.java
Normal file
10
src/main/java/dev/resent/module/impl/misc/NoSwingDelay.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class NoSwingDelay extends Mod{
|
||||
public NoSwingDelay(){
|
||||
super("NoSwingDelay", Category.MISC);
|
||||
}
|
||||
}
|
15
src/main/java/dev/resent/module/impl/misc/Scoreboard.java
Normal file
15
src/main/java/dev/resent/module/impl/misc/Scoreboard.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.setting.BooleanSetting;
|
||||
|
||||
public class Scoreboard extends Mod {
|
||||
public Scoreboard() {
|
||||
super("Scoreboard", Category.MISC, true);
|
||||
addSetting(numbers);
|
||||
|
||||
}
|
||||
|
||||
public BooleanSetting numbers = new BooleanSetting("Numbers","", false);
|
||||
}
|
10
src/main/java/dev/resent/module/impl/misc/SelfNametag.java
Normal file
10
src/main/java/dev/resent/module/impl/misc/SelfNametag.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package dev.resent.module.impl.misc;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.Mod;
|
||||
|
||||
public class SelfNametag extends Mod{
|
||||
public SelfNametag() {
|
||||
super("Self Nametag", Category.MISC);
|
||||
}
|
||||
}
|
22
src/main/java/dev/resent/module/impl/misc/Tooltips.java
Normal file
22
src/main/java/dev/resent/module/impl/misc/Tooltips.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
84
src/main/java/dev/resent/module/impl/movement/Sprint.java
Normal file
84
src/main/java/dev/resent/module/impl/movement/Sprint.java
Normal file
|
@ -0,0 +1,84 @@
|
|||
package dev.resent.module.impl.movement;
|
||||
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.RenderModule;
|
||||
import dev.resent.setting.BooleanSetting;
|
||||
import dev.resent.ui.mods.ClickGUI;
|
||||
import dev.resent.ui.mods.HUDConfigScreen;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
public class Sprint extends RenderModule {
|
||||
|
||||
public BooleanSetting drawn = new BooleanSetting("Text Drawn", "", true);
|
||||
public FontRenderer fr;
|
||||
|
||||
public Sprint(){
|
||||
super("ToggleSprint", Category.MOVEMENT, 4, 10, true);
|
||||
addSetting(drawn);
|
||||
}
|
||||
|
||||
public int lastKeyHeldTicks = 0;
|
||||
public int keyHeldTicks = 0;
|
||||
public boolean toggled = false;
|
||||
public boolean clickDebounce = false;
|
||||
|
||||
private String getText() {
|
||||
String text = "";
|
||||
boolean definitive = false;
|
||||
if(mc.thePlayer.capabilities.isFlying) {
|
||||
text = " [Flying]";
|
||||
}
|
||||
|
||||
if(mc.gameSettings.keyBindSprint.isKeyDown()) {
|
||||
keyHeldTicks += 1;
|
||||
definitive = true;
|
||||
text = "[Sprinting (Key Held)] ";
|
||||
} else if(!mc.gameSettings.keyBindSprint.isKeyDown()) {
|
||||
keyHeldTicks = 0;
|
||||
}
|
||||
/*if(keyHeldTicks > 0 && clickDebounce == false) {
|
||||
toggled = !toggled;
|
||||
clickDebounce = true;
|
||||
} else if(clickDebounce == true) {
|
||||
clickDebounce = false;
|
||||
}*/
|
||||
if (keyHeldTicks > 0) {
|
||||
toggled = !toggled;
|
||||
}
|
||||
if (toggled) {
|
||||
if (mc.thePlayer.movementInput.moveForward == 1 && !mc.thePlayer.isUsingItem())
|
||||
mc.thePlayer.setSprinting(true);
|
||||
text = definitive ? text : "[Sprinting (Toggled)]";
|
||||
}
|
||||
|
||||
lastKeyHeldTicks = keyHeldTicks;
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
if(mc.currentScreen instanceof HUDConfigScreen || mc.currentScreen instanceof ClickGUI) {
|
||||
return fr.getStringWidth("[Sprinting [Toggled)]");
|
||||
} else {
|
||||
return fr.getStringWidth(getText());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw() {
|
||||
this.fr = mc.fontRendererObj;
|
||||
if(drawn.getValue())
|
||||
fr.drawStringWithShadow(getText(), getX() + getWidth() / 2 - ((getWidth() - 10) / 2), getY() + (getHeight() / 2 - fr.FONT_HEIGHT / 2), -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderLayout(int mouseX, int mouseY) {
|
||||
super.renderLayout(mouseX, mouseY);
|
||||
fr.drawStringWithShadow("[Sprinting [Toggled)]", getX() + getWidth() / 2 - ((getWidth() - 10) / 2), getY() + (getHeight() / 2 - fr.FONT_HEIGHT / 2), -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return fr.FONT_HEIGHT + 3;
|
||||
}
|
||||
}
|
16
src/main/java/dev/resent/setting/BooleanSetting.java
Normal file
16
src/main/java/dev/resent/setting/BooleanSetting.java
Normal file
|
@ -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;}
|
||||
|
||||
}
|
51
src/main/java/dev/resent/setting/ModeSetting.java
Normal file
51
src/main/java/dev/resent/setting/ModeSetting.java
Normal file
|
@ -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; }
|
||||
}
|
81
src/main/java/dev/resent/setting/NumberSetting.java
Normal file
81
src/main/java/dev/resent/setting/NumberSetting.java
Normal file
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
19
src/main/java/dev/resent/setting/Setting.java
Normal file
19
src/main/java/dev/resent/setting/Setting.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
278
src/main/java/dev/resent/ui/mods/ClickGUI.java
Normal file
278
src/main/java/dev/resent/ui/mods/ClickGUI.java
Normal file
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
252
src/main/java/dev/resent/ui/mods/GuiScreenModule.java
Normal file
252
src/main/java/dev/resent/ui/mods/GuiScreenModule.java
Normal file
|
@ -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);
|
||||
}
|
||||
|
||||
}*/
|
38
src/main/java/dev/resent/ui/mods/HUDConfigScreen.java
Normal file
38
src/main/java/dev/resent/ui/mods/HUDConfigScreen.java
Normal file
|
@ -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; }
|
||||
|
||||
}
|
151
src/main/java/dev/resent/ui/mods/Settings.java
Normal file
151
src/main/java/dev/resent/ui/mods/Settings.java
Normal file
|
@ -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;
|
||||
}
|
||||
}*/
|
19
src/main/java/dev/resent/util/misc/FuncUtils.java
Normal file
19
src/main/java/dev/resent/util/misc/FuncUtils.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
32
src/main/java/dev/resent/util/misc/W.java
Normal file
32
src/main/java/dev/resent/util/misc/W.java
Normal file
|
@ -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; }
|
||||
|
||||
}
|
316
src/main/java/dev/resent/util/render/Color.java
Normal file
316
src/main/java/dev/resent/util/render/Color.java
Normal file
|
@ -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;
|
||||
}
|
32
src/main/java/dev/resent/util/render/RainbowUtil.java
Normal file
32
src/main/java/dev/resent/util/render/RainbowUtil.java
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
60
src/main/java/dev/resent/util/render/RenderUtils.java
Normal file
60
src/main/java/dev/resent/util/render/RenderUtils.java
Normal file
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -2,6 +2,13 @@ package net.minecraft.client;
|
|||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_BACK;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_GREATER;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_LEQUAL;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_MODELVIEW;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_PROJECTION;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SMOOTH;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.text.DecimalFormat;
|
||||
|
@ -11,11 +18,13 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import dev.resent.Resent;
|
||||
import dev.resent.ui.mods.ClickGUI;
|
||||
import dev.resent.util.misc.W;
|
||||
import net.lax1dude.eaglercraft.v1_8.Display;
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||
|
@ -27,6 +36,7 @@ import net.lax1dude.eaglercraft.v1_8.futures.FutureTask;
|
|||
import net.lax1dude.eaglercraft.v1_8.futures.ListenableFuture;
|
||||
import net.lax1dude.eaglercraft.v1_8.futures.ListenableFutureTask;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
|
@ -211,7 +221,7 @@ public class Minecraft implements IThreadListener {
|
|||
public GameSettings gameSettings;
|
||||
public MouseHelper mouseHelper;
|
||||
private final String launchedVersion;
|
||||
private static int debugFPS;
|
||||
public static int debugFPS;
|
||||
private int rightClickDelayTimer;
|
||||
private String serverName;
|
||||
private int serverPort;
|
||||
|
@ -409,6 +419,7 @@ public class Minecraft implements IThreadListener {
|
|||
GlStateManager.loadIdentity();
|
||||
GlStateManager.matrixMode(GL_MODELVIEW);
|
||||
this.checkGLError("Startup");
|
||||
Resent.INSTANCE.init();
|
||||
this.textureMapBlocks = new TextureMap("textures");
|
||||
this.textureMapBlocks.setMipmapLevels(this.gameSettings.mipmapLevels);
|
||||
this.renderEngine.loadTickableTexture(TextureMap.locationBlocksTexture, this.textureMapBlocks);
|
||||
|
@ -1341,6 +1352,10 @@ public class Minecraft implements IThreadListener {
|
|||
if (this.currentScreen != null) {
|
||||
this.currentScreen.handleKeyboardInput();
|
||||
} else {
|
||||
|
||||
if(Keyboard.getEventKey() == this.gameSettings.keyBindFreelook.keyCode)
|
||||
W.freelook().smh();
|
||||
|
||||
if (k == 1 || (k > -1 && k == this.gameSettings.keyBindClose.getKeyCode())) {
|
||||
this.displayInGameMenu();
|
||||
}
|
||||
|
@ -1467,6 +1482,10 @@ public class Minecraft implements IThreadListener {
|
|||
}
|
||||
}
|
||||
|
||||
if(this.gameSettings.keyBindClickGui.isPressed()){
|
||||
this.displayGuiScreen(new ClickGUI());
|
||||
}
|
||||
|
||||
while (this.gameSettings.keyBindDrop.isPressed()) {
|
||||
if (!this.thePlayer.isSpectator()) {
|
||||
this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown());
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package net.minecraft.client.entity;
|
||||
|
||||
import dev.resent.util.misc.W;
|
||||
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||
|
@ -74,18 +75,20 @@ public abstract class AbstractClientPlayer extends EntityPlayer {
|
|||
|
||||
public float getFovModifier() {
|
||||
float f = 1.0F;
|
||||
if (this.capabilities.isFlying) {
|
||||
if (this.capabilities.isFlying && !W.dynamicFOV().isEnabled()) {
|
||||
f *= 1.1F;
|
||||
}
|
||||
|
||||
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
|
||||
f = (float) ((double) f
|
||||
* ((iattributeinstance.getAttributeValue() / (double) this.capabilities.getWalkSpeed() + 1.0D) / 2.0D));
|
||||
if(!W.dynamicFOV().isEnabled()){
|
||||
f = (float) ((double) f * ((iattributeinstance.getAttributeValue() / (double) this.capabilities.getWalkSpeed() + 1.0D) / 2.0D));
|
||||
}
|
||||
|
||||
if (this.capabilities.getWalkSpeed() == 0.0F || Float.isNaN(f) || Float.isInfinite(f)) {
|
||||
f = 1.0F;
|
||||
}
|
||||
|
||||
if (this.isUsingItem() && this.getItemInUse().getItem() == Items.bow) {
|
||||
if (this.isUsingItem() && this.getItemInUse().getItem() == Items.bow && !W.dynamicFOV().isEnabled()) {
|
||||
int i = this.getItemInUseDuration();
|
||||
float f1 = (float) i / 20.0F;
|
||||
if (f1 > 1.0F) {
|
||||
|
|
|
@ -2,16 +2,27 @@ package net.minecraft.client.gui;
|
|||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SRC_ALPHA;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import dev.resent.Resent;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.module.base.ModManager;
|
||||
import dev.resent.module.base.RenderModule;
|
||||
import dev.resent.module.impl.misc.Crosshair;
|
||||
import dev.resent.ui.mods.HUDConfigScreen;
|
||||
import dev.resent.util.misc.W;
|
||||
import dev.resent.util.render.RenderUtils;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -71,7 +82,7 @@ public class GuiIngame extends Gui {
|
|||
private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png");
|
||||
private final EaglercraftRandom rand = new EaglercraftRandom();
|
||||
private final Minecraft mc;
|
||||
private final RenderItem itemRenderer;
|
||||
public static RenderItem itemRenderer;
|
||||
private final GuiNewChat persistantChatGUI;
|
||||
private int updateCounter;
|
||||
/**+
|
||||
|
@ -159,8 +170,14 @@ public class GuiIngame extends Gui {
|
|||
this.mc.getTextureManager().bindTexture(icons);
|
||||
GlStateManager.enableBlend();
|
||||
if (this.showCrosshair()) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Entity target = mc.pointedEntity;
|
||||
if(!ModManager.crosshair.isEnabled())
|
||||
GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0);
|
||||
GlStateManager.enableAlpha();
|
||||
|
||||
if(target != null && ModManager.crosshair.isEnabled())
|
||||
GlStateManager.color(RenderUtils.getColorWithoutRGB(Crosshair.color).getRed(), RenderUtils.getColorWithoutRGB(Crosshair.color).getGreen(), RenderUtils.getColorWithoutRGB(Crosshair.color).getBlue());
|
||||
this.drawTexturedModalRect(i / 2 - 7, j / 2 - 7, 0, 0, 16, 16);
|
||||
}
|
||||
|
||||
|
@ -288,9 +305,9 @@ public class GuiIngame extends Gui {
|
|||
|
||||
ScoreObjective scoreobjective1 = scoreobjective != null ? scoreobjective
|
||||
: scoreboard.getObjectiveInDisplaySlot(1);
|
||||
if (scoreobjective1 != null) {
|
||||
this.renderScoreboard(scoreobjective1, scaledresolution);
|
||||
}
|
||||
if (scoreobjective1 != null && W.scoreboard().isEnabled()) {
|
||||
this.renderScoreboard(scoreobjective1, scaledresolution);
|
||||
}
|
||||
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
|
@ -313,6 +330,14 @@ public class GuiIngame extends Gui {
|
|||
this.overlayPlayerList.renderPlayerlist(i, scoreboard, scoreobjective1);
|
||||
}
|
||||
|
||||
for (Mod m : Resent.INSTANCE.modManager.modules) {
|
||||
if (m.isEnabled() && (m instanceof RenderModule)) {
|
||||
if (!(mc.currentScreen instanceof HUDConfigScreen)) {
|
||||
((RenderModule) m).draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.enableAlpha();
|
||||
|
@ -504,6 +529,7 @@ public class GuiIngame extends Gui {
|
|||
int l = parScaledResolution.getScaledWidth() - b0 + 2;
|
||||
drawRect(k1 - 2, k, l, k + this.getFontRenderer().FONT_HEIGHT, 1342177280);
|
||||
this.getFontRenderer().drawString(s1, k1, k, 553648127);
|
||||
if(W.scoreboard().numbers.getValue())
|
||||
this.getFontRenderer().drawString(s2, l - this.getFontRenderer().getStringWidth(s2), k, 553648127);
|
||||
if (j == arraylist1.size()) {
|
||||
String s3 = parScoreObjective.getDisplayName();
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import dev.resent.util.misc.W;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
|
@ -89,6 +90,7 @@ public class GuiNewChat extends Gui {
|
|||
if (l1 > 3) {
|
||||
byte b0 = 0;
|
||||
int i2 = -i1 * 9;
|
||||
if(!W.clearChat().isEnabled())
|
||||
drawRect(b0, i2 - 9, b0 + l + 4, i2, l1 / 2 << 24);
|
||||
String s = chatline.getChatComponent().getFormattedText();
|
||||
GlStateManager.enableBlend();
|
||||
|
|
|
@ -47,8 +47,8 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback {
|
|||
private static final Splitter NEWLINE_SPLITTER = Splitter.on('\n');
|
||||
protected Minecraft mc;
|
||||
protected RenderItem itemRender;
|
||||
public int width;
|
||||
public int height;
|
||||
public static int width;
|
||||
public static int height;
|
||||
/**+
|
||||
* A list of all the buttons in this container.
|
||||
*/
|
||||
|
|
|
@ -5,18 +5,21 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import dev.resent.module.base.ModManager;
|
||||
import dev.resent.module.impl.misc.AutoGG;
|
||||
import dev.resent.util.misc.W;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
|
||||
import net.lax1dude.eaglercraft.v1_8.netty.Unpooled;
|
||||
import net.lax1dude.eaglercraft.v1_8.profile.ServerSkinCache;
|
||||
import net.lax1dude.eaglercraft.v1_8.profile.SkinPackets;
|
||||
import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.ClientBrandRetriever;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -750,10 +753,37 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient {
|
|||
/**+
|
||||
* Prints a chatmessage in the chat GUI
|
||||
*/
|
||||
|
||||
public static String hasSaid = "hasSaid1";
|
||||
public void handleChat(S02PacketChat packetIn) {
|
||||
if (packetIn.getType() == 2) {
|
||||
this.gameController.ingameGUI.setRecordPlaying(packetIn.getChatComponent(), false);
|
||||
} else {
|
||||
|
||||
if (packetIn.getChatComponent().getUnformattedText().toLowerCase().contains("you won the match") && AutoGG.onWin.getValue()
|
||||
|| packetIn.getChatComponent().getUnformattedText().toLowerCase().contains("was killed by")
|
||||
&& packetIn.getChatComponent().getUnformattedText().contains(Minecraft.getMinecraft().thePlayer.getName()) || packetIn.getChatComponent().getUnformattedText().toLowerCase().contains("you lost the") && AutoGG.onLose.getValue()) {
|
||||
if (W.autoGG().isEnabled()) {
|
||||
switch (hasSaid) {
|
||||
case "hasSaid1":
|
||||
|
||||
Minecraft.getMinecraft().thePlayer.sendChatMessage("gg");
|
||||
hasSaid = "hasSaid2";
|
||||
break;
|
||||
|
||||
case "hasSaid2":
|
||||
if(AutoGG.rep.getValue()){
|
||||
Minecraft.getMinecraft().thePlayer.sendChatMessage("gf");
|
||||
}else {
|
||||
Minecraft.getMinecraft().thePlayer.sendChatMessage("gg");
|
||||
}
|
||||
|
||||
hasSaid = "hasSaid1";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.gameController.ingameGUI.getChatGUI().printChatMessage(packetIn.getChatComponent());
|
||||
}
|
||||
|
||||
|
@ -892,7 +922,10 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient {
|
|||
* happy), Wolf (...)
|
||||
*/
|
||||
public void handleEntityStatus(S19PacketEntityStatus packetIn) {
|
||||
|
||||
ModManager.comboCounter.onEntityHit(packetIn);
|
||||
Entity entity = packetIn.getEntity(this.clientWorldController);
|
||||
|
||||
if (entity != null) {
|
||||
if (packetIn.getOpCode() == 21) {
|
||||
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian) entity));
|
||||
|
|
|
@ -2,17 +2,19 @@ package net.minecraft.client.renderer;
|
|||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
|
||||
import java.util.List;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
import dev.resent.module.base.ModManager;
|
||||
import dev.resent.util.misc.W;
|
||||
import net.lax1dude.eaglercraft.v1_8.Display;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
|
@ -420,7 +422,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
}
|
||||
|
||||
private void hurtCameraEffect(float partialTicks) {
|
||||
if (this.mc.getRenderViewEntity() instanceof EntityLivingBase) {
|
||||
if (this.mc.getRenderViewEntity() instanceof EntityLivingBase && !W.noHurtCam().isEnabled()) {
|
||||
EntityLivingBase entitylivingbase = (EntityLivingBase) this.mc.getRenderViewEntity();
|
||||
float f = (float) entitylivingbase.hurtTime - partialTicks;
|
||||
if (entitylivingbase.getHealth() <= 0.0F) {
|
||||
|
@ -479,31 +481,31 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
BlockPos blockpos = new BlockPos(entity);
|
||||
IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
|
||||
Block block = iblockstate.getBlock();
|
||||
if (block == Blocks.bed) {
|
||||
int j = ((EnumFacing) iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex();
|
||||
if (block == Blocks.bed) {
|
||||
int j = ((EnumFacing) iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex();
|
||||
GlStateManager.rotate((float) (j * 90), 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
GlStateManager.rotate(
|
||||
entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F,
|
||||
0.0F, -1.0F, 0.0F);
|
||||
ModManager.freelook.getCameraYaw() + (ModManager.freelook.getCameraYaw() - ModManager.freelook.getCameraYaw()) * partialTicks + 180.0F,
|
||||
0.0F, -1.0F, 0.0F);
|
||||
GlStateManager.rotate(
|
||||
entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks,
|
||||
-1.0F, 0.0F, 0.0F);
|
||||
ModManager.freelook.getCameraPitch() + (ModManager.freelook.getCameraPitch() - ModManager.freelook.getCameraPitch()) * partialTicks,
|
||||
-1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
} else if (this.mc.gameSettings.thirdPersonView > 0) {
|
||||
double d3 = (double) (this.thirdPersonDistanceTemp
|
||||
+ (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * partialTicks);
|
||||
if (this.mc.gameSettings.debugCamEnable) {
|
||||
GlStateManager.translate(0.0F, 0.0F, (float) (-d3));
|
||||
} else {
|
||||
float f1 = entity.rotationYaw;
|
||||
float f2 = entity.rotationPitch;
|
||||
if (this.mc.gameSettings.thirdPersonView == 2) {
|
||||
f2 += 180.0F;
|
||||
}
|
||||
+ (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * partialTicks);
|
||||
if (this.mc.gameSettings.debugCamEnable) {
|
||||
GlStateManager.translate(0.0F, 0.0F, (float) (-d3));
|
||||
} else {
|
||||
float f1 = ModManager.freelook.getCameraYaw();
|
||||
float f2 = ModManager.freelook.getCameraPitch();
|
||||
if (this.mc.gameSettings.thirdPersonView == 2) {
|
||||
f2 += 180.0F;
|
||||
}
|
||||
|
||||
double d4 = (double) (-MathHelper.sin(f1 / 180.0F * 3.1415927F)
|
||||
double d4 = (double) (-MathHelper.sin(f1 / 180.0F * 3.1415927F)
|
||||
* MathHelper.cos(f2 / 180.0F * 3.1415927F)) * d3;
|
||||
double d5 = (double) (MathHelper.cos(f1 / 180.0F * 3.1415927F)
|
||||
* MathHelper.cos(f2 / 180.0F * 3.1415927F)) * d3;
|
||||
|
@ -531,11 +533,11 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
GlStateManager.rotate(entity.rotationPitch - f2, 1.0F, 0.0F, 0.0F);
|
||||
GlStateManager.rotate(entity.rotationYaw - f1, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(ModManager.freelook.getCameraPitch() - f2, 1.0F, 0.0F, 0.0F);
|
||||
GlStateManager.rotate(ModManager.freelook.getCameraYaw() - f1, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.translate(0.0F, 0.0F, (float) (-d3));
|
||||
GlStateManager.rotate(f1 - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(f2 - entity.rotationPitch, 1.0F, 0.0F, 0.0F);
|
||||
GlStateManager.rotate(f1 - ModManager.freelook.getCameraYaw(), 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(f2 - ModManager.freelook.getCameraPitch(), 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
} else {
|
||||
GlStateManager.translate(0.0F, 0.0F, -0.1F);
|
||||
|
@ -543,7 +545,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
|
||||
if (!this.mc.gameSettings.debugCamEnable) {
|
||||
GlStateManager.rotate(
|
||||
entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 1.0F,
|
||||
ModManager.freelook.getCameraPitch() + (ModManager.freelook.getCameraPitch() - ModManager.freelook.getCameraPitch()) * partialTicks, 1.0F,
|
||||
0.0F, 0.0F);
|
||||
if (entity instanceof EntityAnimal) {
|
||||
EntityAnimal entityanimal = (EntityAnimal) entity;
|
||||
|
@ -552,7 +554,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
0.0F, 1.0F, 0.0F);
|
||||
} else {
|
||||
GlStateManager.rotate(
|
||||
entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F,
|
||||
ModManager.freelook.getCameraYaw() + (ModManager.freelook.getCameraYaw() - ModManager.freelook.getCameraYaw()) * partialTicks + 180.0F,
|
||||
0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
}
|
||||
|
@ -1159,6 +1161,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
RenderHelper.disableStandardItemLighting();
|
||||
this.setupFog(0, partialTicks);
|
||||
this.mc.mcProfiler.endStartSection("particles");
|
||||
if(!W.noParticles().isEnabled())
|
||||
effectrenderer.renderParticles(entity, partialTicks);
|
||||
this.disableLightmap();
|
||||
}
|
||||
|
@ -1294,6 +1297,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
* Render rain and snow
|
||||
*/
|
||||
protected void renderRainSnow(float partialTicks) {
|
||||
if(!W.noRain().isEnabled()){
|
||||
float f = this.mc.theWorld.getRainStrength(partialTicks);
|
||||
if (f > 0.0F) {
|
||||
this.enableLightmap();
|
||||
|
@ -1439,6 +1443,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
GlStateManager.disableBlend();
|
||||
GlStateManager.alphaFunc(GL_GREATER, 0.1F);
|
||||
this.disableLightmap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@ import java.util.Map;
|
|||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import dev.resent.module.impl.hud.Hitboxes;
|
||||
import dev.resent.util.misc.W;
|
||||
import dev.resent.util.render.RenderUtils;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
|
@ -382,6 +386,51 @@ public class RenderManager {
|
|||
CrashReport.makeCrashReport(throwable, "Rendering entity hitbox in world"));
|
||||
}
|
||||
}
|
||||
|
||||
if (W.hitboxes().isEnabled() && W.hitboxes().old.getValue() && !entity.isInvisible()) {
|
||||
GlStateManager.disableTexture2D();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.disableCull();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.depthMask(false);
|
||||
GlStateManager.pushMatrix();
|
||||
EaglercraftGPU.glLineWidth(1.0f);
|
||||
|
||||
RenderGlobal.func_181563_a(
|
||||
new AxisAlignedBB(
|
||||
entity.boundingBox.minX-0.05-entity.posX
|
||||
+ (entity.posX - renderPosX),
|
||||
entity.boundingBox.minY
|
||||
- 0.05
|
||||
- entity.posY
|
||||
+ (entity.posY - renderPosY),
|
||||
entity.boundingBox.minZ
|
||||
- 0.05
|
||||
- entity.posZ
|
||||
+ (entity.posZ - renderPosZ),
|
||||
entity.boundingBox.maxX
|
||||
+ 0.05
|
||||
- entity.posX
|
||||
+ (entity.posX - renderPosX),
|
||||
entity.boundingBox.maxY
|
||||
+ 0.1
|
||||
- entity.posY
|
||||
+ (entity.posY - renderPosY),
|
||||
entity.boundingBox.maxZ
|
||||
+ 0.05
|
||||
- entity.posZ
|
||||
+ (entity.posZ - renderPosZ)),
|
||||
RenderUtils.getColorWithoutRGB(Hitboxes.color).getRed(),
|
||||
RenderUtils.getColorWithoutRGB(Hitboxes.color).getGreen(),
|
||||
RenderUtils.getColorWithoutRGB(Hitboxes.color).getBlue(), 255);
|
||||
GlStateManager.popMatrix();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.enableCull();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.depthMask(true);
|
||||
//EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
} else if (this.renderEngine != null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -417,7 +466,9 @@ public class RenderManager {
|
|||
axisalignedbb.minY - entityIn.posY + parDouble2, axisalignedbb.minZ - entityIn.posZ + parDouble3,
|
||||
axisalignedbb.maxX - entityIn.posX + parDouble1, axisalignedbb.maxY - entityIn.posY + parDouble2,
|
||||
axisalignedbb.maxZ - entityIn.posZ + parDouble3);
|
||||
RenderGlobal.func_181563_a(axisalignedbb1, 255, 255, 255, 255);
|
||||
RenderGlobal.func_181563_a(axisalignedbb1, W.hitboxes().enabled ? RenderUtils.getColorWithoutRGB(Hitboxes.color).getRed() : 255,
|
||||
W.hitboxes().enabled ? RenderUtils.getColorWithoutRGB(Hitboxes.color).getGreen() : 255,
|
||||
W.hitboxes().enabled ? RenderUtils.getColorWithoutRGB(Hitboxes.color).getBlue() : 255, 255);
|
||||
if (entityIn instanceof EntityLivingBase) {
|
||||
float f1 = 0.01F;
|
||||
RenderGlobal.func_181563_a(new AxisAlignedBB(parDouble1 - (double) f,
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -16,6 +17,12 @@ import com.google.common.collect.Lists;
|
|||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import dev.resent.Resent;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.module.base.RenderModule;
|
||||
import dev.resent.setting.BooleanSetting;
|
||||
import dev.resent.setting.ModeSetting;
|
||||
import dev.resent.setting.Setting;
|
||||
import net.lax1dude.eaglercraft.v1_8.ArrayUtils;
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
|
||||
|
@ -158,6 +165,8 @@ public class GameSettings {
|
|||
"key.categories.misc");
|
||||
public KeyBinding keyBindFunction = new KeyBinding("key.function", KeyboardConstants.KEY_F, "key.categories.misc");
|
||||
public KeyBinding keyBindClose = new KeyBinding("key.close", KeyboardConstants.KEY_GRAVE, "key.categories.misc");
|
||||
public KeyBinding keyBindClickGui = new KeyBinding("Click Gui", KeyboardConstants.KEY_RSHIFT, "Resent");
|
||||
public KeyBinding keyBindFreelook = new KeyBinding("Freelook", KeyboardConstants.KEY_L, "Resent");
|
||||
public KeyBinding[] keyBindsHotbar = new KeyBinding[] {
|
||||
new KeyBinding("key.hotbar.1", 2, "key.categories.inventory"),
|
||||
new KeyBinding("key.hotbar.2", 3, "key.categories.inventory"),
|
||||
|
@ -1021,6 +1030,45 @@ public class GameSettings {
|
|||
this.setModelPartEnabled(enumplayermodelparts, astring[1].equals("true"));
|
||||
}
|
||||
}
|
||||
|
||||
for(Mod m : Resent.INSTANCE.modManager.modules){
|
||||
|
||||
if(astring[0].equals(m.name)){
|
||||
m.setEnabled(astring[1].equals("true"));
|
||||
}
|
||||
|
||||
List<RenderModule> rmodules = new ArrayList<>();
|
||||
if(m instanceof RenderModule){ rmodules.add((RenderModule)m); }
|
||||
|
||||
for(RenderModule rmod : rmodules){
|
||||
if(astring[0].equals(rmod.name+"_x")){
|
||||
rmod.setX(Integer.parseInt(astring[1]));
|
||||
}
|
||||
if(astring[0].equals(rmod.name+"_y")){
|
||||
rmod.setY(Integer.parseInt(astring[1]));
|
||||
}
|
||||
if(astring[0].equals(rmod.name+"_lastx")){
|
||||
rmod.lastX=Integer.parseInt(astring[1]);
|
||||
}
|
||||
if(astring[0].equals(rmod.name+"_lasty")){
|
||||
rmod.lastY=Integer.parseInt(astring[1]);
|
||||
}
|
||||
}
|
||||
|
||||
for(Setting se : m.settings){
|
||||
if(se instanceof ModeSetting){
|
||||
if(astring[0].equals(m.name+"_modesetting_"+se.name)){
|
||||
((ModeSetting)se).setValue(astring[1]);
|
||||
}
|
||||
}
|
||||
if(se instanceof BooleanSetting){
|
||||
if(astring[0].equals(m.name+"_boolsetting_"+se.name)){
|
||||
((BooleanSetting)se).setValue(astring[1].equals("true"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception var8) {
|
||||
logger.warn("Skipping bad option: " + s);
|
||||
}
|
||||
|
@ -1139,6 +1187,31 @@ public class GameSettings {
|
|||
+ this.setModelParts.contains(enumplayermodelparts));
|
||||
}
|
||||
|
||||
for(Mod m : Resent.INSTANCE.modManager.modules){
|
||||
|
||||
printwriter.println(m.name + ":" + m.isEnabled());
|
||||
|
||||
List<RenderModule> rmodules = new ArrayList<>();
|
||||
if(m instanceof RenderModule){ rmodules.add((RenderModule)m); }
|
||||
|
||||
for(RenderModule rmod : rmodules){
|
||||
printwriter.println(rmod.name+"_x:"+rmod.getX());
|
||||
printwriter.println(rmod.name+"_y:"+rmod.getY());
|
||||
printwriter.println(rmod.name+"_lastx:"+rmod.lastX);
|
||||
printwriter.println(rmod.name+"_lastx:"+rmod.lastX);
|
||||
}
|
||||
|
||||
for(Setting s : m.settings){
|
||||
if(s instanceof ModeSetting){
|
||||
printwriter.println(m.name+"_modesetting_"+s.name+":"+((ModeSetting) s).getValue());
|
||||
}
|
||||
if(s instanceof BooleanSetting){
|
||||
printwriter.println(m.name+"_boolsetting_"+s.name+":"+((BooleanSetting) s).getValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
printwriter.close();
|
||||
|
||||
EagRuntime.setStorage("g", bao.toByteArray());
|
||||
|
|
|
@ -34,8 +34,8 @@ public class KeyBinding implements Comparable<KeyBinding> {
|
|||
private final String keyDescription;
|
||||
private final int keyCodeDefault;
|
||||
private final String keyCategory;
|
||||
private int keyCode;
|
||||
private boolean pressed;
|
||||
public int keyCode;
|
||||
public boolean pressed;
|
||||
private int pressTime;
|
||||
|
||||
public static void onTick(int keyCode) {
|
||||
|
|
|
@ -66,7 +66,7 @@ public abstract class Entity {
|
|||
public float rotationPitch;
|
||||
public float prevRotationYaw;
|
||||
public float prevRotationPitch;
|
||||
private AxisAlignedBB boundingBox;
|
||||
public AxisAlignedBB boundingBox;
|
||||
public boolean onGround;
|
||||
public boolean isCollidedHorizontally;
|
||||
public boolean isCollidedVertically;
|
||||
|
|
|
@ -4,15 +4,17 @@ import java.util.Collection;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import dev.resent.module.base.ModManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.ai.attributes.BaseAttributeMap;
|
||||
|
@ -886,6 +888,11 @@ public abstract class EntityLivingBase extends Entity {
|
|||
* account.
|
||||
*/
|
||||
private int getArmSwingAnimationEnd() {
|
||||
|
||||
if(ModManager.animations.isEnabled() && Minecraft.getMinecraft().theWorld != null){
|
||||
return 10;
|
||||
}
|
||||
|
||||
return this.isPotionActive(Potion.digSpeed)
|
||||
? 6 - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1
|
||||
: (this.isPotionActive(Potion.digSlowdown)
|
||||
|
@ -898,7 +905,7 @@ public abstract class EntityLivingBase extends Entity {
|
|||
*/
|
||||
public void swingItem() {
|
||||
if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2
|
||||
|| this.swingProgressInt < 0) {
|
||||
|| this.swingProgressInt < 0 || ModManager.noSwingDelay.isEnabled()) {
|
||||
this.swingProgressInt = -1;
|
||||
this.isSwingInProgress = true;
|
||||
}
|
||||
|
|
|
@ -2,11 +2,14 @@ package net.minecraft.entity.player;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import dev.resent.Resent;
|
||||
import dev.resent.event.impl.Event.EventType;
|
||||
import dev.resent.event.impl.EventAttack;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBed;
|
||||
|
@ -1018,6 +1021,11 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS
|
|||
* Args: targetEntity
|
||||
*/
|
||||
public void attackTargetEntityWithCurrentItem(Entity entity) {
|
||||
|
||||
EventAttack event = new EventAttack(entity);
|
||||
event.setType(EventType.pre);
|
||||
Resent.onEvent(event);
|
||||
|
||||
if (entity.canAttackWithItem()) {
|
||||
if (!entity.hitByEntity(this)) {
|
||||
float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.world.World;
|
|||
*/
|
||||
public class S19PacketEntityStatus implements Packet<INetHandlerPlayClient> {
|
||||
private int entityId;
|
||||
private byte logicOpcode;
|
||||
public byte logicOpcode;
|
||||
|
||||
public S19PacketEntityStatus() {
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package net.minecraft.util;
|
||||
|
||||
import dev.resent.module.impl.misc.FPSB;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
|
||||
|
@ -9,7 +10,7 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
|||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
||||
* EaglercraftX 1.8 patch files are (c) 2022 LAX1DUDE. All Rights Reserved.
|
||||
*
|
||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
||||
|
@ -28,27 +29,29 @@ public class MathHelper {
|
|||
* (exclusive), with steps of 2*PI / 65536.
|
||||
*/
|
||||
private static final float[] SIN_TABLE = new float[65536];
|
||||
private static final float[] SIN_TABLE_FAST = new float[4096];
|
||||
private static final int[] multiplyDeBruijnBitPosition;
|
||||
private static final double field_181163_d;
|
||||
private static final double[] field_181164_e;
|
||||
private static final double[] field_181165_f;
|
||||
public static boolean fps = FPSB.yes;
|
||||
|
||||
/**+
|
||||
* sin looked up in a table
|
||||
*/
|
||||
public static float sin(float parFloat1) {
|
||||
return SIN_TABLE[(int) (parFloat1 * 10430.378F) & '\uffff'];
|
||||
return fps ? SIN_TABLE_FAST[(int) (parFloat1 * 651.8986f) & 4095] : SIN_TABLE[(int) (parFloat1 * 10430.378F) & '\uffff'];
|
||||
}
|
||||
|
||||
/**+
|
||||
* cos looked up in the sin table with the appropriate offset
|
||||
*/
|
||||
public static float cos(float value) {
|
||||
return SIN_TABLE[(int) (value * 10430.378F + 16384.0F) & '\uffff'];
|
||||
return fps ? SIN_TABLE_FAST[(int)((value + ((float)Math.PI / 2f)) * 651.8986f) & 4095] : SIN_TABLE[(int) (value * 10430.378F + 16384.0F) & '\uffff'];
|
||||
}
|
||||
|
||||
public static float sqrt_float(float value) {
|
||||
return (float) Math.sqrt((double) value);
|
||||
return (float) Math.sqrt(value);
|
||||
}
|
||||
|
||||
public static float sqrt_double(double value) {
|
||||
|
@ -362,7 +365,7 @@ public class MathHelper {
|
|||
}
|
||||
|
||||
public static long getCoordinateRandom(int x, int y, int z) {
|
||||
long i = (long) (x * 3129871) ^ (long) z * 116129781L ^ (long) y;
|
||||
long i = (long) (x * 3129871L) ^ (long) z * 116129781L ^ (long) y;
|
||||
i = i * i * 42317861L + i * 11L;
|
||||
return i;
|
||||
}
|
||||
|
@ -491,6 +494,14 @@ public class MathHelper {
|
|||
SIN_TABLE[i] = (float) Math.sin((double) i * 3.141592653589793D * 2.0D / 65536.0D);
|
||||
}
|
||||
|
||||
for (int j = 0; j < 4096; ++j) {
|
||||
SIN_TABLE_FAST[j] = (float) Math.sin(((float) j + 0.5f) / 4096.0f * ((float) Math.PI * 2f));
|
||||
}
|
||||
|
||||
for(int l = 0; l < 360; l += 90){
|
||||
SIN_TABLE_FAST[(int) ((float) l * 11.377778f) & 4095] = (float) Math.sin((float) l * 0.017453292f);
|
||||
}
|
||||
|
||||
multiplyDeBruijnBitPosition = new int[] { 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13,
|
||||
23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 };
|
||||
field_181163_d = Double.longBitsToDouble(4805340802404319232L);
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.google.common.base.Predicate;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import dev.resent.util.misc.W;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockHopper;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
|
@ -1983,7 +1984,11 @@ public abstract class World implements IBlockAccess {
|
|||
*/
|
||||
protected void calculateInitialWeather() {
|
||||
if (this.worldInfo.isRaining()) {
|
||||
if(W.noRain().isEnabled()){
|
||||
this.rainingStrength = 0;
|
||||
}else {
|
||||
this.rainingStrength = 1.0F;
|
||||
}
|
||||
if (this.worldInfo.isThundering()) {
|
||||
this.thunderingStrength = 1.0F;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user