who needs git log anyway
This commit is contained in:
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client/).
|
||||
* Copyright (c) 2021 Meteor Development.
|
||||
*/
|
||||
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
//Created by squidoodly 12/07/2020
|
||||
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.packets.PacketEvent;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.modules.Categories;
|
||||
import minegame159.meteorclient.modules.Module;
|
||||
import minegame159.meteorclient.modules.Modules;
|
||||
import minegame159.meteorclient.modules.world.MountBypass;
|
||||
import minegame159.meteorclient.settings.BoolSetting;
|
||||
import minegame159.meteorclient.settings.IntSetting;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
import minegame159.meteorclient.utils.player.InvUtils;
|
||||
import net.minecraft.block.ShulkerBoxBlock;
|
||||
import net.minecraft.client.gui.screen.ingame.HorseScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.passive.AbstractDonkeyEntity;
|
||||
import net.minecraft.entity.passive.LlamaEntity;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import net.minecraft.screen.slot.SlotActionType;
|
||||
import net.minecraft.util.Hand;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AutoMountBypassDupe extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> shulkersOnly = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("shulker-only")
|
||||
.description("Only moves shulker boxes into the inventory")
|
||||
.defaultValue(true)
|
||||
.build());
|
||||
|
||||
private final Setting<Boolean> faceDown = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("rotate-down")
|
||||
.description("Faces down when dropping items.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("delay")
|
||||
.description("The delay in ticks between actions.")
|
||||
.defaultValue(4)
|
||||
.min(0)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final List<Integer> slotsToMove = new ArrayList<>();
|
||||
private final List<Integer> slotsToThrow = new ArrayList<>();
|
||||
|
||||
private boolean noCancel = false;
|
||||
private AbstractDonkeyEntity entity;
|
||||
private boolean sneak = false;
|
||||
private int timer;
|
||||
|
||||
public AutoMountBypassDupe() {
|
||||
super(Categories.World, "auto-mount-bypass-dupe", "Does the mount bypass dupe for you. Disable with esc.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onSendPacket(PacketEvent.Send event) {
|
||||
if (noCancel) return;
|
||||
|
||||
Modules.get().get(MountBypass.class).onSendPacket(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post event) {
|
||||
if (GLFW.glfwGetKey(mc.getWindow().getHandle(), GLFW.GLFW_KEY_ESCAPE) == GLFW.GLFW_PRESS) {
|
||||
toggle();
|
||||
mc.player.closeHandledScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
if (timer <= 0) {
|
||||
timer = delay.get();
|
||||
} else {
|
||||
timer--;
|
||||
return;
|
||||
}
|
||||
|
||||
int slots = getInvSize(mc.player.getVehicle());
|
||||
|
||||
for (Entity e : mc.world.getEntities()) {
|
||||
if (e.distanceTo(mc.player) < 5 && e instanceof AbstractDonkeyEntity && ((AbstractDonkeyEntity) e).isTame()) {
|
||||
entity = (AbstractDonkeyEntity) e;
|
||||
}
|
||||
}
|
||||
if (entity == null) return;
|
||||
|
||||
if (sneak) {
|
||||
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY));
|
||||
mc.player.setSneaking(false);
|
||||
sneak = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (slots == -1) {
|
||||
if (entity.hasChest() || mc.player.getMainHandStack().getItem() == Items.CHEST){
|
||||
mc.player.networkHandler.sendPacket(new PlayerInteractEntityC2SPacket(entity, Hand.MAIN_HAND, mc.player.isSneaking()));
|
||||
} else {
|
||||
int slot = InvUtils.findItemWithCount(Items.CHEST).slot;
|
||||
if (slot != -1 && slot < 9) {
|
||||
mc.player.inventory.selectedSlot = slot;
|
||||
} else {
|
||||
ChatUtils.moduleError(this, "Cannot find chest in your hotbar... disabling.");
|
||||
this.toggle();
|
||||
}
|
||||
}
|
||||
} else if (slots == 0) {
|
||||
if (isDupeTime()) {
|
||||
if (!slotsToThrow.isEmpty()) {
|
||||
if (faceDown.get()) {
|
||||
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookOnly(mc.player.yaw, 90, mc.player.isOnGround()));
|
||||
}
|
||||
for (int i : slotsToThrow) {
|
||||
InvUtils.clickSlot(i, 1, SlotActionType.THROW);
|
||||
}
|
||||
slotsToThrow.clear();
|
||||
} else {
|
||||
for (int i = 2; i < getDupeSize() + 1; i++) {
|
||||
slotsToThrow.add(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mc.player.closeHandledScreen();
|
||||
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.PRESS_SHIFT_KEY));
|
||||
|
||||
mc.player.setSneaking(true);
|
||||
sneak = true;
|
||||
}
|
||||
} else if (!(mc.currentScreen instanceof HorseScreen)) {
|
||||
mc.player.openRidingInventory();
|
||||
} else if (slots > 0 ) {
|
||||
if (slotsToMove.isEmpty()) {
|
||||
boolean empty = true;
|
||||
for (int i = 2; i <= slots; i++) {
|
||||
if (!(mc.player.currentScreenHandler.getStacks().get(i).isEmpty())) {
|
||||
empty = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty) {
|
||||
for (int i = slots + 2; i < mc.player.currentScreenHandler.getStacks().size(); i++) {
|
||||
if (!(mc.player.currentScreenHandler.getStacks().get(i).isEmpty())) {
|
||||
if (mc.player.currentScreenHandler.getSlot(i).getStack().getItem() == Items.CHEST) continue;
|
||||
if (!(mc.player.currentScreenHandler.getSlot(i).getStack().getItem() instanceof BlockItem && ((BlockItem) mc.player.currentScreenHandler.getSlot(i).getStack().getItem()).getBlock() instanceof ShulkerBoxBlock) && shulkersOnly.get()) continue;
|
||||
slotsToMove.add(i);
|
||||
|
||||
if (slotsToMove.size() >= slots) break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
noCancel = true;
|
||||
mc.player.networkHandler.sendPacket(new PlayerInteractEntityC2SPacket(entity, Hand.MAIN_HAND, entity.getPos().add(entity.getWidth() / 2, entity.getHeight() / 2, entity.getWidth() / 2), mc.player.isSneaking()));
|
||||
noCancel = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!slotsToMove.isEmpty()) {
|
||||
for (int i : slotsToMove) InvUtils.clickSlot(i, 0, SlotActionType.QUICK_MOVE);
|
||||
slotsToMove.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getInvSize(Entity e){
|
||||
if (!(e instanceof AbstractDonkeyEntity)) return -1;
|
||||
|
||||
if (!((AbstractDonkeyEntity)e).hasChest()) return 0;
|
||||
|
||||
if (e instanceof LlamaEntity) {
|
||||
return 3 * ((LlamaEntity) e).getStrength();
|
||||
}
|
||||
|
||||
return 15;
|
||||
}
|
||||
|
||||
private boolean isDupeTime() {
|
||||
if (mc.player.getVehicle() != entity || entity.hasChest() || mc.player.currentScreenHandler.getStacks().size() == 46) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mc.player.currentScreenHandler.getStacks().size() > 38) {
|
||||
for (int i = 2; i < getDupeSize() + 1; i++) {
|
||||
if (mc.player.currentScreenHandler.getSlot(i).hasStack()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private int getDupeSize() {
|
||||
if (mc.player.getVehicle() != entity || entity.hasChest() || mc.player.currentScreenHandler.getStacks().size() == 46) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return mc.player.currentScreenHandler.getStacks().size() - 38;
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,13 @@ import baritone.api.BaritoneAPI;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.entity.player.ItemUseCrosshairTargetEvent;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.modules.Categories;
|
||||
import minegame159.meteorclient.modules.Module;
|
||||
import minegame159.meteorclient.modules.Modules;
|
||||
import minegame159.meteorclient.modules.combat.AnchorAura;
|
||||
import minegame159.meteorclient.modules.combat.BedAura;
|
||||
import minegame159.meteorclient.modules.combat.CrystalAura;
|
||||
import minegame159.meteorclient.modules.combat.KillAura;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
import minegame159.meteorclient.systems.modules.Modules;
|
||||
import minegame159.meteorclient.systems.modules.combat.AnchorAura;
|
||||
import minegame159.meteorclient.systems.modules.combat.BedAura;
|
||||
import minegame159.meteorclient.systems.modules.combat.CrystalAura;
|
||||
import minegame159.meteorclient.systems.modules.combat.KillAura;
|
||||
import minegame159.meteorclient.settings.*;
|
||||
import minegame159.meteorclient.utils.Utils;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
|
||||
205
src/main/java/cloudburst/rejects/modules/Confuse.java
Normal file
205
src/main/java/cloudburst/rejects/modules/Confuse.java
Normal file
@@ -0,0 +1,205 @@
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.RaycastContext;
|
||||
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.render.RenderEvent;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.settings.BoolSetting;
|
||||
import minegame159.meteorclient.settings.EnumSetting;
|
||||
import minegame159.meteorclient.settings.IntSetting;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
import minegame159.meteorclient.utils.render.RenderUtils;
|
||||
import minegame159.meteorclient.utils.render.color.Color;
|
||||
|
||||
public class Confuse extends Module {
|
||||
|
||||
int delayWaited = 0;
|
||||
double circleProgress = 0;
|
||||
double addition = 0.0;
|
||||
Entity target = null;
|
||||
|
||||
public enum Mode {
|
||||
RandomTP,
|
||||
Switch,
|
||||
Circle
|
||||
}
|
||||
|
||||
public Confuse() {
|
||||
super(Categories.Misc, "confuse", "Makes your enemies shit themselves");
|
||||
}
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
|
||||
.name("mode")
|
||||
.defaultValue(Mode.RandomTP)
|
||||
.description("Mode")
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("delay")
|
||||
.description("Delay")
|
||||
.defaultValue(3)
|
||||
.min(0)
|
||||
.sliderMax(20)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Integer> circleSpeed = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("circle-speed")
|
||||
.description("Circle mode speed")
|
||||
.defaultValue(10)
|
||||
.min(1)
|
||||
.sliderMax(180)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> moveThroughBlocks = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("move-through-blocks")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
private final Setting<Boolean> budgetGraphics = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("budget-graphics")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
delayWaited = 0;
|
||||
circleProgress = 0;
|
||||
addition = 0.0;
|
||||
target = null;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
delayWaited++;
|
||||
if (delayWaited < delay.get()) return;
|
||||
delayWaited = 0;
|
||||
assert mc.player != null;
|
||||
Vec3d sel1 = mc.player.getPos().add(-4, -4, -4);
|
||||
Vec3d sel2 = sel1.add(8, 8, 8);
|
||||
Box selector = new Box(sel1, sel2);
|
||||
assert mc.world != null;
|
||||
for (Entity e : mc.world.getEntities()) {
|
||||
if (e.getUuid() == mc.player.getUuid()) continue;
|
||||
if (!e.isAlive()
|
||||
|| !e.isAttackable()) continue;
|
||||
if (e.getBoundingBox().intersects(selector)) {
|
||||
target = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (target == null) return;
|
||||
if (!target.isAlive()) {
|
||||
target = null;
|
||||
return;
|
||||
}
|
||||
Vec3d entityPos = target.getPos();
|
||||
Vec3d playerPos = mc.player.getPos();
|
||||
if (playerPos.distanceTo(entityPos) > 6) {
|
||||
target = null;
|
||||
return;
|
||||
}
|
||||
Random r = new Random();
|
||||
BlockHitResult hit;
|
||||
switch (mode.get()) {
|
||||
case RandomTP:
|
||||
double x = r.nextDouble() * 6 - 3;
|
||||
double y = 0;
|
||||
double z = r.nextDouble() * 6 - 3;
|
||||
Vec3d addend = new Vec3d(x, y, z);
|
||||
Vec3d goal = entityPos.add(addend);
|
||||
if (!mc.world.getBlockState(new BlockPos(goal.x, goal.y, goal.z)).getBlock().is(Blocks.AIR)) {
|
||||
goal = new Vec3d(x, playerPos.y, z);
|
||||
}
|
||||
if (mc.world.getBlockState(new BlockPos(goal.x, goal.y, goal.z)).getBlock().is(Blocks.AIR)) {
|
||||
hit = mc.world.raycast(new RaycastContext(
|
||||
mc.player.getPos(),goal, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (!moveThroughBlocks.get() && hit.isInsideBlock()) {
|
||||
delayWaited = (int) (delay.get() - 1);
|
||||
break;
|
||||
}
|
||||
mc.player.updatePosition(goal.x, goal.y, goal.z);
|
||||
} else {
|
||||
delayWaited = (int) (delay.get() - 1);
|
||||
}
|
||||
break;
|
||||
case Switch:
|
||||
Vec3d diff = entityPos.subtract(playerPos);
|
||||
Vec3d diff1 = new Vec3d(clamp(diff.x, -3, 3), clamp(diff.y, -3, 3), clamp(diff.z, -3, 3));
|
||||
Vec3d goal2 = entityPos.add(diff1);
|
||||
hit = mc.world.raycast(new RaycastContext(
|
||||
mc.player.getPos(), goal2, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (!moveThroughBlocks.get() && hit.isInsideBlock()) {
|
||||
delayWaited = (int) (delay.get() - 1);
|
||||
break;
|
||||
}
|
||||
mc.player.updatePosition(goal2.x, goal2.y, goal2.z);
|
||||
break;
|
||||
case Circle:
|
||||
delay.set(0);
|
||||
circleProgress += circleSpeed.get();
|
||||
if (circleProgress > 360) circleProgress -= 360;
|
||||
double rad = Math.toRadians(circleProgress);
|
||||
double sin = Math.sin(rad) * 3;
|
||||
double cos = Math.cos(rad) * 3;
|
||||
Vec3d current = new Vec3d(entityPos.x + sin, playerPos.y, entityPos.z + cos);
|
||||
hit = mc.world.raycast(new RaycastContext(
|
||||
mc.player.getPos(), current, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (!moveThroughBlocks.get() && hit.isInsideBlock())
|
||||
break;
|
||||
mc.player.updatePosition(current.x, current.y, current.z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onRender(RenderEvent event) {
|
||||
if (target == null) return;
|
||||
|
||||
boolean flag = budgetGraphics.get();
|
||||
Vec3d last = null;
|
||||
addition += flag ? 0 : 1.0;
|
||||
if (addition > 360) addition = 0;
|
||||
for (int i = 0; i < 360; i += flag ? 7 : 1) {
|
||||
Color c1;
|
||||
if (flag) c1 = new Color(0, 255, 0);
|
||||
else {
|
||||
double rot = (255.0 * 3) * (((((double) i) + addition) % 360) / 360.0);
|
||||
int seed = (int) Math.floor(rot / 255.0);
|
||||
double current = rot % 255;
|
||||
double red = seed == 0 ? current : (seed == 1 ? Math.abs(current - 255) : 0);
|
||||
double green = seed == 1 ? current : (seed == 2 ? Math.abs(current - 255) : 0);
|
||||
double blue = seed == 2 ? current : (seed == 0 ? Math.abs(current - 255) : 0);
|
||||
c1 = new Color((int) red, (int) green, (int) blue);
|
||||
}
|
||||
Vec3d tp = target.getPos();
|
||||
double rad = Math.toRadians(i);
|
||||
double sin = Math.sin(rad) * 3;
|
||||
double cos = Math.cos(rad) * 3;
|
||||
Vec3d c = new Vec3d(tp.x + sin, tp.y + target.getHeight() / 2, tp.z + cos);
|
||||
if (last != null) RenderUtils.drawLine(last, c.x, c.y, c.z, c1, event);
|
||||
last = c;
|
||||
}
|
||||
}
|
||||
|
||||
public static double clamp(double val, double min, double max) {
|
||||
return Math.max(min, Math.min(max, val));
|
||||
}
|
||||
}
|
||||
109
src/main/java/cloudburst/rejects/modules/Glide.java
Normal file
109
src/main/java/cloudburst/rejects/modules/Glide.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.settings.DoubleSetting;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
|
||||
public class Glide extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
public Glide() {
|
||||
super(Categories.Movement, "glide", "Makes you glide down slowly when falling.");
|
||||
}
|
||||
|
||||
private final Setting<Double> fallSpeed = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("fall-speed")
|
||||
.description("Fall Speed")
|
||||
.defaultValue(0.125)
|
||||
.min(0.005)
|
||||
.sliderMax(0.25)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> moveSpeed = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("move-speed")
|
||||
.description("Horizontal movement factor.")
|
||||
.defaultValue(1.2)
|
||||
.min(0.75)
|
||||
.sliderMax(5)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Double> minHeight = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("min-height")
|
||||
.description("Won't glide when you are too close to the ground.")
|
||||
.defaultValue(0)
|
||||
.min(0)
|
||||
.sliderMax(2)
|
||||
.build()
|
||||
);
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
Vec3d v = mc.player.getVelocity();
|
||||
|
||||
if(mc.player.isOnGround() || mc.player.isTouchingWater() || mc.player.isInLava()
|
||||
|| mc.player.isClimbing() || v.y >= 0)
|
||||
return;
|
||||
|
||||
if(minHeight.get() > 0)
|
||||
{
|
||||
Box box = mc.player.getBoundingBox();
|
||||
box = box.union(box.offset(0, -minHeight.get(), 0));
|
||||
if(!mc.world.isSpaceEmpty(box))
|
||||
return;
|
||||
|
||||
BlockPos min =
|
||||
new BlockPos(new Vec3d(box.minX, box.minY, box.minZ));
|
||||
BlockPos max =
|
||||
new BlockPos(new Vec3d(box.maxX, box.maxY, box.maxZ));
|
||||
Stream<BlockPos> stream = StreamSupport
|
||||
.stream(getAllInBox(min, max).spliterator(), true);
|
||||
|
||||
// manual collision check, since liquids don't have bounding boxes
|
||||
if(stream.map(this::getState).map(BlockState::getMaterial)
|
||||
.anyMatch(Material::isLiquid))
|
||||
return;
|
||||
}
|
||||
|
||||
mc.player.setVelocity(v.x, Math.max(v.y, -fallSpeed.get()), v.z);
|
||||
mc.player.flyingSpeed *= moveSpeed.get();
|
||||
}
|
||||
|
||||
public static ArrayList<BlockPos> getAllInBox(BlockPos from, BlockPos to)
|
||||
{
|
||||
ArrayList<BlockPos> blocks = new ArrayList<>();
|
||||
|
||||
BlockPos min = new BlockPos(Math.min(from.getX(), to.getX()),
|
||||
Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ()));
|
||||
BlockPos max = new BlockPos(Math.max(from.getX(), to.getX()),
|
||||
Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ()));
|
||||
|
||||
for(int x = min.getX(); x <= max.getX(); x++)
|
||||
for(int y = min.getY(); y <= max.getY(); y++)
|
||||
for(int z = min.getZ(); z <= max.getZ(); z++)
|
||||
blocks.add(new BlockPos(x, y, z));
|
||||
|
||||
return blocks;
|
||||
}
|
||||
|
||||
public BlockState getState(BlockPos pos)
|
||||
{
|
||||
return mc.world.getBlockState(pos);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package cloudburst.rejects.modules;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.render.RenderEvent;
|
||||
import minegame159.meteorclient.events.world.TickEvent;
|
||||
import minegame159.meteorclient.modules.Categories;
|
||||
import minegame159.meteorclient.modules.Module;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
import minegame159.meteorclient.rendering.Renderer;
|
||||
import minegame159.meteorclient.rendering.ShapeMode;
|
||||
import minegame159.meteorclient.settings.EnumSetting;
|
||||
@@ -23,6 +23,7 @@ import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraft.world.RaycastContext;
|
||||
|
||||
|
||||
@@ -102,19 +103,22 @@ public class Lavacast extends Module {
|
||||
if (mc.player == null || mc.world == null) toggle();
|
||||
tick = 0;
|
||||
stage = Stage.None;
|
||||
placeFluidPos = getTargetBlockPos().up();
|
||||
placeFluidPos = getTargetBlockPos();
|
||||
if (placeFluidPos == null) {
|
||||
placeFluidPos = mc.player.getBlockPos().down();
|
||||
placeFluidPos = mc.player.getBlockPos().down(2);
|
||||
} else {
|
||||
placeFluidPos = placeFluidPos.up();
|
||||
}
|
||||
final BlockHitResult result = mc.world.raycast(new RaycastContext(
|
||||
Vec3d.ofCenter(offsetByPlayerRotation(placeFluidPos.down())), Vec3d.ofCenter(offsetByPlayerRotation(placeFluidPos).down(250)), RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (result == null || result.getType() != HitResult.Type.BLOCK) {
|
||||
ChatUtils.moduleError(this,"No floor beneath you");
|
||||
dist=-1;
|
||||
getDistance(new Vec3i(1,0,0));
|
||||
getDistance(new Vec3i(-1,0,0));
|
||||
getDistance(new Vec3i(0,0,1));
|
||||
getDistance(new Vec3i(1,0,-1));
|
||||
if (dist<1) {
|
||||
ChatUtils.moduleError(this,"Couldn't locate bottom.");
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
dist = placeFluidPos.getY() - result.getBlockPos().getY();
|
||||
ChatUtils.moduleInfo(this,"Distance: (highlight)%d(default).", dist);
|
||||
}
|
||||
|
||||
@@ -122,19 +126,10 @@ public class Lavacast extends Module {
|
||||
private void onTick(TickEvent.Pre event) {
|
||||
if (mc.player == null || mc.world == null) return;
|
||||
tick++;
|
||||
if (stage == Stage.LavaDown && tick < dist*lavaDownMult.get()) return;
|
||||
if (stage == Stage.LavaUp && tick < dist*lavaUpMult.get()) return;
|
||||
if (stage == Stage.WaterDown && tick < dist*waterDownMult.get()) return;
|
||||
if (stage == Stage.WaterUp && tick < dist*waterUpMult.get()) return;
|
||||
if (shouldBreakOnTick()) return;
|
||||
if (dist < distMin.get()) toggle();
|
||||
if (tick < tickInterval.get()) {
|
||||
return;
|
||||
}
|
||||
tick = 0;
|
||||
if (stage == Stage.None && mc.world.getBlockState(placeFluidPos).getBlock() != Blocks.AIR) {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos), Rotations.getPitch(placeFluidPos), 100, this::updateBlockBreakingProgress);
|
||||
return;
|
||||
}
|
||||
if (checkMineBlock()) return;
|
||||
switch (stage) {
|
||||
case None: {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos),Rotations.getPitch(placeFluidPos),100, this::placeLava);
|
||||
@@ -162,9 +157,28 @@ public class Lavacast extends Module {
|
||||
stage = Stage.LavaDown;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldBreakOnTick() {
|
||||
if (stage == Stage.LavaDown && tick < dist*lavaDownMult.get()) return true;
|
||||
if (stage == Stage.LavaUp && tick < dist*lavaUpMult.get()) return true;
|
||||
if (stage == Stage.WaterDown && tick < dist*waterDownMult.get()) return true;
|
||||
if (stage == Stage.WaterUp && tick < dist*waterUpMult.get()) return true;
|
||||
if (tick < tickInterval.get()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean checkMineBlock() {
|
||||
if (stage == Stage.None && mc.world.getBlockState(placeFluidPos).getBlock() != Blocks.AIR) {
|
||||
Rotations.rotate(Rotations.getYaw(placeFluidPos), Rotations.getPitch(placeFluidPos), 100, this::updateBlockBreakingProgress);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onRender(RenderEvent event) {
|
||||
if (placeFluidPos == null) return;
|
||||
@@ -194,9 +208,9 @@ public class Lavacast extends Module {
|
||||
return;
|
||||
}
|
||||
int prevSlot = mc.player.inventory.selectedSlot;
|
||||
InvUtils.swap(slot);
|
||||
mc.player.inventory.selectedSlot = slot;
|
||||
mc.interactionManager.interactItem(mc.player,mc.world,Hand.MAIN_HAND);
|
||||
InvUtils.swap(prevSlot);
|
||||
mc.player.inventory.selectedSlot = prevSlot;
|
||||
}
|
||||
|
||||
private void placeWater() {
|
||||
@@ -207,9 +221,9 @@ public class Lavacast extends Module {
|
||||
return;
|
||||
}
|
||||
int prevSlot = mc.player.inventory.selectedSlot;
|
||||
InvUtils.swap(slot);
|
||||
mc.player.inventory.selectedSlot = slot;
|
||||
mc.interactionManager.interactItem(mc.player,mc.world,Hand.MAIN_HAND);
|
||||
InvUtils.swap(prevSlot);
|
||||
mc.player.inventory.selectedSlot = prevSlot;
|
||||
}
|
||||
|
||||
private void pickupLiquid() {
|
||||
@@ -220,9 +234,9 @@ public class Lavacast extends Module {
|
||||
return;
|
||||
}
|
||||
int prevSlot = mc.player.inventory.selectedSlot;
|
||||
InvUtils.swap(slot);
|
||||
mc.player.inventory.selectedSlot = slot;
|
||||
mc.interactionManager.interactItem(mc.player,mc.world,Hand.MAIN_HAND);
|
||||
InvUtils.swap(prevSlot);
|
||||
mc.player.inventory.selectedSlot = prevSlot;
|
||||
}
|
||||
|
||||
private void updateBlockBreakingProgress() {
|
||||
@@ -237,19 +251,17 @@ public class Lavacast extends Module {
|
||||
return ((BlockHitResult) blockHit).getBlockPos();
|
||||
}
|
||||
|
||||
private BlockPos offsetByPlayerRotation(BlockPos pos) {
|
||||
double rotation = (mc.player.yaw - 90) % 360;
|
||||
if (rotation < 0) rotation += 360.0;
|
||||
if (0 <= rotation && rotation < 22.5) return pos.south();
|
||||
else if (22.5 <= rotation && rotation < 67.5) return pos.south().west();
|
||||
else if (67.5 <= rotation && rotation < 112.5) return pos.west();
|
||||
else if (112.5 <= rotation && rotation < 157.5) return pos.north().west();
|
||||
else if (157.5 <= rotation && rotation < 202.5) return pos.north();
|
||||
else if (202.5 <= rotation && rotation < 247.5) return pos.north().east();
|
||||
else if (247.5 <= rotation && rotation < 292.5) return pos.east();
|
||||
else if (292.5 <= rotation && rotation < 337.5) return pos.south().east();
|
||||
else if (337.5 <= rotation && rotation < 360.0) return pos.south();
|
||||
return pos;
|
||||
private void getDistance(Vec3i offset) {
|
||||
BlockPos pos = placeFluidPos.down().add(offset);
|
||||
int new_dist;
|
||||
final BlockHitResult result = mc.world.raycast(new RaycastContext(
|
||||
Vec3d.ofCenter(pos), Vec3d.ofCenter(pos.down(250)), RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player
|
||||
));
|
||||
if (result == null || result.getType() != HitResult.Type.BLOCK) {
|
||||
return;
|
||||
}
|
||||
new_dist = placeFluidPos.getY() - result.getBlockPos().getY();
|
||||
if (new_dist>dist) dist = new_dist;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,59 @@
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
import minegame159.meteorclient.modules.Categories;
|
||||
import minegame159.meteorclient.modules.Module;
|
||||
import minegame159.meteorclient.settings.BoolSetting;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
|
||||
public class RenderInvisible extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> entities = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("entities")
|
||||
.description("Render invisible entities.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> barrier = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("barrier")
|
||||
.description("Render barrier blocks.")
|
||||
.defaultValue(true)
|
||||
.onChanged(onChanged -> {
|
||||
if(this.isActive()) {
|
||||
mc.worldRenderer.reload();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> structureVoid = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("structure-void")
|
||||
.description("Render structure void blocks.")
|
||||
.defaultValue(true)
|
||||
.onChanged(onChanged -> {
|
||||
if(this.isActive()) {
|
||||
mc.worldRenderer.reload();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
);
|
||||
|
||||
public RenderInvisible() {
|
||||
super(Categories.Render, "render-invisible", "Renders invisible entities.");
|
||||
super(Categories.Render, "render-invisible", "Renders invisible entities and blocks.");
|
||||
}
|
||||
|
||||
}
|
||||
public boolean renderEntities() {
|
||||
return this.isActive() && entities.get();
|
||||
}
|
||||
|
||||
public boolean renderBarriers() {
|
||||
return this.isActive() && barrier.get();
|
||||
}
|
||||
|
||||
public boolean renderStructureVoid() {
|
||||
return this.isActive() && structureVoid.get();
|
||||
}
|
||||
}
|
||||
55
src/main/java/cloudburst/rejects/modules/SoundLocator.java
Normal file
55
src/main/java/cloudburst/rejects/modules/SoundLocator.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.world.PlaySoundEvent;
|
||||
import minegame159.meteorclient.settings.Setting;
|
||||
import minegame159.meteorclient.settings.SettingGroup;
|
||||
import minegame159.meteorclient.settings.SoundEventListSetting;
|
||||
import minegame159.meteorclient.systems.modules.Categories;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
import minegame159.meteorclient.utils.player.ChatUtils;
|
||||
import net.minecraft.client.sound.SoundInstance;
|
||||
import net.minecraft.client.sound.WeightedSoundSet;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SoundLocator extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<List<SoundEvent>> sounds = sgGeneral.add(new SoundEventListSetting.Builder()
|
||||
.name("sounds")
|
||||
.description("Sounds to find.")
|
||||
.defaultValue(new ArrayList<>(0))
|
||||
.build()
|
||||
);
|
||||
|
||||
public SoundLocator() {
|
||||
super(Categories.Misc, "sound-locator", "Prints locations of sound events.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPlaySound(PlaySoundEvent event) {
|
||||
for (SoundEvent sound : sounds.get()) {
|
||||
if (sound.getId().equals(event.sound.getId())) {
|
||||
printSound(event.sound);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void printSound(SoundInstance sound) {
|
||||
WeightedSoundSet soundSet = mc.getSoundManager().get(sound.getId());
|
||||
MutableText text = soundSet.getSubtitle().copy();
|
||||
text.append(String.format("%s at ", Formatting.RESET));
|
||||
Vec3d pos = new Vec3d(sound.getX(), sound.getY(), sound.getZ());
|
||||
text.append(ChatUtils.formatCoords(pos));
|
||||
text.append(String.format("%s.", Formatting.RESET));
|
||||
ChatUtils.moduleInfo(this,text);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user