Skip to content

Commit 36e0473

Browse files
committed
creeper ora?
1 parent c03e4de commit 36e0473

File tree

6 files changed

+151
-83
lines changed

6 files changed

+151
-83
lines changed

src/main/java/random/meteor/systems/Manager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ private static void addModules() {
1414

1515
List<Module> m = new ArrayList<>();
1616
m.add(new PearlPhase());
17+
m.add(new CrepperAura());
1718
m.add(new Prefix());
1819
m.add(new ItemRenderer());
1920
m.add(new PistonPush());

src/main/java/random/meteor/systems/modules/AutoMine.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ private void onStartBreakingBlock(StartBreakingBlockEvent event) {
163163
if (!BlockUtils.canBreak(event.blockPos)) return;
164164
if (pos != null) {
165165
Objects.requireNonNull(mc.getNetworkHandler()).sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, pos, Direction.UP));
166-
info("ABORTED BLOCKJ BREAKING ");
167166
}
168167
pos = event.blockPos;
169168
canClear = false;
@@ -246,6 +245,7 @@ public void onTick(TickEvent.Pre event) {
246245
Objects.requireNonNull(mc.getNetworkHandler()).sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, Direction.UP));
247246
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, pos, Direction.UP));
248247

248+
249249
canClear = false;
250250

