aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/dulkirfabric/mixin/render/MinecraftClientMixin.java
blob: 13285e378958b7b6098817fca29ad04a9c186523 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.dulkirfabric.mixin.render;

import com.dulkirfabric.util.GlowingEntityInterface;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
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;

@Mixin(MinecraftClient.class)
public class MinecraftClientMixin {

    @Inject(method = "hasOutline(Lnet/minecraft/entity/Entity;)Z", at = @At("HEAD"), cancellable = true)
    public void outlineCheck(Entity entity, CallbackInfoReturnable<Boolean> cir) {
        if (entity instanceof GlowingEntityInterface gEntity) {
            if (gEntity.shouldDulkirEntityGlow()) {
                cir.setReturnValue(true);
            }
        }
    }
}