Renamed directory to anticope

This commit is contained in:
stormybytes
2021-10-24 09:50:26 +07:00
parent f9753eba09
commit d8c1ad1881
110 changed files with 233 additions and 243 deletions

View File

@@ -0,0 +1,17 @@
package anticope.rejects.mixin;
import anticope.rejects.modules.modifier.NoRenderModifier;
import net.minecraft.client.gui.screen.CommandSuggestor;
import net.minecraft.client.util.math.MatrixStack;
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;
@Mixin(CommandSuggestor.class)
public class CommandSuggestorMixin {
@Inject(method = "render", at = @At(value = "HEAD"), cancellable = true)
public void onRenderCommandSuggestion(MatrixStack matrices, int mouseX, int mouseY, CallbackInfo info) {
if (NoRenderModifier.noCommandSuggestions()) info.cancel();
}
}

View File

@@ -0,0 +1,28 @@
package anticope.rejects.mixin;
import anticope.rejects.events.CustomPayloadEvent;
import meteordevelopment.meteorclient.MeteorClient;
import net.minecraft.network.listener.ClientPlayPacketListener;
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(CustomPayloadS2CPacket.class)
public class CustomPayloadS2CPacketMixin {
@Shadow
private Identifier channel;
@Inject(method = "apply(Lnet/minecraft/network/listener/ClientPlayPacketListener;)V",
at = @At(value = "HEAD"), cancellable = true)
private void onApply(ClientPlayPacketListener clientPlayPacketListener, CallbackInfo info) {
CustomPayloadS2CPacket packet = (CustomPayloadS2CPacket) (Object) this;
CustomPayloadEvent event = MeteorClient.EVENT_BUS.post(CustomPayloadEvent.get(packet));
if (event.isCancelled()) {
info.cancel();
}
}
}

View File

@@ -0,0 +1,19 @@
package anticope.rejects.mixin;
import anticope.rejects.modules.Rendering;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.client.render.entity.feature.Deadmau5FeatureRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Deadmau5FeatureRenderer.class)
public class Deadmau5FeatureRendererMixin {
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Ljava/lang/String;equals(Ljava/lang/Object;)Z"))
private boolean redirectAllow(String s, Object name){
if (Modules.get().get(Rendering.class).deadmau5EarsEnabled()) {
return true; //Allow it always
}
return name.equals(s);
}
}

View File

@@ -0,0 +1,12 @@
package anticope.rejects.mixin;
import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(Entity.class)
public interface EntityAccessor {
@Invoker("setFlag")
void invokeSetFlag(int index, boolean value);
}

View File

@@ -0,0 +1,30 @@
package anticope.rejects.mixin;
import anticope.rejects.modules.Rendering;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.ShaderEffect;
import net.minecraft.client.render.GameRenderer;
import meteordevelopment.meteorclient.systems.modules.Modules;
@Mixin(GameRenderer.class)
public class GameRendererMixin {
@Shadow @Final private MinecraftClient client;
@Redirect(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/render/GameRenderer;shader:Lnet/minecraft/client/gl/ShaderEffect;", ordinal = 0))
private ShaderEffect renderShader(GameRenderer renderer, float tickDelta) {
ShaderEffect shader = Modules.get().get(Rendering.class).getShaderEffect();
if (shader != null) {
shader.setupDimensions(client.getWindow().getFramebufferWidth(), client.getWindow().getFramebufferHeight());
shader.render(tickDelta);
}
return null;
}
}

View File

@@ -0,0 +1,29 @@
package anticope.rejects.mixin;
import anticope.rejects.modules.Rendering;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.entity.LivingEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.Vec3f;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
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;
@Environment(EnvType.CLIENT)
@Mixin(LivingEntityRenderer.class)
public class LivingEntityRendererMixin {
@Inject(method = "setupTransforms", at = @At(value = "TAIL"))
private void dinnerboneEntities(LivingEntity entity, MatrixStack matrices, float _animationProgress, float _bodyYaw, float _tickDelta, CallbackInfo _info) {
if ((!(entity instanceof PlayerEntity)) && Modules.get().get(Rendering.class).dinnerboneEnabled()) {
matrices.translate(0.0D, entity.getHeight() + 0.1F, 0.0D);
matrices.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(180.0F));
}
}
}

View File

@@ -0,0 +1,22 @@
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++;
}
}

View File

