Search in sources :

Example 1 with HudRenderer

use of mathax.client.systems.hud.HudRenderer in project Client by MatHax.

the class BedHud method render.

@Override
public void render(HudRenderer renderer) {
    double x = box.getX();
    double y = box.getY();
    if (isInEditor())
        RenderUtils.drawItem(Items.RED_BED.getDefaultStack(), (int) x, (int) y, scale.get(), true);
    else if (InvUtils.find(itemStack -> itemStack.getItem() instanceof BedItem).count() > 0)
        RenderUtils.drawItem(new ItemStack(Items.RED_BED, InvUtils.find(itemStack -> itemStack.getItem() instanceof BedItem).count()), (int) x, (int) y, scale.get(), true);
}
Also used : SettingGroup(mathax.client.settings.SettingGroup) InvUtils(mathax.client.utils.player.InvUtils) ItemStack(net.minecraft.item.ItemStack) DoubleSetting(mathax.client.settings.DoubleSetting) Setting(mathax.client.settings.Setting) RenderUtils(mathax.client.utils.render.RenderUtils) BedItem(net.minecraft.item.BedItem) HudRenderer(mathax.client.systems.hud.HudRenderer) Items(net.minecraft.item.Items) HUD(mathax.client.systems.hud.HUD) HudElement(mathax.client.systems.hud.HudElement) BedItem(net.minecraft.item.BedItem) ItemStack(net.minecraft.item.ItemStack)

Aggregations

DoubleSetting (mathax.client.settings.DoubleSetting)1 Setting (mathax.client.settings.Setting)1 SettingGroup (mathax.client.settings.SettingGroup)1 HUD (mathax.client.systems.hud.HUD)1 HudElement (mathax.client.systems.hud.HudElement)1 HudRenderer (mathax.client.systems.hud.HudRenderer)1 InvUtils (mathax.client.utils.player.InvUtils)1 RenderUtils (mathax.client.utils.render.RenderUtils)1 BedItem (net.minecraft.item.BedItem)1 ItemStack (net.minecraft.item.ItemStack)1 Items (net.minecraft.item.Items)1