Merge pull request #3 from StormyBytes/reogranize-modules

Reorganized Modules
This commit is contained in:
Cloudburst
2021-06-01 13:23:59 +02:00
committed by GitHub
14 changed files with 142 additions and 153 deletions

View File

@@ -59,14 +59,12 @@ public class AntiBot extends Module {
.build()
);
public AntiBot()
{
public AntiBot() {
super(MeteorRejectsAddon.CATEGORY, "anti-bot", "Detects and removes bots.");
}
@EventHandler
public void onTick(TickEvent.Post tickEvent)
{
public void onTick(TickEvent.Post tickEvent) {
for (Entity entity : mc.world.getEntities())
{
if (removeInvisible.get() && !entity.isInvisible()) continue;
@@ -75,8 +73,7 @@ public class AntiBot extends Module {
}
}
private boolean isBot(Entity entity)
{
private boolean isBot(Entity entity) {
if (entity == null) return false;
if (!(entity instanceof PlayerEntity)) return false;
@@ -93,7 +90,6 @@ public class AntiBot extends Module {
if (nullException.get()) return true;
}
return false;
}
}

View File

@@ -50,8 +50,6 @@ public class AntiSpawnpoint extends Module {
}
}
//
if((BlockIsBed && IsOverWorld)||(BlockIsAnchor && IsNetherWorld)) {
event.cancel();
}

View File

@@ -22,9 +22,14 @@ 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();
@@ -78,10 +83,6 @@ public class AntiVanish extends Module {
}
}
public AntiVanish() {
super(MeteorRejectsAddon.CATEGORY, "anti-vanish", "Notifies user when a admin uses /vanish");
}
public static class NameLookup implements Runnable {
private final String uuidstr;
private final UUID uuid;

View File

@@ -41,10 +41,6 @@ public class Auto32K extends Module {
Dispenser
}
public Auto32K(){
super(MeteorRejectsAddon.CATEGORY, "auto-32k", "Automatically attacks other players with a 32k weapon.");
}
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
@@ -88,7 +84,11 @@ public class Auto32K extends Module {
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;
@@ -305,4 +305,4 @@ public class Auto32K extends Module {
list.add(Blocks.COBBLESTONE);
return list;
}
}
}

View File

@@ -25,7 +25,23 @@ import net.minecraft.util.hit.HitResult;
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()
);
BlockPos bed1;
Direction bed2direction;
BlockPos bed2;
@@ -35,24 +51,6 @@ public class AutoBedTrap extends Module {
public AutoBedTrap() {
super(MeteorRejectsAddon.CATEGORY, "auto-bed-trap", "Automatically places obsidian around bed");
}
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()
);
@Override
public void onActivate() {

View File

@@ -26,12 +26,6 @@ import net.minecraft.util.registry.Registry;
import java.util.concurrent.atomic.AtomicInteger;
public class AutoExtinguish extends Module {
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");
}
private final SettingGroup sgGeneral = settings.createGroup("Extinguish Fire around you");
private final SettingGroup sgBucket = settings.createGroup("Extinguish yourself");
@@ -85,11 +79,15 @@ public class AutoExtinguish extends Module {
.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) {
@@ -187,4 +185,4 @@ public class AutoExtinguish extends Module {
return slot;
}
}
}

View File

