10
build.gradle
10
build.gradle
@@ -29,7 +29,7 @@ dependencies {
|
||||
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
|
||||
modImplementation("meteordevelopment:meteor-client:SNAPSHOT")
|
||||
modImplementation("meteordevelopment:meteor-client:${project.meteor_version}-SNAPSHOT")
|
||||
|
||||
// seed .locate and ore sim
|
||||
extraLibs('com.seedfinding:mc_math:0eb505174da8a92550f8ec6efe254e0fa936cc0d') { transitive = false }
|
||||
@@ -50,11 +50,11 @@ dependencies {
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version
|
||||
|
||||
filter { line -> line.replace("@mc_version@", project.minecraft_version) }
|
||||
filter { line -> line.replace("@gh_hash@", System.getenv("GITHUB_SHA") ?: "") }
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version,
|
||||
"mc_version": project.minecraft_version,
|
||||
"gh_hash": (System.getenv("GITHUB_SHA") ?: "")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,3 +10,5 @@ loader_version=0.14.7
|
||||
mod_version = 0.2
|
||||
maven_group = anticope.rejects
|
||||
archives_base_name = meteor-rejects-addon
|
||||
|
||||
meteor_version=0.5.0
|
||||
@@ -5,11 +5,8 @@ import anticope.rejects.gui.hud.*;
|
||||
import anticope.rejects.gui.themes.rounded.MeteorRoundedGuiTheme;
|
||||
import anticope.rejects.modules.*;
|
||||
import anticope.rejects.modules.modifier.NoRenderModifier;
|
||||
import anticope.rejects.utils.GiveUtils;
|
||||
import anticope.rejects.utils.RejectsUtils;
|
||||
import meteordevelopment.meteorclient.addons.GithubRepo;
|
||||
import meteordevelopment.meteorclient.addons.MeteorAddon;
|
||||
import meteordevelopment.meteorclient.MeteorClient;
|
||||
import meteordevelopment.meteorclient.gui.GuiThemes;
|
||||
import meteordevelopment.meteorclient.systems.Systems;
|
||||
import meteordevelopment.meteorclient.systems.commands.Commands;
|
||||
@@ -20,11 +17,10 @@ import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
import net.minecraft.item.Items;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
public class MeteorRejectsAddon extends MeteorAddon {
|
||||
public static final Logger LOG = LoggerFactory.getLogger("Rejects");
|
||||
public static final Category CATEGORY = new Category("Rejects", Items.BARRIER.getDefaultStack());
|
||||
@@ -34,11 +30,6 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
||||
public void onInitialize() {
|
||||
LOG.info("Initializing Meteor Rejects Addon");
|
||||
|
||||
MeteorClient.EVENT_BUS.registerLambdaFactory("anticope.rejects", (lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup()));
|
||||
|
||||
RejectsUtils.init();
|
||||
GiveUtils.init();
|
||||
|
||||
// Modules
|
||||
Modules modules = Modules.get();
|
||||
modules.add(new AntiBot());
|
||||
@@ -126,7 +117,11 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
||||
.get().getMetadata()
|
||||
.getCustomValue("github:sha")
|
||||
.getAsString();
|
||||
LOG.info(String.format("Rejects version: %s", commit.toString()));
|
||||
return commit.isEmpty() ? null : commit.trim();
|
||||
|
||||
}
|
||||
|
||||
public String getPackage() {
|
||||
return "anticope.rejects";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ public class MeteorRoundedGuiTheme extends GuiTheme {
|
||||
public final Setting<SettingColor> textHighlightColor = color(sgTextColors, "text-highlight", "Color of text highlighting.", new SettingColor(45, 125, 245, 100));
|
||||
public final Setting<SettingColor> titleTextColor = color(sgTextColors, "title-text", "Color of title text.", new SettingColor(255, 255, 255));
|
||||
public final Setting<SettingColor> loggedInColor = color(sgTextColors, "logged-in-text", "Color of logged in account name.", new SettingColor(45, 225, 45));
|
||||
public final Setting<SettingColor> placeholderColor = color(sgTextColors, "placeholder", "Color of placeholder text.", new SettingColor(255, 255, 255, 20));
|
||||
|
||||
// Background
|
||||
|
||||
@@ -236,8 +237,8 @@ public class MeteorRoundedGuiTheme extends GuiTheme {
|
||||
}
|
||||
|
||||
@Override
|
||||
public WTextBox textBox(String text, CharFilter filter, Class<? extends WTextBox.Renderer> renderer) {
|
||||
return w(new WMeteorTextBox(text, filter, renderer));
|
||||
public WTextBox textBox(String text, String placeholder, CharFilter filter, Class<? extends WTextBox.Renderer> renderer) {
|
||||
return w(new WMeteorTextBox(text, placeholder, filter, renderer));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,8 +23,8 @@ public class WMeteorTextBox extends WTextBox implements MeteorWidget {
|
||||
|
||||
private double animProgress;
|
||||
|
||||
public WMeteorTextBox(String text, CharFilter filter, Class<? extends Renderer> renderer) {
|
||||
super(text, filter, renderer);
|
||||
public WMeteorTextBox(String text, String placeholder, CharFilter filter, Class<? extends Renderer> renderer) {
|
||||
super(text, placeholder, filter, renderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,6 +54,9 @@ public class WMeteorTextBox extends WTextBox implements MeteorWidget {
|
||||
if (!text.isEmpty()) {
|
||||
renderer.text(text, x + pad - overflowWidth, y + pad, theme.textColor.get(), false);
|
||||
}
|
||||
else if (placeholder != null) {
|
||||
this.renderer.render(renderer, x + pad - overflowWidth, y + pad, placeholder, theme.placeholderColor.get());
|
||||
}
|
||||
|
||||
// Text highlighting
|
||||
if (focused && (cursor != selectionStart || cursor != selectionEnd)) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class GiveUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
static {
|
||||
STRING_PRESETS.forEach((preset) -> {
|
||||
PRESETS.put(preset.getLeft(), (preview) -> {
|
||||
if (preview) preset.getMiddle().getDefaultStack();
|
||||
|
||||
@@ -2,10 +2,13 @@ package anticope.rejects.utils;
|
||||
|
||||
import anticope.rejects.utils.seeds.Seeds;
|
||||
import meteordevelopment.meteorclient.MeteorClient;
|
||||
|
||||
import meteordevelopment.meteorclient.utils.PostInit;
|
||||
public class RejectsUtils {
|
||||
|
||||
@PostInit
|
||||
public static void init() {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
System.out.println("saving seeds...");
|
||||
RejectsConfig.get().save(MeteorClient.FOLDER);
|
||||
Seeds.get().save(MeteorClient.FOLDER);
|
||||
}));
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
],
|
||||
"custom": {
|
||||
"meteor-client:color": "227,0,0",
|
||||
"github:sha": "@gh_hash@"
|
||||
"github:sha": "${gh_hash}"
|
||||
},
|
||||
"depends": {
|
||||
"java": ">=16",
|
||||
"minecraft": ">=@mc_version@",
|
||||
"minecraft": "~${mc_version}",
|
||||
"meteor-client": "*"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user