who needs git log anyway
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package cloudburst.rejects;
|
||||
|
||||
import minegame159.meteorclient.MeteorAddon;
|
||||
import minegame159.meteorclient.commands.Commands;
|
||||
import minegame159.meteorclient.modules.Modules;
|
||||
import minegame159.meteorclient.systems.commands.Commands;
|
||||
import minegame159.meteorclient.systems.modules.Modules;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -17,13 +17,17 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
||||
public void onInitialize() {
|
||||
LOG.info("Initializing Meteor Rejects Addon");
|
||||
|
||||
Modules.get().add(new AutoMountBypassDupe());
|
||||
Modules.get().add(new AutoPot());
|
||||
Modules.get().add(new Lavacast());
|
||||
Modules.get().add(new RenderInvisible());
|
||||
Modules modules = Modules.get();
|
||||
modules.add(new AutoPot());
|
||||
modules.add(new Confuse());
|
||||
modules.add(new Glide());
|
||||
modules.add(new Lavacast());
|
||||
modules.add(new RenderInvisible());
|
||||
modules.add(new SoundLocator());
|
||||
|
||||
Commands.get().add(new BookDupeCommand());
|
||||
Commands.get().add(new GiveCommand());
|
||||
Commands.get().add(new Notebot());
|
||||
Commands commands = Commands.get();
|
||||
commands.add(new AntiAntiXrayCommand());
|
||||
commands.add(new BookDupeCommand());
|
||||
commands.add(new GiveCommand());
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cloudburst.rejects.commands;
|
||||
|
||||
import cloudburst.rejects.aax.AntiAntiXray;
|
||||
import cloudburst.rejects.aax.Etc.Config;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import minegame159.meteorclient.systems.commands.Command;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||
|
||||
public class AntiAntiXrayCommand extends Command {
|
||||
public AntiAntiXrayCommand() {
|
||||
super("anti-anti-xray", "Circumvent antiantixray plugin", "aax");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||
builder.executes(ctx -> {
|
||||
AntiAntiXray.scanForFake(Config.rad, Config.delay);
|
||||
ChatUtils.prefixInfo("AAX", "Refreshing blocks");
|
||||
return SINGLE_SUCCESS;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package cloudburst.rejects.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
|
||||
import minegame159.meteorclient.commands.Command;
|
||||
import minegame159.meteorclient.systems.commands.Command;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
import minegame159.meteorclient.utils.player.InvUtils;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.nbt.StringNbtReader;
|
||||
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
|
||||
|
||||
import cloudburst.rejects.arguments.EnumStringArgumentType;
|
||||
import minegame159.meteorclient.commands.Command;
|
||||
import minegame159.meteorclient.systems.commands.Command;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
|
||||
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||
|
||||
@@ -1,290 +0,0 @@
|
||||
package cloudburst.rejects.commands;
|
||||
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.MeteorClient;
|
||||
import minegame159.meteorclient.commands.Command;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
import minegame159.meteorclient.utils.player.InvUtils;
|
||||
import minegame159.meteorclient.utils.player.Rotations;
|
||||
import minegame159.meteorclient.utils.world.BlockUtils;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.NoteBlock;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||
|
||||
public class Notebot extends Command {
|
||||
|
||||
private enum Stage {
|
||||
None,
|
||||
SetUp,
|
||||
Tune,
|
||||
Playing,
|
||||
Preview
|
||||
}
|
||||
|
||||
private final List<BlockPos> possibleBlockPos = new java.util.ArrayList<BlockPos>(Collections.emptyList());
|
||||
|
||||
private int tickDelay = 0;
|
||||
private int tempo = 5;
|
||||
private final List<Integer> song = new java.util.ArrayList<Integer>(Collections.emptyList());
|
||||
private final List<Integer> uniqueNotes = new java.util.ArrayList<Integer>(Collections.emptyList());
|
||||
private final HashMap<Integer, BlockPos> blockPositions = new HashMap<Integer, BlockPos>();
|
||||
private int ticks = 0;
|
||||
private int count = 0;
|
||||
private int currentNote = 0;
|
||||
private Stage stage = Stage.None;
|
||||
|
||||
public Notebot() {
|
||||
super("notebot", "Plays noteblocks nicely.");
|
||||
for (int y = -5; y < 5; y++) {
|
||||
for (int x = -5; x < 5; x++) {
|
||||
if (y!=0||x!=0) {
|
||||
BlockPos pos = new BlockPos(x, 0, y);
|
||||
if (pos.getSquaredDistance(0, 0, 0, true) < (4.3*4.3)-0.5) {
|
||||
possibleBlockPos.add(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||
builder.then(literal("tempo").then(argument("value", IntegerArgumentType.integer()).executes(ctx -> {
|
||||
tempo = ctx.getArgument("value",Integer.class);
|
||||
return SINGLE_SUCCESS;
|
||||
})));
|
||||
builder.then(literal("load").then(argument("file", StringArgumentType.greedyString()).executes(ctx -> {
|
||||
String filepath = ctx.getArgument("file",String.class);
|
||||
File file = MeteorClient.FOLDER.toPath().resolve(String.format("notebot/%s.txt",filepath)).toFile();
|
||||
if (!file.exists() || !file.isFile()) {
|
||||
ChatUtils.prefixError("Notebot","File doesn't exist.");
|
||||
return SINGLE_SUCCESS;
|
||||
}
|
||||
if (!loadFile(file.toPath())) return SINGLE_SUCCESS;
|
||||
if (!setupBlocks()) return SINGLE_SUCCESS;
|
||||
MeteorClient.EVENT_BUS.subscribe(this);
|
||||
return SINGLE_SUCCESS;
|
||||
})));
|
||||
builder.then(literal("preview").then(argument("file", StringArgumentType.greedyString()).executes(ctx -> {
|
||||
String filepath = ctx.getArgument("file",String.class);
|
||||
File file = MeteorClient.FOLDER.toPath().resolve(String.format("notebot/%s.txt",filepath)).toFile();
|
||||
if (!file.exists() || !file.isFile()) {
|
||||
ChatUtils.prefixError("Notebot","File doesn't exist.");
|
||||
return SINGLE_SUCCESS;
|
||||
}
|
||||
if (!loadFile(file.toPath())) return SINGLE_SUCCESS;
|
||||
stage = Stage.Preview;
|
||||
currentNote = 0;
|
||||
MeteorClient.EVENT_BUS.subscribe(this);
|
||||
return SINGLE_SUCCESS;
|
||||
})));
|
||||
builder.then(literal("play").executes(ctx -> {
|
||||
startPlaying();
|
||||
return SINGLE_SUCCESS;
|
||||
}));
|
||||
builder.then(literal("stop").executes(ctx -> {
|
||||
stopPlaying();
|
||||
return SINGLE_SUCCESS;
|
||||
}));
|
||||
}
|
||||
|
||||
private boolean loadFile(Path file) {
|
||||
List<String> data;
|
||||
try {
|
||||
data = Files.readAllLines(file);
|
||||
} catch (IOException e) {
|
||||
ChatUtils.prefixError("Notebot","File error");
|
||||
return false;
|
||||
}
|
||||
song.clear();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
try {
|
||||
int v = Integer.parseInt(data.get(i));
|
||||
song.add(v);
|
||||
} catch (NumberFormatException e) {
|
||||
ChatUtils.prefixError("Notebot", "Invalid character at line %d", i);
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean setupBlocks() {
|
||||
for (int i = 0; i < song.size(); i++) {
|
||||
if (!uniqueNotes.contains(song.get(i))) {
|
||||
uniqueNotes.add(song.get(i));
|
||||
}
|
||||
}
|
||||
if (uniqueNotes.size() > possibleBlockPos.size()) {
|
||||
ChatUtils.prefixError("Notebot","Too many notes. %d is the maximum.", possibleBlockPos.size());
|
||||
return false;
|
||||
}
|
||||
currentNote = 0;
|
||||
stage = Stage.SetUp;
|
||||
return true;
|
||||
}
|
||||
|
||||
private void startPlaying() {
|
||||
if (stage != Stage.Playing) {
|
||||
ChatUtils.prefixError("Notebot","You need to load a song first");
|
||||
return;
|
||||
}
|
||||
MeteorClient.EVENT_BUS.subscribe(this);
|
||||
ticks = 0;
|
||||
currentNote = 0;
|
||||
}
|
||||
|
||||
private void stopPlaying() {
|
||||
ChatUtils.prefixInfo("Notebot","Stopped.");
|
||||
MeteorClient.EVENT_BUS.unsubscribe(this);
|
||||
stage = Stage.None;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
ticks++;
|
||||
if (stage != Stage.Playing && stage != Stage.Preview) {
|
||||
if (ticks<tickDelay) return;
|
||||
} else {
|
||||
if (ticks<20/tempo) return;
|
||||
}
|
||||
|
||||
ticks = 0;
|
||||
switch (stage) {
|
||||
case None:
|
||||
return;
|
||||
case Tune:
|
||||
onTickTune();
|
||||
return;
|
||||
case SetUp:
|
||||
onTickSetup();
|
||||
return;
|
||||
case Playing:
|
||||
onTickPlay();
|
||||
return;
|
||||
case Preview:
|
||||
onTickPreview();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void onTickPreview() {
|
||||
if (currentNote>=song.size()) {
|
||||
stopPlaying();
|
||||
return;
|
||||
}
|
||||
int note = song.get(currentNote);
|
||||
if (note==-1) {
|
||||
currentNote++;
|
||||
return;
|
||||
}
|
||||
mc.player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_HARP, 2f, (float) Math.pow(2.0D, (note - 12) / 12.0D));
|
||||
currentNote++;
|
||||
}
|
||||
|
||||
private void onTickSetup() {
|
||||
if (currentNote>=uniqueNotes.size()) {
|
||||
stage = Stage.Playing;
|
||||
MeteorClient.EVENT_BUS.unsubscribe(this);
|
||||
return;
|
||||
}
|
||||
int slot = InvUtils.findItemInHotbar(Items.NOTE_BLOCK);
|
||||
BlockPos pos = mc.player.getBlockPos().add(possibleBlockPos.get(currentNote));
|
||||
if (slot == -1) {
|
||||
ChatUtils.prefixError("Notebot","Not enough noteblocks");
|
||||
stopPlaying();
|
||||
return;
|
||||
}
|
||||
if (uniqueNotes.get(currentNote) != -1) {
|
||||
if (!BlockUtils.place(pos,Hand.MAIN_HAND, slot, true, 100, true)) {
|
||||
ChatUtils.prefixError("Notebot","Couldn't place noteblock");
|
||||
stopPlaying();
|
||||
return;
|
||||
}
|
||||
}
|
||||
blockPositions.put(uniqueNotes.get(currentNote), pos);
|
||||
stage = Stage.Tune;
|
||||
}
|
||||
|
||||
private void onTickTune() {
|
||||
BlockPos pos = mc.player.getBlockPos().add(possibleBlockPos.get(currentNote));
|
||||
Rotations.rotate(Rotations.getYaw(pos), Rotations.getPitch(pos), 100, this::tuneRotate);
|
||||
}
|
||||
|
||||
private void tuneRotate() {
|
||||
BlockPos pos = mc.player.getBlockPos().add(possibleBlockPos.get(currentNote));
|
||||
if (!tuneBlock(pos, uniqueNotes.get(currentNote))) {
|
||||
stopPlaying();
|
||||
}
|
||||
}
|
||||
|
||||
private void onTickPlay() {
|
||||
|
||||
if (currentNote >= song.size()) {
|
||||
stopPlaying();
|
||||
return;
|
||||
}
|
||||
int note = song.get(currentNote);
|
||||
if (note==-1) {
|
||||
currentNote++;
|
||||
return;
|
||||
}
|
||||
BlockPos pos = blockPositions.get(note);
|
||||
Rotations.rotate(Rotations.getYaw(pos), Rotations.getPitch(pos), 100, this::playRotate);
|
||||
}
|
||||
|
||||
private void playRotate() {
|
||||
int note = song.get(currentNote);
|
||||
BlockPos pos = blockPositions.get(note);
|
||||
|
||||
mc.interactionManager.attackBlock(pos,Direction.DOWN);
|
||||
currentNote++;
|
||||
}
|
||||
|
||||
private boolean tuneBlock(BlockPos pos, int note) {
|
||||
if (mc.world == null || mc.player == null) return false;
|
||||
if (count>60) {
|
||||
ChatUtils.prefixError("Notebot","Couldn't tune the noteblock.");
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState block = mc.world.getBlockState(pos);
|
||||
if (block.getBlock() != Blocks.NOTE_BLOCK && note != -1) {
|
||||
ChatUtils.prefixError("Notebot","Block isn't a noteblock");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (block.get(NoteBlock.NOTE).equals(note) || note == -1) {
|
||||
currentNote++;
|
||||
stage=Stage.SetUp;
|
||||
count=0;
|
||||
return true;
|
||||
};
|
||||
mc.interactionManager.interactBlock(mc.player, mc.world, Hand.MAIN_HAND, new BlockHitResult(
|
||||
mc.player.getPos(), Direction.UP, pos, true)
|
||||
);
|
||||
count++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
41
src/main/java/cloudburst/rejects/mixin/ClientWorldMixin.java
Normal file
41
src/main/java/cloudburst/rejects/mixin/ClientWorldMixin.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package cloudburst.rejects.mixin;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.GameMode;
|
||||
|
||||
import cloudburst.rejects.modules.RenderInvisible;
|
||||
import minegame159.meteorclient.systems.modules.Modules;
|
||||
|
||||
@Mixin(ClientWorld.class)
|
||||
public abstract class ClientWorldMixin {
|
||||
|
||||
@Shadow
|
||||
MinecraftClient client;
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "doRandomBlockDisplayTicks", cancellable = true)
|
||||
public void doRandomBlockDisplayTicks(int xCenter, int yCenter, int i, CallbackInfo info) {
|
||||
Random random = new Random();
|
||||
boolean showBarrierParticles = this.client.interactionManager.getCurrentGameMode() == GameMode.CREATIVE && (this.client.player.inventory.getMainHandStack().getItem() == Items.BARRIER || this.client.player.inventory.offHand.get(0).getItem() == Items.BARRIER);
|
||||
if (Modules.get().get(RenderInvisible.class).isActive()) showBarrierParticles = true;
|
||||
|
||||
BlockPos.Mutable mutable = new BlockPos.Mutable();
|
||||
|
||||
for(int k = 0; k < 667; ++k) {
|
||||
client.world.randomBlockDisplayTick(xCenter, yCenter, i, 16, random, showBarrierParticles, mutable);
|
||||
client.world.randomBlockDisplayTick(xCenter, yCenter, i, 32, random, showBarrierParticles, mutable);
|
||||
}
|
||||
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cloudburst.rejects.mixin;
|
||||
|
||||
import minegame159.meteorclient.modules.Modules;
|
||||
import minegame159.meteorclient.systems.modules.Modules;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
||||
@@ -17,6 +17,6 @@ public abstract class EntityMixin {
|
||||
private void isInvisibleToCanceller(PlayerEntity player, CallbackInfoReturnable<Boolean> info) {
|
||||
if (player == null) info.setReturnValue(false);
|
||||
|
||||
if (Modules.get().isActive(RenderInvisible.class)) info.setReturnValue(false);
|
||||
if (Modules.get().get(RenderInvisible.class).renderEntities()) info.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package minegame159.meteorclient.mixin;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.StructureVoidBlock;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import minegame159.meteorclient.systems.modules.Modules;
|
||||
import cloudburst.rejects.modules.RenderInvisible;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(StructureVoidBlock.class)
|
||||
public abstract class StructureVoidBlockMixin extends Block {
|
||||
|
||||
public StructureVoidBlockMixin(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "getRenderType", cancellable = true)
|
||||
public void getRenderType(BlockState state, CallbackInfoReturnable<BlockRenderType> info) {
|
||||
info.setReturnValue(BlockRenderType.MODEL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideInvisible(BlockState state, BlockState neighbor, Direction facing) {
|
||||
return !(Modules.get().get(RenderInvisible.class).renderStructureVoid());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client/).
|
||||
* Copyright (c) 2021 Meteor Development.
|
||||
*/
|
||||
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
//Created by squidoodly 12/07/2020
|
||||
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.packets.PacketEvent;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.modules.Categories;
|
||||
import minegame159.meteorclient.modules.Module;
|
||||
import minegame159.meteorclient.modules.Modules;
|
||||
import minegame159.meteorclient.modules.world.MountBypass;
|
||||
import minegame159.meteorclient.settings.BoolSetting;
|
||||
import minegame159.meteorclient.settings.IntSetting;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
import minegame159.meteorclient.utils.player.InvUtils;
|
||||
import net.minecraft.block.ShulkerBoxBlock;
|
||||
import net.minecraft.client.gui.screen.ingame.HorseScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.passive.AbstractDonkeyEntity;
|
||||
import net.minecraft.entity.passive.LlamaEntity;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import net.minecraft.screen.slot.SlotActionType;
|
||||
import net.minecraft.util.Hand;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AutoMountBypassDupe extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> shulkersOnly = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("shulker-only")
|
||||
.description("Only moves shulker boxes into the inventory")
|
||||
.defaultValue(true)
|
||||
.build());
|
||||
|
||||
private final Setting<Boolean> faceDown = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("rotate-down")
|
||||
.description("Faces down when dropping items.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("delay")
|
||||
.description("The delay in ticks between actions.")
|
||||
.defaultValue(4)
|
||||
.min(0)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final List<Integer> slotsToMove = new ArrayList<>();
|
||||
private final List<Integer> slotsToThrow = new ArrayList<>();
|
||||
|
||||
private boolean noCancel = false;
|
||||
private AbstractDonkeyEntity entity;
|
||||
private boolean sneak = false;
|
||||
private int timer;
|
||||
|
||||
public AutoMountBypassDupe() {
|
||||
super(Categories.World, "auto-mount-bypass-dupe", "Does the mount bypass dupe for you. Disable with esc.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onSendPacket(PacketEvent.Send event) {
|
||||
if (noCancel) return;
|
||||
|
||||
Modules.get().get(MountBypass.class).onSendPacket(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post event) {
|
||||
if (GLFW.glfwGetKey(mc.getWindow().getHandle(), GLFW.GLFW_KEY_ESCAPE) == GLFW.GLFW_PRESS) {
|
||||
toggle();
|
||||
mc.player.closeHandledScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
if (timer <= 0) {
|
||||
timer = delay.get();
|
||||
} else {
|
||||
timer--;
|
||||
return;
|
||||
}
|
||||
|
||||
int slots = getInvSize(mc.player.getVehicle());
|
||||
|
||||
for (Entity e : mc.world.getEntities()) {
|
||||
if (e.distanceTo(mc.player) < 5 && e instanceof AbstractDonkeyEntity && ((AbstractDonkeyEntity) e).isTame()) {
|
||||
entity = (AbstractDonkeyEntity) e;
|
||||
}
|
||||
}
|
||||
if (entity == null) return;
|
||||
|
||||
if (sneak) {
|
||||
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY));
|
||||
mc.player.setSneaking(false);
|
||||
sneak = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (slots == -1) {
|
||||
if (entity.hasChest() || mc.player.getMainHandStack().getItem() == Items.CHEST){
|
||||
mc.player.networkHandler.sendPacket(new PlayerInteractEntityC2SPacket(entity, Hand.MAIN_HAND, mc.player.isSneaking()));
|
||||
} else {
|
||||
int slot = InvUtils.findItemWithCount(Items.CHEST).slot;
|
||||
if (slot != -1 && slot < 9) {
|
||||
mc.player.inventory.selectedSlot = slot;
|
||||
} else {
|
||||
ChatUtils.moduleError(this, "Cannot find chest in your hotbar... disabling.");
|
||||
this.toggle();
|
||||
}
|
||||
}
|
||||
} else if (slots == 0) {
|
||||
if (isDupeTime()) {
|
||||
if (!slotsToThrow.isEmpty()) {
|
||||
if (faceDown.get()) {
|
||||
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookOnly(mc.player.yaw, 90, mc.player.isOnGround()));
|
||||
}
|
||||
for (int i : slotsToThrow) {
|
||||
InvUtils.clickSlot(i, 1, SlotActionType.THROW);
|
||||
}
|
||||
slotsToThrow.clear();
|
||||
} else {
|
||||
for (int i = 2; i < getDupeSize() + 1; i++) {
|
||||
slotsToThrow.add(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mc.player.closeHandledScreen();
|
||||
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.PRESS_SHIFT_KEY));
|
||||
|
||||
mc.player.setSneaking(true);
|
||||
sneak = true;
|
||||
}
|
||||
} else if (!(mc.currentScreen instanceof HorseScreen)) {
|
||||
mc.player.openRidingInventory();
|
||||
} else if (slots > 0 ) {
|
||||
if (slotsToMove.isEmpty()) {
|
||||
boolean empty = true;
|
||||
for (int i = 2; i <= slots; i++) {
|
||||
if (!(mc.player.currentScreenHandler.getStacks().get(i).isEmpty())) {
|
||||
empty = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty) {
|
||||
for (int i = slots + 2; i < mc.player.currentScreenHandler.getStacks().size(); i++) {
|
||||
if (!(mc.player.currentScreenHandler.getStacks().get(i).isEmpty())) {
|
||||
if (mc.player.currentScreenHandler.getSlot(i).getStack().getItem() == Items.CHEST) continue;
|
||||
if (!(mc.player.currentScreenHandler.getSlot(i).getStack().getItem() instanceof BlockItem && ((BlockItem) mc.player.currentScreenHandler.getSlot(i).getStack().getItem()).getBlock() instanceof ShulkerBoxBlock) && shulkersOnly.get()) continue;
|
||||
slotsToMove.add(i);
|
||||
|
||||
if (slotsToMove.size() >= slots) break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
noCancel = true;
|
||||
mc.player.networkHandler.sendPacket(new PlayerInteractEntityC2SPacket(entity, Hand.MAIN_HAND, entity.getPos().add(entity.getWidth() / 2, entity.getHeight() / 2, entity.getWidth() / 2), mc.player.isSneaking()));
|
||||
noCancel = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!slotsToMove.isEmpty()) {
|
||||
for (int i : slotsToMove) InvUtils.clickSlot(i, 0, SlotActionType.QUICK_MOVE);
|
||||
slotsToMove.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getInvSize(Entity e){
|
||||
if (!(e instanceof AbstractDonkeyEntity)) return -1;
|
||||
|
||||
if (!((AbstractDonkeyEntity)e).hasChest()) return 0;
|
||||
|
||||
if (e instanceof LlamaEntity) {
|
||||
return 3 * ((LlamaEntity) e).getStrength();
|
||||
}
|
||||
|
||||
return 15;
|
||||
}
|
||||
|
||||
private boolean isDupeTime() {
|
||||
if (mc.player.getVehicle() != entity || entity.hasChest() || mc.player.currentScreenHandler.getStacks().size() == 46) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mc.player.currentScreenHandler.getStacks().size() > 38) {
|
||||
for (int i = 2; i < getDupeSize() + 1; i++) {
|
||||
if (mc.player.currentScreenHandler.getSlot(i).hasStack()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private int getDupeSize() {
|
||||
if (mc.player.getVehicle() != entity || entity.hasChest() || mc.player.currentScreenHandler.getStacks().size() == 46) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return mc.player.currentScreenHandler.getStacks().size() - 38;
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,13 @@ import baritone.api.BaritoneAPI;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.entity.player.ItemUseCrosshairTargetEvent;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.modules.Categories;
|
||||
import minegame159.meteorclient.modules.Module;
|
||||
import minegame159.meteorclient.modules.Modules;
|
||||
import minegame159.meteorclient.modules.combat.AnchorAura;
|
||||
import minegame159.meteorclient.modules.combat.BedAura;
|
||||
import minegame159.meteorclient.modules.combat.CrystalAura;
|
||||
import minegame159.meteorclient.modules.combat.KillAura;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
import minegame159.meteorclient.systems.modules.Modules;
|
||||
import minegame159.meteorclient.systems.modules.combat.AnchorAura;
|
||||
import minegame159.meteorclient.systems.modules.combat.BedAura;
|
||||
import minegame159.meteorclient.systems.modules.combat.CrystalAura;
|
||||
import minegame159.meteorclient.systems.modules.combat.KillAura;
|
||||
import minegame159.meteorclient.settings.*;
|
||||
import minegame159.meteorclient.utils.Utils;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
|
||||
205
src/main/java/cloudburst/rejects/modules/Confuse.java
Normal file
205
src/main/java/cloudburst/rejects/modules/Confuse.java
Normal file
@@ -0,0 +1,205 @@
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.RaycastContext;
|
||||
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.render.RenderEvent;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.settings.BoolSetting;
|
||||
import minegame159.meteorclient.settings.EnumSetting;
|
||||
import minegame159.meteorclient.settings.IntSetting;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
import minegame159.meteorclient.utils.render.RenderUtils;
|
||||
import minegame159.meteorclient.utils.render.color.Color;
|
||||
|
||||
public class Confuse extends Module {
|
||||
|
||||
int delayWaited = 0;
|
||||
double circleProgress = 0;
|
||||
double addition = 0.0;
|
||||
Entity target = null;
|
||||
|
||||
public enum Mode {
|
||||
RandomTP,
|
||||
Switch,
|
||||
Circle
|
||||
}
|
||||
|
||||
public Confuse() {
|
||||
super(Categories.Misc, "confuse", "Makes your enemies shit themselves");
|
||||
}
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
|
||||
.name("mode")
|
||||
.defaultValue(Mode.RandomTP)
|
||||
.description("Mode")
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("delay")
|
||||
.description("Delay")
|
||||
.defaultValue(3)
|
||||
.min(0)
|
||||
.sliderMax(20)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> circleSpeed = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("circle-speed")
|
||||
.description("Circle mode speed")
|
||||
.defaultValue(10)
|
||||
.min(1)
|
||||
.sliderMax(180)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> moveThroughBlocks = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("move-through-blocks")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> budgetGraphics = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("budget-graphics")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
delayWaited = 0;
|
||||
circleProgress = 0;
|
||||
addition = 0.0;
|
||||
target = null;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
delayWaited++;
|
||||
if (delayWaited < delay.get()) return;
|
||||
delayWaited = 0;
|
||||
assert mc.player != null;
|
||||
Vec3d sel1 = mc.player.getPos().add(-4, -4, -4);
|
||||
Vec3d sel2 = sel1.add(8, 8, 8);
|
||||
Box selector = new Box(sel1, sel2);
|
||||
assert mc.world != null;
|
||||
for (Entity e : mc.world.getEntities()) {
|
||||
if (e.getUuid() == mc.player.getUuid()) continue;
|
||||
if (!e.isAlive()
|
||||
|| !e.isAttackable()) continue;
|
||||
if (e.getBoundingBox().intersects(selector)) {
|
||||
target = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (target == null) return;
|
||||
if (!target.isAlive()) {
|
||||
target = null;
|
||||
return;
|
||||
}
|
||||
Vec3d entityPos = target.getPos();
|
||||
Vec3d playerPos = mc.player.getPos();
|
||||
if (playerPos.distanceTo(entityPos) > 6) {
|
||||
target = null;
|
||||
return;
|
||||
}
|
||||
Random r = new Random();
|
||||
BlockHitResult hit;
|
||||
switch (mode.get()) {
|
||||
case RandomTP:
|
||||
double x = r.nextDouble() * 6 - 3;
|
||||
double y = 0;
|
||||
double z = r.nextDouble() * 6 - 3;
|
||||
Vec3d addend = new Vec3d(x, y, z);
|
||||
Vec3d goal = entityPos.add(addend);
|
||||
if (!mc.world.getBlockState(new BlockPos(goal.x, goal.y, goal.z)).getBlock().is(Blocks.AIR)) {
|
||||
goal = new Vec3d(x, playerPos.y, z);
|
||||
}
|
||||
if (mc.world.getBlockState(new BlockPos(goal.x, goal.y, goal.z)).getBlock().is(Blocks.AIR)) {
|
||||
hit = mc.world.raycast(new RaycastContext(
|
||||
mc.player.getPos(),goal, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (!moveThroughBlocks.get() && hit.isInsideBlock()) {
|
||||
delayWaited = (int) (delay.get() - 1);
|
||||
break;
|
||||
}
|
||||
mc.player.updatePosition(goal.x, goal.y, goal.z);
|
||||
} else {
|
||||
delayWaited = (int) (delay.get() - 1);
|
||||
}
|
||||
break;
|
||||
case Switch:
|
||||
Vec3d diff = entityPos.subtract(playerPos);
|
||||
Vec3d diff1 = new Vec3d(clamp(diff.x, -3, 3), clamp(diff.y, -3, 3), clamp(diff.z, -3, 3));
|
||||
Vec3d goal2 = entityPos.add(diff1);
|
||||
hit = mc.world.raycast(new RaycastContext(
|
||||
mc.player.getPos(), goal2, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (!moveThroughBlocks.get() && hit.isInsideBlock()) {
|
||||
delayWaited = (int) (delay.get() - 1);
|
||||
break;
|
||||
}
|
||||
mc.player.updatePosition(goal2.x, goal2.y, goal2.z);
|
||||
break;
|
||||
case Circle:
|
||||
delay.set(0);
|
||||
circleProgress += circleSpeed.get();
|
||||
if (circleProgress > 360) circleProgress -= 360;
|
||||
double rad = Math.toRadians(circleProgress);
|
||||
double sin = Math.sin(rad) * 3;
|
||||
double cos = Math.cos(rad) * 3;
|
||||
Vec3d current = new Vec3d(entityPos.x + sin, playerPos.y, entityPos.z + cos);
|
||||
hit = mc.world.raycast(new RaycastContext(
|
||||
mc.player.getPos(), current, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (!moveThroughBlocks.get() && hit.isInsideBlock())
|
||||
break;
|
||||
mc.player.updatePosition(current.x, current.y, current.z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onRender(RenderEvent event) {
|
||||
if (target == null) return;
|
||||
|
||||
boolean flag = budgetGraphics.get();
|
||||
Vec3d last = null;
|
||||
addition += flag ? 0 : 1.0;
|
||||
if (addition > 360) addition = 0;
|
||||
for (int i = 0; i < 360; i += flag ? 7 : 1) {
|
||||
Color c1;
|
||||
if (flag) c1 = new Color(0, 255, 0);
|
||||
else {
|
||||
double rot = (255.0 * 3) * (((((double) i) + addition) % 360) / 360.0);
|
||||
int seed = (int) Math.floor(rot / 255.0);
|
||||
double current = rot % 255;
|
||||
double red = seed == 0 ? current : (seed == 1 ? Math.abs(current - 255) : 0);
|
||||
double green = seed == 1 ? current : (seed == 2 ? Math.abs(current - 255) : 0);
|
||||
double blue = seed == 2 ? current : (seed == 0 ? Math.abs(current - 255) : 0);
|
||||
c1 = new Color((int) red, (int) green, (int) blue);
|
||||
}
|
||||
Vec3d tp = target.getPos();
|
||||
double rad = Math.toRadians(i);
|
||||
double sin = Math.sin(rad) * 3;
|
||||
double cos = Math.cos(rad) * 3;
|
||||
Vec3d c = new Vec3d(tp.x + sin, tp.y + target.getHeight() / 2, tp.z + cos);
|
||||
if (last != null) RenderUtils.drawLine(last, c.x, c.y, c.z, c1, event);
|
||||
last = c;
|
||||
}
|
||||
}
|
||||
|
||||
public static double clamp(double val, double min, double max) {
|
||||
return Math.max(min, Math.min(max, val));
|
||||
}
|
||||
}
|
||||
109
src/main/java/cloudburst/rejects/modules/Glide.java
Normal file
109
src/main/java/cloudburst/rejects/modules/Glide.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.settings.DoubleSetting;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
|
||||
public class Glide extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
public Glide() {
|
||||
super(Categories.Movement, "glide", "Makes you glide down slowly when falling.");
|
||||
}
|
||||
|
||||
private final Setting<Double> fallSpeed = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("fall-speed")
|
||||
.description("Fall Speed")
|
||||
.defaultValue(0.125)
|
||||
.min(0.005)
|
||||
.sliderMax(0.25)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> moveSpeed = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("move-speed")
|
||||
.description("Horizontal movement factor.")
|
||||
.defaultValue(1.2)
|
||||
.min(0.75)
|
||||
.sliderMax(5)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> minHeight = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("min-height")
|
||||
.description("Won't glide when you are too close to the ground.")
|
||||
.defaultValue(0)
|
||||
.min(0)
|
||||
.sliderMax(2)
|
||||
.build()
|
||||
);
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
Vec3d v = mc.player.getVelocity();
|
||||
|
||||
if(mc.player.isOnGround() || mc.player.isTouchingWater() || mc.player.isInLava()
|
||||
|| mc.player.isClimbing() || v.y >= 0)
|
||||
return;
|
||||
|
||||
if(minHeight.get() > 0)
|
||||
{
|
||||
Box box = mc.player.getBoundingBox();
|
||||
box = box.union(box.offset(0, -minHeight.get(), 0));
|
||||
if(!mc.world.isSpaceEmpty(box))
|
||||
return;
|
||||
|
||||
BlockPos min =
|
||||
new BlockPos(new Vec3d(box.minX, box.minY, box.minZ));
|
||||
BlockPos max =
|
||||
new BlockPos(new Vec3d(box.maxX, box.maxY, box.maxZ));
|
||||
Stream<BlockPos> stream = StreamSupport
|
||||
.stream(getAllInBox(min, max).spliterator(), true);
|
||||
|
||||
// manual collision check, since liquids don't have bounding boxes
|
||||
if(stream.map(this::getState).map(BlockState::getMaterial)
|
||||
.anyMatch(Material::isLiquid))
|
||||
return;
|
||||
}
|
||||
|
||||
mc.player.setVelocity(v.x, Math.max(v.y, -fallSpeed.get()), v.z);
|
||||
mc.player.flyingSpeed *= moveSpeed.get();
|
||||
}
|
||||
|
||||
public static ArrayList<BlockPos> getAllInBox(BlockPos from, BlockPos to)
|
||||
{
|
||||
ArrayList<BlockPos> blocks = new ArrayList<>();
|
||||
|
||||
BlockPos min = new BlockPos(Math.min(from.getX(), to.getX()),
|
||||
Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ()));
|
||||
BlockPos max = new BlockPos(Math.max(from.getX(), to.getX()),
|
||||
Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ()));
|
||||
|
||||
for(int x = min.getX(); x <= max.getX(); x++)
|
||||
for(int y = min.getY(); y <= max.getY(); y++)
|
||||
for(int z = min.getZ(); z <= max.getZ(); z++)
|
||||
blocks.add(new BlockPos(x, y, z));
|
||||
|
||||
return blocks;
|
||||
}
|
||||
|
||||
public BlockState getState(BlockPos pos)
|
||||
{
|
||||
return mc.world.getBlockState(pos);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package cloudburst.rejects.modules;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.render.RenderEvent;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.modules.Categories;
|
||||
import minegame159.meteorclient.modules.Module;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
import minegame159.meteorclient.rendering.Renderer;
|
||||
import minegame159.meteorclient.rendering.ShapeMode;
|
||||
import minegame159.meteorclient.settings.EnumSetting;
|
||||
@@ -23,6 +23,7 @@ import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraft.world.RaycastContext;
|
||||
|
||||
|
||||
@@ -102,19 +103,22 @@ public class Lavacast extends Module {
|
||||
if (mc.player == null || mc.world == null) toggle();
|
||||
tick = 0;
|
||||
stage = Stage.None;
|
||||
placeFluidPos = getTargetBlockPos().up();
|
||||
placeFluidPos = getTargetBlockPos();
|
||||
if (placeFluidPos == null) {
|
||||
placeFluidPos = mc.player.getBlockPos().down();
|
||||
placeFluidPos = mc.player.getBlockPos().down(2);
|
||||
} else {
|
||||
placeFluidPos = placeFluidPos.up();
|
||||
}
|
||||
final BlockHitResult result = mc.world.raycast(new RaycastContext(
|
||||
Vec3d.ofCenter(offsetByPlayerRotation(placeFluidPos.down())), Vec3d.ofCenter(offsetByPlayerRotation(placeFluidPos).down(250)), RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (result == null || result.getType() != HitResult.Type.BLOCK) {
|
||||
ChatUtils.moduleError(this,"No floor beneath you");
|
||||
dist=-1;
|
||||
getDistance(new Vec3i(1,0,0));
|
||||
getDistance(new Vec3i(-1,0,0));
|
||||
getDistance(new Vec3i(0,0,1));
|
||||
getDistance(new Vec3i(1,0,-1));
|
||||
if (dist<1) {
|
||||
ChatUtils.moduleError(this,"Couldn't locate bottom.");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
dist = placeFluidPos.getY() - result.getBlockPos().getY();
|
||||
ChatUtils.moduleInfo(this,"Distance: (highlight)%d(default).", dist);
|
||||
}
|
||||
|
||||
@@ -122,19 +126,10 @@ public class Lavacast extends Module {
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
if (mc.player == null || mc.world == null) return;
|
||||
tick++;
|
||||
if (stage == Stage.LavaDown && tick < dist*lavaDownMult.get()) return;
|
||||
if (stage == Stage.LavaUp && tick < dist*lavaUpMult.get()) return;
|
||||
if (stage == Stage.WaterDown && tick < dist*waterDownMult.get()) return;
|
||||
if (stage == Stage.WaterUp && tick < dist*waterUpMult.get()) return;
|
||||
if (shouldBreakOnTick()) return;
|
||||
if (dist < distMin.get()) toggle();
|
||||
if (tick < tickInterval.get()) {
|
||||
return;
|
||||
}
|
||||
tick = 0;
|
||||
if (stage == Stage.None && mc.world.getBlockState(placeFluidPos).getBlock() != Blocks.AIR) {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos), Rotations.getPitch(placeFluidPos), 100, this::updateBlockBreakingProgress);
|
||||
return;
|
||||
}
|
||||
if (checkMineBlock()) return;
|
||||
switch (stage) {
|
||||
case None: {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos),Rotations.getPitch(placeFluidPos),100, this::placeLava);
|
||||
@@ -162,9 +157,28 @@ public class Lavacast extends Module {
|
||||
stage = Stage.LavaDown;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldBreakOnTick() {
|
||||
if (stage == Stage.LavaDown && tick < dist*lavaDownMult.get()) return true;
|
||||
if (stage == Stage.LavaUp && tick < dist*lavaUpMult.get()) return true;
|
||||
if (stage == Stage.WaterDown && tick < dist*waterDownMult.get()) return true;
|
||||
if (stage == Stage.WaterUp && tick < dist*waterUpMult.get()) return true;
|
||||
if (tick < tickInterval.get()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean checkMineBlock() {
|
||||
if (stage == Stage.None && mc.world.getBlockState(placeFluidPos).getBlock() != Blocks.AIR) {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos), Rotations.getPitch(placeFluidPos), 100, this::updateBlockBreakingProgress);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onRender(RenderEvent event) {
|
||||
if (placeFluidPos == null) return;
|
||||
@@ -194,9 +208,9 @@ public class Lavacast extends Module {
|
||||
return;
|
||||
}
|
||||
int prevSlot = mc.player.inventory.selectedSlot;
|
||||
InvUtils.swap(slot);
|
||||
mc.player.inventory.selectedSlot = slot;
|
||||
mc.interactionManager.interactItem(mc.player,mc.world,Hand.MAIN_HAND);
|
||||
InvUtils.swap(prevSlot);
|
||||
mc.player.inventory.selectedSlot = prevSlot;
|
||||
}
|
||||
|
||||
private void placeWater() {
|
||||
@@ -207,9 +221,9 @@ public class Lavacast extends Module {
|
||||
return;
|
||||
}
|
||||
int prevSlot = mc.player.inventory.selectedSlot;
|
||||
InvUtils.swap(slot);
|
||||
mc.player.inventory.selectedSlot = slot;
|
||||
mc.interactionManager.interactItem(mc.player,mc.world,Hand.MAIN_HAND);
|
||||
InvUtils.swap(prevSlot);
|
||||
mc.player.inventory.selectedSlot = prevSlot;
|
||||
}
|
||||
|
||||
private void pickupLiquid() {
|
||||
@@ -220,9 +234,9 @@ public class Lavacast extends Module {
|
||||
return;
|
||||
}
|
||||
int prevSlot = mc.player.inventory.selectedSlot;
|
||||
InvUtils.swap(slot);
|
||||
mc.player.inventory.selectedSlot = slot;
|
||||
mc.interactionManager.interactItem(mc.player,mc.world,Hand.MAIN_HAND);
|
||||
InvUtils.swap(prevSlot);
|
||||
mc.player.inventory.selectedSlot = prevSlot;
|
||||
}
|
||||
|
||||
private void updateBlockBreakingProgress() {
|
||||
@@ -237,19 +251,17 @@ public class Lavacast extends Module {
|
||||
return ((BlockHitResult) blockHit).getBlockPos();
|
||||
}
|
||||
|
||||
private BlockPos offsetByPlayerRotation(BlockPos pos) {
|
||||
double rotation = (mc.player.yaw - 90) % 360;
|
||||
if (rotation < 0) rotation += 360.0;
|
||||
if (0 <= rotation && rotation < 22.5) return pos.south();
|
||||
else if (22.5 <= rotation && rotation < 67.5) return pos.south().west();
|
||||
else if (67.5 <= rotation && rotation < 112.5) return pos.west();
|
||||
else if (112.5 <= rotation && rotation < 157.5) return pos.north().west();
|
||||
else if (157.5 <= rotation && rotation < 202.5) return pos.north();
|
||||
else if (202.5 <= rotation && rotation < 247.5) return pos.north().east();
|
||||
else if (247.5 <= rotation && rotation < 292.5) return pos.east();
|
||||
else if (292.5 <= rotation && rotation < 337.5) return pos.south().east();
|
||||
else if (337.5 <= rotation && rotation < 360.0) return pos.south();
|
||||
return pos;
|
||||
private void getDistance(Vec3i offset) {
|
||||
BlockPos pos = placeFluidPos.down().add(offset);
|
||||
int new_dist;
|
||||
final BlockHitResult result = mc.world.raycast(new RaycastContext(
|
||||
Vec3d.ofCenter(pos), Vec3d.ofCenter(pos.down(250)), RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (result == null || result.getType() != HitResult.Type.BLOCK) {
|
||||
return;
|
||||
}
|
||||
new_dist = placeFluidPos.getY() - result.getBlockPos().getY();
|
||||
if (new_dist>dist) dist = new_dist;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,59 @@
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
import minegame159.meteorclient.modules.Categories;
|
||||
import minegame159.meteorclient.modules.Module;
|
||||
import minegame159.meteorclient.settings.BoolSetting;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
|
||||
public class RenderInvisible extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> entities = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("entities")
|
||||
.description("Render invisible entities.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> barrier = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("barrier")
|
||||
.description("Render barrier blocks.")
|
||||
.defaultValue(true)
|
||||
.onChanged(onChanged -> {
|
||||
if(this.isActive()) {
|
||||
mc.worldRenderer.reload();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> structureVoid = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("structure-void")
|
||||
.description("Render structure void blocks.")
|
||||
.defaultValue(true)
|
||||
.onChanged(onChanged -> {
|
||||
if(this.isActive()) {
|
||||
mc.worldRenderer.reload();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
);
|
||||
|
||||
public RenderInvisible() {
|
||||
super(Categories.Render, "render-invisible", "Renders invisible entities.");
|
||||
super(Categories.Render, "render-invisible", "Renders invisible entities and blocks.");
|
||||
}
|
||||
|
||||
public boolean renderEntities() {
|
||||
return this.isActive() && entities.get();
|
||||
}
|
||||
|
||||
public boolean renderBarriers() {
|
||||
return this.isActive() && barrier.get();
|
||||
}
|
||||
|
||||
public boolean renderStructureVoid() {
|
||||
return this.isActive() && structureVoid.get();
|
||||
}
|
||||
}
|
||||
55
src/main/java/cloudburst/rejects/modules/SoundLocator.java
Normal file
55
src/main/java/cloudburst/rejects/modules/SoundLocator.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.world.PlaySoundEvent;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.settings.SoundEventListSetting;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
import net.minecraft.client.sound.SoundInstance;
|
||||
import net.minecraft.client.sound.WeightedSoundSet;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SoundLocator extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<List<SoundEvent>> sounds = sgGeneral.add(new SoundEventListSetting.Builder()
|
||||
.name("sounds")
|
||||
.description("Sounds to find.")
|
||||
.defaultValue(new ArrayList<>(0))
|
||||
.build()
|
||||
);
|
||||
|
||||
public SoundLocator() {
|
||||
super(Categories.Misc, "sound-locator", "Prints locations of sound events.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPlaySound(PlaySoundEvent event) {
|
||||
for (SoundEvent sound : sounds.get()) {
|
||||
if (sound.getId().equals(event.sound.getId())) {
|
||||
printSound(event.sound);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void printSound(SoundInstance sound) {
|
||||
WeightedSoundSet soundSet = mc.getSoundManager().get(sound.getId());
|
||||
MutableText text = soundSet.getSubtitle().copy();
|
||||
text.append(String.format("%s at ", Formatting.RESET));
|
||||
Vec3d pos = new Vec3d(sound.getX(), sound.getY(), sound.getZ());
|
||||
text.append(ChatUtils.formatCoords(pos));
|
||||
text.append(String.format("%s.", Formatting.RESET));
|
||||
ChatUtils.moduleInfo(this,text);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"textures": {
|
||||
"all": "minecraft:block/structure_void",
|
||||
"particle": "minecraft:block/structure_void"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [ 5, 5, 5 ],
|
||||
"to": [ 11, 11, 11 ],
|
||||
"faces": {
|
||||
"down": { "texture": "#all", "cullface": "down" },
|
||||
"up": { "texture": "#all", "cullface": "up" },
|
||||
"north": { "texture": "#all", "cullface": "north" },
|
||||
"south": { "texture": "#all", "cullface": "south" },
|
||||
"west": { "texture": "#all", "cullface": "west" },
|
||||
"east": { "texture": "#all", "cullface": "east" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 228 B |
@@ -5,7 +5,9 @@
|
||||
"mixins": [
|
||||
],
|
||||
"client": [
|
||||
"EntityMixin"
|
||||
"EntityMixin",
|
||||
"ClientWorldMixin",
|
||||
"StructureVoidMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
Reference in New Issue
Block a user