GuiResourcePackList .java

net.minecraft.client.gui.GuiResourcePackList (class, 65 lines): members: field_148204_l, getList, drawListHeader, getListHeader, getListEntry, getSize, mc.

net.minecraft.client.guiclass65 linesclientextends GuiListExtended1.9 KB

API Surface (6)

void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_)
List<ResourcePackListEntry> getList()
int getSize()
ResourcePackListEntry getListEntry(int index)
int getListWidth()
int getScrollBarX()

Fields & Constants (2)

mc
field_148204_l

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

GuiResourcePackList.java65 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.gui;
2
3
import java.util.List;
4
import net.minecraft.client.Minecraft;
5
import net.minecraft.client.renderer.Tessellator;
6
import net.minecraft.client.resources.ResourcePackListEntry;
7
import net.minecraft.util.EnumChatFormatting;
8
9
public abstract class GuiResourcePackList extends GuiListExtended
10
{
11
    protected final Minecraft mc;
12
    protected final List<ResourcePackListEntry> field_148204_l;
13
14
    public GuiResourcePackList(Minecraft mcIn, int p_i45055_2_, int p_i45055_3_, List<ResourcePackListEntry> p_i45055_4_)
15
    {
16
        super(mcIn, p_i45055_2_, p_i45055_3_, 32, p_i45055_3_ - 55 + 4, 36);
17
        this.mc = mcIn;
18
        this.field_148204_l = p_i45055_4_;
19
        this.field_148163_i = false;
20
        this.setHasListHeader(true, (int)((float)mcIn.fontRendererObj.FONT_HEIGHT * 1.5F));
21
    }
22
23
    /**
24
     * Handles drawing a list's header row.
25
     */
26
    protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_)
27
    {
28
        String s = EnumChatFormatting.UNDERLINE + "" + EnumChatFormatting.BOLD + this.getListHeader();
29
        this.mc.fontRendererObj.drawString(s, p_148129_1_ + this.width / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, Math.min(this.top + 3, p_148129_2_), 16777215);
30
    }
31
32
    protected abstract String getListHeader();
33
34
    public List<ResourcePackListEntry> getList()
35
    {
36
        return this.field_148204_l;
37
    }
38
39
    protected int getSize()
40
    {
41
        return this.getList().size();
42
    }
43
44
    /**
45
     * Gets the IGuiListEntry object for the given index
46
     */
47
    public ResourcePackListEntry getListEntry(int index)
48
    {
49
        return (ResourcePackListEntry)this.getList().get(index);
50
    }
51
52
    /**
53
     * Gets the width of the list
54
     */
55
    public int getListWidth()
56
    {
57
        return this.width;
58
    }
59
60
    protected int getScrollBarX()
61
    {
62
        return this.right - 6;
63
    }
64
}
65

Deobfuscated MCP 1.8.9 source of GuiResourcePackList from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/gui/GuiResourcePackList.java), stored verbatim.