fix 1.18.2 (fixes #109)
This commit is contained in:
@@ -89,7 +89,6 @@
|
|||||||
|
|
||||||
## HUD
|
## HUD
|
||||||
- Baritone process HUD
|
- Baritone process HUD
|
||||||
- CPS HUD (Ported from [AuroraKeystrokes](https://github.com/LambdAurora/AuroraKeystrokes/tree/1.16/src/main/java/me/lambdaurora/keystrokes))
|
|
||||||
|
|
||||||
## Config
|
## Config
|
||||||
- `Http Allowed` - modify what http requests can be made with Meteor's http api
|
- `Http Allowed` - modify what http requests can be made with Meteor's http api
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ import meteordevelopment.meteorclient.systems.hud.HUD;
|
|||||||
import meteordevelopment.meteorclient.systems.modules.Category;
|
import meteordevelopment.meteorclient.systems.modules.Category;
|
||||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||||
import net.minecraft.item.Items;
|
import net.minecraft.item.Items;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.slf4j.Logger;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.lang.invoke.MethodHandles;
|
import java.lang.invoke.MethodHandles;
|
||||||
|
|
||||||
public class MeteorRejectsAddon extends MeteorAddon {
|
public class MeteorRejectsAddon extends MeteorAddon {
|
||||||
public static final Logger LOG = LogManager.getLogger();
|
public static final Logger LOG = LoggerFactory.getLogger("Rejects");
|
||||||
public static final Category CATEGORY = new Category("Rejects", Items.BARRIER.getDefaultStack());
|
public static final Category CATEGORY = new Category("Rejects", Items.BARRIER.getDefaultStack());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -93,7 +93,6 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
|||||||
// HUD
|
// HUD
|
||||||
HUD hud = Systems.get(HUD.class);
|
HUD hud = Systems.get(HUD.class);
|
||||||
hud.elements.add(new BaritoneHud(hud));
|
hud.elements.add(new BaritoneHud(hud));
|
||||||
hud.elements.add(new CpsHud(hud));
|
|
||||||
|
|
||||||
// Themes
|
// Themes
|
||||||
GuiThemes.add(new MeteorRoundedGuiTheme());
|
GuiThemes.add(new MeteorRoundedGuiTheme());
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
package anticope.rejects.gui.hud;
|
|
||||||
|
|
||||||
import anticope.rejects.utils.RejectsUtils;
|
|
||||||
import meteordevelopment.meteorclient.systems.hud.HUD;
|
|
||||||
import meteordevelopment.meteorclient.systems.hud.modules.DoubleTextHudElement;
|
|
||||||
|
|
||||||
public class CpsHud extends DoubleTextHudElement {
|
|
||||||
public CpsHud(HUD hud) {
|
|
||||||
super(hud, "cps", "Displays your CPS.", "CPS: ", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getRight() {
|
|
||||||
return Integer.toString(RejectsUtils.CPS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package anticope.rejects.mixin;
|
|
||||||
|
|
||||||
import anticope.rejects.utils.RejectsUtils;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Injects the CPS counter.
|
|
||||||
*/
|
|
||||||
@Mixin(MinecraftClient.class)
|
|
||||||
public class MinecraftClientMixin
|
|
||||||
{
|
|
||||||
@Inject(method = "handleInputEvents", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;doAttack()V"))
|
|
||||||
private void onAttack(CallbackInfo ci)
|
|
||||||
{
|
|
||||||
RejectsUtils.CPS++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -31,7 +31,7 @@ public class CommandsMixin {
|
|||||||
|
|
||||||
@Shadow(remap = false)
|
@Shadow(remap = false)
|
||||||
@Final
|
@Final
|
||||||
private CommandDispatcher<CommandSource> DISPATCHER = new CommandDispatcher<>();
|
private CommandDispatcher<CommandSource> DISPATCHER;
|
||||||
|
|
||||||
@Inject(method = "add", at=@At("HEAD"), remap = false, cancellable = true)
|
@Inject(method = "add", at=@At("HEAD"), remap = false, cancellable = true)
|
||||||
private void onAdd(Command cmd, CallbackInfo ci) {
|
private void onAdd(Command cmd, CallbackInfo ci) {
|
||||||
|
|||||||
@@ -3,30 +3,11 @@ package anticope.rejects.utils;
|
|||||||
import anticope.rejects.utils.seeds.Seeds;
|
import anticope.rejects.utils.seeds.Seeds;
|
||||||
import meteordevelopment.meteorclient.MeteorClient;
|
import meteordevelopment.meteorclient.MeteorClient;
|
||||||
|
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
|
|
||||||
public class RejectsUtils {
|
public class RejectsUtils {
|
||||||
public static int CPS = 0;
|
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||||
RejectsConfig.get().save(MeteorClient.FOLDER);
|
RejectsConfig.get().save(MeteorClient.FOLDER);
|
||||||
Seeds.get().save(MeteorClient.FOLDER);
|
Seeds.get().save(MeteorClient.FOLDER);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
new Timer().scheduleAtFixedRate(newTimerTaskFromLambda(() -> CPS = 0), 0, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TimerTask newTimerTaskFromLambda(Runnable runnable)
|
|
||||||
{
|
|
||||||
return new TimerTask()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
runnable.run();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
"EntityAccessor",
|
"EntityAccessor",
|
||||||
"GameRendererMixin",
|
"GameRendererMixin",
|
||||||
"LivingEntityRendererMixin",
|
"LivingEntityRendererMixin",
|
||||||
"MinecraftClientMixin",
|
|
||||||
"StructureVoidBlockMixin",
|
"StructureVoidBlockMixin",
|
||||||
"ToastManagerMixin",
|
"ToastManagerMixin",
|
||||||
"TitleScreenMixin",
|
"TitleScreenMixin",
|
||||||
|
|||||||
Reference in New Issue
Block a user