Package schrumbo.schrumbohud.hud
Klasse InventoryRenderer
java.lang.Object
schrumbo.schrumbohud.hud.InventoryRenderer
- Alle implementierten Schnittstellen:
net.fabricmc.fabric.api.client.rendering.v1.hud.HudElement
public class InventoryRenderer
extends Object
implements net.fabricmc.fabric.api.client.rendering.v1.hud.HudElement
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprivate intCalculates X position from relative offsetprivate intCalculates Y position from relative offsetprivate voiddrawBackground(net.minecraft.client.gui.DrawContext context, int width, int height, HudConfig config) Renders background and outlineprivate intgetDurabilityColor(float percent) Returns color based on durability percentage (green > yellow > red)static voidregister()Registers the inventory HUD element after the boss barvoidrender(net.minecraft.client.gui.DrawContext context, net.minecraft.client.render.RenderTickCounter tickCounter) private voidrenderDurabilityBar(net.minecraft.client.gui.DrawContext context, net.minecraft.item.ItemStack stack, int x, int y, HudConfig config) Renders durability bar below itemprivate voidrenderInventory(net.minecraft.client.gui.DrawContext context, net.minecraft.entity.player.PlayerInventory inventory, HudConfig config) Renders all inventory slots with itemsprivate voidrenderItem(net.minecraft.client.gui.DrawContext context, net.minecraft.item.ItemStack stack, int x, int y, HudConfig config) Renders single item with count and durabilityprivate voidrenderStackCount(net.minecraft.client.gui.DrawContext context, net.minecraft.item.ItemStack stack, int x, int y, HudConfig config) Renders item stack count text
-
Felddetails
-
ID
public static final net.minecraft.util.Identifier ID -
SLOT_SIZE
private static final int SLOT_SIZE- Siehe auch:
-
ROW_SLOTS
private static final int ROW_SLOTS- Siehe auch:
-
ROWS
private static final int ROWS- Siehe auch:
-
PADDING
private static final int PADDING- Siehe auch:
-
-
Konstruktordetails
-
InventoryRenderer
public InventoryRenderer()
-
-
Methodendetails
-
register
public static void register()Registers the inventory HUD element after the boss bar -
render
public void render(net.minecraft.client.gui.DrawContext context, net.minecraft.client.render.RenderTickCounter tickCounter) - Angegeben von:
renderin Schnittstellenet.fabricmc.fabric.api.client.rendering.v1.hud.HudElement
-
calcX
Calculates X position from relative offset -
calcY
Calculates Y position from relative offset -
drawBackground
private void drawBackground(net.minecraft.client.gui.DrawContext context, int width, int height, HudConfig config) Renders background and outline -
renderInventory
private void renderInventory(net.minecraft.client.gui.DrawContext context, net.minecraft.entity.player.PlayerInventory inventory, HudConfig config) Renders all inventory slots with items -
renderItem
private void renderItem(net.minecraft.client.gui.DrawContext context, net.minecraft.item.ItemStack stack, int x, int y, HudConfig config) Renders single item with count and durability -
renderStackCount
private void renderStackCount(net.minecraft.client.gui.DrawContext context, net.minecraft.item.ItemStack stack, int x, int y, HudConfig config) Renders item stack count text -
renderDurabilityBar
private void renderDurabilityBar(net.minecraft.client.gui.DrawContext context, net.minecraft.item.ItemStack stack, int x, int y, HudConfig config) Renders durability bar below item -
getDurabilityColor
private int getDurabilityColor(float percent) Returns color based on durability percentage (green > yellow > red)
-