|
12 | 12 | import net.minecraft.client.renderer.vertex.DefaultVertexFormats; |
13 | 13 | import net.minecraft.client.gui.GuiButton; |
14 | 14 | import net.minecraft.client.gui.GuiScreen; |
15 | | -import net.minecraft.init.SoundEvents; |
16 | 15 | import net.minecraft.item.Item; |
17 | 16 | import net.minecraft.item.ItemStack; |
18 | 17 |
|
@@ -122,39 +121,38 @@ public void initGui() |
122 | 121 | @Override |
123 | 122 | public void actionPerformed( GuiButton button ) |
124 | 123 | { |
125 | | - // Called on left click of GuiButton |
| 124 | + // Called on left click of GuiButton |
126 | 125 | switch(button.id) |
127 | 126 | { |
128 | 127 | case 99: // Print OreDict |
129 | 128 | for ( String name : OreDictionary.getOreNames() ) // Print the ore dictionary. |
130 | 129 | { |
131 | | - List<ItemStack> oreStack = OreDictionary.getOres( name); |
132 | | - System.out.print( String.format("[OreDict] %-40.40s [%d types] ( ", name, oreStack.size() ) ); |
| 130 | + List<ItemStack> oreStack = OreDictionary.getOres(name); |
| 131 | + System.out.print(String.format("[OreDict] %-40.40s [%d types] ( ", name, oreStack.size())); |
133 | 132 | StringBuilder idMetaCsv = new StringBuilder(); |
134 | | - if( oreStack.size() < 1 ) |
135 | | - { |
136 | | - idMetaCsv.append( " )" ); |
137 | | - } |
138 | | - |
139 | | - for( ItemStack stack : oreStack ) |
140 | | - { |
141 | | - if( stack == oreStack.get( oreStack.size() - 1 ) ) |
142 | | - { |
143 | | - idMetaCsv.append( String.format( "%d:%d )", Item.getIdFromItem( stack.getItem() ), stack.getItemDamage() ) ); |
| 133 | + if (oreStack.size() < 1) { |
| 134 | + List<ItemStack> oreStack = OreDictionary.getOres(name); |
| 135 | + System.out.print(String.format("[OreDict] %-40.40s [%d types] ( ", name, oreStack.size())); |
| 136 | + StringBuilder idMetaCsv = new StringBuilder(); |
| 137 | + if (oreStack.size() < 1) { |
| 138 | + idMetaCsv.append(" )"); |
144 | 139 | } |
145 | | - else |
146 | | - { |
147 | | - idMetaCsv.append( String.format( "%d:%d, ", Item.getIdFromItem( stack.getItem() ), stack.getItemDamage() ) ); |
| 140 | + |
| 141 | + for (ItemStack stack : oreStack) { |
| 142 | + if (stack == oreStack.get(oreStack.size() - 1)) { |
| 143 | + idMetaCsv.append(String.format("%d:%d )", Item.getIdFromItem(stack.getItem()), stack.getItemDamage())); |
| 144 | + } else { |
| 145 | + idMetaCsv.append(String.format("%d:%d, ", Item.getIdFromItem(stack.getItem()), stack.getItemDamage())); |
| 146 | + } |
148 | 147 | } |
| 148 | + System.out.println(idMetaCsv.toString()); |
149 | 149 | } |
150 | | - System.out.println( idMetaCsv.toString() ); |
151 | | - } |
152 | 150 |
|
153 | | - if (!OresSearch.searchList.isEmpty()) // Print out the searchList. |
154 | | - { |
155 | | - for (OreInfo ore : OresSearch.searchList) |
| 151 | + if (!OresSearch.searchList.isEmpty()) // Print out the searchList. |
156 | 152 | { |
157 | | - System.out.println(String.format("[Fgt XRay] OreInfo( %s, %d, %d, 0x%x, %b )", ore.oreName, ore.id, ore.meta, ore.color[0], ore.draw)); |
| 153 | + for (OreInfo ore : OresSearch.searchList) { |
| 154 | + System.out.println(String.format("[Fgt XRay] OreInfo( %s, %d, %d, 0x%x, %b )", ore.oreName, ore.id, ore.meta, ore.color[0], ore.draw)); |
| 155 | + } |
158 | 156 | } |
159 | 157 | } |
160 | 158 | break; |
@@ -246,12 +244,12 @@ public boolean doesGuiPauseGame() |
246 | 244 | // this removes the stupid power of 2 rule that comes with minecraft. |
247 | 245 | private static void drawTexturedQuadFit(double x, double y, double width, double height, double zLevel) |
248 | 246 | { |
249 | | - VertexBuffer tessellate = Tessellator.getInstance().getBuffer(); |
250 | | - tessellate.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); |
251 | | - tessellate.pos(x + 0, y + height, zLevel).tex( 0,1).endVertex(); |
252 | | - tessellate.pos(x + width, y + height, zLevel).tex( 1, 1).endVertex(); |
253 | | - tessellate.pos(x + width, y + 0, zLevel).tex( 1,0).endVertex(); |
254 | | - tessellate.pos(x + 0, y + 0, zLevel).tex( 0, 0).endVertex(); |
| 247 | + VertexBuffer tessellator = Tessellator.getInstance().getBuffer(); |
| 248 | + tessellator.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); |
| 249 | + tessellator.pos(x + 0, y + height, zLevel).tex( 0,1).endVertex(); |
| 250 | + tessellator.pos(x + width, y + height, zLevel).tex( 1, 1).endVertex(); |
| 251 | + tessellator.pos(x + width, y + 0, zLevel).tex( 1,0).endVertex(); |
| 252 | + tessellator.pos(x + 0, y + 0, zLevel).tex( 0, 0).endVertex(); |
255 | 253 | Tessellator.getInstance().draw(); |
256 | 254 | } |
257 | 255 |
|
|
0 commit comments