Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
* Copyright (c) Meteor Development.
*/

package meteordevelopment.meteorclient.mixin;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.ESP;
import net.minecraft.client.render.entity.ArmorStandEntityRenderer;
import net.minecraft.entity.EntityType;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(ArmorStandEntityRenderer.class)
public class ArmorStandEntityRendererMixin {
@Unique
private static ESP esp;

@ModifyExpressionValue(method = "getRenderLayer(Lnet/minecraft/client/render/entity/state/ArmorStandEntityRenderState;ZZZ)Lnet/minecraft/client/render/RenderLayer;", at = @At(value = "FIELD", target = "Lnet/minecraft/client/render/entity/state/ArmorStandEntityRenderState;marker:Z", opcode = Opcodes.GETFIELD))
private boolean modifyMarkerValue(boolean original) {
if (esp == null) esp = Modules.get().get(ESP.class);

return original && !(esp.isActive() && !esp.shouldSkip(EntityType.ARMOR_STAND));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ public boolean shouldSkip(Entity entity) {
return !EntityUtils.isInRenderDistance(entity);
}

public boolean shouldSkip(EntityType<?> entityType) {
return !entities.get().contains(entityType);
}

public Color getColor(Entity entity) {
Color color;
double alpha = 1;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/meteor-client.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"AbstractSignEditScreenAccessor",
"AbstractSignEditScreenMixin",
"ArmorFeatureRendererMixin",
"ArmorStandEntityRendererMixin",
"AttackRangeComponentMixin",
"BannerBlockEntityRendererMixin",
"BeaconBlockEntityRendererMixin",
Expand Down