@@ -0,0 +1,34 @@
package anticope.rejects.mixin;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.StructureVoidBlock;
import net.minecraft.util.math.Direction;
import meteordevelopment.meteorclient.systems.modules.Modules;
import anticope.rejects.modules.Rendering;
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.CallbackInfoReturnable;
@Mixin(StructureVoidBlock.class)
public abstract class StructureVoidBlockMixin extends Block {
public StructureVoidBlockMixin(Settings settings) {
super(settings);
}
@Inject(at = @At("HEAD"), method = "getRenderType", cancellable = true)
public void getRenderType(BlockState state, CallbackInfoReturnable<BlockRenderType> info) {
info.setReturnValue(BlockRenderType.MODEL);
}
@Override
public boolean isSideInvisible(BlockState state, BlockState neighbor, Direction facing) {
return !(Modules.get().get(Rendering.class).renderStructureVoid());
}
}

View File

@@ -0,0 +1,20 @@
package anticope.rejects.mixin;
import anticope.rejects.modules.Rendering;
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;
import net.minecraft.client.toast.Toast;
import net.minecraft.client.toast.ToastManager;
import meteordevelopment.meteorclient.systems.modules.Modules;
@Mixin(ToastManager.class)
public class ToastManagerMixin {
@Inject(method="add", at = @At("HEAD"), cancellable = true)
public void preventAdd(Toast toast, CallbackInfo ci) {
if (Modules.get().get(Rendering.class).disableToasts()) ci.cancel();
}
}

View File

@@ -0,0 +1,49 @@
package anticope.rejects.mixin.meteor;
import anticope.rejects.commands.LocateCommand;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.systems.commands.Commands;
import com.mojang.brigadier.CommandDispatcher;
import net.minecraft.command.CommandSource;
import java.util.List;
import java.util.Map;
@Mixin(Commands.class)
public class CommandsMixin {
@Shadow
@Final
private List<Command> commands;
@Shadow
@Final
private Map<Class<? extends Command>, Command> commandInstances;
@Shadow
@Final
private CommandDispatcher<CommandSource> DISPATCHER = new CommandDispatcher<>();
@Inject(method = "add", at=@At("HEAD"), remap = false, cancellable = true)
private void onAdd(Command cmd, CallbackInfo ci) {
if (cmd instanceof meteordevelopment.meteorclient.systems.commands.commands.LocateCommand) {
Command command = new LocateCommand();
commands.removeIf(command1 -> command1.getName().equals(command.getName()));
commandInstances.values().removeIf(command1 -> command1.getName().equals(command.getName()));
command.registerTo(DISPATCHER);
commands.add(command);
commandInstances.put(command.getClass(), command);
ci.cancel();
}
}
}

View File

@@ -0,0 +1,46 @@
package anticope.rejects.mixin.meteor;
import anticope.rejects.utils.RejectsConfig;
import meteordevelopment.meteorclient.gui.tabs.builtin.ConfigTab;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module;
import java.util.Arrays;
import java.util.List;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ConfigTab.class)
public class ConfigTabMixin {
@Shadow
@Final
private static Settings settings;
private static final SettingGroup sgRejects = settings.createGroup("Rejects");
private static final Setting<RejectsConfig.HttpAllowed> httpAllowed = sgRejects.add(new EnumSetting.Builder<RejectsConfig.HttpAllowed>()
.name("http-allowed")
.description("Changes what api endpoints can be reached.")
.defaultValue(RejectsConfig.get().httpAllowed)
.onChanged(v -> RejectsConfig.get().httpAllowed = v)
.build()
);
private final Setting<List<Module>> hiddenModules = sgRejects.add(new ModuleListSetting.Builder()
.name("hidden-modules")
.description("Which modules to hide.")
.defaultValue(Arrays.asList())
.defaultValue(RejectsConfig.get().getHiddenModules())
.onChanged(v -> RejectsConfig.get().setHiddenModules(v))
.build()
);
// No idea why CallbackInfoReturnable, but fabric crashes otherwise lol
@Inject(method = "createScreen", at=@At("HEAD"), remap = false)
private void onCreateScreen(CallbackInfoReturnable<?> cir) {
hiddenModules.set(RejectsConfig.get().getHiddenModules());
}
}

View File

@@ -0,0 +1,12 @@
package anticope.rejects.mixin.meteor;
import meteordevelopment.meteorclient.gui.renderer.GuiRenderer;
import meteordevelopment.meteorclient.renderer.Renderer2D;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(GuiRenderer.class)
public interface GuiRendererAccessor {
@Accessor("r")
Renderer2D getRenderer2D();
}

