mirror of
https://github.com/Miasmusa/Shadow.git
synced 2024-11-28 18:26:15 -05:00
a
This commit is contained in:
parent
cc605bafea
commit
e2b71c8e1a
9 changed files with 235 additions and 32 deletions
|
@ -17,21 +17,7 @@ public abstract class Command extends Utils.Logging {
|
||||||
private final String[] aliases;
|
private final String[] aliases;
|
||||||
|
|
||||||
public Command(String n, String d, String... a) {
|
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));
|
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.name = n;
|
||||||
this.description = d;
|
this.description = d;
|
||||||
this.aliases = a;
|
this.aliases = a;
|
||||||
|
|
|
@ -306,8 +306,8 @@ public class ClickGUI extends Screen implements FastTickable {
|
||||||
if (closing) {
|
if (closing) {
|
||||||
d *= -1;
|
d *= -1;
|
||||||
}
|
}
|
||||||
introAnimation = 1;
|
introAnimation += d;
|
||||||
//introAnimation = MathHelper.clamp(introAnimation, 0, 1);
|
introAnimation = MathHelper.clamp(introAnimation, 0, 1);
|
||||||
trackedScroll = Transitions.transition(trackedScroll, scroll, 7, 0);
|
trackedScroll = Transitions.transition(trackedScroll, scroll, 7, 0);
|
||||||
for (Element element : elements) {
|
for (Element element : elements) {
|
||||||
element.tickAnim();
|
element.tickAnim();
|
||||||
|
|
|
@ -29,21 +29,7 @@ public abstract class Module {
|
||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
|
|
||||||
public Module(String n, String d, ModuleType type) {
|
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));
|
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.name = n;
|
||||||
this.description = d;
|
this.description = d;
|
||||||
this.moduleType = type;
|
this.moduleType = type;
|
||||||
|
|
|
@ -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.AutoRun;
|
||||||
import net.shadow.client.feature.module.impl.grief.AutoTNT;
|
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.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.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.AdBlock;
|
||||||
import net.shadow.client.feature.module.impl.misc.AdSpammer;
|
import net.shadow.client.feature.module.impl.misc.AdSpammer;
|
||||||
import net.shadow.client.feature.module.impl.misc.AllowFormatCodes;
|
import net.shadow.client.feature.module.impl.misc.AllowFormatCodes;
|
||||||
|
@ -371,6 +373,8 @@ public class ModuleRegistry {
|
||||||
registerModule(RequestCrash.class);
|
registerModule(RequestCrash.class);
|
||||||
registerModule(NoPacketKick.class);
|
registerModule(NoPacketKick.class);
|
||||||
registerModule(MoveCrash.class);
|
registerModule(MoveCrash.class);
|
||||||
|
registerModule(MultiShot.class);
|
||||||
|
registerModule(Explosion.class);
|
||||||
|
|
||||||
|
|
||||||
rebuildSharedModuleList();
|
rebuildSharedModuleList();
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -64,7 +64,7 @@ public class MapFuck extends Module {
|
||||||
decals.add(decal);
|
decals.add(decal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item.getNbt().put("Decorations", decals);
|
item.getOrCreateNbt().put("Decorations", decals);
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
client.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(36 + client.player.getInventory().selectedSlot, item));
|
client.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(36 + client.player.getInventory().selectedSlot, item));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)));
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,7 +19,7 @@ public enum GameTexture {
|
||||||
|
|
||||||
ICONS_RENDER(new Texture("icons/render"), "https://gitlab.com/0x151/coffee-fs/-/raw/main/render.png"),
|
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_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_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_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"),
|
ICONS_MISC(new Texture("icons/misc"), "https://gitlab.com/0x151/coffee-fs/-/raw/main/misc.png"),
|
||||||
|
|
|
@ -24,6 +24,7 @@ import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
import net.minecraft.util.math.Direction;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.math.Vec2f;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.RaycastContext;
|
import net.minecraft.world.RaycastContext;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -273,6 +274,26 @@ public class Utils {
|
||||||
return !bhr.getPos().equals(b);
|
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 {
|
public static class Mouse {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue