Skip to content

Commit

Permalink
1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zgoly committed Feb 12, 2023
1 parent f643ba9 commit 7d4c8ee
Show file tree
Hide file tree
Showing 17 changed files with 284 additions and 51 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
org.gradle.jvmargs=-Xmx2G

# Fabric Properties (https://fabricmc.net/versions.html)
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.8
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.3
loader_version=0.14.9

# Mod Properties
mod_version=1.4
mod_version=1.4.1
maven_group=zgoly
archives_base_name=meteorist

# Meteor (https://maven.meteordev.org/)
meteor_version=0.5.1-SNAPSHOT
meteor_version=0.5.2-SNAPSHOT
19 changes: 10 additions & 9 deletions src/main/java/zgoly/meteorist/Meteorist.java
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
//By Zgoly
package zgoly.meteorist;

import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.systems.Systems;
import meteordevelopment.meteorclient.systems.commands.Commands;
import meteordevelopment.meteorclient.systems.hud.Hud;
import meteordevelopment.meteorclient.systems.hud.HudGroup;
import zgoly.meteorist.commands.Coordinates;
import zgoly.meteorist.commands.TargetNbt;
import zgoly.meteorist.hud.Presets;
import zgoly.meteorist.modules.*;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.systems.modules.Category;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.item.Items;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.invoke.MethodHandles;
import zgoly.meteorist.commands.Coordinates;
import zgoly.meteorist.commands.TargetNbt;
import zgoly.meteorist.hud.Presets;
import zgoly.meteorist.modules.*;