View File

@@ -0,0 +1,27 @@
package anticope.rejects.mixin.meteor;
import anticope.rejects.utils.RejectsConfig;
import meteordevelopment.meteorclient.utils.network.Http;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.*;
@Mixin(Http.class)
public class HttpMixin {
@ModifyArg(method="get", at= @At(value = "INVOKE", target = "Lmeteordevelopment/meteorclient/utils/network/Http$Request;<init>(Lmeteordevelopment/meteorclient/utils/network/Http$Method;Ljava/lang/String;)V"), remap = false)
private static String onGet(String url) {
if (RejectsConfig.get().httpAllowed == RejectsConfig.HttpAllowed.Nothing) return "http://0.0.0.0";
else if (RejectsConfig.get().httpAllowed == RejectsConfig.HttpAllowed.NotMeteorApi && url.startsWith("https://meteorclient.com/api")) return "http://0.0.0.0";
else if (RejectsConfig.get().httpAllowed == RejectsConfig.HttpAllowed.NotMeteorPing && url.startsWith("https://meteorclient.com/api/online")) return "http://0.0.0.0";
return url;
}
@ModifyArg(method="post", at= @At(value = "INVOKE", target = "Lmeteordevelopment/meteorclient/utils/network/Http$Request;<init>(Lmeteordevelopment/meteorclient/utils/network/Http$Method;Ljava/lang/String;)V"), remap = false)
private static String onPost(String url) {
if (RejectsConfig.get().httpAllowed == RejectsConfig.HttpAllowed.Nothing) return "http://0.0.0.0";
else if (RejectsConfig.get().httpAllowed == RejectsConfig.HttpAllowed.NotMeteorApi && url.startsWith("https://meteorclient.com/api")) return "http://0.0.0.0";
else if (RejectsConfig.get().httpAllowed == RejectsConfig.HttpAllowed.NotMeteorPing && url.startsWith("https://meteorclient.com/api/online")) return "http://0.0.0.0";
return url;
}
}

View File

@@ -0,0 +1,36 @@
package anticope.rejects.mixin.meteor;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import anticope.rejects.utils.RejectsConfig;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import meteordevelopment.meteorclient.systems.modules.Category;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.systems.modules.Modules;
@Mixin(Modules.class)
public class ModulesMixin {
@Shadow
@Final
private Map<Category, List<Module>> groups;
@Inject(method = "getGroup", at=@At("HEAD"), cancellable = true, remap = false)
private void onGetGroup(Category category, CallbackInfoReturnable<List<Module>> cir) {
Set<String> hiddenModules = RejectsConfig.get().hiddenModules;
if (hiddenModules.isEmpty()) return;
List<Module> foundModules = groups.computeIfAbsent(category, category1 -> new ArrayList<>());
foundModules.removeIf(m -> hiddenModules.contains(m.name));
cir.setReturnValue(foundModules);
}
}

View File

@@ -0,0 +1,48 @@
package anticope.rejects.mixin.meteor.modules;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.util.math.Vec3d;
import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.movement.Flight;
import static meteordevelopment.meteorclient.utils.Utils.mc;
@Mixin(Flight.class)
public class FlightMixin {
@Shadow
@Final
private SettingGroup sgGeneral;
private Setting<Boolean> stopMomentum = null;
@Inject(method = "<init>", at=@At("TAIL"), remap = false)
private void onInit(CallbackInfo ci) {
stopMomentum = sgGeneral.add(new BoolSetting.Builder()
.name("stop-momentum")
.description("Stops momentum on flight disable")
.defaultValue(false)
.build()
);
}
@Inject(method = "onDeactivate", at=@At("TAIL"), remap = false)
private void onDeactivate(CallbackInfo ci) {
if (mc.player == null || stopMomentum == null || !stopMomentum.get()) return;
mc.options.keyForward.setPressed(false);
mc.options.keyLeft.setPressed(false);
mc.options.keyBack.setPressed(false);
mc.options.keyRight.setPressed(false);
mc.player.setVelocity(Vec3d.ZERO);
}
}

View File

@@ -0,0 +1,12 @@
package anticope.rejects.mixin.meteor.modules;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(NoRender.class)
public interface NoRenderAccessor {
@Accessor("sgOverlay")
SettingGroup getSgOverlay();
}