Item Borders [Fabric]

Item Borders [Fabric]

6M Downloads

Nether Chested compatibility

LTCatt opened this issue ยท 1 comments

commented

That's it.

import com.anthonyhilyard.itemborders.ItemBorders;
import fuzs.puzzlesaccessapi.api.client.container.v1.ExtendableContainerScreen;
import fuzs.puzzlesapi.api.client.limitlesscontainers.v1.LimitlessContainerScreen;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.Slot;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.jetbrains.annotations.NotNull;
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(LimitlessContainerScreen.class)
@OnlyIn(Dist.CLIENT)
public class Border<T extends AbstractContainerMenu> extends ExtendableContainerScreen<T> {
    public Border(T menu, Inventory inventory, Component title) { super(menu, inventory, title); }
    protected void renderBg(@NotNull GuiGraphics guiGraphics, float v, int i, int i1) {}

    @Inject(method = "m_280092_", at = @At(value = "INVOKE", target = "Lfuzs/puzzlesapi/impl/limitlesscontainers/client/AdvancedItemRenderer;renderItemDecorations(Lnet/minecraft/client/gui/GuiGraphics;Lnet/minecraft/client/gui/Font;Lnet/minecraft/world/item/ItemStack;IILjava/lang/String;)V", shift = At.Shift.AFTER, remap = false), remap = false)
    private void renderSlot(GuiGraphics guiGraphics, Slot slot, CallbackInfo ci) {
        ItemBorders.renderBorder(guiGraphics.pose(), slot);
    }

}
commented

Yes please! Personally looking for Fabric 1.20.1.