Renamed directory to anticope
This commit is contained in:
95
src/main/java/anticope/rejects/modules/AntiBot.java
Normal file
95
src/main/java/anticope/rejects/modules/AntiBot.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.entity.EntityUtils;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
||||
|
||||
public class AntiBot extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
private final SettingGroup sgFilters = settings.createGroup("Filters");
|
||||
|
||||
private final Setting<Boolean> removeInvisible = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("remove-invisible")
|
||||
.description("Removes bot only if they are invisible.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> gameMode = sgFilters.add(new BoolSetting.Builder()
|
||||
.name("null-gamemode")
|
||||
.description("Removes players without a gamemode")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> api = sgFilters.add(new BoolSetting.Builder()
|
||||
.name("null-entry")
|
||||
.description("Removes players without a player entry")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> profile = sgFilters.add(new BoolSetting.Builder()
|
||||
.name("null-profile")
|
||||
.description("Removes players without a game profile")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> latency = sgFilters.add(new BoolSetting.Builder()
|
||||
.name("ping-check")
|
||||
.description("Removes players using ping check")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> nullException = sgFilters.add(new BoolSetting.Builder()
|
||||
.name("null-exception")
|
||||
.description("Removes players if a NullPointerException occurred")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
public AntiBot() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "anti-bot", "Detects and removes bots.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onTick(TickEvent.Post tickEvent) {
|
||||
for (Entity entity : mc.world.getEntities())
|
||||
{
|
||||
if (removeInvisible.get() && !entity.isInvisible()) continue;
|
||||
|
||||
if (isBot(entity)) entity.remove(Entity.RemovalReason.DISCARDED);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isBot(Entity entity) {
|
||||
if (entity == null) return false;
|
||||
if (!(entity instanceof PlayerEntity)) return false;
|
||||
|
||||
PlayerEntity player = (PlayerEntity)entity;
|
||||
try {
|
||||
if (gameMode.get() && EntityUtils.getGameMode(player) == null) return true;
|
||||
if (api.get() &&
|
||||
mc.getNetworkHandler().getPlayerListEntry(player.getUuid()) == null) return true;
|
||||
if (profile.get() &&
|
||||
mc.getNetworkHandler().getPlayerListEntry(player.getUuid()).getProfile() == null) return true;
|
||||
if (latency.get() &&
|
||||
mc.getNetworkHandler().getPlayerListEntry(player.getUuid()).getLatency() > 1) return true;
|
||||
} catch (NullPointerException e) {
|
||||
if (nullException.get()) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
57
src/main/java/anticope/rejects/modules/AntiSpawnpoint.java
Normal file
57
src/main/java/anticope/rejects/modules/AntiSpawnpoint.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import net.minecraft.block.BedBlock;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class AntiSpawnpoint extends Module {
|
||||
|
||||
private SettingGroup sgDefault = settings.getDefaultGroup();
|
||||
|
||||
private Setting<Boolean> fakeUse = sgDefault.add(new BoolSetting.Builder()
|
||||
.name("fake-use")
|
||||
.description("Fake using the bed or anchor.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
public AntiSpawnpoint() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "anti-spawnpoint", "Protects the player from losing the respawn point.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onSendPacket(PacketEvent.Send event) {
|
||||
if (mc.world == null) return;
|
||||
if(!(event.packet instanceof PlayerInteractBlockC2SPacket)) return;
|
||||
|
||||
|
||||
BlockPos blockPos = ((PlayerInteractBlockC2SPacket) event.packet).getBlockHitResult().getBlockPos();
|
||||
boolean IsOverWorld = mc.world.getDimension().isBedWorking();
|
||||
boolean IsNetherWorld = mc.world.getDimension().isRespawnAnchorWorking();
|
||||
boolean BlockIsBed = mc.world.getBlockState(blockPos).getBlock() instanceof BedBlock;
|
||||
boolean BlockIsAnchor = mc.world.getBlockState(blockPos).getBlock().equals(Blocks.RESPAWN_ANCHOR);
|
||||
|
||||
if (fakeUse.get()) {
|
||||
if (BlockIsBed && IsOverWorld) {
|
||||
mc.player.swingHand(Hand.MAIN_HAND);
|
||||
mc.player.updatePosition(blockPos.getX(),blockPos.up().getY(),blockPos.getZ());
|
||||
}
|
||||
else if (BlockIsAnchor && IsNetherWorld) {
|
||||
mc.player.swingHand(Hand.MAIN_HAND);
|
||||
}
|
||||
}
|
||||
|
||||
if((BlockIsBed && IsOverWorld)||(BlockIsAnchor && IsNetherWorld)) {
|
||||
event.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
137
src/main/java/anticope/rejects/modules/AntiVanish.java
Normal file
137
src/main/java/anticope/rejects/modules/AntiVanish.java
Normal file
@@ -0,0 +1,137 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.game.GameLeftEvent;
|
||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Queue;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
public class AntiVanish extends Module {
|
||||
|
||||
private final Queue<UUID> toLookup = new ConcurrentLinkedQueue<UUID>();
|
||||
private long lastTick = 0;
|
||||
|
||||
public AntiVanish() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "anti-vanish", "Notifies user when a admin uses /vanish");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
toLookup.clear();
|
||||
}
|
||||
@EventHandler
|
||||
public void onLeave(GameLeftEvent event) {
|
||||
toLookup.clear();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPacket(PacketEvent.Receive event) {
|
||||
if (event.packet instanceof PlayerListS2CPacket) {
|
||||
PlayerListS2CPacket packet = (PlayerListS2CPacket) event.packet;
|
||||
if (packet.getAction() == PlayerListS2CPacket.Action.UPDATE_LATENCY) {
|
||||
try {
|
||||
for (PlayerListS2CPacket.Entry entry : packet.getEntries()) {
|
||||
if (mc.getNetworkHandler().getPlayerListEntry(entry.getProfile().getId()) != null)
|
||||
continue;
|
||||
toLookup.add(entry.getProfile().getId());
|
||||
}
|
||||
} catch (Exception ignore) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onTick(TickEvent.Post event) {
|
||||
long time = mc.world.getTime();
|
||||
UUID lookup;
|
||||
|
||||
if (Math.abs(lastTick - time) > 100 && (lookup = toLookup.poll()) != null) {
|
||||
try {
|
||||
String name = getPlayerNameFromUUID(lookup);
|
||||
if (name != null) {
|
||||
warning(name + " has gone into vanish.");
|
||||
}
|
||||
} catch (Exception ignore) {}
|
||||
lastTick = time;
|
||||
}
|
||||
}
|
||||
|
||||
public String getPlayerNameFromUUID(UUID id) {
|
||||
try {
|
||||
final NameLookup process = new NameLookup(id, mc);
|
||||
final Thread thread = new Thread(process);
|
||||
thread.start();
|
||||
thread.join();
|
||||
return process.getName();
|
||||
} catch (Exception ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static class NameLookup implements Runnable {
|
||||
private final String uuidstr;
|
||||
private final UUID uuid;
|
||||
private final MinecraftClient mc;
|
||||
private volatile String name;
|
||||
|
||||
public NameLookup(final String input, MinecraftClient mc) {
|
||||
this.uuidstr = input;
|
||||
this.uuid = UUID.fromString(input);
|
||||
this.mc = mc;
|
||||
}
|
||||
|
||||
public NameLookup(final UUID input, MinecraftClient mc) {
|
||||
this.uuid = input;
|
||||
this.uuidstr = input.toString();
|
||||
this.mc = mc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
this.name = this.lookUpName();
|
||||
}
|
||||
|
||||
public String lookUpName() {
|
||||
PlayerEntity player = null;
|
||||
if (mc.world != null) {
|
||||
player = mc.world.getPlayerByUuid(uuid);
|
||||
}
|
||||
if (player == null) {
|
||||
final String url = "https://api.mojang.com/user/profiles/" + this.uuidstr.replace("-", "") + "/names";
|
||||
try {
|
||||
final JsonParser parser = new JsonParser();
|
||||
final String nameJson = IOUtils.toString(new URL(url), StandardCharsets.UTF_8);
|
||||
final JsonElement nameElement = parser.parse(nameJson);
|
||||
final JsonArray nameArray = nameElement.getAsJsonArray();
|
||||
final String playerSlot = nameArray.get(nameArray.size() - 1).toString();
|
||||
final JsonObject nameObject = parser.parse(playerSlot).getAsJsonObject();
|
||||
return nameObject.get("name").toString();
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return player.getName().asString();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
314
src/main/java/anticope/rejects/modules/Auto32K.java
Normal file
314
src/main/java/anticope/rejects/modules/Auto32K.java
Normal file
@@ -0,0 +1,314 @@
|
||||
/*
|
||||
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client/).
|
||||
* Copyright (c) 2021 Meteor Development.
|
||||
*/
|
||||
|
||||
package anticope.rejects.modules;
|
||||
|
||||
//Created by squidoodly 13/07/2020
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.player.*;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockUtils;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.client.gui.screen.ingame.Generic3x3ContainerScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.HopperScreen;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class Auto32K extends Module {
|
||||
public enum Mode{
|
||||
Hopper,
|
||||
Dispenser
|
||||
}
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
|
||||
.name("mode")
|
||||
.description("The bypass mode used.")
|
||||
.defaultValue(Mode.Dispenser)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> placeRange = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("place-range")
|
||||
.description("The distance in a single direction the shulker is placed.")
|
||||
.defaultValue(3)
|
||||
.min(0)
|
||||
.sliderMax(5)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> fillHopper = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("fill-hopper")
|
||||
.description("Fills all slots of the hopper except one for the 32k.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<List<Block>> throwawayItems = sgGeneral.add(new BlockListSetting.Builder()
|
||||
.name("throwaway-blocks")
|
||||
.description("Whitelisted blocks to use to fill the hopper.")
|
||||
.defaultValue(setDefaultBlocks())
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> autoMove = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("auto-move")
|
||||
.description("Moves the 32K into your inventory automatically.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private int x;
|
||||
private int z;
|
||||
private int phase = 0;
|
||||
private BlockPos bestBlock;
|
||||
|
||||
public Auto32K(){
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-32k", "Automatically attacks other players with a 32k weapon.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
phase = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
bestBlock = findValidBlocksDispenser();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post event) {
|
||||
if (phase <= 7) {
|
||||
if (mode.get() == Mode.Hopper) {
|
||||
FindItemResult findShulker = InvUtils.findInHotbar(this::isShulkerBox);
|
||||
FindItemResult findHopper = InvUtils.findInHotbar(Items.HOPPER);
|
||||
if (isValidSlot(findShulker) || isValidSlot(findHopper)) return;
|
||||
List<BlockPos> sortedBlocks = findValidBlocksHopper();
|
||||
sortedBlocks.sort(Comparator.comparingDouble(value -> mc.player.squaredDistanceTo(value.getX(), value.getY(), value.getZ())));
|
||||
Iterator<BlockPos> sortedIterator = sortedBlocks.iterator();
|
||||
BlockPos bestBlock = null;
|
||||
if(sortedIterator.hasNext()) bestBlock = sortedIterator.next();
|
||||
|
||||
if (bestBlock != null) {
|
||||
while (!BlockUtils.place(bestBlock, findHopper,true,100,false)) {
|
||||
if(sortedIterator.hasNext()) {
|
||||
bestBlock = sortedIterator.next().up();
|
||||
}else break;
|
||||
}
|
||||
mc.player.setSneaking(true);
|
||||
if (!BlockUtils.place(bestBlock.up(), findShulker,true,100,false)) {
|
||||
error("Failed to place.");
|
||||
this.toggle();
|
||||
return;
|
||||
}
|
||||
mc.player.setSneaking(false);
|
||||
mc.interactionManager.interactBlock(mc.player, mc.world, Hand.MAIN_HAND, new BlockHitResult(mc.player.getPos(), mc.player.getHorizontalFacing(), bestBlock.up(), false));
|
||||
phase = 8;
|
||||
}
|
||||
} else if (mode.get() == Mode.Dispenser) {
|
||||
FindItemResult shulkerSlot = InvUtils.find(this::isShulkerBox);
|
||||
FindItemResult hopperSlot = InvUtils.find(Items.HOPPER);
|
||||
FindItemResult dispenserSlot = InvUtils.find(Items.DISPENSER);
|
||||
FindItemResult redstoneSlot = InvUtils.find(Items.REDSTONE_BLOCK);
|
||||
if ((isValidSlot(shulkerSlot) && mode.get() == Mode.Hopper) || isValidSlot(hopperSlot) || isValidSlot(dispenserSlot) || isValidSlot(redstoneSlot))
|
||||
return;
|
||||
if (phase == 0) {
|
||||
bestBlock = findValidBlocksDispenser();
|
||||
if(bestBlock == null) return;
|
||||
if (!BlockUtils.place(bestBlock.add(x, 0, z), hopperSlot, true, 100, false)) {
|
||||
error("Failed to place.");
|
||||
this.toggle();
|
||||
return;
|
||||
}
|
||||
phase += 1;
|
||||
} else if (phase == 1) {
|
||||
mc.player.getInventory().selectedSlot = dispenserSlot.getSlot();
|
||||
if (x == -1) {
|
||||
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(-90f, mc.player.getPitch(), mc.player.isOnGround()));
|
||||
} else if (x == 1) {
|
||||
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(90f, mc.player.getPitch(), mc.player.isOnGround()));
|
||||
} else if (z == -1) {
|
||||
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(1f, mc.player.getPitch(), mc.player.isOnGround()));
|
||||
} else if (z == 1) {
|
||||
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(179f, mc.player.getPitch(), mc.player.isOnGround()));
|
||||
}
|
||||
phase += 1;
|
||||
} else if (phase == 2) {
|
||||
mc.interactionManager.interactBlock(mc.player, mc.world, Hand.MAIN_HAND, new BlockHitResult(mc.player.getPos(), Direction.UP, bestBlock, false));
|
||||
phase += 1;
|
||||
} else if (phase == 3) {
|
||||
mc.interactionManager.interactBlock(mc.player, mc.world, Hand.MAIN_HAND, new BlockHitResult(mc.player.getPos(), mc.player.getHorizontalFacing().getOpposite(), bestBlock.up(), false));
|
||||
phase += 1;
|
||||
}else if (phase == 4 && mc.currentScreen instanceof Generic3x3ContainerScreen) {
|
||||
mc.player.getSpeed();
|
||||
InvUtils.move().from(shulkerSlot.getSlot()).toId(4);
|
||||
phase += 1;
|
||||
}else if (phase == 5 && mc.currentScreen instanceof Generic3x3ContainerScreen) {
|
||||
mc.player.closeHandledScreen();
|
||||
phase += 1;
|
||||
}else if (phase == 6) {
|
||||
mc.player.getInventory().selectedSlot = redstoneSlot.getSlot();
|
||||
mc.player.setSneaking(true);
|
||||
mc.interactionManager.interactBlock(mc.player, mc.world, Hand.MAIN_HAND, new BlockHitResult(mc.player.getPos(), mc.player.getHorizontalFacing().getOpposite(), bestBlock.up(2), false));
|
||||
mc.player.setSneaking(false);
|
||||
phase += 1;
|
||||
}else if (phase == 7){
|
||||
mc.interactionManager.interactBlock(mc.player, mc.world, Hand.MAIN_HAND, new BlockHitResult(mc.player.getPos(), mc.player.getHorizontalFacing().getOpposite(), bestBlock.add(x, 0, z), false));
|
||||
phase += 1;
|
||||
}
|
||||
}
|
||||
}else if(phase == 8) {
|
||||
if (mc.currentScreen instanceof HopperScreen) {
|
||||
if (fillHopper.get() && !throwawayItems.get().isEmpty()) {
|
||||
int slot = -1;
|
||||
int count = 0;
|
||||
Iterator<Block> blocks = throwawayItems.get().iterator();
|
||||
for (Item item = blocks.next().asItem(); blocks.hasNext(); item = blocks.next().asItem()) {
|
||||
for (int i = 5; i <= 40; i++) {
|
||||
ItemStack stack = mc.player.getInventory().getStack(i);
|
||||
if (stack.getItem() == item && stack.getCount() >= 4) {
|
||||
slot = i;
|
||||
count = stack.getCount();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (count >= 4) break;
|
||||
}
|
||||
for (int i = 1; i < 5; i++) {
|
||||
if (mc.player.currentScreenHandler.getSlot(i).getStack().getItem() instanceof AirBlockItem) {
|
||||
InvUtils.move().from(slot - 4).toId(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean manage = true;
|
||||
int slot = -1;
|
||||
int dropSlot = -1;
|
||||
for (int i = 32; i < 41; i++) {
|
||||
if (EnchantmentHelper.getLevel(Enchantments.SHARPNESS, mc.player.currentScreenHandler.getSlot(i).getStack()) > 5) {
|
||||
manage = false;
|
||||
slot = i;
|
||||
break;
|
||||
}else if (mc.player.currentScreenHandler.getSlot(i).getStack().getItem() instanceof SwordItem
|
||||
&& EnchantmentHelper.getLevel(Enchantments.SHARPNESS, mc.player.currentScreenHandler.getSlot(i).getStack()) <= 5) {
|
||||
dropSlot = i;
|
||||
}
|
||||
}
|
||||
if (dropSlot != -1) InvUtils.drop().slot(dropSlot);
|
||||
if(autoMove.get() && manage){
|
||||
int slot2 = mc.player.getInventory().getEmptySlot();
|
||||
if (slot2 < 9 && slot2 != -1 && EnchantmentHelper.getLevel(Enchantments.SHARPNESS, mc.player.currentScreenHandler.getSlot(0).getStack()) > 5) {
|
||||
InvUtils.move().fromId(0).to(slot2 - 4);
|
||||
} else if (EnchantmentHelper.getLevel(Enchantments.SHARPNESS, mc.player.currentScreenHandler.getSlot(0).getStack()) <= 5 && mc.player.currentScreenHandler.getSlot(0).getStack().getItem() != Items.AIR) {
|
||||
InvUtils.drop().slotId(0);
|
||||
}
|
||||
}
|
||||
if(slot != -1) {
|
||||
mc.player.getInventory().selectedSlot = slot - 32;
|
||||
}
|
||||
}else this.toggle();
|
||||
}
|
||||
}
|
||||
|
||||
private List<BlockPos> findValidBlocksHopper(){
|
||||
Iterator<BlockPos> allBlocks = getRange(mc.player.getBlockPos(), placeRange.get()).iterator();
|
||||
List<BlockPos> validBlocks = new ArrayList<>();
|
||||
for(BlockPos i = null; allBlocks.hasNext(); i = allBlocks.next()){
|
||||
if(i == null) continue;
|
||||
if(!mc.world.getBlockState(i).getMaterial().isReplaceable()
|
||||
&& (mc.world.getBlockState(i.up()).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.up().getX(), i.up().getY(), i.up().getZ(), i.up().getX() + 1.0D, i.up().getY() + 2.0D, i.up().getZ() + 1.0D)).isEmpty())
|
||||
&& mc.world.getBlockState(i.up(2)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.up(2).getX(), i.up(2).getY(), i.up(2).getZ(), i.up(2).getX() + 1.0D, i.up(2).getY() + 2.0D, i.up(2).getZ() + 1.0D)).isEmpty()){
|
||||
validBlocks.add(i);
|
||||
}
|
||||
}
|
||||
return validBlocks;
|
||||
}
|
||||
|
||||
private BlockPos findValidBlocksDispenser(){
|
||||
List<BlockPos> allBlocksNotSorted = getRange(mc.player.getBlockPos(), placeRange.get());
|
||||
allBlocksNotSorted.sort(Comparator.comparingDouble(value -> mc.player.squaredDistanceTo(value.getX(), value.getY(), value.getZ())));
|
||||
Iterator<BlockPos> allBlocks = allBlocksNotSorted.iterator();
|
||||
for(BlockPos i = null; allBlocks.hasNext(); i = allBlocks.next()){
|
||||
if(i == null) continue;
|
||||
if(!mc.world.getBlockState(i).getMaterial().isReplaceable()
|
||||
&& (mc.world.getBlockState(i.up()).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.up().getX(), i.up().getY(), i.up().getZ(), i.up().getX() + 1.0D, i.up().getY() + 2.0D, i.up().getZ() + 1.0D)).isEmpty())
|
||||
&& (mc.world.getBlockState(i.up(2)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.up(2).getX(), i.up(2).getY(), i.up(2).getZ(), i.up(2).getX() + 1.0D, i.up(2).getY() + 2.0D, i.up(2).getZ() + 1.0D)).isEmpty())
|
||||
&& (mc.world.getBlockState(i.up(3)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.up(3).getX(), i.up(3).getY(), i.up(3).getZ(), i.up(2).getX() + 1.0D, i.up(2).getY() + 2.0D, i.up(2).getZ() + 1.0D)).isEmpty())){
|
||||
if (mc.world.getBlockState(i.add(-1, 1, 0)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.add(-1, 1, 0).getX(), i.add(-1, 1, 0).getY(), i.add(-1, 1, 0).getZ(), i.add(-1, 1, 0).getX() + 1.0D, i.add(-1, 1, 0).getY() + 2.0D, i.add(-1, 1, 0).getZ() + 1.0D)).isEmpty()
|
||||
&& mc.world.getBlockState(i.add(-1, 0, 0)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.add(-1, 0, 0).getX(), i.add(-1, 0, 0).getY(), i.add(-1, 0, 0).getZ(), i.add(-1, 0, 0).getX() + 1.0D, i.add(-1, 0, 0).getY() + 2.0D, i.add(-1, 0, 0).getZ() + 1.0D)).isEmpty()) {
|
||||
x = -1;
|
||||
z = 0;
|
||||
return i;
|
||||
}else if (mc.world.getBlockState(i.add(1, 1, 0)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.add(1, 1, 0).getX(), i.add(1, 1, 0).getY(), i.add(1, 1, 0).getZ(), i.add(1, 1, 0).getX() + 1.0D, i.add(1, 1, 0).getY() + 2.0D, i.add(1, 1, 0).getZ() + 1.0D)).isEmpty()
|
||||
&& mc.world.getBlockState(i.add(1, 0, 0)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.add(1, 0, 0).getX(), i.add(1, 0, 0).getY(), i.add(1, 0, 0).getZ(), i.add(1, 0, 0).getX() + 1.0D, i.add(1, 0, 0).getY() + 2.0D, i.add(1, 0, 0).getZ() + 1.0D)).isEmpty()) {
|
||||
x = 1;
|
||||
z = 0;
|
||||
return i;
|
||||
}else if (mc.world.getBlockState(i.add(0, 1, -1)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.add(0, 1, -1).getX(), i.add(0, 1, -1).getY(), i.add(0, 1, -1).getZ(), i.add(0, 1, -1).getX() + 1.0D, i.add(0, 1, -1).getY() + 2.0D, i.add(0, 1, -1).getZ() + 1.0D)).isEmpty()
|
||||
&& mc.world.getBlockState(i.add(0, 0, -1)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.add(0, 0, -1).getX(), i.add(0, 0, -1).getY(), i.add(0, 0, -1).getZ(), i.add(0, 0, -1).getX() + 1.0D, i.add(0, 0, -1).getY() + 2.0D, i.add(0, 0, -1).getZ() + 1.0D)).isEmpty()) {
|
||||
x = 0;
|
||||
z = -1;
|
||||
return i;
|
||||
}else if (mc.world.getBlockState(i.add(0, 1, 1)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.add(0, 1, 1).getX(), i.add(0, 1, 1).getY(), i.add(0, 1, 1).getZ(), i.add(0, 1, 1).getX() + 1.0D, i.add(0, 1, 1).getY() + 2.0D, i.add(0, 1, 1).getZ() + 1.0D)).isEmpty()
|
||||
&& mc.world.getBlockState(i.add(0, 0, 1)).getBlock() == Blocks.AIR && mc.world.getOtherEntities(null, new Box(i.add(0, 0, 1).getX(), i.add(0, 0, 1).getY(), i.add(0, 0, 1).getZ(), i.add(0, 0, 1).getX() + 1.0D, i.add(0, 0, 1).getY() + 2.0D, i.add(0, 0, 1).getZ() + 1.0D)).isEmpty()) {
|
||||
x = 0;
|
||||
z = 1;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean isShulkerBox(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
if (!(item instanceof BlockItem)) return false;
|
||||
Block block = ((BlockItem)item).getBlock();
|
||||
return block instanceof ShulkerBoxBlock;
|
||||
}
|
||||
|
||||
private List<BlockPos> getRange(BlockPos player, double range){
|
||||
List<BlockPos> allBlocks = new ArrayList<>();
|
||||
for(double i = player.getX() - range; i < player.getX() + range; i++){
|
||||
for(double j = player.getZ() - range; j < player.getZ() + range; j++){
|
||||
for(int k = player.getY() - 3; k < player.getY() + 3; k++){
|
||||
BlockPos x = new BlockPos(i, k, j);
|
||||
allBlocks.add(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
return allBlocks;
|
||||
}
|
||||
|
||||
private boolean isValidSlot(FindItemResult findItemResult){
|
||||
return findItemResult.getSlot() == -1 || findItemResult.getSlot() >= 9;
|
||||
}
|
||||
|
||||
private List<Block> setDefaultBlocks(){
|
||||
List<Block> list = new ArrayList<>();
|
||||
list.add(Blocks.OBSIDIAN);
|
||||
list.add(Blocks.COBBLESTONE);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
138
src/main/java/anticope/rejects/modules/AutoBedTrap.java
Normal file
138
src/main/java/anticope/rejects/modules/AutoBedTrap.java
Normal file
@@ -0,0 +1,138 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.BlockListSetting;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.DoubleSetting;
|
||||
import meteordevelopment.meteorclient.settings.IntSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.misc.Pool;
|
||||
import meteordevelopment.meteorclient.utils.player.FindItemResult;
|
||||
import meteordevelopment.meteorclient.utils.player.InvUtils;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockIterator;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BedBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class AutoBedTrap extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Integer> bpt = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("blocks-per-tick")
|
||||
.description("How many blocks to place per tick")
|
||||
.defaultValue(2)
|
||||
.min(1)
|
||||
.sliderMax(8)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("rotate")
|
||||
.description("Rotates when placing")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> range = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("range")
|
||||
.description("The break range.")
|
||||
.defaultValue(4)
|
||||
.min(0)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<List<Block>> blockTypes = sgGeneral.add(new BlockListSetting.Builder()
|
||||
.name("blocks")
|
||||
.description("The blocks you bedtrap with.")
|
||||
.defaultValue(Arrays.asList(Blocks.OBSIDIAN))
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Pool<BlockPos.Mutable> blockPosPool = new Pool<>(BlockPos.Mutable::new);
|
||||
private final List<BlockPos.Mutable> blocks = new ArrayList<>();
|
||||
|
||||
int cap = 0;
|
||||
|
||||
public AutoBedTrap() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-bed-trap", "Automatically places obsidian around beds");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
for (BlockPos.Mutable blockPos : blocks) blockPosPool.free(blockPos);
|
||||
blocks.clear();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
|
||||
BlockIterator.register((int) Math.ceil(range.get()), (int) Math.ceil(range.get()), (blockPos, blockState) -> {
|
||||
if (!BlockUtils.canBreak(blockPos, blockState)) return;
|
||||
|
||||
if (!(blockState.getBlock() instanceof BedBlock)) return;
|
||||
|
||||
blocks.add(blockPosPool.get().set(blockPos));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTickPost(TickEvent.Post event) {
|
||||
boolean noBlocks = false;
|
||||
for (BlockPos blockPos : blocks) {
|
||||
if (!placeTickAround(blockPos)) {
|
||||
noBlocks = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (noBlocks && isActive()) toggle();
|
||||
}
|
||||
|
||||
public boolean placeTickAround(BlockPos block) {
|
||||
for (BlockPos b : new BlockPos[]{
|
||||
block.up(), block.west(),
|
||||
block.north(), block.south(),
|
||||
block.east(), block.down()}) {
|
||||
|
||||
if (cap >= bpt.get()) {
|
||||
cap = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (blockTypes.get().contains(mc.world.getBlockState(b).getBlock())) return true;
|
||||
|
||||
FindItemResult findBlock = InvUtils.findInHotbar((item) -> {
|
||||
if (!(item.getItem() instanceof BlockItem)) return false;
|
||||
BlockItem bitem = (BlockItem)item.getItem();
|
||||
return blockTypes.get().contains(bitem.getBlock());
|
||||
});
|
||||
if (!findBlock.found()) {
|
||||
error("No specified blocks found. Disabling.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (BlockUtils.place(b, findBlock, rotate.get(), 10, false)) {
|
||||
cap++;
|
||||
if (cap >= bpt.get()) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
cap = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
81
src/main/java/anticope/rejects/modules/AutoCraft.java
Normal file
81
src/main/java/anticope/rejects/modules/AutoCraft.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.ItemListSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.client.gui.screen.recipebook.RecipeResultCollection;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.screen.CraftingScreenHandler;
|
||||
import net.minecraft.screen.slot.SlotActionType;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class AutoCraft extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<List<Item>> items = sgGeneral.add(new ItemListSetting.Builder()
|
||||
.name("items")
|
||||
.description("Items you want to get crafted.")
|
||||
.defaultValue(Arrays.asList())
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> antiDesync = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("anti-desync")
|
||||
.description("Try to prevent inventory desync.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> craftAll = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("craft-all")
|
||||
.description("Crafts maximum possible amount amount per craft (shift-clicking)")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> drop = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("drop")
|
||||
.description("Automatically drops crafted items (useful for when not enough inventory space)")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
public AutoCraft() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-craft", "Automatically crafts items.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post event) {
|
||||
if (mc.interactionManager == null) return;
|
||||
if (items.get().isEmpty()) return;
|
||||
|
||||
if (!(mc.player.currentScreenHandler instanceof CraftingScreenHandler)) return;
|
||||
|
||||
|
||||
if (antiDesync.get())
|
||||
mc.player.getInventory().updateItems();
|
||||
|
||||
// Danke schön GhostTypes
|
||||
// https://github.com/GhostTypes/orion/blob/main/src/main/java/me/ghosttypes/orion/modules/main/AutoBedCraft.java
|
||||
CraftingScreenHandler currentScreenHandler = (CraftingScreenHandler) mc.player.currentScreenHandler;
|
||||
List<Item> itemList = items.get();
|
||||
List<RecipeResultCollection> recipeResultCollectionList = mc.player.getRecipeBook().getOrderedResults();
|
||||
for (RecipeResultCollection recipeResultCollection : recipeResultCollectionList) {
|
||||
for (Recipe<?> recipe : recipeResultCollection.getRecipes(true)) {
|
||||
if (!itemList.contains(recipe.getOutput().getItem())) continue;
|
||||
mc.interactionManager.clickRecipe(currentScreenHandler.syncId, recipe, craftAll.get());
|
||||
mc.interactionManager.clickSlot(currentScreenHandler.syncId, 0, 1,
|
||||
drop.get() ? SlotActionType.THROW : SlotActionType.QUICK_MOVE, mc.player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
188
src/main/java/anticope/rejects/modules/AutoExtinguish.java
Normal file
188
src/main/java/anticope/rejects/modules/AutoExtinguish.java
Normal file
@@ -0,0 +1,188 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.IntSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
|
||||
import meteordevelopment.meteorclient.utils.player.Rotations;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockIterator;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class AutoExtinguish extends Module {
|
||||
private final SettingGroup sgGeneral = settings.createGroup("Extinguish Fire around you");
|
||||
private final SettingGroup sgBucket = settings.createGroup("Extinguish yourself");
|
||||
|
||||
private final Setting<Boolean> extinguish = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("extinguish")
|
||||
.description("Automatically extinguishes fire around you.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> horizontalRadius = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("horizontal-radius")
|
||||
.description("Horizontal radius in which to search for fire.")
|
||||
.defaultValue(4)
|
||||
.min(0)
|
||||
.sliderMax(6)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> verticalRadius = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("vertical-radius")
|
||||
.description("Vertical radius in which to search for fire.")
|
||||
.defaultValue(4)
|
||||
.min(0)
|
||||
.sliderMax(6)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> maxBlockPerTick = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("block-per-tick")
|
||||
.description("Maximum amount of Blocks to extinguish per tick.")
|
||||
.defaultValue(5)
|
||||
.min(1)
|
||||
.sliderMax(50)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> waterBucket = sgBucket.add(new BoolSetting.Builder()
|
||||
.name("water")
|
||||
.description("Automatically places water when you are on fire (and don't have fire resistance).")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> center = sgBucket.add(new BoolSetting.Builder()
|
||||
.name("center")
|
||||
.description("Automatically centers you when placing water.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> onGround = sgBucket.add(new BoolSetting.Builder()
|
||||
.name("on-ground")
|
||||
.description("Only place when you are on ground.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private boolean hasPlacedWater = false;
|
||||
private BlockPos blockPos = null;
|
||||
private boolean doesWaterBucketWork = true;
|
||||
|
||||
private static final StatusEffect FIRE_RESISTANCE = Registry.STATUS_EFFECT.get(new Identifier("fire_resistance"));
|
||||
|
||||
public AutoExtinguish() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-extinguish", "Automatically extinguishes fire around you");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
if (mc.world.getDimension().isRespawnAnchorWorking()) {
|
||||
if (doesWaterBucketWork) {
|
||||
warning("Water Buckets don't work in this dimension!");
|
||||
doesWaterBucketWork = false;
|
||||
|
||||
}
|
||||
} else {
|
||||
if (!doesWaterBucketWork) {
|
||||
warning("Enabled Water Buckets!");
|
||||
doesWaterBucketWork = true;
|
||||
}
|
||||
}
|
||||
if (onGround.get() && !mc.player.isOnGround()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (waterBucket.get() && doesWaterBucketWork) {
|
||||
if (hasPlacedWater) {
|
||||
final int slot = findSlot(Items.BUCKET);
|
||||
blockPos = mc.player.getBlockPos();
|
||||
place(slot);
|
||||
hasPlacedWater = false;
|
||||
|
||||
} else if (!mc.player.hasStatusEffect(FIRE_RESISTANCE) && mc.player.isOnFire()) {
|
||||
blockPos = mc.player.getBlockPos();
|
||||
final int slot = findSlot(Items.WATER_BUCKET);
|
||||
if (mc.world.getBlockState(blockPos).getBlock() == Blocks.FIRE || mc.world.getBlockState(blockPos).getBlock() == Blocks.SOUL_FIRE) {
|
||||
float yaw = mc.gameRenderer.getCamera().getYaw() % 360;
|
||||
float pitch = mc.gameRenderer.getCamera().getPitch() % 360;
|
||||
if (center.get()) {
|
||||
PlayerUtils.centerPlayer();
|
||||
}
|
||||
Rotations.rotate(yaw, 90);
|
||||
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, Direction.UP));
|
||||
mc.player.swingHand(Hand.MAIN_HAND);
|
||||
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, Direction.UP));
|
||||
|
||||
Rotations.rotate(yaw, pitch);
|
||||
}
|
||||
place(slot);
|
||||
hasPlacedWater = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (extinguish.get()) {
|
||||
AtomicInteger blocksPerTick = new AtomicInteger();
|
||||
BlockIterator.register(horizontalRadius.get(), verticalRadius.get(), (blockPos, blockState) -> {
|
||||
if (blocksPerTick.get() <= maxBlockPerTick.get()) {
|
||||
if (blockState.getBlock() == Blocks.FIRE || mc.world.getBlockState(blockPos).getBlock() == Blocks.SOUL_FIRE) {
|
||||
extinguishFire(blockPos);
|
||||
blocksPerTick.getAndIncrement();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void place(int slot) {
|
||||
if (slot != -1) {
|
||||
final int preSlot = mc.player.getInventory().selectedSlot;
|
||||
if (center.get()) {
|
||||
PlayerUtils.centerPlayer();
|
||||
}
|
||||
mc.player.getInventory().selectedSlot = slot;
|
||||
float yaw = mc.gameRenderer.getCamera().getYaw() % 360;
|
||||
float pitch = mc.gameRenderer.getCamera().getPitch() % 360;
|
||||
|
||||
Rotations.rotate(yaw, 90);
|
||||
mc.interactionManager.interactItem(mc.player, mc.player.world, Hand.MAIN_HAND);
|
||||
mc.player.getInventory().selectedSlot = preSlot;
|
||||
Rotations.rotate(yaw, pitch);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void extinguishFire(BlockPos blockPos) {
|
||||
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, net.minecraft.util.math.Direction.UP));
|
||||
mc.player.swingHand(Hand.MAIN_HAND);
|
||||
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, net.minecraft.util.math.Direction.UP));
|
||||
}
|
||||
|
||||
private int findSlot(Item item) {
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
ItemStack block = mc.player.getInventory().getStack(i);
|
||||
if (block.getItem() == item) {
|
||||
slot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return slot;
|
||||
}
|
||||
|
||||
}
|
||||
175
src/main/java/anticope/rejects/modules/AutoEz.java
Normal file
175
src/main/java/anticope/rejects/modules/AutoEz.java
Normal file
@@ -0,0 +1,175 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.entity.player.AttackEntityEvent;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.friends.Friends;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.network.MeteorExecutor;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.decoration.EndCrystalEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.Pair;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class AutoEz extends Module {
|
||||
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<String> format = sgGeneral.add(new StringSetting.Builder()
|
||||
.name("message")
|
||||
.description("Send a chat message about killing a player.")
|
||||
.defaultValue("EZ! {name}!")
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> minArmor = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("min-armor")
|
||||
.description("Minimum number of armor elements.")
|
||||
.defaultValue(2)
|
||||
.min(0)
|
||||
.max(4)
|
||||
.sliderMin(0)
|
||||
.sliderMax(4)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> ignoreFriends = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("ignore-friends")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
ArrayList<Pair<UUID, Long>> players = new ArrayList<>();
|
||||
ArrayList<String> msgplayers = new ArrayList<>();
|
||||
|
||||
|
||||
public AutoEz() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-ez", "Send a chat message after killing a player.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
players.clear();
|
||||
msgplayers.clear();
|
||||
}
|
||||
|
||||
private boolean checkArmor(PlayerEntity p) {
|
||||
|
||||
int armor = 0;
|
||||
|
||||
if (p.getEquippedStack(EquipmentSlot.HEAD).getItem() != Items.AIR) armor++;
|
||||
if (p.getEquippedStack(EquipmentSlot.CHEST).getItem() != Items.AIR) armor++;
|
||||
if (p.getEquippedStack(EquipmentSlot.LEGS).getItem() != Items.AIR) armor++;
|
||||
if (p.getEquippedStack(EquipmentSlot.FEET).getItem() != Items.AIR) armor++;
|
||||
|
||||
return armor < minArmor.get();
|
||||
}
|
||||
|
||||
|
||||
private boolean checkFriend(PlayerEntity p) {
|
||||
return (ignoreFriends.get() && Friends.get().isFriend(p));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void AttackEntity(AttackEntityEvent e) {
|
||||
if (e.entity instanceof EndCrystalEntity) {
|
||||
List<AbstractClientPlayerEntity> worldplayers = mc.world.getPlayers();
|
||||
for (int x = 0; x < worldplayers.size(); x++) {
|
||||
PlayerEntity p = worldplayers.get(x);
|
||||
if (!p.isSpectator() && !p.isCreative() && !p.isInvulnerable() && !mc.player.equals(p) && !checkArmor(p) && !checkFriend(p) && p.distanceTo(e.entity) < 12) {
|
||||
|
||||
Pair<UUID, Long> pair = new Pair<>(p.getUuid(), System.currentTimeMillis());
|
||||
int index = -1;
|
||||
for (int w = 0; w < players.size(); w++) {
|
||||
if (players.get(w).getLeft().equals(p.getUuid())) {
|
||||
index = w;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == -1) {
|
||||
players.add(pair);
|
||||
} else {
|
||||
players.set(index, pair);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (e.entity instanceof PlayerEntity) {
|
||||
PlayerEntity p = (PlayerEntity) e.entity;
|
||||
if (!p.isSpectator() && !p.isCreative() && !p.isInvulnerable() && !mc.player.equals(p) && !checkArmor(p) && !checkFriend(p)) {
|
||||
|
||||
Pair<UUID, Long> pair = new Pair<>(p.getUuid(), System.currentTimeMillis());
|
||||
int index = -1;
|
||||
for (int w = 0; w < players.size(); w++) {
|
||||
if (players.get(w).getLeft().equals(p.getUuid())) {
|
||||
index = w;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == -1) {
|
||||
players.add(pair);
|
||||
} else {
|
||||
players.set(index, pair);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre e) {
|
||||
if (players.size() == 0) return;
|
||||
|
||||
ArrayList<Pair<UUID, Long>> newPlayers = players;
|
||||
|
||||
for (int x = 0; x < players.size(); x++) {
|
||||
Pair<UUID, Long> w = players.get(x);
|
||||
long time = w.getRight();
|
||||
|
||||
PlayerEntity p = mc.world.getPlayerByUuid(w.getLeft());
|
||||
|
||||
if (System.currentTimeMillis() - time > 2000 || p == null) {
|
||||
newPlayers.remove(x);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (p.isDead()) {
|
||||
if (!msgplayers.contains(p.getName().asString()))
|
||||
msgplayers.add(p.getName().asString());
|
||||
newPlayers.remove(x);
|
||||
MeteorExecutor.execute(() -> send());
|
||||
}
|
||||
}
|
||||
|
||||
players = newPlayers;
|
||||
}
|
||||
|
||||
private void send() {
|
||||
int size = msgplayers.size();
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
if (size != msgplayers.size()) {
|
||||
MeteorExecutor.execute(() -> send());
|
||||
return;
|
||||
}
|
||||
|
||||
if (msgplayers.size() == 0) return;
|
||||
String message = format.get();
|
||||
message = message.replace("{name}", String.join(", ", msgplayers));
|
||||
mc.player.sendChatMessage(message);
|
||||
|
||||
msgplayers.clear();
|
||||
}
|
||||
|
||||
}
|
||||
415
src/main/java/anticope/rejects/modules/AutoPot.java
Normal file
415
src/main/java/anticope/rejects/modules/AutoPot.java
Normal file
@@ -0,0 +1,415 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
//import baritone.api.BaritoneAPI;
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.entity.player.ItemUseCrosshairTargetEvent;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
import meteordevelopment.meteorclient.systems.modules.combat.AnchorAura;
|
||||
import meteordevelopment.meteorclient.systems.modules.combat.BedAura;
|
||||
import meteordevelopment.meteorclient.systems.modules.combat.CrystalAura;
|
||||
import meteordevelopment.meteorclient.systems.modules.combat.KillAura;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.utils.Utils;
|
||||
import meteordevelopment.meteorclient.utils.player.Rotations;
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.entity.effect.StatusEffects;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.potion.PotionUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AutoPot extends Module {
|
||||
private static final Class<? extends Module>[] AURAS = new Class[] { KillAura.class, CrystalAura.class, AnchorAura.class, BedAura.class };
|
||||
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> Healing = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("Healing")
|
||||
.description("Enables healing potions.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> Strength = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("Strength")
|
||||
.description("Enables strength potions.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> useSplashPots = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("Splash-Pots")
|
||||
.description("Allow the use of splash pots")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> health = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("health")
|
||||
.description("If health goes below this point, Healing Pot will trigger.")
|
||||
.defaultValue(15)
|
||||
.min(0)
|
||||
.sliderMax(20)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> pauseAuras = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("pause-auras")
|
||||
.description("Pauses all auras when eating.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> pauseBaritone = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("pause-baritone")
|
||||
.description("Pause baritone when eating.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> lookDown = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("rotate")
|
||||
.description("Forces you to rotate downwards when throwing bottles.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
private int slot, prevSlot;
|
||||
private boolean drinking, splashing;
|
||||
private final List<Class<? extends Module>> wasAura = new ArrayList<>();
|
||||
private boolean wasBaritone;
|
||||
public AutoPot() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-pot", "Automatically Drinks Potions");
|
||||
}
|
||||
//Gilded's first module, lets see how much i'll die making this
|
||||
//TODO:Rework everything to accept all pots
|
||||
//TODO: Does strength work better if you throw it up? will check.
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
if (drinking) stopDrinking();
|
||||
if (splashing) stopSplashing();
|
||||
}
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
if (Healing.get()) {
|
||||
if (ShouldDrinkHealth()) {
|
||||
//Heal Pot Slot
|
||||
int slot = HealingpotionSlot();
|
||||
//Slot Not Invalid
|
||||
if (slot != -1) {
|
||||
startDrinking();
|
||||
} else if (HealingpotionSlot() == -1 && useSplashPots.get()) {
|
||||
slot = HealingSplashpotionSlot();
|
||||
if (slot != -1) {
|
||||
startSplashing();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (drinking) {
|
||||
if (ShouldDrinkHealth()) {
|
||||
if (isNotPotion(mc.player.getInventory().getStack(slot))) {
|
||||
slot = HealingpotionSlot();
|
||||
if (slot == -1) {
|
||||
info("Ran out of Pots while drinking");
|
||||
stopDrinking();
|
||||
return;
|
||||
}
|
||||
} else changeSlot(slot);
|
||||
}
|
||||
drink();
|
||||
if (ShouldNotDrinkHealth()) {
|
||||
info("Health Full");
|
||||
stopDrinking();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (splashing) {
|
||||
if (ShouldDrinkHealth()) {
|
||||
if (isNotSplashPotion(mc.player.getInventory().getStack(slot))) {
|
||||
slot = HealingSplashpotionSlot();
|
||||
if (slot == -1) {
|
||||
info("Ran out of Pots while splashing");
|
||||
stopSplashing();
|
||||
return;
|
||||
} else changeSlot(slot);
|
||||
}
|
||||
splash();
|
||||
if (ShouldNotDrinkHealth()) {
|
||||
info("Health Full");
|
||||
stopSplashing();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Strength.get()) {
|
||||
if (ShouldDrinkStrength()) {
|
||||
//Strength Pot Slot
|
||||
int slot = StrengthpotionSlot();
|
||||
//Slot Not Invalid
|
||||
if (slot != -1) {
|
||||
startDrinking();
|
||||
}
|
||||
else if (StrengthpotionSlot() == -1 && useSplashPots.get()) {
|
||||
slot = StrengthSplashpotionSlot();
|
||||
if (slot != -1) {
|
||||
startSplashing();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (drinking) {
|
||||
if (ShouldDrinkStrength()) {
|
||||
if (isNotPotion(mc.player.getInventory().getStack(slot))) {
|
||||
slot = StrengthpotionSlot();
|
||||
if (slot == -1) {
|
||||
stopDrinking();
|
||||
info("Out of Pots");
|
||||
return;
|
||||
} else changeSlot(slot);
|
||||
}
|
||||
drink();
|
||||
} else {
|
||||
stopDrinking();
|
||||
}
|
||||
}
|
||||
if (splashing) {
|
||||
if (ShouldDrinkStrength()) {
|
||||
if (isNotSplashPotion(mc.player.getInventory().getStack(slot))) {
|
||||
slot = StrengthSplashpotionSlot();
|
||||
if (slot == -1) {
|
||||
info("Ran out of Pots while splashing");
|
||||
stopSplashing();
|
||||
return;
|
||||
} else changeSlot(slot);
|
||||
}
|
||||
splash();
|
||||
} else {
|
||||
stopSplashing();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@EventHandler
|
||||
private void onItemUseCrosshairTarget(ItemUseCrosshairTargetEvent event) {
|
||||
if (drinking) event.target = null;
|
||||
}
|
||||
private void setPressed(boolean pressed) {
|
||||
mc.options.keyUse.setPressed(pressed);
|
||||
}
|
||||
private void startDrinking() {
|
||||
prevSlot = mc.player.getInventory().selectedSlot;
|
||||
drink();
|
||||
// Pause auras
|
||||
wasAura.clear();
|
||||
if (pauseAuras.get()) {
|
||||
for (Class<? extends Module> klass : AURAS) {
|
||||
Module module = Modules.get().get(klass);
|
||||
|
||||
if (module.isActive()) {
|
||||
wasAura.add(klass);
|
||||
module.toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Pause baritone
|
||||
wasBaritone = false;
|
||||
//if (pauseBaritone.get() && BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing()) {
|
||||
// wasBaritone = true;
|
||||
// BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("pause");
|
||||
//}
|
||||
}
|
||||
private void startSplashing() {
|
||||
prevSlot = mc.player.getInventory().selectedSlot;
|
||||
if (lookDown.get()){
|
||||
Rotations.rotate(mc.player.getYaw(), 90); splash();
|
||||
}
|
||||
splash();
|
||||
// Pause auras
|
||||
wasAura.clear();
|
||||
if (pauseAuras.get()) {
|
||||
for (Class<? extends Module> klass : AURAS) {
|
||||
Module module = Modules.get().get(klass);
|
||||
|
||||
if (module.isActive()) {
|
||||
wasAura.add(klass);
|
||||
module.toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Pause baritone
|
||||
//wasBaritone = false;
|
||||
//if (pauseBaritone.get() && BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing()) {
|
||||
// wasBaritone = true;
|
||||
// BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("pause");
|
||||
//}
|
||||
}
|
||||
private void drink() {
|
||||
changeSlot(slot);
|
||||
setPressed(true);
|
||||
if (!mc.player.isUsingItem()) Utils.rightClick();
|
||||
|
||||
drinking = true;
|
||||
}
|
||||
private void splash() {
|
||||
changeSlot(slot);
|
||||
setPressed(true);
|
||||
splashing = true;
|
||||
}
|
||||
private void stopDrinking() {
|
||||
changeSlot(prevSlot);
|
||||
setPressed(false);
|
||||
drinking = false;
|
||||
|
||||
// Resume auras
|
||||
if (pauseAuras.get()) {
|
||||
for (Class<? extends Module> klass : AURAS) {
|
||||
Module module = Modules.get().get(klass);
|
||||
|
||||
if (wasAura.contains(klass) && !module.isActive()) {
|
||||
module.toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Resume baritone
|
||||
//if (pauseBaritone.get() && wasBaritone) {
|
||||
// BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("resume");
|
||||
//}
|
||||
}
|
||||
private void stopSplashing() {
|
||||
changeSlot(prevSlot);
|
||||
setPressed(false);
|
||||
|
||||
splashing = false;
|
||||
|
||||
// Resume auras
|
||||
if (pauseAuras.get()) {
|
||||
for (Class<? extends Module> klass : AURAS) {
|
||||
Module module = Modules.get().get(klass);
|
||||
|
||||
if (wasAura.contains(klass) && !module.isActive()) {
|
||||
module.toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Resume baritone
|
||||
//if (pauseBaritone.get() && wasBaritone) {
|
||||
// BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("resume");
|
||||
//}
|
||||
}
|
||||
private double truehealth() {
|
||||
assert mc.player != null;
|
||||
return mc.player.getHealth();
|
||||
}
|
||||
private void changeSlot(int slot) {
|
||||
mc.player.getInventory().selectedSlot = slot;
|
||||
this.slot = slot;
|
||||
}
|
||||
//Sunk 7 hours into these checks, if i die blame checks
|
||||
//Heal pot checks
|
||||
private int HealingpotionSlot() {
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
// Skip if item stack is empty
|
||||
ItemStack stack = mc.player.getInventory().getStack(i);
|
||||
if (stack.isEmpty()) continue;
|
||||
if (stack.getItem() != Items.POTION) continue;
|
||||
if (stack.getItem() == Items.POTION) {
|
||||
List<StatusEffectInstance> effects = PotionUtil.getPotion(mc.player.getInventory().getStack(i)).getEffects();
|
||||
if (effects.size() > 0) {
|
||||
StatusEffectInstance effect = effects.get(0);
|
||||
if (effect.getTranslationKey().equals("effect.minecraft.instant_health")) {
|
||||
slot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return slot;
|
||||
}
|
||||
private int HealingSplashpotionSlot() {
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
// Skip if item stack is empty
|
||||
ItemStack stack = mc.player.getInventory().getStack(i);
|
||||
if (stack.isEmpty()) continue;
|
||||
if (stack.getItem() != Items.SPLASH_POTION) continue;
|
||||
if (stack.getItem() == Items.SPLASH_POTION) {
|
||||
List<StatusEffectInstance> effects = PotionUtil.getPotion(mc.player.getInventory().getStack(i)).getEffects();
|
||||
if (effects.size() > 0) {
|
||||
StatusEffectInstance effect = effects.get(0);
|
||||
if (effect.getTranslationKey().equals("effect.minecraft.instant_health")) {
|
||||
slot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return slot;
|
||||
}
|
||||
//Strength Pot Checks
|
||||
private int StrengthSplashpotionSlot () {
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
// Skip if item stack is empty
|
||||
ItemStack stack = mc.player.getInventory().getStack(i);
|
||||
if (stack.isEmpty()) continue;
|
||||
if (stack.getItem() != Items.SPLASH_POTION) continue;
|
||||
if (stack.getItem() == Items.SPLASH_POTION) {
|
||||
List<StatusEffectInstance> effects = PotionUtil.getPotion(mc.player.getInventory().getStack(i)).getEffects();
|
||||
if (effects.size() > 0) {
|
||||
StatusEffectInstance effect = effects.get(0);
|
||||
if (effect.getTranslationKey().equals("effect.minecraft.strength")) {
|
||||
slot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return slot;
|
||||
}
|
||||
private int StrengthpotionSlot () {
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
// Skip if item stack is empty
|
||||
ItemStack stack = mc.player.getInventory().getStack(i);
|
||||
if (stack.isEmpty()) continue;
|
||||
if (stack.getItem() != Items.POTION) continue;
|
||||
if (stack.getItem() == Items.POTION) {
|
||||
List<StatusEffectInstance> effects = PotionUtil.getPotion(mc.player.getInventory().getStack(i)).getEffects();
|
||||
if (effects.size() > 0) {
|
||||
StatusEffectInstance effect = effects.get(0);
|
||||
if (effect.getTranslationKey().equals("effect.minecraft.strength")) {
|
||||
slot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return slot;
|
||||
}
|
||||
private boolean isNotPotion(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
return item != Items.POTION;
|
||||
}
|
||||
private boolean isNotSplashPotion(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
return item != Items.SPLASH_POTION;
|
||||
}
|
||||
private boolean ShouldDrinkHealth(){
|
||||
if (truehealth() < health.get()) return true;
|
||||
return false;
|
||||
}
|
||||
private boolean ShouldNotDrinkHealth(){
|
||||
if (truehealth() >= health.get()) return true;
|
||||
return false;
|
||||
}
|
||||
private boolean ShouldDrinkStrength(){
|
||||
Map<StatusEffect, StatusEffectInstance> effects = mc.player.getActiveStatusEffects();
|
||||
return !effects.containsKey(StatusEffects.STRENGTH);
|
||||
}
|
||||
}
|
||||
222
src/main/java/anticope/rejects/modules/AutoTNT.java
Normal file
222
src/main/java/anticope/rejects/modules/AutoTNT.java
Normal file
@@ -0,0 +1,222 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import anticope.rejects.utils.TntDamage;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.IntSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.misc.Pool;
|
||||
import meteordevelopment.meteorclient.utils.player.FindItemResult;
|
||||
import meteordevelopment.meteorclient.utils.player.InvUtils;
|
||||
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockIterator;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.block.TntBlock;
|
||||
import net.minecraft.item.*;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class AutoTNT extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
// General
|
||||
|
||||
private final Setting<Boolean> ignite = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("ignite")
|
||||
.description("Whether to ignite tnt.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> place = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("place")
|
||||
.description("Whether to place tnt. (VERY LAGGY)")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> igniteDelay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("ignition-delay")
|
||||
.description("Delay in ticks between ignition")
|
||||
.defaultValue(1)
|
||||
.visible(ignite::get)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> placeDelay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("place-delay")
|
||||
.description("Delay in ticks between placement")
|
||||
.defaultValue(1)
|
||||
.visible(place::get)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> horizontalRange = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("horizontal-range")
|
||||
.description("Horizontal range of ignition and placement")
|
||||
.defaultValue(4)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> verticalRange = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("vertical-range")
|
||||
.description("Vertical range of ignition and placement")
|
||||
.defaultValue(4)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> antiBreak = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("anti-break")
|
||||
.description("Whether to save flint and steel from breaking.")
|
||||
.defaultValue(true)
|
||||
.visible(ignite::get)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> fireCharge = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("fire-charge")
|
||||
.description("Whether to also use fire charges.")
|
||||
.defaultValue(true)
|
||||
.visible(ignite::get)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("rotate")
|
||||
.description("Whether to rotate towards action.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final List<BlockPos.Mutable> blocksToIgnite = new ArrayList<>();
|
||||
private final Pool<BlockPos.Mutable> ignitePool = new Pool<>(BlockPos.Mutable::new);
|
||||
private final List<TntPos> blocksToPlace = new ArrayList<>();
|
||||
private final Pool<TntPos> placePool = new Pool<>(TntPos::new);
|
||||
private int igniteTick = 0;
|
||||
private int placeTick = 0;
|
||||
|
||||
public AutoTNT() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-tnt", "Places and/or ignites tnt automatically. Good for griefing.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
igniteTick = 0;
|
||||
placeTick = 0;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPreTick(TickEvent.Pre event) {
|
||||
if (ignite.get() && igniteTick > igniteDelay.get()) {
|
||||
// Clear blocks
|
||||
for (BlockPos.Mutable blockPos : blocksToIgnite) ignitePool.free(blockPos);
|
||||
blocksToIgnite.clear();
|
||||
|
||||
// Register
|
||||
BlockIterator.register(horizontalRange.get(), verticalRange.get(), (blockPos, blockState) -> {
|
||||
if (blockState.getBlock() instanceof TntBlock) blocksToIgnite.add(ignitePool.get().set(blockPos));
|
||||
});
|
||||
}
|
||||
|
||||
if (place.get() && placeTick > placeDelay.get()) {
|
||||
// Clear blocks
|
||||
for (TntPos tntPos : blocksToPlace) placePool.free(tntPos);
|
||||
blocksToPlace.clear();
|
||||
|
||||
// Register
|
||||
BlockIterator.register(horizontalRange.get(), verticalRange.get(), (blockPos, blockState) -> {
|
||||
if (BlockUtils.canPlace(blockPos)) blocksToPlace.add(placePool.get().set(blockPos, TntDamage.calculate(blockPos)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPostTick(TickEvent.Post event) {
|
||||
// Ignition
|
||||
if (ignite.get() && blocksToIgnite.size() > 0) {
|
||||
if (igniteTick > igniteDelay.get()) {
|
||||
// Sort based on closest tnt
|
||||
blocksToIgnite.sort(Comparator.comparingDouble(PlayerUtils::distanceTo));
|
||||
|
||||
// Ignition
|
||||
FindItemResult itemResult = InvUtils.findInHotbar(item -> {
|
||||
if (item.getItem() instanceof FlintAndSteelItem) {
|
||||
return (antiBreak.get() && (item.getMaxDamage() - item.getDamage()) > 10);
|
||||
}
|
||||
else if (item.getItem() instanceof FireChargeItem) {
|
||||
return fireCharge.get();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (!itemResult.found()) {
|
||||
error("No flint and steel in hotbar");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
ignite(blocksToIgnite.get(0), itemResult);
|
||||
|
||||
// Reset ticks
|
||||
igniteTick = 0;
|
||||
}
|
||||
}
|
||||
igniteTick++;
|
||||
|
||||
// Placement
|
||||
if (place.get() && blocksToPlace.size() > 0) {
|
||||
if (placeTick > placeDelay.get()) {
|
||||
// Sort based on closest tnt
|
||||
blocksToPlace.sort(Comparator.comparingInt(o -> o.score));
|
||||
|
||||
// Placement
|
||||
FindItemResult itemResult = InvUtils.findInHotbar(item -> item.getItem() == Items.TNT);
|
||||
if (!itemResult.found()) {
|
||||
error("No tnt in hotbar");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
place(blocksToPlace.get(0).blockPos, itemResult);
|
||||
|
||||
// Reset ticks
|
||||
placeTick = 0;
|
||||
}
|
||||
}
|
||||
placeTick++;
|
||||
}
|
||||
|
||||
private void ignite(BlockPos pos, FindItemResult item) {
|
||||
InvUtils.swap(item.getSlot(), true);
|
||||
|
||||
mc.interactionManager.interactBlock(mc.player, mc.world, Hand.MAIN_HAND, new BlockHitResult(new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5), Direction.UP, pos, true));
|
||||
|
||||
InvUtils.swapBack();
|
||||
}
|
||||
|
||||
private void place(BlockPos pos, FindItemResult item) {
|
||||
BlockUtils.place(pos, item, rotate.get(), 10);
|
||||
}
|
||||
|
||||
private class TntPos {
|
||||
public BlockPos.Mutable blockPos;
|
||||
public int score;
|
||||
|
||||
public TntPos set(BlockPos blockPos, int score) {
|
||||
if (this.blockPos != null)
|
||||
this.blockPos.set(blockPos);
|
||||
|
||||
this.score = score;
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
342
src/main/java/anticope/rejects/modules/AutoWither.java
Normal file
342
src/main/java/anticope/rejects/modules/AutoWither.java
Normal file
@@ -0,0 +1,342 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.render.Render3DEvent;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.renderer.ShapeMode;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.misc.Pool;
|
||||
import meteordevelopment.meteorclient.utils.player.FindItemResult;
|
||||
import meteordevelopment.meteorclient.utils.player.InvUtils;
|
||||
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
|
||||
import meteordevelopment.meteorclient.utils.player.Rotations;
|
||||
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockIterator;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
public class AutoWither extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
private final SettingGroup sgRender = settings.createGroup("Render");
|
||||
|
||||
// General
|
||||
|
||||
private final Setting<Integer> horizontalRadius = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("horizontal-radius")
|
||||
.description("Horizontal radius for placement")
|
||||
.defaultValue(4)
|
||||
.min(0)
|
||||
.sliderMax(6)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> verticalRadius = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("vertical-radius")
|
||||
.description("Vertical radius for placement")
|
||||
.defaultValue(3)
|
||||
.min(0)
|
||||
.sliderMax(6)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Priority> priority = sgGeneral.add(new EnumSetting.Builder<Priority>()
|
||||
.name("priority")
|
||||
.description("Priority")
|
||||
.defaultValue(Priority.Random)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> witherDelay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("wither-delay")
|
||||
.description("Delay in ticks between wither placements")
|
||||
.defaultValue(1)
|
||||
.min(1)
|
||||
.sliderMax(10)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> blockDelay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("block-delay")
|
||||
.description("Delay in ticks between block placements")
|
||||
.defaultValue(1)
|
||||
.min(0)
|
||||
.sliderMax(10)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("rotate")
|
||||
.description("Whether or not to rotate while building")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> turnOff = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("turn-off")
|
||||
.description("Turns off automatically after building a single wither.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
// Render
|
||||
|
||||
private final Setting<ShapeMode> shapeMode = sgRender.add(new EnumSetting.Builder<ShapeMode>()
|
||||
.name("shape-mode")
|
||||
.description("How the shapes are rendered.")
|
||||
.defaultValue(ShapeMode.Both)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<SettingColor> sideColor = sgRender.add(new ColorSetting.Builder()
|
||||
.name("side-color")
|
||||
.description("The side color of the target block rendering.")
|
||||
.defaultValue(new SettingColor(197, 137, 232, 10))
|
||||
.build()
|
||||
);
|
||||
private final Setting<SettingColor> lineColor = sgRender.add(new ColorSetting.Builder()
|
||||
.name("line-color")
|
||||
.description("The line color of the target block rendering.")
|
||||
.defaultValue(new SettingColor(197, 137, 232))
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Pool<Wither> witherPool = new Pool<>(Wither::new);
|
||||
private final ArrayList<Wither> withers = new ArrayList<>();
|
||||
private Wither wither;
|
||||
|
||||
private int witherTicksWaited, blockTicksWaited;
|
||||
|
||||
public AutoWither() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-wither", "Automatically builds withers.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
wither = null;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
if (wither == null) {
|
||||
// Delay
|
||||
if (witherTicksWaited < witherDelay.get() - 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear pool and list
|
||||
for (Wither wither : withers) witherPool.free(wither);
|
||||
withers.clear();
|
||||
|
||||
// Register
|
||||
BlockIterator.register(horizontalRadius.get(), verticalRadius.get(), (blockPos, blockState) -> {
|
||||
Direction dir = Direction.fromRotation(Rotations.getYaw(blockPos)).getOpposite();
|
||||
if (isValidSpawn(blockPos, dir)) withers.add(witherPool.get().set(blockPos, dir));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPostTick(TickEvent.Post event) {
|
||||
if (wither == null) {
|
||||
// Delay
|
||||
if (witherTicksWaited < witherDelay.get() - 1) {
|
||||
witherTicksWaited++;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (withers.isEmpty()) return;
|
||||
|
||||
// Sorting
|
||||
switch (priority.get()) {
|
||||
case Closest:
|
||||
withers.sort(Comparator.comparingDouble(w -> PlayerUtils.distanceTo(w.foot)));
|
||||
case Furthest:
|
||||
withers.sort((w1, w2) -> {
|
||||
int sort = Double.compare(PlayerUtils.distanceTo(w1.foot), PlayerUtils.distanceTo(w2.foot));
|
||||
if (sort == 0) return 0;
|
||||
return sort > 0 ? -1 : 1;
|
||||
});
|
||||
case Random:
|
||||
Collections.shuffle(withers);
|
||||
}
|
||||
|
||||
wither = withers.get(0);
|
||||
}
|
||||
|
||||
// Soul sand/soil and skull slot
|
||||
FindItemResult findSoulSand = InvUtils.findInHotbar(Items.SOUL_SAND);
|
||||
if (!findSoulSand.found()) findSoulSand = InvUtils.findInHotbar(Items.SOUL_SOIL);
|
||||
FindItemResult findWitherSkull = InvUtils.findInHotbar(Items.WITHER_SKELETON_SKULL);
|
||||
|
||||
// Check for enough resources
|
||||
if (!findSoulSand.found() || !findWitherSkull.found()) {
|
||||
error("Not enough resources in hotbar");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Build
|
||||
if (blockDelay.get() == 0) {
|
||||
// All in 1 tick
|
||||
|
||||
// Body
|
||||
BlockUtils.place(wither.foot, findSoulSand, rotate.get(), -50);
|
||||
BlockUtils.place(wither.foot.up(), findSoulSand, rotate.get(), -50);
|
||||
BlockUtils.place(wither.foot.up().offset(wither.axis, -1), findSoulSand, rotate.get(), -50);
|
||||
BlockUtils.place(wither.foot.up().offset(wither.axis, 1), findSoulSand, rotate.get(), -50);
|
||||
|
||||
// Head
|
||||
BlockUtils.place(wither.foot.up().up(), findWitherSkull, rotate.get(), -50);
|
||||
BlockUtils.place(wither.foot.up().up().offset(wither.axis, -1), findWitherSkull, rotate.get(), -50);
|
||||
BlockUtils.place(wither.foot.up().up().offset(wither.axis, 1), findWitherSkull, rotate.get(), -50);
|
||||
|
||||
|
||||
// Auto turnoff
|
||||
if (turnOff.get()) {
|
||||
wither = null;
|
||||
toggle();
|
||||
}
|
||||
|
||||
} else {
|
||||
// Delay
|
||||
if (blockTicksWaited < blockDelay.get() - 1) {
|
||||
blockTicksWaited++;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (wither.stage) {
|
||||
case 0:
|
||||
if (BlockUtils.place(wither.foot, findSoulSand, rotate.get(), -50)) wither.stage++;
|
||||
break;
|
||||
case 1:
|
||||
if (BlockUtils.place(wither.foot.up(), findSoulSand, rotate.get(), -50)) wither.stage++;
|
||||
break;
|
||||
case 2:
|
||||
if (BlockUtils.place(wither.foot.up().offset(wither.axis, -1), findSoulSand, rotate.get(), -50)) wither.stage++;
|
||||
break;
|
||||
case 3:
|
||||
if (BlockUtils.place(wither.foot.up().offset(wither.axis, 1), findSoulSand, rotate.get(), -50)) wither.stage++;
|
||||
break;
|
||||
case 4:
|
||||
if (BlockUtils.place(wither.foot.up().up(), findWitherSkull, rotate.get(), -50)) wither.stage++;
|
||||
break;
|
||||
case 5:
|
||||
if (BlockUtils.place(wither.foot.up().up().offset(wither.axis, -1), findWitherSkull, rotate.get(), -50)) wither.stage++;
|
||||
break;
|
||||
case 6:
|
||||
if (BlockUtils.place(wither.foot.up().up().offset(wither.axis, 1), findWitherSkull, rotate.get(), -50)) wither.stage++;
|
||||
break;
|
||||
case 7:
|
||||
// Auto turnoff
|
||||
if (turnOff.get()) {
|
||||
wither = null;
|
||||
toggle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
witherTicksWaited = 0;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onRender(Render3DEvent event) {
|
||||
if (wither == null) return;
|
||||
|
||||
// Body
|
||||
event.renderer.box(wither.foot, sideColor.get(), lineColor.get(), shapeMode.get(), 0);
|
||||
event.renderer.box(wither.foot.up(), sideColor.get(), lineColor.get(), shapeMode.get(), 0);
|
||||
event.renderer.box(wither.foot.up().offset(wither.axis, -1), sideColor.get(), lineColor.get(), shapeMode.get(), 0);
|
||||
event.renderer.box(wither.foot.up().offset(wither.axis, 1), sideColor.get(), lineColor.get(), shapeMode.get(), 0);
|
||||
|
||||
// Head
|
||||
BlockPos midHead = wither.foot.up().up();
|
||||
BlockPos leftHead = wither.foot.up().up().offset(wither.axis, -1);
|
||||
BlockPos rightHead = wither.foot.up().up().offset(wither.axis, 1);
|
||||
|
||||
event.renderer.box((double) midHead.getX() + 0.2, (double) midHead.getX(), (double) midHead.getX() + 0.2,
|
||||
(double) midHead.getX() + 0.8, (double) midHead.getX() + 0.7, (double) midHead.getX() + 0.8,
|
||||
sideColor.get(), lineColor.get(), shapeMode.get(), 0);
|
||||
|
||||
event.renderer.box((double) leftHead.getX() + 0.2, (double) leftHead.getX(), (double) leftHead.getX() + 0.2,
|
||||
(double) leftHead.getX() + 0.8, (double) leftHead.getX() + 0.7, (double) leftHead.getX() + 0.8,
|
||||
sideColor.get(), lineColor.get(), shapeMode.get(), 0);
|
||||
|
||||
event.renderer.box((double) rightHead.getX() + 0.2, (double) rightHead.getX(), (double) rightHead.getX() + 0.2,
|
||||
(double) rightHead.getX() + 0.8, (double) rightHead.getX() + 0.7, (double) rightHead.getX() + 0.8,
|
||||
sideColor.get(), lineColor.get(), shapeMode.get(), 0);
|
||||
}
|
||||
|
||||
private boolean isValidSpawn(BlockPos blockPos, Direction direction) {
|
||||
// Withers are 3x3x1
|
||||
|
||||
// Check if y > (255 - 3)
|
||||
// Because withers are 3 blocks tall
|
||||
if (blockPos.getY() > 252) return false;
|
||||
|
||||
// Determine width from direction
|
||||
int widthX = 0;
|
||||
int widthZ = 0;
|
||||
|
||||
if (direction == Direction.EAST || direction == Direction.WEST) widthZ = 1;
|
||||
if (direction == Direction.NORTH || direction == Direction.SOUTH) widthX = 1;
|
||||
|
||||
|
||||
// Check for non air blocks and entities
|
||||
BlockPos.Mutable bp = new BlockPos.Mutable();
|
||||
for (int x = blockPos.getX() - widthX; x <= blockPos.getX() + widthX; x++) {
|
||||
for (int z = blockPos.getZ() - widthZ; z <= blockPos.getZ(); z++) {
|
||||
for (int y = blockPos.getY(); y <= blockPos.getY() + 2; y++) {
|
||||
bp.set(x, y, z);
|
||||
if (!mc.world.getBlockState(bp).getMaterial().isReplaceable()) return false;
|
||||
if (!mc.world.canPlace(Blocks.STONE.getDefaultState(), bp, ShapeContext.absent())) return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public enum Priority {
|
||||
Closest,
|
||||
Furthest,
|
||||
Random
|
||||
}
|
||||
|
||||
private static class Wither {
|
||||
public int stage;
|
||||
// 0 = foot
|
||||
// 1 = mid body
|
||||
// 2 = left arm
|
||||
// 3 = right arm
|
||||
// 4 = mid head
|
||||
// 5 = left head
|
||||
// 6 = right head
|
||||
// 7 = end
|
||||
public BlockPos.Mutable foot = new BlockPos.Mutable();
|
||||
public Direction facing;
|
||||
public Direction.Axis axis;
|
||||
|
||||
public Wither set(BlockPos pos, Direction dir) {
|
||||
this.stage = 0;
|
||||
this.foot.set(pos);
|
||||
this.facing = dir;
|
||||
this.axis = dir.getAxis();
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
183
src/main/java/anticope/rejects/modules/BedrockWalk.java
Normal file
183
src/main/java/anticope/rejects/modules/BedrockWalk.java
Normal file
@@ -0,0 +1,183 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.FluidBlock;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.mixininterface.IVec3d;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.DoubleSetting;
|
||||
import meteordevelopment.meteorclient.settings.IntSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
|
||||
public class BedrockWalk extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Double> activationWindow = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("activation-window")
|
||||
.description("The area above the target Y level at which pull activates.")
|
||||
.min(0.2D)
|
||||
.max(5.0D)
|
||||
.sliderMin(0.2D)
|
||||
.sliderMax(5.0D)
|
||||
.defaultValue(0.5D)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
private final Setting<Integer> driftToHeight = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("drift-to-height")
|
||||
.description("Y level to find blocks to drift onto.")
|
||||
.min(0)
|
||||
.max(256)
|
||||
.sliderMin(0)
|
||||
.sliderMax(256)
|
||||
.defaultValue(5)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
private final Setting<Double> horizontalPullStrength = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("horizontal-pull")
|
||||
.description("The horizontal speed/strength at which you drift to the goal block.")
|
||||
.min(0.1D)
|
||||
.max(10.0D)
|
||||
.sliderMin(0.1D)
|
||||
.sliderMax(10.0D)
|
||||
.defaultValue(1.0D)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
private final Setting<Double> verticalPullStrength = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("vertical-pull")
|
||||
.description("The vertical speed/strength at which you drift to the goal block.")
|
||||
.min(0.1D)
|
||||
.max(10.0D)
|
||||
.sliderMin(0.1D)
|
||||
.sliderMax(10.0D)
|
||||
.defaultValue(1.0D)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
private final Setting<Integer> searchRadius = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("search-radius")
|
||||
.description("The radius at which tanuki mode searches for blocks (odd numbers only).")
|
||||
.min(3)
|
||||
.max(15)
|
||||
.sliderMin(3)
|
||||
.sliderMax(15)
|
||||
.defaultValue(3)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
private final Setting<Boolean> updatePositionFailsafe = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("failsafe")
|
||||
.description("Updates your position to the top of the target block if you miss the jump.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
private final Setting<Double> failsafeWindow = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("failsafe-window")
|
||||
.description("Window below the target block to fall to trigger failsafe.")
|
||||
.min(0.01D)
|
||||
.max(1.0D)
|
||||
.sliderMin(0.01D)
|
||||
.sliderMax(1.0D)
|
||||
.defaultValue(0.1D)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
private final Setting<Double> successfulLandingMargin = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("landing-margin")
|
||||
.description("The distance from a landing block to be considered a successful landing.")
|
||||
.min(0.01D)
|
||||
.max(10.0D)
|
||||
.sliderMin(0.01D)
|
||||
.sliderMax(10.0D)
|
||||
.defaultValue(1.0D)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final BlockPos.Mutable blockPos = new BlockPos.Mutable(0, 0, 0);
|
||||
private final ArrayList<BlockPos> validBlocks = new ArrayList<>();
|
||||
private final TreeMap<Double, BlockPos> sortedBlocks = new TreeMap<>();
|
||||
private final BlockPos.Mutable playerHorizontalPos = new BlockPos.Mutable();
|
||||
private boolean successfulLanding;
|
||||
|
||||
|
||||
public BedrockWalk() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "bedrock-walk", "Makes moving on bedrock easier.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
if (this.searchRadius.get() % 2 == 0) {
|
||||
info("%d is not valid for radius, rounding up", this.searchRadius.get());
|
||||
searchRadius.set(searchRadius.get() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post event) {
|
||||
if (mc.player.getY() > driftToHeight.get() + activationWindow.get()) return;
|
||||
Vec3d targetPos = findNearestBlock(mc.player.getX(), driftToHeight.get() -1, mc.player.getZ());
|
||||
if (targetPos == null) return;
|
||||
if (mc.player.getY() == targetPos.getY() + 1.0D) return;
|
||||
if (mc.options.keyJump.isPressed()) return;
|
||||
if (updatePositionFailsafe.get() && !successfulLanding && mc.player.getY() < (driftToHeight.get() - failsafeWindow.get())) {
|
||||
mc.player.setPos(targetPos.getX(), targetPos.getY() + 1.0D, targetPos.getZ());
|
||||
}
|
||||
Vec3d normalizedDirection = targetPos.subtract(mc.player.getPos()).normalize();
|
||||
Vec3d velocity = mc.player.getVelocity();
|
||||
((IVec3d)mc.player.getVelocity()).set(
|
||||
velocity.x + normalizedDirection.x * horizontalPullStrength.get() * mc.getTickDelta(),
|
||||
velocity.y + normalizedDirection.y * verticalPullStrength.get() * mc.getTickDelta(),
|
||||
velocity.z + normalizedDirection.z * horizontalPullStrength.get() * mc.getTickDelta()
|
||||
);
|
||||
|
||||
successfulLanding = mc.player.getPos().isInRange(targetPos, successfulLandingMargin.get());
|
||||
}
|
||||
|
||||
private Vec3d findNearestBlock(double x, int y, double z) {
|
||||
validBlocks.clear();
|
||||
sortedBlocks.clear();
|
||||
|
||||
playerHorizontalPos.set(x, y, z);
|
||||
|
||||
int rad = searchRadius.get();
|
||||
for (int ix = 0; ix < rad; ix++) {
|
||||
for (int iy = 0; iy < rad; iy++) {
|
||||
BlockState block = mc.world.getBlockState(blockPos.set(x - ((rad - 1) / 2 - ix), y, x - ((rad - 1) / 2 - iy)));
|
||||
if (!block.isAir() &&!(block.getBlock() instanceof FluidBlock)) {
|
||||
validBlocks.add(blockPos.mutableCopy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
validBlocks.forEach(blockPos -> {
|
||||
sortedBlocks.put(blockPos.getSquaredDistance(x, y, z, true), blockPos);
|
||||
});
|
||||
|
||||
Map.Entry<Double, BlockPos> firstEntry = sortedBlocks.firstEntry();
|
||||
|
||||
if (firstEntry == null) return null;
|
||||
|
||||
return Vec3d.ofBottomCenter(firstEntry.getValue());
|
||||
}
|
||||
}
|
||||
146
src/main/java/anticope/rejects/modules/BlockIn.java
Normal file
146
src/main/java/anticope/rejects/modules/BlockIn.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.player.FindItemResult;
|
||||
import meteordevelopment.meteorclient.utils.player.InvUtils;
|
||||
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.FallingBlock;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class BlockIn extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> multiPlace = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("multi-place")
|
||||
.description("Whether to place all blocks in a single tick")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> center = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("center")
|
||||
.description("Whether to center to avoid obstructing placement")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("rotate")
|
||||
.description("Whether to rotate towards block placements.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> turnOff = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("turn-off")
|
||||
.description("Whether to turn off after finished placing.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> onlyOnGround = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("only-on-ground")
|
||||
.description("Only places when you are standing on blocks (not in midair).")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final BlockPos.Mutable bp = new BlockPos.Mutable();
|
||||
private boolean return_;
|
||||
|
||||
public BlockIn() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "block-in", "Block yourself in using any block.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPreTick(TickEvent.Pre event) {
|
||||
if (center.get()) PlayerUtils.centerPlayer();
|
||||
if (onlyOnGround.get() && !mc.player.isOnGround()) return;
|
||||
|
||||
return_ = false;
|
||||
|
||||
// Multiplace
|
||||
if (multiPlace.get()) {
|
||||
// Bottom
|
||||
boolean p1 = place(0, -1, 0);
|
||||
// Lower sides
|
||||
boolean p2 = place(1, 0, 0);
|
||||
boolean p3 = place(-1, 0, 0);
|
||||
boolean p4 = place(0, 0, 1);
|
||||
boolean p5 = place(0, 0, -1);
|
||||
// Upper sides
|
||||
boolean p6 = place(1, 1, 0);
|
||||
boolean p7 = place(-1, 1, 0);
|
||||
boolean p8 = place(0, 1, 1);
|
||||
boolean p9 = place(0, 1, -1);
|
||||
// Top
|
||||
boolean p10 = place(0, 2, 0);
|
||||
|
||||
// Turn off
|
||||
if (turnOff.get() && p1 && p2 && p3 && p4 && p5 && p6 && p7 && p8 && p9 && p10) toggle();
|
||||
|
||||
// No multiplace
|
||||
} else {
|
||||
// Bottom
|
||||
boolean p1 = place(0, -1, 0);
|
||||
if (return_) return;
|
||||
// Lower sides
|
||||
boolean p2 = place(1, 0, 0);
|
||||
if (return_) return;
|
||||
boolean p3 = place(-1, 0, 0);
|
||||
if (return_) return;
|
||||
boolean p4 = place(0, 0, 1);
|
||||
if (return_) return;
|
||||
boolean p5 = place(0, 0, -1);
|
||||
if (return_) return;
|
||||
// Upper sides
|
||||
boolean p6 = place(1, 1, 0);
|
||||
if (return_) return;
|
||||
boolean p7 = place(-1, 1, 0);
|
||||
if (return_) return;
|
||||
boolean p8 = place(0, 1, 1);
|
||||
if (return_) return;
|
||||
boolean p9 = place(0, 1, -1);
|
||||
if (return_) return;
|
||||
// Top
|
||||
boolean p10 = place(0, 2, 0);
|
||||
|
||||
// Turn off
|
||||
if (turnOff.get() && p1 && p2 && p3 && p4 && p5 && p6 && p7 && p8 && p9 && p10) toggle();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean place(int x, int y, int z) {
|
||||
setBlockPos(x, y, z);
|
||||
FindItemResult findItemResult = InvUtils.findInHotbar(itemStack -> validItem(itemStack, bp));
|
||||
if (!BlockUtils.canPlace(bp)) return true;
|
||||
|
||||
if (BlockUtils.place(bp, findItemResult, rotate.get(), 100, true)) {
|
||||
return_ = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void setBlockPos(int x, int y, int z) {
|
||||
bp.set(mc.player.getX() + x, mc.player.getY() + y, mc.player.getZ() + z);
|
||||
}
|
||||
|
||||
private boolean validItem(ItemStack itemStack, BlockPos pos) {
|
||||
if (!(itemStack.getItem() instanceof BlockItem)) return false;
|
||||
Block block = ((BlockItem) itemStack.getItem()).getBlock();
|
||||
|
||||
if (!Block.isShapeFullCube(block.getDefaultState().getCollisionShape(mc.world, pos))) return false;
|
||||
return !(block instanceof FallingBlock) || !FallingBlock.canFallThrough(mc.world.getBlockState(pos));
|
||||
}
|
||||
}
|
||||
130
src/main/java/anticope/rejects/modules/BoatGlitch.java
Normal file
130
src/main/java/anticope/rejects/modules/BoatGlitch.java
Normal file
@@ -0,0 +1,130 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.entity.BoatMoveEvent;
|
||||
import meteordevelopment.meteorclient.events.meteor.KeyEvent;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
import meteordevelopment.meteorclient.utils.misc.input.KeyAction;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
public class BoatGlitch extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> toggleAfter = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("toggle-after")
|
||||
.description("Disables the module when finished.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> remount = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("remount")
|
||||
.description("Remounts the boat when finished.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private Entity boat = null;
|
||||
private int dismountTicks = 0;
|
||||
private int remountTicks = 0;
|
||||
private boolean dontPhase = true;
|
||||
private boolean boatPhaseEnabled;
|
||||
|
||||
public BoatGlitch() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "boat-glitch", "Glitches your boat into the block beneath you. Dismount to trigger.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
dontPhase = true;
|
||||
dismountTicks = 0;
|
||||
remountTicks = 0;
|
||||
boat = null;
|
||||
if (Modules.get().isActive(BoatPhase.class)) {
|
||||
boatPhaseEnabled = true;
|
||||
Modules.get().get(BoatPhase.class).toggle();
|
||||
}
|
||||
else {
|
||||
boatPhaseEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
if (boat != null) {
|
||||
boat.noClip = false;
|
||||
boat = null;
|
||||
}
|
||||
if (boatPhaseEnabled && !(Modules.get().isActive(BoatPhase.class))) {
|
||||
Modules.get().get(BoatPhase.class).toggle();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onBoatMove(BoatMoveEvent event) {
|
||||
if (dismountTicks == 0 && !dontPhase) {
|
||||
if (boat != event.boat) {
|
||||
if (boat != null) {
|
||||
boat.noClip = false;
|
||||
}
|
||||
if (mc.player.getVehicle() != null && event.boat == mc.player.getVehicle()) {
|
||||
boat = event.boat;
|
||||
}
|
||||
else {
|
||||
boat = null;
|
||||
}
|
||||
}
|
||||
if (boat != null) {
|
||||
boat.noClip = true;
|
||||
//boat.pushSpeedReduction = 1;
|
||||
dismountTicks = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post event) {
|
||||
if (dismountTicks > 0) {
|
||||
dismountTicks--;
|
||||
if (dismountTicks == 0) {
|
||||
if (boat != null) {
|
||||
boat.noClip = false;
|
||||
if (toggleAfter.get() && !remount.get()) {
|
||||
toggle();
|
||||
}
|
||||
else if (remount.get()) {
|
||||
remountTicks = 5;
|
||||
}
|
||||
}
|
||||
dontPhase = true;
|
||||
}
|
||||
}
|
||||
if (remountTicks > 0) {
|
||||
remountTicks--;
|
||||
if (remountTicks == 0) {
|
||||
mc.getNetworkHandler().sendPacket( PlayerInteractEntityC2SPacket.interact(boat, false, Hand.MAIN_HAND));
|
||||
if (toggleAfter.get()) {
|
||||
toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@EventHandler
|
||||
private void onKey(KeyEvent event) {
|
||||
if (event.key == mc.options.keySneak.getDefaultKey().getCode() && event.action == KeyAction.Press) {
|
||||
if (mc.player.getVehicle() != null && mc.player.getVehicle().getType().equals(EntityType.BOAT)) {
|
||||
dontPhase = false;
|
||||
boat = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
137
src/main/java/anticope/rejects/modules/BoatPhase.java
Normal file
137
src/main/java/anticope/rejects/modules/BoatPhase.java
Normal file
@@ -0,0 +1,137 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.entity.BoatMoveEvent;
|
||||
import meteordevelopment.meteorclient.mixininterface.IVec3d;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.DoubleSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.vehicle.BoatEntity;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class BoatPhase extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
private final SettingGroup sgSpeeds = settings.createGroup("Speeds");
|
||||
|
||||
private final Setting<Boolean> lockYaw = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("lock-boat-yaw")
|
||||
.description("Locks boat yaw to the direction you're facing.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> verticalControl = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("vertical-control")
|
||||
.description("Whether or not space/ctrl can be used to move vertically.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> adjustHorizontalSpeed = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("adjust-horizontal-speed")
|
||||
.description("Whether or not horizontal speed is modified.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> fall = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("fall")
|
||||
.description("Toggles vertical glide.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> horizontalSpeed = sgSpeeds.add(new DoubleSetting.Builder()
|
||||
.name("horizontal-speed")
|
||||
.description("Horizontal speed in blocks per second.")
|
||||
.defaultValue(10)
|
||||
.min(0)
|
||||
.sliderMax(50)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> verticalSpeed = sgSpeeds.add(new DoubleSetting.Builder()
|
||||
.name("vertical-speed")
|
||||
.description("Vertical speed in blocks per second.")
|
||||
.defaultValue(5)
|
||||
.min(0)
|
||||
.sliderMax(20)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> fallSpeed = sgSpeeds.add(new DoubleSetting.Builder()
|
||||
.name("fall-speed")
|
||||
.description("How fast you fall in blocks per second.")
|
||||
.defaultValue(0.625)
|
||||
.min(0)
|
||||
.sliderMax(10)
|
||||
.build()
|
||||
);
|
||||
|
||||
private BoatEntity boat = null;
|
||||
|
||||
public BoatPhase() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "boat-phase", "Phase through blocks using a boat.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
boat = null;
|
||||
if (Modules.get().isActive(BoatGlitch.class)) Modules.get().get(BoatGlitch.class).toggle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
if (boat != null) {
|
||||
boat.noClip = false;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onBoatMove(BoatMoveEvent event) {
|
||||
if (mc.player.getVehicle() != null && mc.player.getVehicle().getType().equals(EntityType.BOAT)) {
|
||||
if (boat != mc.player.getVehicle()) {
|
||||
if (boat != null) {
|
||||
boat.noClip = false;
|
||||
}
|
||||
boat = (BoatEntity) mc.player.getVehicle();
|
||||
}
|
||||
} else boat = null;
|
||||
|
||||
if (boat != null) {
|
||||
boat.noClip = true;
|
||||
//boat.pushSpeedReduction = 1;
|
||||
|
||||
if (lockYaw.get()) {
|
||||
boat.setYaw(mc.player.getYaw());
|
||||
}
|
||||
|
||||
Vec3d vel;
|
||||
|
||||
if (adjustHorizontalSpeed.get()) {
|
||||
vel = PlayerUtils.getHorizontalVelocity(horizontalSpeed.get());
|
||||
}
|
||||
else {
|
||||
vel = boat.getVelocity();
|
||||
}
|
||||
|
||||
double velX = vel.x;
|
||||
double velY = 0;
|
||||
double velZ = vel.z;
|
||||
|
||||
if (verticalControl.get()) {
|
||||
if (mc.options.keyJump.isPressed()) velY += verticalSpeed.get() / 20;
|
||||
if (mc.options.keySprint.isPressed()) velY -= verticalSpeed.get() / 20;
|
||||
else if (fall.get()) velY -= fallSpeed.get() / 20;
|
||||
} else if (fall.get()) velY -= fallSpeed.get() / 20;
|
||||
|
||||
((IVec3d) boat.getVelocity()).set(velX,velY,velZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
38
src/main/java/anticope/rejects/modules/Boost.java
Normal file
38
src/main/java/anticope/rejects/modules/Boost.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import meteordevelopment.meteorclient.settings.DoubleSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
|
||||
public class Boost extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Double> strength = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("strength")
|
||||
.description("Strength to yeet you with.")
|
||||
.defaultValue(4.0)
|
||||
.min(0.5)
|
||||
.sliderMax(10)
|
||||
.build()
|
||||
);
|
||||
|
||||
public Boost() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "boost", "Works like a dash move.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
if (mc.player == null) {
|
||||
this.toggle();
|
||||
return;
|
||||
}
|
||||
Vec3d v = mc.player.getRotationVecClient().multiply(strength.get());
|
||||
mc.player.addVelocity(v.getX(), v.getY(), v.getZ());
|
||||
this.toggle();
|
||||
}
|
||||
}
|
||||
157
src/main/java/anticope/rejects/modules/ChatBot.java
Normal file
157
src/main/java/anticope/rejects/modules/ChatBot.java
Normal file
@@ -0,0 +1,157 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtString;
|
||||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
|
||||
|
||||
import meteordevelopment.meteorclient.events.game.ReceiveMessageEvent;
|
||||
import meteordevelopment.meteorclient.gui.GuiTheme;
|
||||
import meteordevelopment.meteorclient.gui.widgets.WWidget;
|
||||
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
|
||||
import meteordevelopment.meteorclient.gui.widgets.input.WTextBox;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WMinus;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WPlus;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.settings.StringSetting;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.misc.MeteorStarscript;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.starscript.Script;
|
||||
import meteordevelopment.starscript.compiler.Compiler;
|
||||
import meteordevelopment.starscript.compiler.Parser;
|
||||
import meteordevelopment.starscript.utils.StarscriptError;
|
||||
|
||||
public class ChatBot extends Module {
|
||||
|
||||
public final HashMap<String, String> commands = new HashMap<>() {{
|
||||
put("ping", "Pong!");
|
||||
put("tps", "Current TPS: {server.tps}");
|
||||
put("time", "It's currently {server.time}");
|
||||
put("time", "It's currently {server.time}");
|
||||
put("pos", "I am @ {player.pos}");
|
||||
}};
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<String> prefix = sgGeneral.add(new StringSetting.Builder()
|
||||
.name("prefix")
|
||||
.description("Command prefix for the bot.")
|
||||
.defaultValue("!")
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> help = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("help")
|
||||
.description("Add help command.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
public ChatBot() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "chat-bot", "Bot which automatically responds to chat messages.");
|
||||
}
|
||||
|
||||
private String currMsgK = "", currMsgV = "";
|
||||
|
||||
@EventHandler
|
||||
private void onMessageRecieve(ReceiveMessageEvent event) {
|
||||
String msg = event.getMessage().getString();
|
||||
if (help.get() && msg.endsWith(prefix.get()+"help")) {
|
||||
mc.getNetworkHandler().sendPacket(new ChatMessageC2SPacket("Avaliable commands: " + String.join(", ", commands.keySet())));
|
||||
return;
|
||||
}
|
||||
for (String cmd : commands.keySet()) {
|
||||
if (msg.endsWith(prefix.get()+cmd)) {
|
||||
Script script = compile(commands.get(cmd));
|
||||
if (script == null) mc.player.sendChatMessage("An error occurred");
|
||||
try {
|
||||
mc.player.sendChatMessage(MeteorStarscript.ss.run(script));
|
||||
} catch (StarscriptError e) {
|
||||
MeteorStarscript.printChatError(e);
|
||||
mc.player.sendChatMessage("An error occurred");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WWidget getWidget(GuiTheme theme) {
|
||||
WTable table = theme.table();
|
||||
fillTable(theme, table);
|
||||
return table;
|
||||
}
|
||||
|
||||
private void fillTable(GuiTheme theme, WTable table) {
|
||||
table.clear();
|
||||
commands.keySet().forEach((key) -> {
|
||||
table.add(theme.label(key)).expandCellX();
|
||||
table.add(theme.label(commands.get(key))).expandCellX();
|
||||
WMinus delete = table.add(theme.minus()).widget();
|
||||
delete.action = () -> {
|
||||
commands.remove(key);
|
||||
fillTable(theme,table);
|
||||
};
|
||||
table.row();
|
||||
});
|
||||
WTextBox textBoxK = table.add(theme.textBox(currMsgK)).minWidth(100).expandX().widget();
|
||||
textBoxK.action = () -> {
|
||||
currMsgK = textBoxK.get();
|
||||
};
|
||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV)).minWidth(100).expandX().widget();
|
||||
textBoxV.action = () -> {
|
||||
currMsgV = textBoxV.get();
|
||||
};
|
||||
WPlus add = table.add(theme.plus()).widget();
|
||||
add.action = () -> {
|
||||
if (currMsgK != "" && currMsgV != "") {
|
||||
commands.put(currMsgK, currMsgV);
|
||||
currMsgK = ""; currMsgV = "";
|
||||
fillTable(theme,table);
|
||||
}
|
||||
};
|
||||
table.row();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NbtCompound toTag() {
|
||||
NbtCompound tag = super.toTag();
|
||||
|
||||
NbtCompound messTag = new NbtCompound();
|
||||
commands.keySet().forEach((key) -> {
|
||||
messTag.put(key, NbtString.of(commands.get(key)));
|
||||
});
|
||||
|
||||
tag.put("commands", messTag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Module fromTag(NbtCompound tag) {
|
||||
|
||||
commands.clear();
|
||||
if (tag.contains("commands")) {
|
||||
NbtCompound msgs = tag.getCompound("commands");
|
||||
msgs.getKeys().forEach((key) -> {
|
||||
commands.put(key, msgs.getString(key));
|
||||
});
|
||||
}
|
||||
|
||||
return super.fromTag(tag);
|
||||
}
|
||||
|
||||
private static Script compile(String script) {
|
||||
if (script == null) return null;
|
||||
Parser.Result result = Parser.parse(script);
|
||||
if (result.hasErrors()) {
|
||||
MeteorStarscript.printChatError(result.errors.get(0));
|
||||
return null;
|
||||
}
|
||||
return Compiler.compile(result);
|
||||
}
|
||||
}
|
||||
43
src/main/java/anticope/rejects/modules/ColorSigns.java
Normal file
43
src/main/java/anticope/rejects/modules/ColorSigns.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import net.minecraft.network.packet.c2s.play.UpdateSignC2SPacket;
|
||||
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;
|
||||
|
||||
public class ColorSigns extends Module {
|
||||
|
||||
public ColorSigns() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "color-signs", "Allows you to use colors on signs on NON-PAPER servers (use \"&\" for color symbols)");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPacketSend(PacketEvent.Send event) {
|
||||
if (event.packet instanceof GameJoinS2CPacket) {
|
||||
checkWarning();
|
||||
return;
|
||||
}
|
||||
if (!(event.packet instanceof UpdateSignC2SPacket)) return;
|
||||
UpdateSignC2SPacket p = (UpdateSignC2SPacket)event.packet;
|
||||
for (int l = 0; l < p.getText().length; l++) {
|
||||
String newText = p.getText()[l].replaceAll("(?i)\u00a7|&([0-9A-FK-OR])", "\u00a7\u00a7$1$1");
|
||||
p.getText()[l] = newText;
|
||||
}
|
||||
event.packet = p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
super.onActivate();
|
||||
checkWarning();
|
||||
}
|
||||
|
||||
private void checkWarning() {
|
||||
String brand = mc.player.getServerBrand();
|
||||
if (brand == null) return;
|
||||
if (brand.contains("Paper")) warning("You are on a paper server. Color signs won't work here");
|
||||
}
|
||||
}
|
||||
213
src/main/java/anticope/rejects/modules/Confuse.java
Normal file
213
src/main/java/anticope/rejects/modules/Confuse.java
Normal file
@@ -0,0 +1,213 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.render.Render3DEvent;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.Utils;
|
||||
import meteordevelopment.meteorclient.utils.entity.SortPriority;
|
||||
import meteordevelopment.meteorclient.utils.entity.TargetUtils;
|
||||
import meteordevelopment.meteorclient.utils.render.color.Color;
|
||||
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
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.Vec3d;
|
||||
import net.minecraft.world.RaycastContext;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// Too much much spaghetti!
|
||||
// -StormyBytes
|
||||
|
||||
public class Confuse extends Module {
|
||||
|
||||
public enum Mode {
|
||||
RandomTP,
|
||||
Switch,
|
||||
Circle
|
||||
}
|
||||
|
||||
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> range = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("radius")
|
||||
.description("Range to confuse opponents")
|
||||
.defaultValue(6)
|
||||
.min(0).sliderMax(10)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<SortPriority> priority = sgGeneral.add(new EnumSetting.Builder<SortPriority>()
|
||||
.name("priority")
|
||||
.description("Targetting priority")
|
||||
.defaultValue(SortPriority.LowestHealth)
|
||||
.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()
|
||||
);
|
||||
|
||||
private final Setting<SettingColor> circleColor = sgGeneral.add(new ColorSetting.Builder()
|
||||
.name("circle-color")
|
||||
.description("Color for circle rendering")
|
||||
.defaultValue(new SettingColor(0, 255, 0))
|
||||
.visible(budgetGraphics::get)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
int delayWaited = 0;
|
||||
double circleProgress = 0;
|
||||
double addition = 0.0;
|
||||
Entity target = null;
|
||||
|
||||
public Confuse() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "confuse", "Makes your enemies shit themselves");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
delayWaited = 0;
|
||||
circleProgress = 0;
|
||||
addition = 0.0;
|
||||
target = null;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
|
||||
// Delay
|
||||
delayWaited++;
|
||||
if (delayWaited < delay.get()) return;
|
||||
delayWaited = 0;
|
||||
|
||||
|
||||
// Targetting
|
||||
target = TargetUtils.getPlayerTarget(range.get(), priority.get());
|
||||
|
||||
if (target == null) return;
|
||||
|
||||
Vec3d entityPos = target.getPos();
|
||||
Vec3d playerPos = mc.player.getPos();
|
||||
Random r = new Random();
|
||||
BlockHitResult hit;
|
||||
int halfRange = range.get() / 2;
|
||||
|
||||
switch (mode.get()) {
|
||||
case RandomTP:
|
||||
double x = r.nextDouble() * range.get() - halfRange;
|
||||
double y = 0;
|
||||
double z = r.nextDouble() * range.get() - halfRange;
|
||||
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() != Blocks.AIR) {
|
||||
goal = new Vec3d(x, playerPos.y, z);
|
||||
}
|
||||
if (mc.world.getBlockState(new BlockPos(goal.x, goal.y, goal.z)).getBlock() == 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(Utils.clamp(diff.x, -halfRange, halfRange), Utils.clamp(diff.y, -halfRange, halfRange), Utils.clamp(diff.z, -halfRange, halfRange));
|
||||
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(Render3DEvent 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 = circleColor.get();
|
||||
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) event.renderer.line(last.x, last.y, last.z, c.x, c.y, c.z, c1);
|
||||
last = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
184
src/main/java/anticope/rejects/modules/CoordLogger.java
Normal file
184
src/main/java/anticope/rejects/modules/CoordLogger.java
Normal file
@@ -0,0 +1,184 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.DoubleSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.player.ChatUtils;
|
||||
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.passive.TameableEntity;
|
||||
import net.minecraft.network.packet.s2c.play.EntityPositionS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.WorldEventS2CPacket;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.text.BaseText;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class CoordLogger extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
private final SettingGroup sgTeleports = settings.createGroup("Teleports");
|
||||
private final SettingGroup sgWorldEvents = settings.createGroup("World Events");
|
||||
private final SettingGroup sgSounds = settings.createGroup("Sounds");
|
||||
|
||||
// General
|
||||
|
||||
private final Setting<Double> minDistance = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("minimum-distance")
|
||||
.description("Minimum distance to log event.")
|
||||
.min(5)
|
||||
.max(100)
|
||||
.sliderMin(5)
|
||||
.sliderMax(100)
|
||||
.defaultValue(10)
|
||||
.build()
|
||||
);
|
||||
|
||||
// Teleports
|
||||
|
||||
private final Setting<Boolean> players = sgTeleports.add(new BoolSetting.Builder()
|
||||
.name("players")
|
||||
.description("Logs player teleports.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> wolves = sgTeleports.add(new BoolSetting.Builder()
|
||||
.name("wolves")
|
||||
.description("Logs wolf teleports.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
// World events
|
||||
|
||||
private final Setting<Boolean> enderDragons = sgWorldEvents.add(new BoolSetting.Builder()
|
||||
.name("ender-dragons")
|
||||
.description("Logs killed ender dragons.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> endPortals = sgWorldEvents.add(new BoolSetting.Builder()
|
||||
.name("end-portals")
|
||||
.description("Logs opened end portals.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> withers = sgWorldEvents.add(new BoolSetting.Builder()
|
||||
.name("withers")
|
||||
.description("Logs wither spawns.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
private final Setting<Boolean> otherEvents = sgWorldEvents.add(new BoolSetting.Builder()
|
||||
.name("other-global-events")
|
||||
.description("Logs other global events.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
// Sounds
|
||||
|
||||
private final Setting<Boolean> thunder = sgSounds.add(new BoolSetting.Builder()
|
||||
.name("thunder")
|
||||
.description("Logs thunder sounds.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
public CoordLogger() {
|
||||
super(MeteorRejectsAddon.CATEGORY,"coord-logger", "Logs coordinates of various events. Might not work on Spigot/Paper servers.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPacketReceive(PacketEvent.Receive event) {
|
||||
// Teleports
|
||||
if (event.packet instanceof EntityPositionS2CPacket) {
|
||||
EntityPositionS2CPacket packet = (EntityPositionS2CPacket) event.packet;
|
||||
|
||||
try {
|
||||
Entity entity = mc.world.getEntityById(packet.getId());
|
||||
|
||||
// Player teleport
|
||||
if (entity.getType().equals(EntityType.PLAYER) && players.get()) {
|
||||
Vec3d packetPosition = new Vec3d(packet.getX(), packet.getY(), packet.getZ());
|
||||
Vec3d playerPosition = entity.getPos();
|
||||
|
||||
if (playerPosition.distanceTo(packetPosition) >= minDistance.get()) {
|
||||
info(formatMessage("Player '" + entity.getEntityName() + "' has teleported to ", packetPosition));
|
||||
}
|
||||
}
|
||||
|
||||
// World teleport
|
||||
else if (entity.getType().equals(EntityType.WOLF) && wolves.get()) {
|
||||
Vec3d packetPosition = new Vec3d(packet.getX(), packet.getY(), packet.getZ());
|
||||
Vec3d wolfPosition = entity.getPos();
|
||||
|
||||
UUID ownerUuid = ((TameableEntity) entity).getOwnerUuid();
|
||||
|
||||
if (ownerUuid != null && wolfPosition.distanceTo(packetPosition) >= minDistance.get()) {
|
||||
info(formatMessage("Wolf has teleported to ", packetPosition));
|
||||
}
|
||||
}
|
||||
} catch(NullPointerException ignored) {}
|
||||
|
||||
// World events
|
||||
} else if (event.packet instanceof WorldEventS2CPacket) {
|
||||
WorldEventS2CPacket worldEventS2CPacket = (WorldEventS2CPacket) event.packet;
|
||||
|
||||
if (worldEventS2CPacket.isGlobal()) {
|
||||
// Min distance
|
||||
if (PlayerUtils.distanceTo(worldEventS2CPacket.getPos()) <= minDistance.get()) return;
|
||||
|
||||
switch (worldEventS2CPacket.getEventId()) {
|
||||
case 1023:
|
||||
if (withers.get()) info(formatMessage("Wither spawned at ", worldEventS2CPacket.getPos()));
|
||||
break;
|
||||
case 1038:
|
||||
if (endPortals.get()) info(formatMessage("End portal opened at ", worldEventS2CPacket.getPos()));
|
||||
break;
|
||||
case 1028:
|
||||
if (enderDragons.get()) info(formatMessage("Ender dragon killed at ", worldEventS2CPacket.getPos()));
|
||||
break;
|
||||
default:
|
||||
if (otherEvents.get()) info(formatMessage("Unknown global event at ", worldEventS2CPacket.getPos()));
|
||||
}
|
||||
}
|
||||
|
||||
// Sounds
|
||||
} else if (thunder.get() && event.packet instanceof PlaySoundS2CPacket playSoundS2CPacket) {
|
||||
// Check for thunder sound
|
||||
if (playSoundS2CPacket.getSound() != SoundEvents.ENTITY_LIGHTNING_BOLT_IMPACT) return;
|
||||
|
||||
// Min distance
|
||||
if (PlayerUtils.distanceTo(playSoundS2CPacket.getX(), playSoundS2CPacket.getY(), playSoundS2CPacket.getZ()) <= minDistance.get()) return;
|
||||
|
||||
info("Thunder noise at %d %d %d", playSoundS2CPacket.getX(), playSoundS2CPacket.getY(), playSoundS2CPacket.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
public BaseText formatMessage(String message, Vec3d coords) {
|
||||
BaseText text = new LiteralText(message);
|
||||
text.append(ChatUtils.formatCoords(coords));
|
||||
text.append(Formatting.GRAY.toString()+".");
|
||||
return text;
|
||||
}
|
||||
|
||||
public BaseText formatMessage(String message, BlockPos coords) {
|
||||
return formatMessage(message, new Vec3d(coords.getX(), coords.getY(), coords.getZ()));
|
||||
}
|
||||
}
|
||||
119
src/main/java/anticope/rejects/modules/CustomPackets.java
Normal file
119
src/main/java/anticope/rejects/modules/CustomPackets.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import anticope.rejects.events.CustomPayloadEvent;
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.player.ChatUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.text.*;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
public class CustomPackets extends Module {
|
||||
private static final Gson GSON_NON_PRETTY = new GsonBuilder().enableComplexMapKeySerialization().disableHtmlEscaping().create();
|
||||
private static final Type BADLION_MODS_TYPE = new TypeToken<Map<String, BadlionMod>>() {}.getType();
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
private final SettingGroup sgBadlion = settings.createGroup("Bad Lion");
|
||||
|
||||
|
||||
private final Setting<Boolean> unknownPackets = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("unknown-packets")
|
||||
.description("Whether to print unknown packets.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> mods = sgBadlion.add(new BoolSetting.Builder()
|
||||
.name("disallowed-mods")
|
||||
.description("Whether to print what badlion mods are disallowed.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
public CustomPackets() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "custom-packets", "Handles different non-vanilla protocols.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onCustomPayloadPacket(CustomPayloadEvent event) {
|
||||
switch (event.packet.getChannel().toString()) {
|
||||
case "badlion:mods" -> onBadlionModsPacket(event);
|
||||
default -> onUnknownPacket(event);
|
||||
}
|
||||
}
|
||||
|
||||
private void onUnknownPacket(CustomPayloadEvent event) {
|
||||
if (!unknownPackets.get()) return;
|
||||
BaseText text = new LiteralText(event.packet.getChannel().toString());
|
||||
text.setStyle(text.getStyle()
|
||||
.withHoverEvent(new HoverEvent(
|
||||
HoverEvent.Action.SHOW_TEXT,
|
||||
new LiteralText(readString(event.packet.getData()))
|
||||
)));
|
||||
info(text);
|
||||
}
|
||||
|
||||
private void onBadlionModsPacket(CustomPayloadEvent event) {
|
||||
if (!mods.get()) return;
|
||||
String json = readString(event.packet.getData());
|
||||
Map<String, BadlionMod> mods = GSON_NON_PRETTY.fromJson(json, BADLION_MODS_TYPE);
|
||||
ChatUtils.sendMsg("Badlion", format("Mods", formatMods(mods)));
|
||||
event.cancel();
|
||||
}
|
||||
|
||||
private BaseText format(String type, BaseText message) {
|
||||
BaseText text = new LiteralText(String.format("[%s%s%s]",
|
||||
Formatting.AQUA,
|
||||
type,
|
||||
Formatting.GRAY
|
||||
));
|
||||
text.append(" ");
|
||||
text.append(message);
|
||||
return text;
|
||||
}
|
||||
|
||||
private BaseText format(String type, String message) {
|
||||
return format(type, new LiteralText(message));
|
||||
}
|
||||
|
||||
private String readString(PacketByteBuf data) {
|
||||
return data.readCharSequence(
|
||||
data.readableBytes(),
|
||||
StandardCharsets.UTF_8
|
||||
).toString();
|
||||
}
|
||||
|
||||
private BaseText formatMods(Map<String, BadlionMod> mods) {
|
||||
BaseText text = new LiteralText("Disallowed mods: \n");
|
||||
|
||||
mods.forEach((name, data) -> {
|
||||
BaseText modLine = new LiteralText(String.format("- %s%s%s ", Formatting.YELLOW, name, Formatting.GRAY));
|
||||
modLine.append(data.disabled ? "disabled" : "enabled");
|
||||
modLine.append("\n");
|
||||
if (data.extra_data != null) {
|
||||
modLine.setStyle(modLine.getStyle()
|
||||
.withHoverEvent(new HoverEvent(
|
||||
HoverEvent.Action.SHOW_TEXT,
|
||||
new LiteralText(data.extra_data.toString())
|
||||
)));
|
||||
}
|
||||
text.append(modLine);
|
||||
});
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
private static class BadlionMod {
|
||||
private boolean disabled;
|
||||
private JsonObject extra_data;
|
||||
private JsonObject settings;
|
||||
}
|
||||
}
|
||||
158
src/main/java/anticope/rejects/modules/InteractionMenu.java
Normal file
158
src/main/java/anticope/rejects/modules/InteractionMenu.java
Normal file
@@ -0,0 +1,158 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import anticope.rejects.gui.screens.InteractionScreen;
|
||||
import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
|
||||
import meteordevelopment.meteorclient.gui.GuiTheme;
|
||||
import meteordevelopment.meteorclient.gui.widgets.WWidget;
|
||||
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
|
||||
import meteordevelopment.meteorclient.gui.widgets.input.WTextBox;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WMinus;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WPlus;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.Utils;
|
||||
import meteordevelopment.meteorclient.utils.misc.Keybind;
|
||||
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
||||
import net.minecraft.client.render.debug.DebugRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtString;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class InteractionMenu extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
private final SettingGroup sgStyle = settings.createGroup("Style");
|
||||
|
||||
private final Setting<Object2BooleanMap<EntityType<?>>> entities = sgGeneral.add(new EntityTypeListSetting.Builder()
|
||||
.name("entities")
|
||||
.description("Entities")
|
||||
.defaultValue(Utils.asO2BMap(
|
||||
EntityType.PLAYER))
|
||||
.build()
|
||||
);
|
||||
public final Setting<Keybind> keybind = sgGeneral.add(new KeybindSetting.Builder()
|
||||
.name("keybind")
|
||||
.description("The keybind to open.")
|
||||
.action(this::onKey)
|
||||
.build()
|
||||
);
|
||||
|
||||
// Style
|
||||
public final Setting<SettingColor> selectedDotColor = sgStyle.add(new ColorSetting.Builder()
|
||||
.name("selected-dot-color")
|
||||
.description("Color of the dot when selected.")
|
||||
.defaultValue(new SettingColor(76, 255, 0))
|
||||
.build()
|
||||
);
|
||||
public final Setting<SettingColor> dotColor = sgStyle.add(new ColorSetting.Builder()
|
||||
.name("dot-color")
|
||||
.description("Color of the dot when.")
|
||||
.defaultValue(new SettingColor(0, 148, 255))
|
||||
.build()
|
||||
);
|
||||
public final Setting<SettingColor> backgroundColor = sgStyle.add(new ColorSetting.Builder()
|
||||
.name("background-color")
|
||||
.description("Color of the background.")
|
||||
.defaultValue(new SettingColor(128, 128, 128, 128))
|
||||
.build()
|
||||
);
|
||||
public final Setting<SettingColor> borderColor = sgStyle.add(new ColorSetting.Builder()
|
||||
.name("border-color")
|
||||
.description("Color of the border.")
|
||||
.defaultValue(new SettingColor(0,0,0))
|
||||
.build()
|
||||
);
|
||||
public final Setting<SettingColor> textColor = sgStyle.add(new ColorSetting.Builder()
|
||||
.name("text-color")
|
||||
.description("Color of the text.")
|
||||
.defaultValue(new SettingColor(255,255,255))
|
||||
.build()
|
||||
);
|
||||
|
||||
public final HashMap<String,String> messages = new HashMap<>();
|
||||
private String currMsgK = "", currMsgV = "";
|
||||
|
||||
public InteractionMenu() {
|
||||
super(MeteorRejectsAddon.CATEGORY,"interaction-menu","An interaction screen when looking at an entity.");
|
||||
}
|
||||
|
||||
public void onKey() {
|
||||
if (mc.currentScreen != null) return;
|
||||
Optional<Entity> lookingAt = DebugRenderer.getTargetedEntity(mc.player, 20);
|
||||
if (lookingAt.isPresent()) {
|
||||
Entity e = lookingAt.get();
|
||||
if (entities.get().getBoolean(e.getType())) {
|
||||
mc.setScreen(new InteractionScreen(e, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WWidget getWidget(GuiTheme theme) {
|
||||
WTable table = theme.table();
|
||||
fillTable(theme, table);
|
||||
return table;
|
||||
}
|
||||
|
||||
private void fillTable(GuiTheme theme, WTable table) {
|
||||
table.clear();
|
||||
messages.keySet().forEach((key) -> {
|
||||
table.add(theme.label(key)).expandCellX();
|
||||
table.add(theme.label(messages.get(key))).expandCellX();
|
||||
WMinus delete = table.add(theme.minus()).widget();
|
||||
delete.action = () -> {
|
||||
messages.remove(key);
|
||||
fillTable(theme,table);
|
||||
};
|
||||
table.row();
|
||||
});
|
||||
WTextBox textBoxK = table.add(theme.textBox(currMsgK)).minWidth(100).expandX().widget();
|
||||
textBoxK.action = () -> {
|
||||
currMsgK = textBoxK.get();
|
||||
};
|
||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV)).minWidth(100).expandX().widget();
|
||||
textBoxV.action = () -> {
|
||||
currMsgV = textBoxV.get();
|
||||
};
|
||||
WPlus add = table.add(theme.plus()).widget();
|
||||
add.action = () -> {
|
||||
if (currMsgK != "" && currMsgV != "") {
|
||||
messages.put(currMsgK, currMsgV);
|
||||
currMsgK = ""; currMsgV = "";
|
||||
fillTable(theme,table);
|
||||
}
|
||||
};
|
||||
table.row();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NbtCompound toTag() {
|
||||
NbtCompound tag = super.toTag();
|
||||
|
||||
NbtCompound messTag = new NbtCompound();
|
||||
messages.keySet().forEach((key) -> {
|
||||
messTag.put(key, NbtString.of(messages.get(key)));
|
||||
});
|
||||
|
||||
tag.put("messages", messTag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Module fromTag(NbtCompound tag) {
|
||||
|
||||
messages.clear();
|
||||
if (tag.contains("messages")) {
|
||||
NbtCompound msgs = tag.getCompound("messages");
|
||||
msgs.getKeys().forEach((key) -> {
|
||||
messages.put(key, msgs.getString(key));
|
||||
});
|
||||
}
|
||||
|
||||
return super.fromTag(tag);
|
||||
}
|
||||
}
|
||||
269
src/main/java/anticope/rejects/modules/Lavacast.java
Normal file
269
src/main/java/anticope/rejects/modules/Lavacast.java
Normal file
@@ -0,0 +1,269 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.render.Render3DEvent;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.renderer.ShapeMode;
|
||||
import meteordevelopment.meteorclient.settings.IntSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.utils.player.FindItemResult;
|
||||
import meteordevelopment.meteorclient.utils.player.InvUtils;
|
||||
import meteordevelopment.meteorclient.utils.player.Rotations;
|
||||
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
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;
|
||||
|
||||
|
||||
public class Lavacast extends Module {
|
||||
|
||||
private enum Stage {
|
||||
None,
|
||||
LavaDown,
|
||||
LavaUp,
|
||||
WaterDown,
|
||||
WaterUp
|
||||
}
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
private final SettingGroup sgShape = settings.createGroup("Shape", false);
|
||||
private final Setting<Integer> tickInterval = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("tick-interval")
|
||||
.description("Interval")
|
||||
.defaultValue(2)
|
||||
.min(0)
|
||||
.sliderMax(20)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> distMin = sgShape.add(new IntSetting.Builder()
|
||||
.name("minimum-distance")
|
||||
.description("Top plane cutoff")
|
||||
.defaultValue(5)
|
||||
.min(0)
|
||||
.sliderMax(10)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> lavaDownMult = sgShape.add(new IntSetting.Builder()
|
||||
.name("lava-down-mulipiler")
|
||||
.description("Controlls the shape of the cast")
|
||||
.defaultValue(40)
|
||||
.min(1)
|
||||
.sliderMax(100)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> lavaUpMult = sgShape.add(new IntSetting.Builder()
|
||||
.name("lava-up-mulipiler")
|
||||
.description("Controlls the shape of the cast")
|
||||
.defaultValue(8)
|
||||
.min(1)
|
||||
.sliderMax(100)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> waterDownMult = sgShape.add(new IntSetting.Builder()
|
||||
.name("water-down-mulipiler")
|
||||
.description("Controlls the shape of the cast")
|
||||
.defaultValue(4)
|
||||
.min(1)
|
||||
.sliderMax(100)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> waterUpMult = sgShape.add(new IntSetting.Builder()
|
||||
.name("water-up-mulipiler")
|
||||
.description("Controlls the shape of the cast")
|
||||
.defaultValue(1)
|
||||
.min(1)
|
||||
.sliderMax(100)
|
||||
.build()
|
||||
);
|
||||
|
||||
private int dist;
|
||||
private BlockPos placeFluidPos;
|
||||
private int tick;
|
||||
private Stage stage = Stage.None;
|
||||
|
||||
public Lavacast() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "lavacast", "Automatically Lavacasts");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
if (mc.player == null || mc.world == null) toggle();
|
||||
tick = 0;
|
||||
stage = Stage.None;
|
||||
placeFluidPos = getTargetBlockPos();
|
||||
if (placeFluidPos == null) {
|
||||
placeFluidPos = mc.player.getBlockPos().down(2);
|
||||
} else {
|
||||
placeFluidPos = placeFluidPos.up();
|
||||
}
|
||||
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) {
|
||||
error("Couldn't locate bottom.");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
info("Distance: (highlight)%d(default).", dist);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
if (mc.player == null || mc.world == null) return;
|
||||
tick++;
|
||||
if (shouldBreakOnTick()) return;
|
||||
if (dist < distMin.get()) toggle();
|
||||
tick = 0;
|
||||
if (checkMineBlock()) return;
|
||||
switch (stage) {
|
||||
case None: {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos),Rotations.getPitch(placeFluidPos),100, this::placeLava);
|
||||
stage = Stage.LavaDown;
|
||||
break;
|
||||
}
|
||||
case LavaDown: {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos),Rotations.getPitch(placeFluidPos),100, this::pickupLiquid);
|
||||
stage = Stage.LavaUp;
|
||||
break;
|
||||
}
|
||||
case LavaUp: {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos),Rotations.getPitch(placeFluidPos),100, this::placeWater);
|
||||
stage = Stage.WaterDown;
|
||||
break;
|
||||
}
|
||||
case WaterDown: {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos),Rotations.getPitch(placeFluidPos),100, this::pickupLiquid);
|
||||
stage = Stage.WaterUp;
|
||||
break;
|
||||
}
|
||||
case WaterUp: {
|
||||
dist--;
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos),Rotations.getPitch(placeFluidPos),100, this::placeLava);
|
||||
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(Render3DEvent event) {
|
||||
if (placeFluidPos == null) return;
|
||||
double x1 = placeFluidPos.getX();
|
||||
double y1 = placeFluidPos.getY();
|
||||
double z1 = placeFluidPos.getZ();
|
||||
double x2 = x1+1;
|
||||
double y2 = y1+1;
|
||||
double z2 = z1+1;
|
||||
|
||||
SettingColor color = new SettingColor(128, 128, 128);
|
||||
if (stage == Stage.LavaDown) color = new SettingColor(255, 180, 10);
|
||||
if (stage == Stage.LavaUp) color = new SettingColor(255, 180, 128);
|
||||
if (stage == Stage.WaterDown) color = new SettingColor(10, 10, 255);
|
||||
if (stage == Stage.WaterUp) color = new SettingColor(128, 128, 255);
|
||||
SettingColor color1 = color;
|
||||
color1.a = 75;
|
||||
|
||||
event.renderer.box(x1, y1, z1, x2, y2, z2, color1, color, ShapeMode.Both, 0);
|
||||
}
|
||||
|
||||
private void placeLava() {
|
||||
FindItemResult findItemResult = InvUtils.findInHotbar(Items.LAVA_BUCKET);
|
||||
if (!findItemResult.found()) {
|
||||
error("No lava bucket found.");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
int prevSlot = mc.player.getInventory().selectedSlot;
|
||||
mc.player.getInventory().selectedSlot = findItemResult.getSlot();
|
||||
mc.interactionManager.interactItem(mc.player,mc.world,Hand.MAIN_HAND);
|
||||
mc.player.getInventory().selectedSlot = prevSlot;
|
||||
}
|
||||
|
||||
private void placeWater() {
|
||||
FindItemResult findItemResult = InvUtils.findInHotbar(Items.WATER_BUCKET);
|
||||
if (!findItemResult.found()) {
|
||||
error("No water bucket found.");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
int prevSlot = mc.player.getInventory().selectedSlot;
|
||||
mc.player.getInventory().selectedSlot = findItemResult.getSlot();
|
||||
mc.interactionManager.interactItem(mc.player,mc.world,Hand.MAIN_HAND);
|
||||
mc.player.getInventory().selectedSlot = prevSlot;
|
||||
}
|
||||
|
||||
private void pickupLiquid() {
|
||||
FindItemResult findItemResult = InvUtils.findInHotbar(Items.BUCKET);
|
||||
if (!findItemResult.found()) {
|
||||
error("No bucket found.");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
int prevSlot = mc.player.getInventory().selectedSlot;
|
||||
mc.player.getInventory().selectedSlot = findItemResult.getSlot();
|
||||
mc.interactionManager.interactItem(mc.player,mc.world,Hand.MAIN_HAND);
|
||||
mc.player.getInventory().selectedSlot = prevSlot;
|
||||
}
|
||||
|
||||
private void updateBlockBreakingProgress() {
|
||||
mc.interactionManager.updateBlockBreakingProgress(placeFluidPos,Direction.UP);
|
||||
}
|
||||
|
||||
private BlockPos getTargetBlockPos() {
|
||||
HitResult blockHit = mc.crosshairTarget;
|
||||
if (blockHit.getType() != HitResult.Type.BLOCK) {
|
||||
return null;
|
||||
}
|
||||
return ((BlockHitResult) blockHit).getBlockPos();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoString() {
|
||||
return stage.toString();
|
||||
}
|
||||
}
|
||||
158
src/main/java/anticope/rejects/modules/NewChunks.java
Normal file
158
src/main/java/anticope/rejects/modules/NewChunks.java
Normal file
@@ -0,0 +1,158 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||
import meteordevelopment.meteorclient.events.render.Render3DEvent;
|
||||
import meteordevelopment.meteorclient.renderer.ShapeMode;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.render.color.Color;
|
||||
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.network.packet.s2c.play.*;
|
||||
import net.minecraft.util.math.*;
|
||||
import net.minecraft.world.chunk.WorldChunk;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/*
|
||||
Ported from: https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.16/src/main/java/bleach/hack/module/mods/NewChunks.java
|
||||
*/
|
||||
public class NewChunks extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> remove = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("remove")
|
||||
.description("Removes the cached chunks when disabling the module.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<SettingColor> newChunksColor = sgGeneral.add(new ColorSetting.Builder()
|
||||
.name("new-chunks-color")
|
||||
.description("Color of the chunks that are (most likely) completely new.")
|
||||
.defaultValue(new SettingColor(204, 153, 217))
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<SettingColor> oldChunksColor = sgGeneral.add(new ColorSetting.Builder()
|
||||
.name("old-chunks-color")
|
||||
.description("Color of the chunks that have (most likely) been loaded before.")
|
||||
.defaultValue(new SettingColor(230, 51, 51))
|
||||
.build()
|
||||
);
|
||||
|
||||
private Set<ChunkPos> newChunks = Collections.synchronizedSet(new HashSet<>());
|
||||
private Set<ChunkPos> oldChunks = Collections.synchronizedSet(new HashSet<>());
|
||||
private static final Direction[] searchDirs = new Direction[] { Direction.EAST, Direction.NORTH, Direction.WEST, Direction.SOUTH, Direction.UP };
|
||||
|
||||
public NewChunks() {
|
||||
super(MeteorRejectsAddon.CATEGORY,"new-chunks", "Detects completely new chunks using certain traits of them");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
if (remove.get()) {
|
||||
newChunks.clear();
|
||||
oldChunks.clear();
|
||||
}
|
||||
super.onDeactivate();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onRender(Render3DEvent event) {
|
||||
if (newChunksColor.get().a > 5) {
|
||||
synchronized (newChunks) {
|
||||
for (ChunkPos c : newChunks) {
|
||||
if (mc.getCameraEntity().getBlockPos().isWithinDistance(c.getStartPos(), 1024)) {
|
||||
drawBoxOutline(new Box(c.getStartPos(), c.getStartPos().add(16, 0, 16)), newChunksColor.get(), event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (oldChunksColor.get().a > 5){
|
||||
synchronized (oldChunks) {
|
||||
for (ChunkPos c : oldChunks) {
|
||||
if (mc.getCameraEntity().getBlockPos().isWithinDistance(c.getStartPos(), 1024)) {
|
||||
drawBoxOutline(new Box(c.getStartPos(), c.getStartPos().add(16, 0, 16)), oldChunksColor.get(), event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void drawBoxOutline(Box box, Color color, Render3DEvent event) {
|
||||
event.renderer.box(
|
||||
box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ,
|
||||
new Color(0,0,0,0), color, ShapeMode.Lines, 0
|
||||
);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onReadPacket(PacketEvent.Receive event) {
|
||||
if (event.packet instanceof ChunkDeltaUpdateS2CPacket) {
|
||||
ChunkDeltaUpdateS2CPacket packet = (ChunkDeltaUpdateS2CPacket) event.packet;
|
||||
|
||||
packet.visitUpdates((pos, state) -> {
|
||||
if (!state.getFluidState().isEmpty() && !state.getFluidState().isStill()) {
|
||||
ChunkPos chunkPos = new ChunkPos(pos);
|
||||
|
||||
for (Direction dir: searchDirs) {
|
||||
if (mc.world.getBlockState(pos.offset(dir)).getFluidState().isStill() && !oldChunks.contains(chunkPos)) {
|
||||
newChunks.add(chunkPos);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
else if (event.packet instanceof BlockUpdateS2CPacket) {
|
||||
BlockUpdateS2CPacket packet = (BlockUpdateS2CPacket) event.packet;
|
||||
|
||||
if (!packet.getState().getFluidState().isEmpty() && !packet.getState().getFluidState().isStill()) {
|
||||
ChunkPos chunkPos = new ChunkPos(packet.getPos());
|
||||
|
||||
for (Direction dir: searchDirs) {
|
||||
if (mc.world.getBlockState(packet.getPos().offset(dir)).getFluidState().isStill() && !oldChunks.contains(chunkPos)) {
|
||||
newChunks.add(chunkPos);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (event.packet instanceof ChunkDataS2CPacket && mc.world != null) {
|
||||
ChunkDataS2CPacket packet = (ChunkDataS2CPacket) event.packet;
|
||||
|
||||
ChunkPos pos = new ChunkPos(packet.getX(), packet.getZ());
|
||||
|
||||
if (!newChunks.contains(pos) && mc.world.getChunkManager().getChunk(packet.getX(), packet.getZ()) == null) {
|
||||
WorldChunk chunk = new WorldChunk(mc.world, pos, null);
|
||||
try {
|
||||
chunk.loadFromPacket(null, packet.getReadBuffer(), new NbtCompound(), packet.getVerticalStripBitmask());
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int y = mc.world.getBottomY(); y < mc.world.getTopY(); y++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
FluidState fluid = chunk.getFluidState(x, y, z);
|
||||
|
||||
if (!fluid.isEmpty() && !fluid.isStill()) {
|
||||
oldChunks.add(pos);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
119
src/main/java/anticope/rejects/modules/ObsidianFarm.java
Normal file
119
src/main/java/anticope/rejects/modules/ObsidianFarm.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
import meteordevelopment.meteorclient.systems.modules.player.AutoEat;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class ObsidianFarm extends Module {
|
||||
|
||||
private boolean allowBreakAgain;
|
||||
|
||||
public ObsidianFarm() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "obsidian-farm", "Auto obsidian farm(portals).");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
allowBreakAgain = true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post event) {
|
||||
if (mc.player == null) return;
|
||||
if (mc.world == null) return;
|
||||
if (mc.interactionManager == null) return;
|
||||
if (mc.world.getDimension().isRespawnAnchorWorking()) {
|
||||
allowBreakAgain = true;
|
||||
return;
|
||||
}
|
||||
if (!allowBreakAgain) return;
|
||||
if ((mc.player.isUsingItem() || Modules.get().get(AutoEat.class).isActive()) && (mc.player.getOffHandStack().getItem().isFood() || mc.player.getMainHandStack().getItem().isFood()))
|
||||
return;
|
||||
|
||||
if(mc.player.getMainHandStack().getItem() != Items.NETHERITE_PICKAXE && mc.player.getMainHandStack().getItem() != Items.DIAMOND_PICKAXE) {
|
||||
int pickAxe = findPickAxe();
|
||||
if (pickAxe == -1) {
|
||||
if (this.isActive()) {
|
||||
this.toggle();
|
||||
return;
|
||||
}
|
||||
}
|
||||
mc.player.getInventory().selectedSlot = pickAxe;
|
||||
}
|
||||
|
||||
BlockPos obsidian = findObsidian();
|
||||
if (obsidian == null) return;
|
||||
|
||||
mc.interactionManager.updateBlockBreakingProgress(obsidian, Direction.UP);
|
||||
mc.player.swingHand(Hand.MAIN_HAND);
|
||||
|
||||
if (mc.player.getBlockPos().down().equals(obsidian) && mc.world.getBlockState(obsidian).getBlock() != Blocks.OBSIDIAN) {
|
||||
allowBreakAgain = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private BlockPos findObsidian() {
|
||||
List<BlockPos> blocksList = new ArrayList<>();
|
||||
|
||||
for (int x = -2; x < 3; x++) {
|
||||
for (int z = -2; z < 3; z++) {
|
||||
int y = 2;
|
||||
BlockPos block = new BlockPos(mc.player.getBlockPos().getX() + x, mc.player.getBlockPos().getY() + y, mc.player.getBlockPos().getZ() + z);
|
||||
blocksList.add(block);
|
||||
}
|
||||
}
|
||||
|
||||
Optional<BlockPos> result = blocksList.stream()
|
||||
.parallel()
|
||||
.filter(blockPos -> mc.world.getBlockState(blockPos).getBlock() == Blocks.OBSIDIAN)
|
||||
.min(Comparator.comparingDouble(blockPos -> mc.player.squaredDistanceTo(blockPos.getX(), blockPos.getY(), blockPos.getZ())));
|
||||
if (result.isPresent()) return result.get();
|
||||
|
||||
blocksList.clear();
|
||||
for (int x = -2; x < 3; x++) {
|
||||
for (int z = -2; z < 3; z++) {
|
||||
for (int y = 3; y > -2; y--) {
|
||||
BlockPos block = new BlockPos(mc.player.getBlockPos().getX() + x, mc.player.getBlockPos().getY() + y, mc.player.getBlockPos().getZ() + z);
|
||||
blocksList.add(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Optional<BlockPos> result2 = blocksList.stream()
|
||||
.parallel()
|
||||
.filter(blockPos -> !mc.player.getBlockPos().down().equals(blockPos))
|
||||
.filter(blockPos -> mc.world.getBlockState(blockPos).getBlock() == Blocks.OBSIDIAN)
|
||||
.min(Comparator.comparingDouble(blockPos -> mc.player.squaredDistanceTo(blockPos.getX(), blockPos.getY(), blockPos.getZ())));
|
||||
if (result2.isPresent()) return result2.get();
|
||||
|
||||
if (mc.world.getBlockState(mc.player.getBlockPos().down()).getBlock() == Blocks.OBSIDIAN)
|
||||
return mc.player.getBlockPos().down();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private int findPickAxe() {
|
||||
int result = -1;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if (mc.player.getInventory().getStack(i).getItem() == Items.NETHERITE_PICKAXE) return i;
|
||||
if (mc.player.getInventory().getStack(i).getItem() == Items.DIAMOND_PICKAXE) result = i;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
210
src/main/java/anticope/rejects/modules/PacketFly.java
Normal file
210
src/main/java/anticope/rejects/modules/PacketFly.java
Normal file
@@ -0,0 +1,210 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import io.netty.util.internal.ConcurrentSet;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
|
||||
import meteordevelopment.meteorclient.events.entity.player.SendMovementPacketsEvent;
|
||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||
import meteordevelopment.meteorclient.mixin.PlayerPositionLookS2CPacketAccessor;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.TeleportConfirmC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class PacketFly extends Module {
|
||||
private final Set<PlayerMoveC2SPacket> packets = new ConcurrentSet();
|
||||
private final SettingGroup sgMovement = settings.createGroup("movement");
|
||||
private final SettingGroup sgClient = settings.createGroup("client");
|
||||
private final SettingGroup sgBypass = settings.createGroup("bypass");
|
||||
|
||||
private final Setting<Double> horizontalSpeed = sgMovement.add(new DoubleSetting.Builder()
|
||||
.name("horizontal-speed")
|
||||
.description("Horizontal speed in blocks per second.")
|
||||
.defaultValue(5.2)
|
||||
.min(0.0)
|
||||
.max(20.0)
|
||||
.sliderMin(0.0)
|
||||
.sliderMax(20.0)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> verticalSpeed = sgMovement.add(new DoubleSetting.Builder()
|
||||
.name("vertical-speed")
|
||||
.description("Vertical speed in blocks per second.")
|
||||
.defaultValue(1.24)
|
||||
.min(0.0)
|
||||
.max(20.0)
|
||||
.sliderMin(0.0)
|
||||
.sliderMax(20.0)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> sendTeleport = sgMovement.add(new BoolSetting.Builder()
|
||||
.name("teleport")
|
||||
.description("Sends teleport packets.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> setYaw = sgClient.add(new BoolSetting.Builder()
|
||||
.name("set-yaw")
|
||||
.description("Sets yaw client side.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> setMove = sgClient.add(new BoolSetting.Builder()
|
||||
.name("set-move")
|
||||
.description("Sets movement client side.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> setPos = sgClient.add(new BoolSetting.Builder()
|
||||
.name("set-pos")
|
||||
.description("Sets position client side.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> setID = sgClient.add(new BoolSetting.Builder()
|
||||
.name("set-id")
|
||||
.description("Updates teleport id when a position packet is received.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> antiKick = sgBypass.add(new BoolSetting.Builder()
|
||||
.name("anti-kick")
|
||||
.description("Moves down occasionally to prevent kicks.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> downDelay = sgBypass.add(new IntSetting.Builder()
|
||||
.name("down-delay")
|
||||
.description("How often you move down when not flying upwards. (ticks)")
|
||||
.defaultValue(4)
|
||||
.sliderMin(1)
|
||||
.sliderMax(30)
|
||||
.min(1)
|
||||
.max(30)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> downDelayFlying = sgBypass.add(new IntSetting.Builder()
|
||||
.name("flying-down-delay")
|
||||
.description("How often you move down when flying upwards. (ticks)")
|
||||
.defaultValue(10)
|
||||
.sliderMin(1)
|
||||
.sliderMax(30)
|
||||
.min(1)
|
||||
.max(30)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> invalidPacket = sgBypass.add(new BoolSetting.Builder()
|
||||
.name("invalid-packet")
|
||||
.description("Sends invalid movement packets.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private int flightCounter = 0;
|
||||
private int teleportID = 0;
|
||||
|
||||
public PacketFly() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "packet-fly", "Fly using packets.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onSendMovementPackets(SendMovementPacketsEvent.Pre event) {
|
||||
mc.player.setVelocity(0.0,0.0,0.0);
|
||||
double speed = 0.0;
|
||||
boolean checkCollisionBoxes = checkHitBoxes();
|
||||
|
||||
speed = mc.player.input.jumping && (checkCollisionBoxes || !(mc.player.input.movementForward != 0.0 || mc.player.input.movementSideways != 0.0)) ? (antiKick.get() && !checkCollisionBoxes ? (resetCounter(downDelayFlying.get()) ? -0.032 : verticalSpeed.get()/20) : verticalSpeed.get()/20) : (mc.player.input.sneaking ? verticalSpeed.get()/-20 : (!checkCollisionBoxes ? (resetCounter(downDelay.get()) ? (antiKick.get() ? -0.04 : 0.0) : 0.0) : 0.0));
|
||||
|
||||
Vec3d horizontal = PlayerUtils.getHorizontalVelocity(horizontalSpeed.get());
|
||||
|
||||
mc.player.setVelocity(horizontal.x, speed, horizontal.z);
|
||||
sendPackets(mc.player.getVelocity().x, mc.player.getVelocity().y, mc.player.getVelocity().z, sendTeleport.get());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onMove (PlayerMoveEvent event) {
|
||||
if (setMove.get() && flightCounter != 0) {
|
||||
event.movement = new Vec3d(mc.player.getVelocity().x, mc.player.getVelocity().y, mc.player.getVelocity().z);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPacketSent(PacketEvent.Send event) {
|
||||
if (event.packet instanceof PlayerMoveC2SPacket && !packets.remove((PlayerMoveC2SPacket) event.packet)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPacketReceive(PacketEvent.Receive event) {
|
||||
if (event.packet instanceof PlayerPositionLookS2CPacket && !(mc.player == null || mc.world == null)) {
|
||||
BlockPos pos = new BlockPos(mc.player.getPos().x, mc.player.getPos().y, mc.player.getPos().z);
|
||||
PlayerPositionLookS2CPacket packet = (PlayerPositionLookS2CPacket) event.packet;
|
||||
if (setYaw.get()) {
|
||||
((PlayerPositionLookS2CPacketAccessor) event.packet).setPitch(mc.player.getPitch());
|
||||
((PlayerPositionLookS2CPacketAccessor) event.packet).setYaw(mc.player.getYaw());
|
||||
}
|
||||
if (setID.get()) {
|
||||
teleportID = packet.getTeleportId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkHitBoxes() {
|
||||
return !(mc.world.getBlockCollisions(mc.player, mc.player.getBoundingBox().expand(-0.0625,-0.0625,-0.0625)).count() == 0);
|
||||
}
|
||||
|
||||
private boolean resetCounter(int counter) {
|
||||
if (++flightCounter >= counter) {
|
||||
flightCounter = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void sendPackets(double x, double y, double z, boolean teleport) {
|
||||
Vec3d vec = new Vec3d(x, y, z);
|
||||
Vec3d position = mc.player.getPos().add(vec);
|
||||
Vec3d outOfBoundsVec = outOfBoundsVec(vec, position);
|
||||
packetSender(new PlayerMoveC2SPacket.PositionAndOnGround(position.x, position.y, position.z, mc.player.isOnGround()));
|
||||
if (invalidPacket.get()) {
|
||||
packetSender(new PlayerMoveC2SPacket.PositionAndOnGround(outOfBoundsVec.x, outOfBoundsVec.y, outOfBoundsVec.z, mc.player.isOnGround()));
|
||||
}
|
||||
if (setPos.get()) {
|
||||
mc.player.setPos(position.x, position.y, position.z);
|
||||
}
|
||||
teleportPacket(position, teleport);
|
||||
}
|
||||
|
||||
private void teleportPacket(Vec3d pos, boolean shouldTeleport) {
|
||||
if (shouldTeleport) {
|
||||
mc.player.networkHandler.sendPacket(new TeleportConfirmC2SPacket(++teleportID));
|
||||
}
|
||||
}
|
||||
|
||||
private Vec3d outOfBoundsVec(Vec3d offset, Vec3d position) {
|
||||
return position.add(0.0, 1500.0, 0.0);
|
||||
}
|
||||
|
||||
private void packetSender(PlayerMoveC2SPacket packet) {
|
||||
packets.add(packet);
|
||||
mc.player.networkHandler.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
162
src/main/java/anticope/rejects/modules/Painter.java
Normal file
162
src/main/java/anticope/rejects/modules/Painter.java
Normal file
@@ -0,0 +1,162 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import anticope.rejects.utils.WorldUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.player.FindItemResult;
|
||||
import meteordevelopment.meteorclient.utils.player.InvUtils;
|
||||
import meteordevelopment.meteorclient.utils.world.BlockUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Painter extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Block> block = sgGeneral.add(new BlockSetting.Builder()
|
||||
.name("block")
|
||||
.description("Block to use for painting")
|
||||
.defaultValue(Blocks.STONE_BUTTON)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> range = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("range")
|
||||
.description("Range of placement")
|
||||
.min(0)
|
||||
.defaultValue(0)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("delay")
|
||||
.description("Delay between block placement (in ticks)")
|
||||
.min(0)
|
||||
.defaultValue(0)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("rotate")
|
||||
.description("Whether or not to rotate towards block while placing")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> topSurfaces = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("top-surface")
|
||||
.description("Whether or not to cover top surfaces")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> sideSurfaces = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("side-surface")
|
||||
.description("Whether or not to cover side surfaces")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> bottomSurfaces = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("bottom-surface")
|
||||
.description("Whether or not to cover bottom surfaces")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> oneBlockHeight = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("one-block-height")
|
||||
.description("Whether or not to cover in one block high gaps")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private ArrayList<BlockPos> positions = new ArrayList<>();
|
||||
private int ticksWaited;
|
||||
|
||||
public Painter() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "painter", "Automatically paints/covers surfaces (good for trolling)");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post event) {
|
||||
// Tick delay
|
||||
if (delay.get() != 0 && ticksWaited < delay.get() - 1) {
|
||||
ticksWaited++;
|
||||
return;
|
||||
}
|
||||
else ticksWaited = 0;
|
||||
|
||||
// Get slot
|
||||
FindItemResult findItemResult = InvUtils.findInHotbar(itemStack -> block.get() == Block.getBlockFromItem(itemStack.getItem()));
|
||||
if (!findItemResult.found()) {
|
||||
error("No selected blocks in hotbar");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
|
||||
// Find spots
|
||||
for (BlockPos blockPos : WorldUtils.getSphere(mc.player.getBlockPos(), range.get(), range.get())) {
|
||||
if (shouldPlace(blockPos, block.get())) positions.add(blockPos);
|
||||
}
|
||||
|
||||
// Place
|
||||
for (BlockPos blockPos : positions) {
|
||||
BlockUtils.place(blockPos, findItemResult, rotate.get(), -100, false);
|
||||
|
||||
// Delay 0
|
||||
if (delay.get() != 0) break;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldPlace(BlockPos blockPos, Block useBlock) {
|
||||
// Self
|
||||
if (!mc.world.getBlockState(blockPos).getMaterial().isReplaceable()) return false;
|
||||
|
||||
// One block height
|
||||
if (!oneBlockHeight.get() &&
|
||||
!mc.world.getBlockState(blockPos.up()).getMaterial().isReplaceable() &&
|
||||
!mc.world.getBlockState(blockPos.down()).getMaterial().isReplaceable()) return false;
|
||||
|
||||
|
||||
boolean north = true;
|
||||
boolean south = true;
|
||||
boolean east = true;
|
||||
boolean west = true;
|
||||
boolean up = true;
|
||||
boolean bottom = true;
|
||||
BlockState northState = mc.world.getBlockState(blockPos.north());
|
||||
BlockState southState = mc.world.getBlockState(blockPos.south());
|
||||
BlockState eastState = mc.world.getBlockState(blockPos.east());
|
||||
BlockState westState = mc.world.getBlockState(blockPos.west());
|
||||
BlockState upState = mc.world.getBlockState(blockPos.up());
|
||||
BlockState bottomState = mc.world.getBlockState(blockPos.down());
|
||||
|
||||
// Top surface
|
||||
if (topSurfaces.get()) {
|
||||
if (upState.getMaterial().isReplaceable() || upState.getBlock() == useBlock) up = false;
|
||||
}
|
||||
|
||||
// Side surfaces
|
||||
if (sideSurfaces.get()) {
|
||||
|
||||
if (northState.getMaterial().isReplaceable() || northState.getBlock() == useBlock) north = false;
|
||||
if (southState.getMaterial().isReplaceable() || southState.getBlock() == useBlock) south = false;
|
||||
if (eastState.getMaterial().isReplaceable() || eastState.getBlock() == useBlock) east = false;
|
||||
if (westState.getMaterial().isReplaceable() || westState.getBlock() == useBlock) west = false;
|
||||
}
|
||||
|
||||
// Bottom surface
|
||||
if (bottomSurfaces.get()) {
|
||||
if (bottomState.getMaterial().isReplaceable() || bottomState.getBlock() == useBlock) bottom = false;
|
||||
}
|
||||
|
||||
return north || south || east || west || up || bottom;
|
||||
}
|
||||
}
|
||||
159
src/main/java/anticope/rejects/modules/Phase.java
Normal file
159
src/main/java/anticope/rejects/modules/Phase.java
Normal file
@@ -0,0 +1,159 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
|
||||
import meteordevelopment.meteorclient.events.world.CollisionShapeEvent;
|
||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||
import meteordevelopment.meteorclient.settings.DoubleSetting;
|
||||
import meteordevelopment.meteorclient.settings.EnumSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
|
||||
public class Phase extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
|
||||
.name("mode")
|
||||
.description("The phase mode used.")
|
||||
.defaultValue(Mode.NRNB)
|
||||
.onChanged(v -> { setPos(); })
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> distance = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("speed")
|
||||
.description("The X and Z distance per clip.")
|
||||
.defaultValue(0.1)
|
||||
.min(0.0)
|
||||
.sliderMin(0.0)
|
||||
.sliderMax(10.0)
|
||||
.visible(() -> (mode.get() != Mode.CollisionShape))
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
private double prevX = Double.NaN;
|
||||
private double prevZ = Double.NaN;
|
||||
|
||||
public Phase() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "phase", "Lets you clip through ground sometimes.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
if (mc.player == null) return;
|
||||
setPos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
prevX = Double.NaN;
|
||||
prevZ = Double.NaN;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onCollisionShape(CollisionShapeEvent event) {
|
||||
if (mc.world == null || mc.player == null) return;
|
||||
if (mode.get() != Mode.CollisionShape) return;
|
||||
if (event == null || event.pos == null) return;
|
||||
if (event.type != CollisionShapeEvent.CollisionType.BLOCK) return;
|
||||
if (event.pos.getY() < mc.player.getY()) {
|
||||
if (mc.player.isSneaking()) {
|
||||
event.shape = VoxelShapes.empty();
|
||||
}
|
||||
} else {
|
||||
event.shape = VoxelShapes.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post post) {
|
||||
if (mode.get() == Mode.CollisionShape) return;
|
||||
if (mc.player == null) return;
|
||||
|
||||
if (Double.isNaN(prevX) || Double.isNaN(prevZ)) setPos();
|
||||
|
||||
Vec3d yawForward = Vec3d.fromPolar((float)0.0f, (float)mc.player.getYaw());
|
||||
Vec3d yawBack = Vec3d.fromPolar((float)0.0f, (float)mc.player.getYaw() - 180f);
|
||||
Vec3d yawLeft = Vec3d.fromPolar((float)0.0f, (float)mc.player.getYaw() - 90f);
|
||||
Vec3d yawRight = Vec3d.fromPolar((float)0.0f, (float)mc.player.getYaw() - 270f);
|
||||
|
||||
if (mode.get() == Mode.Normal) {
|
||||
|
||||
if (mc.options.keyForward.isPressed()) {
|
||||
mc.player.setPos(
|
||||
mc.player.getX() + yawForward.x * distance.get(),
|
||||
mc.player.getY(),
|
||||
mc.player.getZ() + yawForward.z * distance.get()
|
||||
);
|
||||
}
|
||||
|
||||
if (mc.options.keyBack.isPressed()) {
|
||||
mc.player.setPos(
|
||||
mc.player.getX() + yawBack.x * distance.get(),
|
||||
mc.player.getY(),
|
||||
mc.player.getZ() + yawBack.z * distance.get()
|
||||
);
|
||||
}
|
||||
|
||||
if (mc.options.keyLeft.isPressed()) {
|
||||
mc.player.setPos(
|
||||
mc.player.getX() + yawLeft.x * distance.get(),
|
||||
mc.player.getY(),
|
||||
mc.player.getZ() + yawLeft.z * distance.get()
|
||||
);
|
||||
}
|
||||
|
||||
if (mc.options.keyRight.isPressed()) {
|
||||
mc.player.setPos(
|
||||
mc.player.getX() + yawRight.x * distance.get(),
|
||||
mc.player.getY(),
|
||||
mc.player.getZ() + yawRight.z * distance.get()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
else if (mode.get() == Mode.NRNB) {
|
||||
if (mc.options.keyForward.isPressed()) {
|
||||
prevX += yawForward.x * distance.get();
|
||||
prevZ += yawForward.z * distance.get();
|
||||
mc.player.setPos(prevX, mc.player.getY(), prevZ);
|
||||
}
|
||||
|
||||
if (mc.options.keyBack.isPressed()) {
|
||||
prevX += yawBack.x * distance.get();
|
||||
prevZ += yawBack.z * distance.get();
|
||||
mc.player.setPos(prevX, mc.player.getY(), prevZ);
|
||||
}
|
||||
|
||||
if (mc.options.keyLeft.isPressed()) {
|
||||
prevX += yawLeft.x * distance.get();
|
||||
prevZ += yawLeft.z * distance.get();
|
||||
mc.player.setPos(prevX, mc.player.getY(), prevZ);
|
||||
}
|
||||
|
||||
if (mc.options.keyRight.isPressed()) {
|
||||
prevX += yawRight.x * distance.get();
|
||||
prevZ += yawRight.z * distance.get();
|
||||
mc.player.setPos(prevX, mc.player.getY(), prevZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setPos() {
|
||||
if (mc.player == null) return;
|
||||
prevX = mc.player.getX();
|
||||
prevZ = mc.player.getZ();
|
||||
}
|
||||
|
||||
public static enum Mode {
|
||||
NRNB,
|
||||
Normal,
|
||||
CollisionShape
|
||||
}
|
||||
}
|
||||
24
src/main/java/anticope/rejects/modules/Prone.java
Normal file
24
src/main/java/anticope/rejects/modules/Prone.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.world.CollisionShapeEvent;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
|
||||
public class Prone extends Module {
|
||||
|
||||
public Prone() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "prone", "Become prone on demand.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onCollisionShape(CollisionShapeEvent event) {
|
||||
if (mc.world == null || mc.player == null) return;
|
||||
if (event.state == null) return;
|
||||
|
||||
if (event.pos.getY() != mc.player.getY() + 1) return;
|
||||
|
||||
event.shape = VoxelShapes.fullCube();
|
||||
}
|
||||
}
|
||||
142
src/main/java/anticope/rejects/modules/Rendering.java
Normal file
142
src/main/java/anticope/rejects/modules/Rendering.java
Normal file
@@ -0,0 +1,142 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import net.minecraft.client.gl.ShaderEffect;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import meteordevelopment.meteorclient.settings.EnumSetting;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
|
||||
public class Rendering extends Module {
|
||||
|
||||
public enum Shader {
|
||||
None,
|
||||
Notch,
|
||||
FXAA,
|
||||
Art,
|
||||
Bumpy,
|
||||
Blobs,
|
||||
Blobs2,
|
||||
Pencil,
|
||||
Vibrant,
|
||||
Deconverge,
|
||||
Flip,
|
||||
Invert,
|
||||
NTSC,
|
||||
Outline,
|
||||
Phosphor,
|
||||
Scanline,
|
||||
Sobel,
|
||||
Bits,
|
||||
Desaturate,
|
||||
Green,
|
||||
Blur,
|
||||
Wobble,
|
||||
Antialias,
|
||||
Creeper,
|
||||
Spider
|
||||
}
|
||||
|
||||
private final SettingGroup sgInvisible = settings.createGroup("Invisible");
|
||||
private final SettingGroup sgFun = settings.createGroup("Fun");
|
||||
|
||||
private final Setting<Boolean> structureVoid = sgInvisible.add(new BoolSetting.Builder()
|
||||
.name("structure-void")
|
||||
.description("Render structure void blocks.")
|
||||
.defaultValue(true)
|
||||
.onChanged(onChanged -> {
|
||||
if(this.isActive()) {
|
||||
mc.worldRenderer.reload();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Shader> shaderEnum = sgFun.add(new EnumSetting.Builder<Shader>()
|
||||
.name("shader")
|
||||
.description("Select which shader to use")
|
||||
.defaultValue(Shader.None)
|
||||
.onChanged(this::onChanged)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> dinnerbone = sgFun.add(new BoolSetting.Builder()
|
||||
.name("dinnerbone")
|
||||
.description("Apply dinnerbone effects to all entities")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> deadmau5Ears = sgFun.add(new BoolSetting.Builder()
|
||||
.name("deadmau5-ears")
|
||||
.description("Add deadmau5 ears to all players")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> disableToasts = sgFun.add(new BoolSetting.Builder()
|
||||
.name("disable-toasts")
|
||||
.description("Disable toasts (e.g. advancements)")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private ShaderEffect shader = null;
|
||||
|
||||
public Rendering() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "Rendering", "Various Render Tweaks");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
mc.worldRenderer.reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
mc.worldRenderer.reload();
|
||||
}
|
||||
|
||||
public void onChanged(Shader s) {
|
||||
String name;
|
||||
if (s == Shader.Vibrant) name = "color_convolve";
|
||||
else if (s == Shader.Scanline) name = "scan_pincushion";
|
||||
else name = s.toString().toLowerCase();
|
||||
Identifier shaderID = new Identifier(String.format("shaders/post/%s.json", name));
|
||||
try {
|
||||
ShaderEffect shader = new ShaderEffect(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), shaderID);
|
||||
this.shader = shader;
|
||||
} catch (IOException e) {
|
||||
this.shader = null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean renderStructureVoid() {
|
||||
return this.isActive() && structureVoid.get();
|
||||
}
|
||||
|
||||
public ShaderEffect getShaderEffect() {
|
||||
if (!this.isActive()) return null;
|
||||
return shader;
|
||||
}
|
||||
|
||||
public boolean dinnerboneEnabled() {
|
||||
if (!this.isActive()) return false;
|
||||
return dinnerbone.get();
|
||||
}
|
||||
|
||||
public boolean deadmau5EarsEnabled() {
|
||||
if (!this.isActive()) return false;
|
||||
return deadmau5Ears.get();
|
||||
}
|
||||
|
||||
public boolean disableToasts() {
|
||||
if (!this.isActive()) return false;
|
||||
return disableToasts.get();
|
||||
}
|
||||
}
|
||||
199
src/main/java/anticope/rejects/modules/SkeletonESP.java
Normal file
199
src/main/java/anticope/rejects/modules/SkeletonESP.java
Normal file
@@ -0,0 +1,199 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.render.Render3DEvent;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.config.Config;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
import meteordevelopment.meteorclient.systems.modules.render.Freecam;
|
||||
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
|
||||
import meteordevelopment.meteorclient.utils.player.Rotations;
|
||||
import meteordevelopment.meteorclient.utils.render.color.Color;
|
||||
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.model.ModelPart;
|
||||
import net.minecraft.client.option.Perspective;
|
||||
import net.minecraft.client.render.*;
|
||||
import net.minecraft.client.render.entity.LivingEntityRenderer;
|
||||
import net.minecraft.client.render.entity.PlayerEntityRenderer;
|
||||
import net.minecraft.client.render.entity.model.PlayerEntityModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.Vec3f;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.*;
|
||||
|
||||
public class SkeletonESP extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Freecam freecam;
|
||||
|
||||
private final Setting<SettingColor> skeletonColorSetting = sgGeneral.add(new ColorSetting.Builder()
|
||||
.name("players-color")
|
||||
.description("The other player's color.")
|
||||
.defaultValue(new SettingColor(255, 255, 255))
|
||||
.build()
|
||||
);
|
||||
|
||||
public SkeletonESP() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "skeleton-esp", "Looks cool as fuck");
|
||||
freecam = Modules.get().get(Freecam.class);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onRender(Render3DEvent event) {
|
||||
MatrixStack matrixStack = event.matrices;
|
||||
float g = event.tickDelta;
|
||||
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
||||
RenderSystem.disableTexture();
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
RenderSystem.disableDepthTest();
|
||||
RenderSystem.depthMask(MinecraftClient.isFabulousGraphicsOrBetter());
|
||||
RenderSystem.enableCull();
|
||||
mc.world.getEntities().forEach(entity -> {
|
||||
if (!(entity instanceof PlayerEntity)) return;
|
||||
if (mc.options.getPerspective() == Perspective.FIRST_PERSON && !freecam.isActive() && mc.player == entity) return;
|
||||
int rotationHoldTicks = Config.get().rotationHoldTicks;
|
||||
|
||||
Color skeletonColor = PlayerUtils.getPlayerColor((PlayerEntity)entity, skeletonColorSetting.get());
|
||||
PlayerEntity playerEntity = (PlayerEntity) entity;
|
||||
|
||||
Vec3d footPos = getEntityRenderPosition(playerEntity, g);
|
||||
PlayerEntityRenderer livingEntityRenderer = (PlayerEntityRenderer)(LivingEntityRenderer<?, ?>) mc.getEntityRenderDispatcher().getRenderer(playerEntity);
|
||||
PlayerEntityModel<PlayerEntity> playerEntityModel = (PlayerEntityModel)livingEntityRenderer.getModel();
|
||||
|
||||
float h = MathHelper.lerpAngleDegrees(g, playerEntity.prevBodyYaw, playerEntity.bodyYaw);
|
||||
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) h = Rotations.serverYaw;
|
||||
float j = MathHelper.lerpAngleDegrees(g, playerEntity.prevHeadYaw, playerEntity.headYaw);
|
||||
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) j = Rotations.serverYaw;
|
||||
|
||||
float q = playerEntity.limbAngle - playerEntity.limbDistance * (1.0F - g);
|
||||
float p = MathHelper.lerp(g, playerEntity.lastLimbDistance, playerEntity.limbDistance);
|
||||
float o = (float)playerEntity.age + g;
|
||||
float k = j - h;
|
||||
float m = playerEntity.getPitch(g);
|
||||
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) m = Rotations.serverPitch;
|
||||
|
||||
playerEntityModel.animateModel(playerEntity, q, p, g);
|
||||
playerEntityModel.setAngles(playerEntity, q, p, o, k, m);
|
||||
|
||||
boolean swimming = playerEntity.isInSwimmingPose();
|
||||
boolean sneaking = playerEntity.isSneaking();
|
||||
boolean flying = playerEntity.isFallFlying();
|
||||
|
||||
ModelPart head = playerEntityModel.head;
|
||||
ModelPart leftArm = playerEntityModel.leftArm;
|
||||
ModelPart rightArm = playerEntityModel.rightArm;
|
||||
ModelPart leftLeg = playerEntityModel.leftLeg;
|
||||
ModelPart rightLeg = playerEntityModel.rightLeg;
|
||||
|
||||
matrixStack.translate(footPos.x, footPos.y, footPos.z);
|
||||
if (swimming)
|
||||
matrixStack.translate(0, 0.35f, 0);
|
||||
|
||||
matrixStack.multiply(new Quaternion(new Vec3f(0, -1, 0), h + 180, true));
|
||||
if (swimming || flying)
|
||||
matrixStack.multiply(new Quaternion(new Vec3f(-1, 0, 0), 90 + m, true));
|
||||
if (swimming)
|
||||
matrixStack.translate(0, -0.95f, 0);
|
||||
|
||||
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);
|
||||
|
||||
Matrix4f matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
bufferBuilder.vertex(matrix4f, 0, sneaking ? 1.05f : 1.4f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//spine
|
||||
|
||||
bufferBuilder.vertex(matrix4f, -0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//shoulders
|
||||
bufferBuilder.vertex(matrix4f, 0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, -0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//pelvis
|
||||
bufferBuilder.vertex(matrix4f, 0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
|
||||
matrixStack.push();//head
|
||||
matrixStack.translate(0, sneaking ? 1.05f : 1.4f, 0);
|
||||
rotate(matrixStack, head);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0.15f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
matrixStack.pop();
|
||||
|
||||
matrixStack.push();//right leg
|
||||
matrixStack.translate(0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
|
||||
rotate(matrixStack, rightLeg);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
matrixStack.pop();
|
||||
|
||||
matrixStack.push();//left leg
|
||||
matrixStack.translate(-0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
|
||||
rotate(matrixStack, leftLeg);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
matrixStack.pop();
|
||||
|
||||
matrixStack.push();//right arm
|
||||
matrixStack.translate(0.37f, sneaking ? 1.05f : 1.35f, 0);
|
||||
rotate(matrixStack, rightArm);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
matrixStack.pop();
|
||||
|
||||
matrixStack.push();//left arm
|
||||
matrixStack.translate(-0.37f, sneaking ? 1.05f : 1.35f, 0);
|
||||
rotate(matrixStack, leftArm);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
matrixStack.pop();
|
||||
|
||||
bufferBuilder.end();
|
||||
BufferRenderer.draw(bufferBuilder);
|
||||
|
||||
if (swimming)
|
||||
matrixStack.translate(0, 0.95f, 0);
|
||||
if (swimming || flying)
|
||||
matrixStack.multiply(new Quaternion(new Vec3f(1, 0, 0), 90 + m, true));
|
||||
if (swimming)
|
||||
matrixStack.translate(0, -0.35f, 0);
|
||||
|
||||
matrixStack.multiply(new Quaternion(new Vec3f(0, 1, 0), h + 180, true));
|
||||
matrixStack.translate(-footPos.x, -footPos.y, -footPos.z);
|
||||
});
|
||||
RenderSystem.enableTexture();
|
||||
RenderSystem.disableCull();
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.enableDepthTest();
|
||||
RenderSystem.depthMask(true);
|
||||
}
|
||||
|
||||
private void rotate(MatrixStack matrix, ModelPart modelPart) {
|
||||
if (modelPart.roll != 0.0F) {
|
||||
matrix.multiply(Vec3f.POSITIVE_Z.getRadialQuaternion(modelPart.roll));
|
||||
}
|
||||
|
||||
if (modelPart.yaw != 0.0F) {
|
||||
matrix.multiply(Vec3f.NEGATIVE_Y.getRadialQuaternion(modelPart.yaw));
|
||||
}
|
||||
|
||||
if (modelPart.pitch != 0.0F) {
|
||||
matrix.multiply(Vec3f.NEGATIVE_X.getRadialQuaternion(modelPart.pitch));
|
||||
}
|
||||
}
|
||||
|
||||
private Vec3d getEntityRenderPosition(Entity entity, double partial) {
|
||||
double x = entity.prevX + ((entity.getX() - entity.prevX) * partial) - mc.getEntityRenderDispatcher().camera.getPos().x;
|
||||
double y = entity.prevY + ((entity.getY() - entity.prevY) * partial) - mc.getEntityRenderDispatcher().camera.getPos().y;
|
||||
double z = entity.prevZ + ((entity.getZ() - entity.prevZ) * partial) - mc.getEntityRenderDispatcher().camera.getPos().z;
|
||||
return new Vec3d(x, y, z);
|
||||
}
|
||||
}
|
||||
56
src/main/java/anticope/rejects/modules/SoundLocator.java
Normal file
56
src/main/java/anticope/rejects/modules/SoundLocator.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.meteorclient.events.world.PlaySoundEvent;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.settings.SoundEventListSetting;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.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(MeteorRejectsAddon.CATEGORY, "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));
|
||||
info(text);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package anticope.rejects.modules.modifier;
|
||||
|
||||
import anticope.rejects.mixin.meteor.modules.NoRenderAccessor;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
|
||||
|
||||
public class NoRenderModifier {
|
||||
static SettingGroup sgOverlay;
|
||||
|
||||
public static Setting<Boolean> noCommandSuggestions;
|
||||
|
||||
public static boolean noCommandSuggestions() {
|
||||
return Modules.get().get(NoRender.class).isActive() && noCommandSuggestions.get();
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
sgOverlay = ((NoRenderAccessor) Modules.get().get(NoRender.class)).getSgOverlay();
|
||||
noCommandSuggestions = sgOverlay.add(new BoolSetting.Builder()
|
||||
.name("command-suggestions")
|
||||
.description("Disables command suggestions in chat.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user