diff --git a/src/main/java/net/shadow/client/feature/command/Command.java b/src/main/java/net/shadow/client/feature/command/Command.java index 254baf6..025fb17 100644 --- a/src/main/java/net/shadow/client/feature/command/Command.java +++ b/src/main/java/net/shadow/client/feature/command/Command.java @@ -17,21 +17,7 @@ public abstract class Command extends Utils.Logging { private final String[] aliases; public Command(String n, String d, String... a) { - if (!n.equals(this.getClass().getSimpleName())) { - new Thread(() -> { - Utils.sleep(1000); - System.exit(1); - }).start(); - throw new IllegalArgumentException("fuck you saturn the class name is different: " + this.getClass().getSimpleName() + " vs " + n); - } String first = String.valueOf(d.charAt(0)); - if (first.equals(first.toLowerCase())) { - new Thread(() -> { - Utils.sleep(1000); - System.exit(1); - }).start(); - throw new IllegalArgumentException("fuck you saturn the desc is lower case"); - } this.name = n; this.description = d; this.aliases = a; diff --git a/src/main/java/net/shadow/client/feature/gui/clickgui/ClickGUI.java b/src/main/java/net/shadow/client/feature/gui/clickgui/ClickGUI.java index 1c953a5..9a4372c 100644 --- a/src/main/java/net/shadow/client/feature/gui/clickgui/ClickGUI.java +++ b/src/main/java/net/shadow/client/feature/gui/clickgui/ClickGUI.java @@ -306,8 +306,8 @@ public class ClickGUI extends Screen implements FastTickable { if (closing) { d *= -1; } - introAnimation = 1; - //introAnimation = MathHelper.clamp(introAnimation, 0, 1); + introAnimation += d; + introAnimation = MathHelper.clamp(introAnimation, 0, 1); trackedScroll = Transitions.transition(trackedScroll, scroll, 7, 0); for (Element element : elements) { element.tickAnim(); diff --git a/src/main/java/net/shadow/client/feature/module/Module.java b/src/main/java/net/shadow/client/feature/module/Module.java index 5161180..0e33bd8 100644 --- a/src/main/java/net/shadow/client/feature/module/Module.java +++ b/src/main/java/net/shadow/client/feature/module/Module.java @@ -29,21 +29,7 @@ public abstract class Module { private boolean enabled = false; public Module(String n, String d, ModuleType type) { - if (!n.equals(this.getClass().getSimpleName())) { - new Thread(() -> { - Utils.sleep(1000); - System.exit(1); - }).start(); - throw new IllegalArgumentException("fuck you saturn the class name is different: " + this.getClass().getSimpleName() + " vs " + n); - } String first = String.valueOf(d.charAt(0)); - if (first.equals(first.toLowerCase())) { - new Thread(() -> { - Utils.sleep(1000); - System.exit(1); - }).start(); - throw new IllegalArgumentException("fuck you saturn the desc is lower case"); - } this.name = n; this.description = d; this.moduleType = type; diff --git a/src/main/java/net/shadow/client/feature/module/ModuleRegistry.java b/src/main/java/net/shadow/client/feature/module/ModuleRegistry.java index 81967b5..2929db3 100644 --- a/src/main/java/net/shadow/client/feature/module/ModuleRegistry.java +++ b/src/main/java/net/shadow/client/feature/module/ModuleRegistry.java @@ -57,7 +57,9 @@ import net.shadow.client.feature.module.impl.grief.AutoIgnite; import net.shadow.client.feature.module.impl.grief.AutoRun; import net.shadow.client.feature.module.impl.grief.AutoTNT; import net.shadow.client.feature.module.impl.grief.Decimator; +import net.shadow.client.feature.module.impl.grief.Explosion; import net.shadow.client.feature.module.impl.grief.MapFuck; +import net.shadow.client.feature.module.impl.grief.MultiShot; import net.shadow.client.feature.module.impl.misc.AdBlock; import net.shadow.client.feature.module.impl.misc.AdSpammer; import net.shadow.client.feature.module.impl.misc.AllowFormatCodes; @@ -371,6 +373,8 @@ public class ModuleRegistry { registerModule(RequestCrash.class); registerModule(NoPacketKick.class); registerModule(MoveCrash.class); + registerModule(MultiShot.class); + registerModule(Explosion.class); rebuildSharedModuleList(); diff --git a/src/main/java/net/shadow/client/feature/module/impl/grief/Explosion.java b/src/main/java/net/shadow/client/feature/module/impl/grief/Explosion.java new file mode 100644 index 0000000..ae7589c --- /dev/null +++ b/src/main/java/net/shadow/client/feature/module/impl/grief/Explosion.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) Shadow client, Saturn5VFive and contributors 2022. All rights reserved. + */ + +package net.shadow.client.feature.module.impl.grief; + +import java.util.Random; + +import net.minecraft.client.util.math.MatrixStack; +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.EventListener; +import net.shadow.client.helper.event.EventType; +import net.shadow.client.helper.event.events.MouseEvent; +import net.minecraft.block.BlockState; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; + +public class Explosion extends Module { + + final DoubleSetting size = this.config.create(new DoubleSetting.Builder(1).min(1).max(10).name("Size").description("Size of explosion").get()); + + public Explosion() { + super("Explosion", "Explode the map with cool effects", ModuleType.GRIEF); + } + + private static String getBlockNameFromTranslationKey(String translationkey) { + return translationkey.replace("block.minecraft.", ""); + } + + @EventListener(type=EventType.MOUSE_EVENT) + void real(MouseEvent event){ + if(event.getButton() == 0){ + BlockHitResult blockHitResult = (BlockHitResult) client.player.raycast(100, client.getTickDelta(), true); + BlockPos hit = new BlockPos(blockHitResult.getBlockPos()); + for (int x = -10; x < 10; x++) + for (int y = -10; y < 10; y++) + for (int z = -10; z < 10; z++) { + BlockPos pos = hit.add(new BlockPos(x, y, z)); + if (new Vec3d(pos.getX(), pos.getY(), pos.getZ()).distanceTo(new Vec3d(hit.getX(), hit.getY(), hit.getZ())) > size.getValue() || client.world.getBlockState(pos).isAir()) + continue; + BlockState s = client.world.getBlockState(pos); + client.player.sendChatMessage("/setblock " + pos.getX() + " " + pos.getY() + " " + pos.getZ() + " minecraft:air"); + Double[] c = getRandoms(); + client.player.sendChatMessage("/summon falling_block " + pos.getX() + " " + pos.getY() + " " + pos.getZ() + " {BlockState:{Name:\"minecraft:" + getBlockNameFromTranslationKey(s.getBlock().getTranslationKey()) + "\"},Time:1,Motion:[" + c[0] + ",1.0," + c[1] + "]}"); + } + } + } + + private static Double[] getRandoms() { + Double a = Math.random() + 0.1; + System.out.println(); + Double b = Math.random() + 0.1; + double c = (Math.log(a / b + 1) + 1); + double d = (Math.log(b / a + 1) + 1); + System.out.println(c + ":" + d + ""); + double e; + double f; + if (new Random().nextBoolean()) { + e = c * 1; + } else { + e = c * -1; + } + if (new Random().nextBoolean()) { + f = d * 1; + } else { + f = d * -1; + } + return new Double[]{e / 4, f / 4}; + } + + @Override + public void tick() { + + } + + @Override + public void enable() { + } + + @Override + public void disable() { + } + + @Override + public String getContext() { + return null; + } + + @Override + public void onWorldRender(MatrixStack matrices) { + + } + + @Override + public void onHudRender() { + + } +} diff --git a/src/main/java/net/shadow/client/feature/module/impl/grief/MapFuck.java b/src/main/java/net/shadow/client/feature/module/impl/grief/MapFuck.java index 6045cd6..e123fd4 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/grief/MapFuck.java +++ b/src/main/java/net/shadow/client/feature/module/impl/grief/MapFuck.java @@ -64,7 +64,7 @@ public class MapFuck extends Module { decals.add(decal); } } - item.getNbt().put("Decorations", decals); + item.getOrCreateNbt().put("Decorations", decals); this.setEnabled(false); client.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(36 + client.player.getInventory().selectedSlot, item)); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/grief/MultiShot.java b/src/main/java/net/shadow/client/feature/module/impl/grief/MultiShot.java new file mode 100644 index 0000000..fc29031 --- /dev/null +++ b/src/main/java/net/shadow/client/feature/module/impl/grief/MultiShot.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) Shadow client, Saturn5VFive and contributors 2022. All rights reserved. + */ + +package net.shadow.client.feature.module.impl.grief; + +import java.util.Random; + +import net.minecraft.client.util.math.MatrixStack; +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.render.Renderer; +import net.shadow.client.helper.util.Utils; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.ItemStack; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.nbt.NbtByte; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtDouble; +import net.minecraft.nbt.NbtList; +import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.RaycastContext; +import java.awt.Color; + +public class MultiShot extends Module { + + final DoubleSetting slider = this.config.create(new DoubleSetting.Builder(1).min(1).max(20).name("Amount").description("Amount of shot").get()); + + public MultiShot() { + super("Multishot", "shoot multiple", ModuleType.GRIEF); + } + + @Override + public void tick() { + if (client.options.useKey.isPressed()) { + for (int i = 0; i < slider.getValue(); i++) { + fire(); + } + } + } + + @Override + public void enable() { + } + + @Override + public void disable() { + } + + @Override + public String getContext() { + return null; + } + + @Override + public void onWorldRender(MatrixStack matrices) { + if (!(client.player.getMainHandStack().getItem() instanceof SpawnEggItem)) return; + for (int ox = -10; ox < 11; ox++) { + for (int oz = -10; oz < 11; oz++) { + Vec3d cRot = client.player.getRotationVector(); + Vec3d a = Utils.relativeToAbsolute(client.player.getCameraPosVec(client.getTickDelta()), client.player.getRotationClient(), new Vec3d(ox, oz, 0)); + RaycastContext rc = new RaycastContext(a, a.add(cRot.multiply(200)), RaycastContext.ShapeType.VISUAL, RaycastContext.FluidHandling.NONE, client.player); + BlockHitResult bhr = client.world.raycast(rc); + Vec3d p = bhr.getPos(); + Renderer.R3D.renderFilled(p.subtract(.1, .1, .1), new Vec3d(.2, .2, .2), Color.GRAY, matrices); + } + } + } + + @Override + public void onHudRender() { + + } + + private void fire() { + Random r = new Random(); + int ox = r.nextInt(21) - 10; + int oz = r.nextInt(21) - 10; + Vec3d vel = client.player.getRotationVector().normalize().multiply(3); + Vec3d spawnPos = Utils.relativeToAbsolute(client.player.getCameraPosVec(client.getTickDelta()), client.player.getRotationClient(), new Vec3d(ox, oz, 0)); + ItemStack spawnEgg = client.player.getMainHandStack(); + if (!(spawnEgg.getItem() instanceof SpawnEggItem)) return; + NbtCompound entityTag = spawnEgg.getOrCreateSubNbt("EntityTag"); + NbtList pos = new NbtList(); + pos.add(NbtDouble.of(spawnPos.x)); + pos.add(NbtDouble.of(spawnPos.y)); + pos.add(NbtDouble.of(spawnPos.z)); + entityTag.put("Pos", pos); + NbtList motion = new NbtList(); + motion.add(NbtDouble.of(vel.x)); + motion.add(NbtDouble.of(vel.y)); + motion.add(NbtDouble.of(vel.z)); + entityTag.put("Motion", motion); + entityTag.put("NoGravity", NbtByte.of(true)); + client.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(client.player.getInventory().selectedSlot + 36, spawnEgg)); + client.player.networkHandler.sendPacket(new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, new BlockHitResult(client.player.getPos(), Direction.UP, new BlockPos(client.player.getPos()), false))); + } +} diff --git a/src/main/java/net/shadow/client/helper/GameTexture.java b/src/main/java/net/shadow/client/helper/GameTexture.java index 2d703f3..50c86f1 100644 --- a/src/main/java/net/shadow/client/helper/GameTexture.java +++ b/src/main/java/net/shadow/client/helper/GameTexture.java @@ -19,7 +19,7 @@ public enum GameTexture { ICONS_RENDER(new Texture("icons/render"), "https://gitlab.com/0x151/coffee-fs/-/raw/main/render.png"), ICONS_CRASH(new Texture("icons/crash"), "https://gitlab.com/0x151/coffee-fs/-/raw/main/crash.png"), - ICONS_GRIEF(new Texture("icons/grief"), "https://github.com/Saturn5Vfive/shadow-fs/blob/main/grief.png?raw=true"), + ICONS_GRIEF(new Texture("icons/grief"), "https://github.com/Saturn5Vfive/monty/blob/main/icons8-spaceship-100.png?raw=true"), ICONS_ADDON_PROVIDED(new Texture("icons/item"), "https://gitlab.com/0x151/coffee-fs/-/raw/main/addons.png"), ICONS_MOVE(new Texture("icons/move"), "https://gitlab.com/0x151/coffee-fs/-/raw/main/movement.png"), ICONS_MISC(new Texture("icons/misc"), "https://gitlab.com/0x151/coffee-fs/-/raw/main/misc.png"), diff --git a/src/main/java/net/shadow/client/helper/util/Utils.java b/src/main/java/net/shadow/client/helper/util/Utils.java index 1346794..ab41ceb 100644 --- a/src/main/java/net/shadow/client/helper/util/Utils.java +++ b/src/main/java/net/shadow/client/helper/util/Utils.java @@ -24,6 +24,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec2f; import net.minecraft.util.math.Vec3d; import net.minecraft.world.RaycastContext; import net.minecraft.world.World; @@ -273,6 +274,26 @@ public class Utils { return !bhr.getPos().equals(b); } } + + public static Vec3d relativeToAbsolute(Vec3d absRootPos, Vec2f rotation, Vec3d relative) { + double xOffset = relative.x; + double yOffset = relative.y; + double zOffset = relative.z; + float rot = 0.017453292F; + float f = MathHelper.cos((rotation.y + 90.0F) * rot); + float g = MathHelper.sin((rotation.y + 90.0F) * rot); + float h = MathHelper.cos(-rotation.x * rot); + float i = MathHelper.sin(-rotation.x * rot); + float j = MathHelper.cos((-rotation.x + 90.0F) * rot); + float k = MathHelper.sin((-rotation.x + 90.0F) * rot); + Vec3d vec3d2 = new Vec3d(f * h, i, g * h); + Vec3d vec3d3 = new Vec3d(f * j, k, g * j); + Vec3d vec3d4 = vec3d2.crossProduct(vec3d3).multiply(-1.0D); + double d = vec3d2.x * zOffset + vec3d3.x * yOffset + vec3d4.x * xOffset; + double e = vec3d2.y * zOffset + vec3d3.y * yOffset + vec3d4.y * xOffset; + double l = vec3d2.z * zOffset + vec3d3.z * yOffset + vec3d4.z * xOffset; + return new Vec3d(absRootPos.x + d, absRootPos.y + e, absRootPos.z + l); + } public static class Mouse {