package org.chrisoft.trashyaddon.mixin; import meteordevelopment.meteorclient.systems.modules.Modules; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider; import net.minecraft.screen.ScreenHandler; import net.minecraft.screen.slot.Slot; import net.minecraft.text.Text; import org.chrisoft.trashyaddon.modules.MatchedItemHighlight; 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(HandledScreen.class) public abstract class HandledScreenMixin extends Screen implements ScreenHandlerProvider { public HandledScreenMixin(Text title) { super(title); } @Inject(method = "drawSlot", at = @At("HEAD")) private void onDrawSlot(DrawContext context, Slot slot, CallbackInfo ci) { int color = Modules.get().get(MatchedItemHighlight.class).getSlotColor(slot.id).getPacked(); if (color != 0) context.fill(slot.x, slot.y, slot.x + 16, slot.y + 16, color); } }