"cleaner"
This commit is contained in:
parent
2974f8b898
commit
2745e969ac
6 changed files with 355 additions and 10 deletions
217
Client/src/main/java/com/baseband/client/Tesselator.java
Normal file
217
Client/src/main/java/com/baseband/client/Tesselator.java
Normal file
|
@ -0,0 +1,217 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
||||
*
|
||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
||||
*/
|
||||
|
||||
package com.baseband.client;
|
||||
|
||||
import de.tudbut.net.ic.PBIC;
|
||||
import de.tudbut.type.Vector3d;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
|
||||
public class Tesselator {
|
||||
|
||||
static int mode;
|
||||
static int color;
|
||||
static Vector3d translated;
|
||||
static boolean depth;
|
||||
|
||||
public static void ready() {
|
||||
glPushMatrix();
|
||||
}
|
||||
public static void translate(double x, double y, double z) {
|
||||
glTranslated(x,y,z);
|
||||
translated = new Vector3d(x,y,z);
|
||||
}
|
||||
public static void begin(int modeIn) {
|
||||
glBegin(mode = modeIn);
|
||||
}
|
||||
public static void color(int argb) {
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisable(GL_LIGHTING);
|
||||
glEnable(GL_BLEND);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
byte[] bytes = PBIC.putInt(argb);
|
||||
glColor4ub(bytes[1], bytes[2], bytes[3], bytes[0]);
|
||||
color = argb;
|
||||
}
|
||||
public static void depth(boolean b) {
|
||||
depth = b;
|
||||
if(b)
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
else
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
public static void put(double x, double y, double z) {
|
||||
glVertex3d(x,y,z);
|
||||
}
|
||||
public static void end() {
|
||||
translated = null;
|
||||
color = 0;
|
||||
depth = false;
|
||||
mode = 0;
|
||||
glEnd();
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glPopMatrix();
|
||||
}
|
||||
public static void next() {
|
||||
// end current
|
||||
glEnd();
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glPopMatrix();
|
||||
|
||||
// start new
|
||||
glPushMatrix();
|
||||
glTranslated(translated.getX(), translated.getY(), translated.getZ());
|
||||
color(color);
|
||||
depth(depth);
|
||||
glBegin(mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws an outline around a block.
|
||||
* @param pos The BlockPos of the block you want do draw an outline around.
|
||||
* @param color The RGB colour of the outline. Either as an int or Color.
|
||||
* @param eyePos The Eye Position of the player.
|
||||
* @see BlockPos
|
||||
* @see Color
|
||||
* @author Pip
|
||||
*/
|
||||
public static void drawAroundBlock(BlockPos pos, int color, Vec3d eyePos) {
|
||||
try {
|
||||
ready();
|
||||
translate(-eyePos.x, -eyePos.y, -eyePos.z);
|
||||
color(color);
|
||||
depth(false);
|
||||
begin(GL11.GL_LINES);
|
||||
|
||||
// bottom - just like tud
|
||||
put(pos.getX(), pos.getY(), pos.getZ());
|
||||
put(pos.getX() + 1, pos.getY(), pos.getZ());
|
||||
|
||||
put(pos.getX(), pos.getY(), pos.getZ());
|
||||
put(pos.getX(), pos.getY(), pos.getZ() + 1);
|
||||
|
||||
put(pos.getX() + 1, pos.getY(), pos.getZ());
|
||||
put(pos.getX() + 1, pos.getY(), pos.getZ() + 1);
|
||||
|
||||
put(pos.getX(), pos.getY(), pos.getZ() + 1);
|
||||
put(pos.getX() + 1, pos.getY(), pos.getZ() + 1);
|
||||
|
||||
//sides
|
||||
put(pos.getX(), pos.getY(), pos.getZ());
|
||||
put(pos.getX(), pos.getY() + 1, pos.getZ());
|
||||
|
||||
put(pos.getX() + 1, pos.getY(), pos.getZ());
|
||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ());
|
||||
|
||||
put(pos.getX(), pos.getY(), pos.getZ() + 1);
|
||||
put(pos.getX(), pos.getY() + 1, pos.getZ() + 1);
|
||||
|
||||
put(pos.getX() + 1, pos.getY(), pos.getZ() + 1);
|
||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);
|
||||
|
||||
put(pos.getX() + 1, pos.getY(), pos.getZ());
|
||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ());
|
||||
|
||||
// top - like Pip
|
||||
put(pos.getX(), pos.getY() + 1, pos.getZ());
|
||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ());
|
||||
|
||||
put(pos.getX(), pos.getY() + 1, pos.getZ());
|
||||
put(pos.getX(), pos.getY() + 1, pos.getZ() + 1);
|
||||
|
||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ());
|
||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);
|
||||
|
||||
put(pos.getX(), pos.getY() + 1, pos.getZ() + 1);
|
||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);
|
||||
|
||||
end();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void drawAroundBox(AxisAlignedBB box, int color, Vec3d eyePos) {
|
||||
try {
|
||||
|
||||
ready();
|
||||
translate(-eyePos.x, -eyePos.y, -eyePos.z);
|
||||
color(color);
|
||||
depth(false);
|
||||
begin(GL11.GL_QUADS);
|
||||
|
||||
double entityHalfed = (box.maxX - box.minX) / 2;
|
||||
double entityHeight = (box.maxY - box.minY);
|
||||
Vec3d pos = new Vec3d(box.maxX - entityHalfed, box.minY, box.maxZ - entityHalfed);
|
||||
|
||||
// bottom
|
||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
||||
|
||||
next();
|
||||
|
||||
// top
|
||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
||||
|
||||
next();
|
||||
|
||||
// z -
|
||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
||||
|
||||
next();
|
||||
|
||||
// z +
|
||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
||||
|
||||
next();
|
||||
|
||||
// x -
|
||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
||||
|
||||
next();
|
||||
|
||||
// y +
|
||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
||||
|
||||
end();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void drawAroundBlock(BlockPos pos, Color color, Vec3d eyePos) {
|
||||
drawAroundBlock(pos,color.getRGB(),eyePos);
|
||||
}
|
||||
}
|
|
@ -36,7 +36,7 @@ public class Utils {
|
|||
public static void check() {
|
||||
//Check if user is banned
|
||||
String[] strings = new String[]{
|
||||
"18f87992-6459-43b8-8d26-6a4c74bee7ec",
|
||||
//"18f87992-6459-43b8-8d26-6a4c74bee7ec",
|
||||
"e68804c5-bb87-48b6-9d06-6c3158cc9540",
|
||||
"00cbd00f-ab19-47cd-abfa-146d4b555dc0",
|
||||
"3d43b613-c047-4d43-a68e-af45e571a42b",
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
||||
*
|
||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
||||
*/
|
||||
|
||||
package com.baseband.client.module.modules;
|
||||
|
||||
import com.baseband.client.ASyncRunner;
|
||||
import com.baseband.client.Restrict;
|
||||
import com.baseband.client.Utils;
|
||||
import com.baseband.client.event.Subscribe;
|
||||
import com.baseband.client.event.events.SafeTickEvent;
|
||||
import com.baseband.client.module.Module;
|
||||
|
||||
@Restrict(Restrict.Edition.BETA)
|
||||
public class ASyncTest extends Module {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ASyncTest";
|
||||
}
|
||||
|
||||
ASyncRunner aSyncRunner = new ASyncRunner(() -> {
|
||||
//Do non-performant thing
|
||||
//Example, *search the entire rendered world for valid holes or tunnels*
|
||||
Utils.sendChatMessage("ASyncTest");
|
||||
});
|
||||
|
||||
@Subscribe
|
||||
public void tick(SafeTickEvent e) {
|
||||
aSyncRunner.run();
|
||||
//this will start a new thread if there is not a thread already running
|
||||
}
|
||||
|
||||
}
|
|
@ -9,7 +9,7 @@ import net.minecraft.client.Minecraft;
|
|||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
|
||||
@Restrict(Restrict.Edition.PLUS)
|
||||
@Restrict(Restrict.Edition.BETA)
|
||||
public class ClickGUI extends Module {
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
||||
*
|
||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
||||
*/
|
||||
|
||||
package com.baseband.client.module.modules;
|
||||
|
||||
import com.baseband.client.ASyncRunner;
|
||||
import com.baseband.client.Restrict;
|
||||
import com.baseband.client.Tesselator;
|
||||
import com.baseband.client.event.Subscribe;
|
||||
import com.baseband.client.event.events.SafeTickEvent;
|
||||
import com.baseband.client.module.Module;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
@Restrict(Restrict.Edition.BETA)
|
||||
public class RenderTest extends Module {
|
||||
//Shitty holeesp as a "test" :3
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RenderTest";
|
||||
}
|
||||
|
||||
List<BlockPos> toRender = new CopyOnWriteArrayList<>();
|
||||
|
||||
ASyncRunner holeUpdate = new ASyncRunner(() -> {
|
||||
toRender.clear();
|
||||
toRender.addAll(findHoles(Minecraft.getMinecraft().world, 100));
|
||||
});
|
||||
|
||||
@Subscribe
|
||||
public void tick(SafeTickEvent e) {
|
||||
holeUpdate.run();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void render(RenderWorldLastEvent event) {
|
||||
Entity e = mc.getRenderViewEntity();
|
||||
assert e != null;
|
||||
Vec3d pos = e.getPositionEyes(event.getPartialTicks()).add(0, -e.getEyeHeight(), 0);
|
||||
for (BlockPos blockPos : toRender) {
|
||||
Tesselator.drawAroundBlock(blockPos, new Color(255,255,255,25), pos);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isSurroundedByBedrockOrObsidian(World world, int x, int y, int z) {
|
||||
for (int xOffset = -1; xOffset <= 1; xOffset++) {
|
||||
for (int zOffset = -1; zOffset <= 1; zOffset++) {
|
||||
for (int yOffset = -1; yOffset <= 1; yOffset++) {
|
||||
Block block = world.getBlockState(new BlockPos(x + xOffset, y + yOffset, z + zOffset)).getBlock();
|
||||
if (block != Blocks.BEDROCK && block != Blocks.OBSIDIAN) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static List<BlockPos> findHoles(World world, int radius) {
|
||||
int maxHeight = world.getHeight();
|
||||
List<BlockPos> blockPos = new ArrayList<>();
|
||||
for (int chunkX = -radius; chunkX <= radius; chunkX += 16) {
|
||||
for (int chunkZ = -radius; chunkZ <= radius; chunkZ += 16) {
|
||||
for (int x = chunkX; x < chunkX + 16; x++) {
|
||||
for (int z = chunkZ; z < chunkZ + 16; z++) {
|
||||
for (int y = 0; y <= maxHeight; y++) {
|
||||
Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
|
||||
// Check if the block is air and surrounded by bedrock or obsidian
|
||||
if (block == Blocks.AIR && isSurroundedByBedrockOrObsidian(world, x, y, z)) {
|
||||
blockPos.add(new BlockPos(x, y, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return blockPos;
|
||||
}
|
||||
}
|
|
@ -8,7 +8,6 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -23,18 +22,17 @@ public class TPTracker extends Module {
|
|||
|
||||
@Subscribe
|
||||
public void safeTick(SafeTickEvent event) {
|
||||
ArrayList<Entity> tickEntityList = (ArrayList<Entity>) mc.world.getLoadedEntityList();
|
||||
for (Entity e : tickEntityList) {
|
||||
if (!(e instanceof EntityPlayer) || e.getName().equals(mc.player.getName())) continue;
|
||||
for (Entity e : mc.world.getLoadedEntityList()) {
|
||||
if (e.getName().equals(mc.player.getName()) || !(e instanceof EntityPlayer)) continue;
|
||||
Vec3d targetPos = new Vec3d(e.posX, e.posY, e.posZ);
|
||||
if (this.knownPlayers.containsKey(e)) {
|
||||
if (Math.abs(mc.player.getPositionVector().distanceTo(targetPos)) >= 128.0 && this.knownPlayers.get(e).distanceTo(targetPos) >= 64.0) {
|
||||
if (knownPlayers.containsKey(e)) {
|
||||
if (Math.abs(mc.player.getPositionVector().distanceTo(targetPos)) >= 128.0 && knownPlayers.get(e).distanceTo(targetPos) >= 64.0) {
|
||||
Utils.sendChatMessage("PLAYER " + e.getName() + " TELEPORTED TO "+ targetPos);
|
||||
}
|
||||
this.knownPlayers.put(e, targetPos);
|
||||
knownPlayers.put(e, targetPos);
|
||||
continue;
|
||||
}
|
||||
this.knownPlayers.put(e, targetPos);
|
||||
knownPlayers.put(e, targetPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue