summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java
blob: a4ea44e7c98d455ce1ddcd210663771c0827a1cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
package darkknight.jewelrycraft.container;

import java.awt.Desktop;
import java.net.URL;
import java.util.ArrayList;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.client.GuiGuide;
import darkknight.jewelrycraft.item.ItemList;

public class GuiTabItems extends GuiTab
{

    public GuiTabItems(int id)
    {
        super("Items", id);
    }

    public ItemStack getIcon()
    {        
        return new ItemStack(ItemList.thiefGloves);
    }

    @Override
    public void drawBackground(GuiGuide gui, int x, int y, int page)
    {        
        ArrayList<String> text = new ArrayList<String>();
        ArrayList<ItemStack> items = new ArrayList<ItemStack>();
        int xPos = (page%2==0)?107:-35;
        switch(page)
        {    
            case 1: 
                text.add("  Shadow ingots are");
                text.add("obtained by smelting");
                text.add("shadow ore. They are");
                text.add("used in a few recipes");
                text.add("and an important key");
                text.add("for making some");
                text.add("jewellery work.");
                items.add(new ItemStack(BlockList.shadowOre));
                items.add(new ItemStack(ItemList.shadowIngot));
                Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y);
                break;
            case 2: 
                text.add("  These gloves allow");
                text.add("you to steal the trades");
                text.add("the pesky Testificates");
                text.add("have to offer.");
                text.add("  To use these simply");
                text.add("open their gui at least");
                text.add("once, then crouch and");
                items.add(new ItemStack(ItemList.thiefGloves));
                items.add(new ItemStack(ItemList.shadowIngot));
                items.add(null);
                items.add(new ItemStack(ItemList.shadowIngot));
                items.add(new ItemStack(Blocks.wool, 1, 15));
                items.add(new ItemStack(ItemList.shadowIngot));
                items.add(new ItemStack(Blocks.wool, 1, 15));
                items.add(new ItemStack(Blocks.wool, 1, 15));
                items.add(new ItemStack(ItemList.shadowIngot));
                items.add(new ItemStack(Blocks.wool, 1, 15));
                Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y);
                break;
            case 3: 
                text.add("right click on the them");
                text.add("to steal the trades.");
                text.add("A villager has 7 of the");
                text.add("same trade item. So, for");
                text.add("example, if he wants 2");
                text.add("emeralds in exchange");
                text.add("for 4 diamonds, you will");
                text.add("get 28 diamonds from");
                text.add("him, because 7*4=28.");
                text.add("However, if you have");
                text.add("traded with him before,");
                text.add("then he will have that");
                Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
                break;
            case 4: 
                text.add("many times less of the");
                text.add("item. This has a maximum");
                text.add("of 10 uses before it");
                text.add("breaks.");
                Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
                break;
            case 5: 
                text.add("  In order to get the");
                text.add("ingot back from the");
                text.add("smelter you need a");
                text.add("mold for it. However,");
                text.add("this mold can't be used.");
                text.add("It is too soft. It needs");
                text.add("to be hardened in");
                text.add("order for it to be used.");
                items.add(new ItemStack(ItemList.clayMolds, 1, 0));
                items.add(new ItemStack(Items.clay_ball));
                items.add(new ItemStack(Items.clay_ball));
                Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, items, x, y);
                break;
            case 6: 
                text.add("  By smelting the clay_ball");
                text.add("mold you get a harder");
                text.add("version which can be");
                text.add("used to create ingots.");
                text.add("Simply right click with");
                text.add("this on a molder to");
                text.add("attach it and you're");
                text.add("ready to go.");
                items.add(new ItemStack(ItemList.clayMolds, 1, 0));
                items.add(new ItemStack(ItemList.molds, 1, 0));
                Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y);
                break;
            case 7: 
                text.add("  In order to create a");
                text.add("ring you need a mold");
                text.add("for it. However, this");
                text.add("one can't be used. It is");
                text.add("too soft. It needs to be");
                text.add("hardened in order for");
                text.add("it to be used.");
                items.add(new ItemStack(ItemList.clayMolds, 1, 1));
                items.add(null);
                items.add(new ItemStack(Items.clay_ball));
                items.add(null);
                items.add(new ItemStack(Items.clay_ball));
                items.add(null);
                items.add(new ItemStack(Items.clay_ball));
                items.add(null);
                items.add(new ItemStack(Items.clay_ball));
                items.add(null);
                Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y);
                break;
            case 8: 
                text.add("  By smelting the clay_ball");
                text.add("mold you get a harder");
                text.add("version which can be");
                text.add("used to create rings.");
                text.add("Simply right click with");
                text.add("this on a molder to");
                text.add("attach it and you're");
                text.add("ready to go.");
                items.add(new ItemStack(ItemList.clayMolds, 1, 1));
                items.add(new ItemStack(ItemList.molds, 1, 1));
                Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y);
                break;
            case 9: 
                text.add("  In order to create a");
                text.add("necklace you need a");
                text.add("mold for it. However,");
                text.add("this one can't be used.");
                text.add("It is too soft. It needs");
                text.add("to be hardened in");
                text.add("order for it to be used.");
                items.add(new ItemStack(ItemList.clayMolds, 1, 2));
                items.add(new ItemStack(Items.clay_ball));
                items.add(null);
                items.add(new ItemStack(Items.clay_ball));
                items.add(new ItemStack(Items.clay_ball));
                items.add(null);
                items.add(new ItemStack(Items.clay_ball));                
                items.add(null);
                items.add(new ItemStack(Items.clay_ball));
                items.add(null);
                Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y);
                break;
            case 10: 
                text.add("  By smelting the clay_ball");
                text.add("mold you get a harder");
                text.add("version which can be");
                text.add("used to create");
                text.add("necklaces. Simply right");
                text.add("click with this on a");
                text.add("molder to attach it and");
                text.add("you're ready to go.");
                items.add(new ItemStack(ItemList.clayMolds, 1, 2));
                items.add(new ItemStack(ItemList.molds, 1, 2));
                Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y);
                break;
            case 11: 
                text.add("  Crystals don't do");
                text.add("much. They can be dyed");
                text.add("in any color and used");
                text.add("as jewels to create a");
                text.add("nice jewellery.");
                items.add(new ItemStack(ItemList.crystal, 1, 15));
                items.add(null);
                items.add(new ItemStack(Blocks.glass));
                items.add(null);
                items.add(new ItemStack(Blocks.glass));
                items.add(null);
                items.add(new ItemStack(Blocks.glass));
                items.add(null);
                items.add(new ItemStack(Blocks.glass));
                items.add(null);
                Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y);
                break;
            case 12: 
                if(del == 0) values++;
                del++;
                if(del >= 300) del = 0;
                if(values >= 15) values = 0;
                items.add(new ItemStack(ItemList.crystal, 1, values));
                items.add(new ItemStack(Items.dye, 1, values));
                items.add(new ItemStack(ItemList.crystal, 1, 15));
                Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, items, x, y);
                items.removeAll(items);
                items.add(new ItemStack(ItemList.crystal, 1, 15));
                items.add(new ItemStack(Items.dye, 1, 15));
                items.add(new ItemStack(ItemList.crystal, 1, values));
                Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop() + 60, true, text, items, x, y);
                break;
            case 13: 
                if(del == 0) values++;
                del++;
                if(del >= 300) del = 0;
                if(values >= 3) values = 0;
                text.add("  It's this exact guide.");
                text.add("I don't even know why");
                text.add("you're reading this.");
                text.add("I added this recipe in");
                text.add("case you lose the");
                text.add("original. In case you");
                text.add("don't have it, I suggest");
                text.add("adding NEI so you can");
                items.add(new ItemStack(ItemList.guide));
                items.add(new ItemStack(ItemList.molds, 1, values));
                items.add(new ItemStack(Items.book));
                Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, items, x, y);
                break;
            case 14: 
                String link = "HERE";
                if(x >= gui.getLeft() + 138 && x <= gui.getLeft() + 168 && y >= gui.getTop() + 98 && y <= gui.getTop() + 108) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK;
                text.add("see all the recipes.");
                text.add("Since you are reading");
                text.add("this, how about making");
                text.add("a youtube video");
                text.add("spotlighting this mod.");
                text.add("I'd really appreciate it.");
                text.add("After that you can");
                text.add("share it in the main");
                text.add("thread " + link + ".");
                text.add("  This mod was made by");
                text.add("DarkKnight (or sor1n");
                text.add("depending from where");
                text.add("you got this)");
                Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
                break;
            default:;
        }
    }

    public int getMaxPages()
    {
        return 13;
    }

    public void mouseClick(GuiGuide gui, int x, int y, int button) 
    {
        if(gui.page == 13 && x >= gui.getLeft() + 138 && x <= gui.getLeft() + 168 && y >= gui.getTop() + 98 && y <= gui.getTop() + 108)
        {
            try 
            {
                Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/topic/2210959-164smp-ssp-jewelrycraft-version-12/").toURI());
            }           
            catch (Exception e) {}
        }
    }

    @Override
    public void drawForeground(GuiGuide gui, int x, int y, int page)
    {        
    }

}