diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-06-12 20:52:15 +0100 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-06-12 20:52:15 +0100 |
| commit | 01c68617fea5d860dec350583fa3433326f14a7d (patch) | |
| tree | 2761fc7955823f9bca28e09be9ae5e768f58d0da | |
| parent | 8daf430d18eb2e1fa389c3d6523c9efdb5a7aaf3 (diff) | |
Mini fix
3 files changed, 17 insertions, 31 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java index 9d3736f..31660d4 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java @@ -88,18 +88,18 @@ public class GuiJewelryModifier extends GuiContainer { @Override
protected void keyTyped(char character, int key) {
- try {
- if (this.searchField.textboxKeyTyped(character, key)) {
+ if (this.searchField.textboxKeyTyped(character, key)) {
+ try {
int items = 0;
for (ItemStack item : JewelrycraftUtil.objects)
if (item != null && searchField.getText() != "" && item.getDisplayName() != null && item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase())) items++;
maxPages = items / 48 + 1;
page = 1;
this.pages.setText(page + "/" + maxPages);
- } else super.keyTyped(character, key);
- } catch (Exception e) {
- JewelrycraftMod.logger.info("Trying to display an item but gets this error: " + e.getMessage());
- }
+ } catch (Exception e) {
+ JewelrycraftMod.logger.info("Trying to display an item but gets this error: " + e.getMessage());
+ }
+ } else super.keyTyped(character, key);
}
protected void mouseClicked(int x, int y, int id) {
@@ -209,13 +209,17 @@ public class GuiJewelryModifier extends GuiContainer { int i = 0;
List<String> list = new ArrayList<String>();
for (ItemStack item : JewelrycraftUtil.objects) {
- if (item != null && item.getDisplayName() != null && (this.searchField.getText() == "" || item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase()))) {
- if (i >= (page - 1) * 48 && i < page * 48 && x >= this.guiLeft + 88 + 20 * (i % 6) && x < this.guiLeft + 108 + 20 * (i % 6) && y >= this.guiTop + 9 + 17 * (i / 6) - 136 * (page - 1) && y < this.guiTop + 25 + 17 * (i / 6) - 136 * (page - 1)) {
- list.add(item.getDisplayName());
- if (item.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips) != null) this.renderToolTip(item, x, y);
- else this.drawHoveringText(list, x, y, this.fontRendererObj);
+ try {
+ if (item != null && item.getDisplayName() != null && (this.searchField.getText() == "" || item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase()))) {
+ if (i >= (page - 1) * 48 && i < page * 48 && x >= this.guiLeft + 88 + 20 * (i % 6) && x < this.guiLeft + 108 + 20 * (i % 6) && y >= this.guiTop + 9 + 17 * (i / 6) - 136 * (page - 1) && y < this.guiTop + 25 + 17 * (i / 6) - 136 * (page - 1)) {
+ list.add(item.getDisplayName());
+ if (item.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips) != null) this.renderToolTip(item, x, y);
+ else this.drawHoveringText(list, x, y, this.fontRendererObj);
+ }
+ i++;
}
- i++;
+ } catch (Exception e) {
+ JewelrycraftMod.logger.info("Trying to display an item but gets this error: " + e.getMessage());
}
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java index 0f68283..d376648 100644 --- a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java @@ -149,11 +149,7 @@ public class ItemMoltenMetalBucket extends Item { @Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass) {
- try {
- return color(stack, pass);
- } catch (IOException e) {
- e.printStackTrace();
- }
+ if (pass == 1 && JewelryNBT.ingot(stack) != null) return JewelrycraftUtil.getColor(JewelryNBT.ingot(stack));
return 16777215;
}
@@ -178,19 +174,6 @@ public class ItemMoltenMetalBucket extends Item { }
/**
- * @param stack
- * @param pass
- * @return
- * @throws IOException
- */
- @SideOnly(Side.CLIENT)
- public static int color(ItemStack stack, int pass) throws IOException {
- // System.out.println(JewelrycraftUtil.getColor(stack));
- if (pass == 1 && JewelryNBT.ingot(stack) != null) return JewelrycraftUtil.getColor(JewelryNBT.ingot(stack));
- return 16777215;
- }
-
- /**
* @param ingot
* @return
*/
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java index 5f094e4..fbed30c 100644 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java @@ -49,7 +49,6 @@ public class WorldGenStructure2 extends WorldGenerator { if (!world.isRemote) world.func_147480_a(x, y, z, true);
JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage());
JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage()));
- System.out.println(x + " " + y + " " + z);
world.setBlock(x, y, z, BlockList.moltenMetal, 0, 3);
}
return true;
|
