add insta mine back
This commit is contained in:
committed by
Cloudburst
parent
271194b289
commit
883585a6db
@@ -32,6 +32,7 @@
|
|||||||
# Features
|
# Features
|
||||||
## Modules
|
## Modules
|
||||||
- AntiBot (Removed from Meteor in [166fc](https://github.com/MeteorDevelopment/meteor-client/commit/166fccc73e53de6cfdbe41ea58dc593a2f5011f6#diff-05896d5a7f735a14ee8da5d12fbd24585862ca68efdf32b9401b3f4329d17c73))
|
- AntiBot (Removed from Meteor in [166fc](https://github.com/MeteorDevelopment/meteor-client/commit/166fccc73e53de6cfdbe41ea58dc593a2f5011f6#diff-05896d5a7f735a14ee8da5d12fbd24585862ca68efdf32b9401b3f4329d17c73))
|
||||||
|
- Insta Mine (Removed from Meteor in [62cd0](https://github.com/MeteorDevelopment/meteor-client/commit/62cd0461e48a6c50f040bf48de25be1fa4eba77e))
|
||||||
- AntiSpawnpoint
|
- AntiSpawnpoint
|
||||||
- AntiVanish
|
- AntiVanish
|
||||||
- AutoBedTrap (Ported from [BleachHack-CupEdition](https://github.com/CUPZYY/BleachHack-CupEdition/blob/master/CupEdition-1.17/src/main/java/bleach/hack/module/mods/AutoBedtrap.java))
|
- AutoBedTrap (Ported from [BleachHack-CupEdition](https://github.com/CUPZYY/BleachHack-CupEdition/blob/master/CupEdition-1.17/src/main/java/bleach/hack/module/mods/AutoBedtrap.java))
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
|||||||
modules.add(new CustomPackets());
|
modules.add(new CustomPackets());
|
||||||
modules.add(new GhostMode());
|
modules.add(new GhostMode());
|
||||||
modules.add(new Glide());
|
modules.add(new Glide());
|
||||||
|
modules.add(new InstaMine());
|
||||||
modules.add(new InteractionMenu());
|
modules.add(new InteractionMenu());
|
||||||
modules.add(new Lavacast());
|
modules.add(new Lavacast());
|
||||||
modules.add(new NewChunks());
|
modules.add(new NewChunks());
|
||||||
|
|||||||
132
src/main/java/anticope/rejects/modules/InstaMine.java
Normal file
132
src/main/java/anticope/rejects/modules/InstaMine.java
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
package anticope.rejects.modules;
|
||||||
|
|
||||||
|
import anticope.rejects.MeteorRejectsAddon;
|
||||||
|
import meteordevelopment.meteorclient.events.entity.player.StartBreakingBlockEvent;
|
||||||
|
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.Categories;
|
||||||
|
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||||
|
import meteordevelopment.meteorclient.utils.player.Rotations;
|
||||||
|
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
||||||
|
import meteordevelopment.meteorclient.utils.world.BlockUtils;
|
||||||
|
import meteordevelopment.orbit.EventHandler;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket;
|
||||||
|
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||||
|
import net.minecraft.util.Hand;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
|
||||||
|
public class InstaMine extends Module {
|
||||||
|
|
||||||
|
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||||
|
private final SettingGroup sgRender = settings.createGroup("Render");
|
||||||
|
|
||||||
|
private final Setting<Integer> tickDelay = sgGeneral.add(new IntSetting.Builder()
|
||||||
|
.name("delay")
|
||||||
|
.description("The delay between breaks.")
|
||||||
|
.defaultValue(0)
|
||||||
|
.min(0)
|
||||||
|
.sliderMax(20)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
private final Setting<Boolean> pick = sgGeneral.add(new BoolSetting.Builder()
|
||||||
|
.name("only-pick")
|
||||||
|
.description("Only tries to mine the block if you are holding a pickaxe.")
|
||||||
|
.defaultValue(true)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
|
||||||
|
.name("rotate")
|
||||||
|
.description("Faces the blocks being mined server side.")
|
||||||
|
.defaultValue(true)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
|
||||||
|
private final Setting<Boolean> render = sgRender.add(new BoolSetting.Builder()
|
||||||
|
.name("render")
|
||||||
|
.description("Renders a block overlay on the block being broken.")
|
||||||
|
.defaultValue(true)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
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 color of the sides of the blocks being rendered.")
|
||||||
|
.defaultValue(new SettingColor(204, 0, 0, 10))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
private final Setting<SettingColor> lineColor = sgRender.add(new ColorSetting.Builder()
|
||||||
|
.name("line-color")
|
||||||
|
.description("The color of the lines of the blocks being rendered.")
|
||||||
|
.defaultValue(new SettingColor(204, 0, 0, 255))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
private int ticks;
|
||||||
|
|
||||||
|
private final BlockPos.Mutable blockPos = new BlockPos.Mutable(0, -1, 0);
|
||||||
|
private Direction direction;
|
||||||
|
|
||||||
|
public InstaMine() {
|
||||||
|
super(MeteorRejectsAddon.CATEGORY, "insta-mine", "Attempts to instantly mine blocks.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivate() {
|
||||||
|
ticks = 0;
|
||||||
|
blockPos.set(0, -1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void onStartBreakingBlock(StartBreakingBlockEvent event) {
|
||||||
|
direction = event.direction;
|
||||||
|
blockPos.set(event.blockPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void onTick(TickEvent.Pre event) {
|
||||||
|
if (ticks >= tickDelay.get()) {
|
||||||
|
ticks = 0;
|
||||||
|
|
||||||
|
if (shouldMine()) {
|
||||||
|
if (rotate.get()) {
|
||||||
|
Rotations.rotate(Rotations.getYaw(blockPos), Rotations.getPitch(blockPos), () -> mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, direction)));
|
||||||
|
} else {
|
||||||
|
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, direction));
|
||||||
|
}
|
||||||
|
|
||||||
|
mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND));
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ticks++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean shouldMine() {
|
||||||
|
if (blockPos.getY() == -1) return false;
|
||||||
|
if (!BlockUtils.canBreak(blockPos)) return false;
|
||||||
|
return !pick.get() || (mc.player.getMainHandStack().getItem() == Items.DIAMOND_PICKAXE || mc.player.getMainHandStack().getItem() == Items.NETHERITE_PICKAXE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void onRender(Render3DEvent event) {
|
||||||
|
if (!render.get() || !shouldMine()) return;
|
||||||
|
event.renderer.box(blockPos, sideColor.get(), lineColor.get(), shapeMode.get(), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user