1.21.3 support
This commit is contained in:
parent
854ce7201c
commit
8f9a6005f5
13 changed files with 31 additions and 28 deletions
|
@ -4,6 +4,7 @@ import me.kawaiizenbo.moonlight.ui.hud.HUDModule;
|
|||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class HUDModuleButton
|
||||
|
@ -24,7 +25,7 @@ public class HUDModuleButton
|
|||
this.y = y;
|
||||
drawContext.fill(x, y, x + width, y + height, hovered(mouseX, mouseY) ? 0xFF333333 : 0xFF222222);
|
||||
drawContext.drawText(textRenderer, module.name, x+2, y+2, module.enabled ? 0x55FFFF : 0xFFFFFF, false);
|
||||
if (!module.settings.isEmpty()) drawContext.drawGuiTexture(Identifier.of("moonlight", "settings"), x+width-12, y, 12, 12);
|
||||
if (!module.settings.isEmpty()) drawContext.drawGuiTexture(RenderLayer::getGuiTextured, Identifier.of("moonlight", "settings"), x+width-12, y, 12, 12);
|
||||
}
|
||||
|
||||
public boolean hovered(int mouseX, int mouseY)
|
||||
|
|
|
@ -6,6 +6,7 @@ import me.kawaiizenbo.moonlight.ui.hud.HUDModule;
|
|||
import me.kawaiizenbo.moonlight.ui.hud.HUDModuleManager;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class HUDModuleList
|
||||
|
@ -39,7 +40,7 @@ public class HUDModuleList
|
|||
}
|
||||
drawContext.fill(x, y, x+width, collapsed ? y+16 : y+height, 0xFF55FFFF);
|
||||
drawContext.fill(x+2, y+2, x+(width-2), y+14, hovered(mouseX, mouseY) ? 0xFF333333 : 0xFF222222);
|
||||
drawContext.drawGuiTexture(Identifier.of("moonlight", "hud"), x+2, y+2, 12, 12);
|
||||
drawContext.drawGuiTexture(RenderLayer::getGuiTextured, Identifier.of("moonlight", "hud"), x+2, y+2, 12, 12);
|
||||
drawContext.drawText(textRenderer, "HUD Modules", x+16, y+4, 0xFFFFFFFF, false);
|
||||
if (!collapsed)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ public class ArmorDisplay extends HUDModule
|
|||
{
|
||||
ItemStack piece = mc.player.getInventory().getStack(i);
|
||||
drawContext.drawItem(piece, x, y+yOffset);
|
||||
drawContext.drawItemInSlot(textRenderer, piece, x, y+yOffset);
|
||||
drawContext.drawStackOverlay(textRenderer, piece, x, y+yOffset);
|
||||
yOffset += 16;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue