who needs git log anyway
This commit is contained in:
16
src/main/java/cloudburst/rejects/aax/AntiAntiXray.java
Normal file
16
src/main/java/cloudburst/rejects/aax/AntiAntiXray.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package cloudburst.rejects.aax;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cloudburst.rejects.aax.Etc.*;
|
||||
|
||||
public class AntiAntiXray {
|
||||
public static List<RefreshingJob> jobs = new ArrayList<>();
|
||||
|
||||
public static void scanForFake(int rad, long delayInMS) {
|
||||
RefreshingJob rfj = new RefreshingJob(new Runner(rad, delayInMS));
|
||||
jobs.add(rfj);
|
||||
}
|
||||
|
||||
}
|
||||
24
src/main/java/cloudburst/rejects/aax/Etc/Config.java
Normal file
24
src/main/java/cloudburst/rejects/aax/Etc/Config.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package cloudburst.rejects.aax.Etc;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
|
||||
import static org.lwjgl.glfw.GLFW.GLFW_KEY_Y;
|
||||
import static org.lwjgl.glfw.GLFW.GLFW_KEY_V;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Config {
|
||||
public static int rad = 5;
|
||||
public static long delay = 1000;
|
||||
public static boolean scanAll = false;
|
||||
public static boolean auto = false;
|
||||
public static int mtreshold = 5;
|
||||
public static Block[] checkblocks = {Blocks.OBSIDIAN, Blocks.CLAY, Blocks.MOSSY_COBBLESTONE,
|
||||
Blocks.DIAMOND_ORE, Blocks.REDSTONE_ORE, Blocks.IRON_ORE, Blocks.COAL_ORE, Blocks.LAPIS_ORE,
|
||||
Blocks.GOLD_ORE, Blocks.EMERALD_ORE, Blocks.NETHER_QUARTZ_ORE};
|
||||
public static int kcScan = GLFW_KEY_Y;
|
||||
public static int kcRemove = GLFW_KEY_V;
|
||||
|
||||
|
||||
}
|
||||
19
src/main/java/cloudburst/rejects/aax/Etc/RefreshingJob.java
Normal file
19
src/main/java/cloudburst/rejects/aax/Etc/RefreshingJob.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package cloudburst.rejects.aax.Etc;
|
||||
|
||||
public class RefreshingJob {
|
||||
public Runner refresher;
|
||||
public Thread runner;
|
||||
public boolean done = false;
|
||||
|
||||
public RefreshingJob(Runner refresher) {
|
||||
this.refresher = refresher;
|
||||
this.runner = new Thread(refresher);
|
||||
this.runner.start();
|
||||
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
refresher.isRunning = false;
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
66
src/main/java/cloudburst/rejects/aax/Etc/Runner.java
Normal file
66
src/main/java/cloudburst/rejects/aax/Etc/Runner.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package cloudburst.rejects.aax.Etc;
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
public class Runner implements Runnable {
|
||||
boolean isRunning = true;
|
||||
long delay;
|
||||
int rad;
|
||||
|
||||
public Runner(int rad, long delay) {
|
||||
this.rad = rad;
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MinecraftClient mc = MinecraftClient.getInstance();
|
||||
BlockPos pos = mc.player.getBlockPos();
|
||||
|
||||
|
||||
// Blocks that aren't ores but still needs to be checked
|
||||
Block[] blocks2check = Config.checkblocks;
|
||||
|
||||
for (int cx = -rad; cx <= rad; cx++) {
|
||||
for (int cy = -rad; cy <= rad; cy++) {
|
||||
for (int cz = -rad; cz <= rad; cz++) {
|
||||
if (!isRunning) break;
|
||||
BlockPos current = new BlockPos(pos.getX() + cx, pos.getY() + cy, pos.getZ() + cz);
|
||||
if (mc.world.getBlockState(current).getBlock() == null) continue;
|
||||
Block block = mc.world.getBlockState(current).getBlock();
|
||||
|
||||
boolean good = Config.scanAll; // cool for else man
|
||||
|
||||
// only check if block is a ore or in blocks2check (obsidian for example)
|
||||
for (Block block1 : blocks2check) {
|
||||
if (block.equals(block1)) {
|
||||
good = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!good) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
PlayerActionC2SPacket packet = new PlayerActionC2SPacket(Action.ABORT_DESTROY_BLOCK, current, Direction.UP);
|
||||
|
||||
mc.getNetworkHandler().sendPacket(packet);
|
||||
|
||||
try {
|
||||
Thread.sleep(delay);
|
||||
} catch (InterruptedException ignored) {
|
||||
ignored.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user