Add FoV options to KA and imassist (#214)
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
package anticope.rejects.mixin;
|
||||
|
||||
import net.minecraft.client.model.ModelPart;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.block.entity.ChestBlockEntityRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import anticope.rejects.modules.Rendering;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
|
||||
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(ChestBlockEntityRenderer.class)
|
||||
public class ChestBlockEntityRendererMixin {
|
||||
@Shadow private boolean christmas;
|
||||
|
||||
@Inject(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/client/model/ModelPart;Lnet/minecraft/client/model/ModelPart;Lnet/minecraft/client/model/ModelPart;FII)V", at = @At("HEAD"), cancellable = true)
|
||||
public void render1(MatrixStack matrices, VertexConsumer vertices, ModelPart lid, ModelPart latch, ModelPart base, float openFactor, int light, int overlay, CallbackInfo ci) {
|
||||
Rendering rendering = Modules.get().get(Rendering.class);
|
||||
if (rendering != null)
|
||||
this.christmas = rendering.chistmas();
|
||||
}
|
||||
|
||||
@Inject(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/client/model/ModelPart;Lnet/minecraft/client/model/ModelPart;Lnet/minecraft/client/model/ModelPart;FII)V", at = @At("RETURN"))
|
||||
public void render2(MatrixStack matrices, VertexConsumer vertices, ModelPart lid, ModelPart latch, ModelPart base, float openFactor, int light, int overlay, CallbackInfo ci) {
|
||||
Rendering rendering = Modules.get().get(Rendering.class);
|
||||
if (rendering != null)
|
||||
this.christmas = rendering.chistmas();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package anticope.rejects.mixin;
|
||||
|
||||
import anticope.rejects.modules.Rendering;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
import net.minecraft.client.render.TexturedRenderLayers;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(TexturedRenderLayers.class)
|
||||
public class TexturedRenderLayersMixin {
|
||||
@ModifyVariable(method = "getChestTexture(Lnet/minecraft/block/entity/BlockEntity;Lnet/minecraft/block/enums/ChestType;Z)Lnet/minecraft/client/util/SpriteIdentifier;", at = @At("LOAD"), name = "christmas")
|
||||
private static boolean chrsitmas(boolean christmas) {
|
||||
Rendering rendering = Modules.get().get(Rendering.class);
|
||||
if (rendering != null && rendering.chistmas())
|
||||
return true;
|
||||
return christmas;
|
||||
}
|
||||
}
|
||||
@@ -12,13 +12,13 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Module.class)
|
||||
@Mixin(value = Module.class, remap = false)
|
||||
public class ModuleMixin {
|
||||
@Mutable @Shadow(remap = false) public String name;
|
||||
@Mutable @Shadow public String name;
|
||||
|
||||
@Mutable @Shadow(remap = false) public String title;
|
||||
@Mutable @Shadow public String title;
|
||||
|
||||
@Inject(method = "<init>", at = @At("TAIL"), remap = false)
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void onInit(Category category, String name, String description, CallbackInfo info) {
|
||||
if (RejectsConfig.get().duplicateModuleNames) {
|
||||
this.name = RejectsUtils.getModuleName(name);
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package anticope.rejects.mixin.meteor.modules;
|
||||
|
||||
import anticope.rejects.utils.RejectsUtils;
|
||||
import meteordevelopment.meteorclient.settings.DoubleSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.combat.AimAssist;
|
||||
import net.minecraft.entity.Entity;
|
||||
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.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(value = AimAssist.class, remap = false)
|
||||
public class AimAssistMixin {
|
||||
@Shadow @Final private SettingGroup sgGeneral;
|
||||
|
||||
private Setting<Double> fov;
|
||||
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void onInit(CallbackInfo info) {
|
||||
fov = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("fov")
|
||||
.description("Will only aim entities in the fov.")
|
||||
.defaultValue(360)
|
||||
.min(0)
|
||||
.max(360)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
@Inject(method = "lambda$onTick$1", at = @At(value = "RETURN", ordinal = 5), cancellable = true)
|
||||
private void onCheckEntity(Entity entity, CallbackInfoReturnable<Boolean> info) {
|
||||
info.setReturnValue(RejectsUtils.inFov(entity, fov.get()));
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
public abstract class InventoryTweaksMixin implements IInventoryTweaks {
|
||||
private Runnable callback;
|
||||
|
||||
@Inject(method = "lambda$steal$3", at = @At("RETURN"))
|
||||
@Inject(method = "lambda$steal$4", at = @At("RETURN"))
|
||||
private void afterSteal(ScreenHandler handler, CallbackInfo info) {
|
||||
if (callback != null) {
|
||||
callback.run();
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package anticope.rejects.mixin.meteor.modules;
|
||||
|
||||
import anticope.rejects.utils.RejectsUtils;
|
||||
import meteordevelopment.meteorclient.settings.DoubleSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.combat.KillAura;
|
||||
import net.minecraft.entity.Entity;
|
||||
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.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(value = KillAura.class, remap = false)
|
||||
public class KillAuraMixin {
|
||||
@Shadow
|
||||
@Final
|
||||
private SettingGroup sgGeneral;
|
||||
|
||||
private Setting<Double> fov;
|
||||
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void onInit(CallbackInfo info) {
|
||||
fov = sgGeneral.add(new DoubleSetting.Builder()
|
||||
.name("fov")
|
||||
.description("Will only aim entities in the fov.")
|
||||
.defaultValue(360)
|
||||
.min(0)
|
||||
.max(360)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
@Inject(method = "entityCheck", at = @At(value = "RETURN", ordinal = 14), cancellable = true)
|
||||
private void onReturn(Entity entity, CallbackInfoReturnable<Boolean> info) {
|
||||
info.setReturnValue(info.getReturnValueZ() && RejectsUtils.inFov(entity, fov.get()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user