251251
if (progress >= 1) {
@@ -284,7 +284,6 @@ public void onTick(TickEvent.Pre event) {
284284
}
285285

286286

287-
288287
public void doCrystal(BlockPos pos) {
289288
if (!isRange(mc.player != null ? mc.player : null, pos, 5)) return;
290289
FindItemResult crystal = InvUtils.findInHotbar(Items.END_CRYSTAL);

src/main/java/random/meteor/systems/modules/AutoSnowball.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import net.minecraft.item.Items;
1616
import random.meteor.Main;
1717

18+
import java.util.Objects;
19+
1820
import static meteordevelopment.meteorclient.utils.entity.TargetUtils.getPlayerTarget;
1921
import static meteordevelopment.meteorclient.utils.entity.TargetUtils.isBadTarget;
2022

@@ -63,7 +65,7 @@ public void onTick(TickEvent.Pre e) {
6365

6466
PlayerEntity target = getPlayerTarget(range.get(), SortPriority.LowestDistance);
6567

66-
if (isBadTarget(target, range.get()) || !mc.player.canSee(target)) return;
68+
if (isBadTarget(target, range.get()) || !Objects.requireNonNull(mc.player).canSee(target)) return;
6769

6870

6971
if (ticks > 0) {
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
package random.meteor.systems.modules;
2+
3+
import meteordevelopment.meteorclient.events.render.Render3DEvent;
4+
import meteordevelopment.meteorclient.events.world.TickEvent;
5+
import meteordevelopment.meteorclient.renderer.ShapeMode;
6+
import meteordevelopment.meteorclient.settings.*;
7+
import meteordevelopment.meteorclient.systems.modules.Module;
8+
import meteordevelopment.meteorclient.utils.entity.SortPriority;
9+
import meteordevelopment.meteorclient.utils.entity.TargetUtils;
10+
import meteordevelopment.meteorclient.utils.player.FindItemResult;
11+
import meteordevelopment.meteorclient.utils.player.InvUtils;
12+
import meteordevelopment.meteorclient.utils.player.Rotations;
13+
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
14+
import meteordevelopment.orbit.EventHandler;
15+
import net.minecraft.entity.player.PlayerEntity;
16+
import net.minecraft.item.Items;
17+
import net.minecraft.util.ActionResult;
18+
import net.minecraft.util.Hand;
19+
import net.minecraft.util.hit.BlockHitResult;
20+
import net.minecraft.util.math.BlockPos;
21+
import net.minecraft.util.math.Direction;
22+
import random.meteor.Main;
23+
24+
public class CrepperAura extends Module {
25+
private final SettingGroup sgGeneral = settings.getDefaultGroup();
26+
private final SettingGroup sgRender = settings.createGroup("Render");
27+
28+
private final Setting<Double> targetRange = sgGeneral.add(new DoubleSetting.Builder().name("target-range").description("The radius in which players get targeted.").defaultValue(5.5).min(0).sliderMax(7).build());
29+
private final Setting<SortPriority> priority = sgGeneral.add(new EnumSetting.Builder<SortPriority>().name("target-priority").description("How to filter targets within range.").defaultValue(SortPriority.LowestDistance).build());
30+
private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder().name("place-delay").description("How many ticks between block placements.").defaultValue(1).build());
31+
private final Setting<Boolean> silentSwap = sgGeneral.add(new BoolSetting.Builder().name("silent-swap").defaultValue(true).build());
32+
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder().name("rotate").description("Automatically rotates you towards the city block.").defaultValue(true).build());
33+
/*render*/
34+
private final Setting<Boolean> swingHand = sgRender.add(new BoolSetting.Builder().name("swing-hand").description("Whether to render your hand swinging.").defaultValue(false).build());
35+
36+
private final Setting<Boolean> renderBlock = sgRender.add(new BoolSetting.Builder().name("render-block").description("Whether to render the block being broken.").defaultValue(true).build());
37+
38+
private final Setting<ShapeMode> shapeMode = sgRender.add(new EnumSetting.Builder<ShapeMode>().name("shape-mode").description("How the shapes are rendered.").defaultValue(ShapeMode.Both).visible(renderBlock::get).build());
39+
private final Setting<SettingColor> sideColor = sgRender.add(new ColorSetting.Builder()
40+
.name("side-color")
41+
.description("The side color of the rendering.")
42+
.defaultValue(new SettingColor(225, 0, 0, 75))
43+
.build()
44+
);
45+
46+
private final Setting<SettingColor> lineColor = sgRender.add(new ColorSetting.Builder()
47+
.name("line-color")
48+
.description("The line color of the rendering.")
49+
.defaultValue(new SettingColor(225, 0, 0, 255))
50+
.build()
51+
);
52+
int ticks;
53+
PlayerEntity target;
54+
BlockPos targetPos;
55+
56+
@Override
57+
public void onActivate() {
58+
ticks = 0;
59+
target = null;
60+
targetPos = null;
61+
super.onActivate();
62+
}
63+
64+
public CrepperAura() {
65+
super(Main.RM, "creeper-aura", "8b8t fags");
66+
}
67+
68+
@EventHandler
69+
public void tick(TickEvent.Pre event) {
70+
71+
if (TargetUtils.isBadTarget(target, targetRange.get())) {
72+
target = TargetUtils.getPlayerTarget(targetRange.get(), priority.get());
73+
}
74+
75+
FindItemResult egg = InvUtils.findInHotbar(Items.CREEPER_SPAWN_EGG);
76+
77+
if (!egg.isHotbar() || TargetUtils.isBadTarget(target, targetRange.get())) return;
78+
79+
if (ticks > 0) {
80+
ticks--;
81+
return;
82+
}
83+
84+
85+
InvUtils.swap(egg.slot(), silentSwap.get());
86+
87+
targetPos = target.getBlockPos().down(2);
88+
89+
90+
if (rotate.get()) {
91+
Rotations.rotate(Rotations.getYaw(targetPos), Rotations.getPitch(targetPos));
92+
}
93+
94+
ActionResult result = mc.interactionManager.interactBlock(mc.player,
95+
egg.getHand(), new BlockHitResult(targetPos.toCenterPos(),
96+
Direction.UP, targetPos, false)
97+
);
98+
99+
if (result.isAccepted()) if (swingHand.get()) mc.player.swingHand(Hand.MAIN_HAND);
100+
101+
if (silentSwap.get()) InvUtils.swapBack();
102+
103+
ticks = delay.get();
104+
}
105+
106+
@EventHandler
107+
private void onRender(Render3DEvent event) {
108+
109+
if (targetPos == null) return;
110+
111+
event.renderer.box(targetPos, sideColor.get(), lineColor.get(), shapeMode.get(), 0);
112+
}
113+
}

src/main/java/random/meteor/systems/modules/PistonAura.java

Lines changed: 29 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -20,59 +20,17 @@
2020
import random.meteor.Main;
2121
import random.meteor.utils.Utils;
2222

23-
import static random.meteor.utils.Utils.getCrystal;
24-
2523
public class PistonAura extends Module {
2624
private final SettingGroup sgGeneral = settings.getDefaultGroup();
2725

28-
private final Setting<Double> targetRange = sgGeneral.add(new DoubleSetting.Builder()
29-
.name("target-range")
30-
.description("The radius in which players get targeted.")
31-
.defaultValue(5.5)
32-
.min(0)
33-
.sliderMax(7)
34-
.build()
35-
);
36-
private final Setting<Integer> pistonDelay = sgGeneral.add(new IntSetting.Builder()
37-
.name("piston-delay")
38-
.defaultValue(1)
39-
.min(1)
40-
.sliderRange(1, 50)
41-
.build()
42-
);
43-
private final Setting<Integer> redstoneDelay = sgGeneral.add(new IntSetting.Builder()
44-
.name("redstone-delay")
45-
.defaultValue(1)
46-
.min(1)
47-
.sliderRange(1, 50)
48-
.build()
49-
);
50-
private final Setting<Integer> crystalDelay = sgGeneral.add(new IntSetting.Builder()
51-
.name("crystal-delay")
52-
.defaultValue(1)
53-
.min(1)
54-
.sliderRange(1, 50)
55-
.build()
56-
);
57-
private final Setting<Integer> attackDelay = sgGeneral.add(new IntSetting.Builder()
58-
.name("attack-delay")
59-
.defaultValue(1)
60-
.min(1)
61-
.sliderRange(1, 50)
62-
.build()
63-
);
64-
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
65-
.name("rotate")
66-
.description("Automatically rotates you towards the city block.")
67-
.build()
68-
);
69-
70-
private final Setting<Boolean> swing = sgGeneral.add(new BoolSetting.Builder()
71-
.name("swing-hand")
72-
.description("Whether to render your hand swinging.")
73-
.defaultValue(false)
74-
.build()
75-
);
26+
private final Setting<Double> targetRange = sgGeneral.add(new DoubleSetting.Builder().name("target-range").description("The radius in which players get targeted.").defaultValue(5.5).min(0).sliderMax(7).build());
27+
private final Setting<Integer> pistonDelay = sgGeneral.add(new IntSetting.Builder().name("piston-delay").defaultValue(1).min(1).sliderRange(1, 50).build());
28+
private final Setting<Integer> redstoneDelay = sgGeneral.add(new IntSetting.Builder().name("redstone-delay").defaultValue(1).min(1).sliderRange(1, 50).build());
29+
private final Setting<Integer> crystalDelay = sgGeneral.add(new IntSetting.Builder().name("crystal-delay").defaultValue(1).min(1).sliderRange(1, 50).build());
30+
private final Setting<Integer> attackDelay = sgGeneral.add(new IntSetting.Builder().name("attack-delay").defaultValue(1).min(1).sliderRange(1, 50).build());
31+
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder().name("rotate").description("Automatically rotates you towards the city block.").build());
32+
33+
private final Setting<Boolean> swing = sgGeneral.add(new BoolSetting.Builder().name("swing-hand").description("Whether to render your hand swinging.").defaultValue(false).build());
7634

7735
public PistonAura() {
7836
super(Main.RM, "piston-aura", "iced out");
@@ -82,6 +40,7 @@ public PistonAura() {
8240
int crystalTick, redstoneTick, pistonTick, attackTick;
8341
public Stage stage;
8442

43+
8544
@EventHandler
8645
public void onTick(TickEvent.Pre event) {
8746

@@ -100,11 +59,9 @@ public void onTick(TickEvent.Pre event) {
10059

10160
case Piston -> {
10261
if (pistonTick >= pistonDelay.get()) {
103-
BlockUtils.place(calculated.pistonPos, piston, true, 50);
62+
if (BlockUtils.place(calculated.pistonPos, piston, true, 50)) stage = Stage.Crystal;
10463
pistonTick = 0;
105-
stage = Stage.Crystal;
106-
} else
107-
pistonTick++;
64+
} else pistonTick++;
10865
}
10966
case Crystal -> {
11067

@@ -119,27 +76,27 @@ public void onTick(TickEvent.Pre event) {
11976
} else crystalTick++;
12077
}
12178
case Redstone -> {
122-
123-
boolean canAttack = false;
124-
12579
if (redstoneTick >= redstoneDelay.get()) {
126-
BlockUtils.place(calculated.redstonePos, redstoneBlock, true, 50);
127-
canAttack = true;
80+
if (BlockUtils.place(calculated.redstonePos, redstoneBlock, true, 50)) stage = Stage.Attack;
12881
redstoneTick = 0;
129-
} else redstoneTick++;
130-
82+
} else {
83+
redstoneTick++;
84+
}
85+
}
86+
case Attack -> {
13187
if (attackTick >= attackDelay.get()) {
132-
if (getCrystal(calculated.basePos) != null) {
133-
mc.interactionManager.attackEntity(mc.player, getCrystal(calculated.basePos));
88+
89+
/*i forogt it must be in the head pos?*/
90+
91+
if (Utils.getCrystal(mc.player.getBlockPos().up()) != null) {
92+
mc.interactionManager.attackEntity(mc.player, Utils.getCrystal(mc.player.getBlockPos().up()));
13493
}
94+
stage = null;
13595
attackTick = 0;
136-
stage = Stage.Piston;
137-
} else {
138-
if (canAttack) attackTick++; // logic genius 😰
139-
}
96+
} else attackTick++;
14097
}
98+
default -> stage = null;
14199
}
142-
143100
}
144101

145102

@@ -160,18 +117,12 @@ public void doCalcuate() {
160117

161118
BlockPos redstonePos = null;
162119

163-
for (Direction d : Direction.values()) {
120+
if (BlockUtils.canPlace(pistonPos.offset(direction))) {
121+
redstonePos = pistonPos.offset(direction);
164122

165-
if (!(d == Direction.DOWN || d == direction)) {
166-
continue;
167-
}
168-
169-
if (BlockUtils.canPlace(pistonPos.offset(d))) {
170-
redstonePos = pistonPos.offset(d);
171-
break;
172-
}
173123
}
174124

125+
175126
if (redstonePos == null) continue;
176127

177128
calculated = new CalculatedPos(pistonPos, offset, redstonePos);
@@ -183,9 +134,7 @@ public void doCalcuate() {
183134

184135

185136
public enum Stage {
186-
Piston,
187-
Crystal,
188-
Redstone
137+
Piston, Crystal, Redstone, Attack
189138
}
190139

191140
public record CalculatedPos(BlockPos pistonPos, BlockPos basePos, BlockPos redstonePos) {

src/main/java/random/meteor/utils/Utils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import net.minecraft.screen.ScreenHandler;
2323
import net.minecraft.screen.slot.SlotActionType;
2424
import net.minecraft.util.math.BlockPos;
25+
import net.minecraft.util.math.Direction;
2526
import net.minecraft.util.math.Vec3d;
2627

2728
import java.util.Arrays;
@@ -170,9 +171,12 @@ public static boolean canContinue(int timer, int delay) {
170171
public static Block state(BlockPos pos) {
171172
return mc.world.getBlockState(pos).getBlock();
172173
}
174+
173175
public static boolean equalsBlock(Block block, BlockPos... poses) {
174176
return Arrays.stream(poses).map(Utils::state).allMatch(currentBlock -> currentBlock.equals(block));
175177
}
178+
179+
176180
public static Entity crystal() {
177181
for (Entity e : mc.world.getEntities()) {
178182
if (e.getType().equals(EntityType.END_CRYSTAL)) return e;

0 commit comments

Comments
 (0)