public class Meteorist extends MeteorAddon {
public static final Logger LOG = LoggerFactory.getLogger("Meteorist");
public static final Category CATEGORY = new Category("Meteorist", Items.DIRT.getDefaultStack());
public static final Category CATEGORY = new Category("Meteorist", Items.FIRE_CHARGE.getDefaultStack());
public static final HudGroup HUD_GROUP = new HudGroup("Meteorist");

@Override
Expand All @@ -35,18 +32,22 @@ public void onInitialize() {
Modules.get().add(new AutoLeave());
Modules.get().add(new AutoLogin());
Modules.get().add(new ContainerCleaner());
//Modules.get().add(new DmSpam());
Modules.get().add(new EntityUse());
Modules.get().add(new FastBridge());
Modules.get().add(new AutoLight());
Modules.get().add(new ItemSucker());
Modules.get().add(new JumpFlight());
Modules.get().add(new JumpJump());
Modules.get().add(new NewVelocity());
//Modules.get().add(new Placer());
Modules.get().add(new SlotClick());
Modules.get().add(new ZKillaura());

// Commands
Commands.get().add(new Coordinates());
Commands.get().add(new TargetNbt());

// Hud Presets
Presets.starscriptAdd();
Hud hud = Systems.get(Hud.class);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/zgoly/meteorist/commands/Coordinates.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("copy").executes(context -> CopyPos()));

builder.then(literal("share-in-chat").executes(context -> {
mc.player.sendChatMessage("Coordinates: " + getPos(), Text.of("Coordinates"));
mc.getNetworkHandler().sendChatMessage("Coordinates: " + getPos());
return SINGLE_SUCCESS;
}));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/zgoly/meteorist/modules/AutoFeed.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void onActivate() {
@EventHandler
private void onTick(TickEvent.Post event) {
if (timer >= delay.get() && mc.player.getHungerManager().getFoodLevel() <= hungerLevel.get()) {
mc.player.sendCommand(feedCommand.get().replace("/", ""));
mc.getNetworkHandler().sendChatCommand(feedCommand.get().replace("/", ""));
timer = 0;
} else timer ++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/zgoly/meteorist/modules/AutoFix.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void onTick(TickEvent.Post event) {
}
}
if (work) {
mc.player.sendCommand(fixCommand.get().replace("/", ""));
mc.getNetworkHandler().sendChatCommand(fixCommand.get().replace("/", ""));
timer = 0;
}
} else timer ++;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/zgoly/meteorist/modules/AutoHeal.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void onActivate() {
@EventHandler
private void onTick(TickEvent.Post event) {
if (timer >= delay.get() && mc.player.getHealth() <= healthLevel.get()) {
mc.player.sendCommand(healCommand.get().replace("/", ""));
mc.getNetworkHandler().sendChatCommand(healCommand.get().replace("/", ""));
timer = 0;
} else timer ++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/zgoly/meteorist/modules/AutoLeave.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void onTick(TickEvent.Post event) {
if (mode.get() == Mode.Logout) {
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(Text.of("[Auto Leave] Found player in radius.")));
} else if (mode.get() == Mode.Commands && !commands.get().isEmpty()) {
for (String command : commands.get()) mc.player.sendCommand(command.replace("/", ""));
for (String command : commands.get()) mc.getNetworkHandler().sendChatCommand(command.replace("/", ""));
}
work = !work;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/zgoly/meteorist/modules/AutoLight.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import zgoly.meteorist.Meteorist;

import java.util.Arrays;
import java.util.List;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/zgoly/meteorist/modules/AutoLogin.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void onTick(TickEvent.Post event) {
if (serverOnly.get() && mc.getServer() != null && mc.getServer().isSingleplayer()) return;
if (timer >= delay.get() && !loginCommand.get().isEmpty() && work) {
work = false;
mc.player.sendCommand(loginCommand.get().replace("/", ""));
mc.getNetworkHandler().sendChatCommand(loginCommand.get().replace("/", ""));
timer = 0;
} else timer ++;
}
Expand Down
134 changes: 134 additions & 0 deletions src/main/java/zgoly/meteorist/modules/DmSpam.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
TODO: fix & add to Meteorist
*/
package zgoly.meteorist.modules;

import meteordevelopment.meteorclient.events.game.GameLeftEvent;
import meteordevelopment.meteorclient.events.game.OpenScreenEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Categories;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.client.gui.screen.DisconnectedScreen;
import net.minecraft.text.Text;
import org.apache.commons.lang3.RandomStringUtils;

import java.util.List;

public class DmSpam extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();

private final Setting<String> command = sgGeneral.add(new StringSetting.Builder()
.name("messages")
.description("The command.")
.defaultValue("/msg ")
.build()
);

private final Setting<List<String>> messages = sgGeneral.add(new StringListSetting.Builder()
.name("messages")
.description("Messages to use for spam.")
.defaultValue(List.of("Hi!"))
.build()
);

private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder()
.name("delay")
.description("The delay between specified messages in ticks.")
.defaultValue(20)
.min(0)
.sliderMax(200)
.build()
);

private final Setting<Boolean> disableOnLeave = sgGeneral.add(new BoolSetting.Builder()
.name("disable-on-leave")
.description("Disables spam when you leave a server.")
.defaultValue(true)
.build()
);


private final Setting<Boolean> disableOnDisconnect = sgGeneral.add(new BoolSetting.Builder()
.name("disable-on-disconnect")
.description("Disables spam when you are disconnected from a server.")
.defaultValue(true)
.build()
);

private final Setting<Boolean> random = sgGeneral.add(new BoolSetting.Builder()
.name("randomise")
.description("Selects a random message from your spam message list.")
.defaultValue(false)
.build()
);

private final Setting<Boolean> bypass = sgGeneral.add(new BoolSetting.Builder()
.name("bypass")
.description("Add random text at the end of the message to try to bypass anti spams.")
.defaultValue(false)
.build()
);

private final Setting<Integer> length = sgGeneral.add(new IntSetting.Builder()
.name("length")
.description("Number of characters used to bypass anti spam.")
.visible(bypass::get)
.defaultValue(16)
.sliderRange(1, 256)
.build()
);

private int messageI, timer;

public DmSpam() {
super(Categories.Misc, "dm-spam", "Spams messages in players direct messages.");
}

@Override
public void onActivate() {
timer = delay.get();
messageI = 0;
}

@EventHandler
private void onScreenOpen(OpenScreenEvent event) {
if (disableOnDisconnect.get() && event.screen instanceof DisconnectedScreen) {
toggle();
}
}

@EventHandler
private void onGameLeft(GameLeftEvent event) {
if (disableOnLeave.get()) toggle();
}

@EventHandler
private void onTick(TickEvent.Post event) {
mc.player.sendMessage(Text.of(mc.world.getPlayers().toString()));
if (messages.get().isEmpty()) return;

if (timer <= 0) {
int i;
if (random.get()) {
i = Utils.random(0, messages.get().size());
}
else {
if (messageI >= messages.get().size()) messageI = 0;
i = messageI++;
}

String text = command.get() + messages.get().get(i);
if (bypass.get()) {
text += " " + RandomStringUtils.randomAlphabetic(length.get()).toLowerCase();
}
mc.getNetworkHandler().sendChatCommand(text);
timer = delay.get();
}
else {
timer--;
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/zgoly/meteorist/modules/EntityUse.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class EntityUse extends Module {

private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
.name("rotate")
.description("Sends rotation packets to the server when mining.")
.description("Sends rotation packets to the server when clicking on entity.")
.defaultValue(true)
.build()
);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/zgoly/meteorist/modules/ItemSucker.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public ItemSucker() {
super(Meteorist.CATEGORY, "item-sucker", "Sucks up all items on the ground.");
}

//clear pos
@Override
public void onActivate() {pos = null;}
@EventHandler
Expand Down Expand Up @@ -98,5 +97,4 @@ private void onTick(TickEvent.Pre event) {
}
}
}
//Вижу цель — иду в атаку, хруст костей, как тако, а
}
1 change: 0 additions & 1 deletion src/main/java/zgoly/meteorist/modules/JumpFlight.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ private void onKey(KeyEvent event) {
@EventHandler
private void onMouseScroll(MouseScrollEvent event) {
if (scrollBool.get()) speed.set(speed.get() + event.value * scrollSens.get());
//Voice в моих ушах — я позабыл все дни недели
}

@EventHandler
Expand Down
89 changes: 89 additions & 0 deletions src/main/java/zgoly/meteorist/modules/Placer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
//By Zgoly

package zgoly.meteorist.modules;

import meteordevelopment.meteorclient.gui.GuiTheme;
import meteordevelopment.meteorclient.gui.screens.settings.BlockSettingScreen;
import meteordevelopment.meteorclient.gui.widgets.WItem;
import meteordevelopment.meteorclient.gui.widgets.WWidget;
import meteordevelopment.meteorclient.gui.widgets.containers.WSection;
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
import meteordevelopment.meteorclient.gui.widgets.containers.WVerticalList;
import meteordevelopment.meteorclient.gui.widgets.input.WIntEdit;
import meteordevelopment.meteorclient.gui.widgets.pressable.WButton;
import meteordevelopment.meteorclient.gui.widgets.pressable.WMinus;
import meteordevelopment.meteorclient.gui.widgets.pressable.WPlus;
import meteordevelopment.meteorclient.settings.BlockSetting;
import meteordevelopment.meteorclient.settings.IntSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Module;
import net.minecraft.block.Blocks;
import net.minecraft.item.Items;
import zgoly.meteorist.Meteorist;

import java.util.ArrayList;
import java.util.List;

public class Placer extends Module {
List<Object> list = new ArrayList<>();
private final SettingGroup sgGeneral = settings.getDefaultGroup();


private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder()
.name("delay")
.description("Delay after sending a command in ticks (20 ticks = 1 sec).")
.defaultValue(20)
.range(1, 1200)
.sliderRange(1, 40)
.build()
);

// It would be nice to get help for saving / loading because I don't know how to do it; other things should be easier
/*
TODO: add auto save / load for table using `NbtCompound toTag()` and `Module fromTag(NbtCompound tag)`
- add functionality
- add placing holograms, when player rotated in right direction, placing holograms should also rotate
*/

public void createRow(GuiTheme theme, WTable table) {
int min = -128;
int max = 128;
WIntEdit x1 = table.add(theme.intEdit(0, min, max, true)).expandX().widget();
WIntEdit y1 = table.add(theme.intEdit(0, min, max, true)).expandX().widget();
WIntEdit z1 = table.add(theme.intEdit(0, min, max, true)).expandX().widget();
WIntEdit x2 = table.add(theme.intEdit(0, min, max, true)).expandX().widget();
WIntEdit y2 = table.add(theme.intEdit(0, min, max, true)).expandX().widget();
WIntEdit z2 = table.add(theme.intEdit(0, min, max, true)).expandX().widget();
WItem item = table.add(theme.item(Items.AIR.getDefaultStack())).expandX().widget();
WButton blockSelect = table.add(theme.button("Select Block")).expandX().widget();
blockSelect.action = () -> mc.setScreen(new BlockSettingScreen(theme, new BlockSetting(
"", "", Blocks.AIR, block -> item.set(block.asItem().getDefaultStack()), null, null, null
)));
WButton sideColor = table.add(theme.button("Side Color")).expandX().widget();
WButton lineColor = table.add(theme.button("Line Color")).expandX().widget();
WMinus minus = table.add(theme.minus()).widget();
minus.action = () -> {
if (!table.getRow(1).isEmpty()) {
table.removeRow(1);
}
};
table.row();
}

@Override
public WWidget getWidget(GuiTheme theme) {
WVerticalList list = theme.verticalList();
WSection blocksSection = list.add(theme.section("Blocks")).expandX().widget();
WTable table = blocksSection.add(theme.table()).expandX().widget();
WPlus plus = table.add(theme.plus()).centerX().widget();
plus.action = () -> createRow(theme, table);
table.row();
return list;
}


public Placer() {
super(Meteorist.CATEGORY, "placer", "Places blocks in range.");
}
}
Loading

0 comments on commit 7d4c8ee

Please sign in to comment.