@@ -18,9 +18,21 @@ import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
public class AutoHighway extends Module {
private enum Direction {
SOUTH,
SOUTH_WEST,
WEST,
WEST_NORTH,
NORTH,
NORTH_EAST,
EAST,
EAST_SOUTH
}
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final Setting<Boolean> disableOnJump = sgGeneral.add(new BoolSetting.Builder()
@@ -48,25 +60,11 @@ public class AutoHighway extends Module {
.build()
);
private enum Direction {
SOUTH,
SOUTH_WEST,
WEST,
WEST_NORTH,
NORTH,
NORTH_EAST,
EAST,
EAST_SOUTH
}
private Direction direction;
private final BlockPos.Mutable blockPos = new BlockPos.Mutable();
private boolean return_;
private int highwaySize;
public AutoHighway() {
super(MeteorRejectsAddon.CATEGORY, "auto-highway", "Automatically build highway.");
}
@@ -652,4 +650,4 @@ public class AutoHighway extends Module {
}
}

View File

@@ -25,21 +25,12 @@ 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(MeteorRejectsAddon.CATEGORY, "confuse", "Makes your enemies shit themselves");
}
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
@@ -74,6 +65,15 @@ public class Confuse extends Module {
.defaultValue(false)
.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() {

View File

@@ -19,12 +19,8 @@ import minegame159.meteorclient.settings.SettingGroup;
import minegame159.meteorclient.systems.modules.Module;
public class Glide extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
public Glide() {
super(MeteorRejectsAddon.CATEGORY, "glide", "Makes you glide down slowly when falling.");
}
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final Setting<Double> fallSpeed = sgGeneral.add(new DoubleSetting.Builder()
.name("fall-speed")
@@ -34,7 +30,7 @@ public class Glide extends Module {
.sliderMax(0.25)
.build()
);
private final Setting<Double> moveSpeed = sgGeneral.add(new DoubleSetting.Builder()
.name("move-speed")
.description("Horizontal movement factor.")
@@ -43,7 +39,7 @@ public class Glide extends Module {
.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.")
@@ -52,58 +48,62 @@ public class Glide extends Module {
.sliderMax(2)
.build()
);
public Glide() {
super(MeteorRejectsAddon.CATEGORY, "glide", "Makes you glide down slowly when falling.");
}
@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));
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();
.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;
}
{
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);
}
{
return mc.world.getBlockState(pos);
}
}

View File

@@ -23,9 +23,8 @@ import java.util.HashMap;
import java.util.Optional;
public class InteractionMenu extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
public final HashMap<String,String> messages = new HashMap<>();
private String currMsgK = "", currMsgV = "";
private final Setting<Object2BooleanMap<EntityType<?>>> entities = sgGeneral.add(new EntityTypeListSetting.Builder()
.name("entities")
@@ -40,8 +39,10 @@ public class InteractionMenu extends Module {
.action(this::onKey)
.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.");
}

View File

@@ -35,11 +35,6 @@ public class Lavacast extends Module {
WaterUp
}
private int dist;
private BlockPos placeFluidPos;
private int tick;
private Stage stage = Stage.None;
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final SettingGroup sgShape = settings.createGroup("Shape", false);
private final Setting<Integer> tickInterval = sgGeneral.add(new IntSetting.Builder()
@@ -91,6 +86,11 @@ public class Lavacast extends Module {
.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");

View File

@@ -20,14 +20,6 @@ import java.util.*;
public class NewChunks extends Module {
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");
}
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final Setting<Boolean> remove = sgGeneral.add(new BoolSetting.Builder()
@@ -50,6 +42,14 @@ public class NewChunks extends Module {
.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() {

View File

@@ -20,13 +20,12 @@ import java.util.Optional;
public class ObsidianFarm extends Module {
private boolean allowBreakAgain;
public ObsidianFarm() {
super(MeteorRejectsAddon.CATEGORY, "obsidian-farm", "Auto obsidian farm(portals).");
}
private boolean allowBreakAgain;
@Override
public void onActivate() {
allowBreakAgain = true;

View File

@@ -45,12 +45,6 @@ public class Rendering extends Module {
private final SettingGroup sgInvisible = settings.createGroup("Invisible");
private final SettingGroup sgFun = settings.createGroup("Fun");
private ShaderEffect shader = null;
public Rendering() {
super(MeteorRejectsAddon.CATEGORY, "Rendering", "Various Render Tweaks");
}
private final Setting<Boolean> entities = sgInvisible.add(new BoolSetting.Builder()
.name("entities")
.description("Render invisible entities.")
@@ -91,6 +85,12 @@ public class Rendering extends Module {
.defaultValue(false)
.build()
);
private ShaderEffect shader = null;
public Rendering() {
super(MeteorRejectsAddon.CATEGORY, "Rendering", "Various Render Tweaks");
}
@Override
public void onActivate() {