diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-06-12 20:15:20 +0100 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-06-12 20:15:20 +0100 |
| commit | 59b192c7e3738c08b1fde066e96a837294f96c6d (patch) | |
| tree | a8275e4a382d85dc37c32c308d1ec5e91dbbe45c /src | |
| parent | 2eb071cb6b7ce228cbc7820b9ecc3eec65c9b6f9 (diff) | |
Testing stuff
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java index 68ef0c3..4932e12 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.logging.Level;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
@@ -93,7 +92,7 @@ public class GuiJewelryModifier extends GuiContainer if (this.searchField.textboxKeyTyped(character, key)){
int items = 0;
for(ItemStack item: JewelrycraftUtil.objects)
- if (item != null && item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase())) items++;
+ if (item != null && searchField.getText() != "" && item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase())) items++;
maxPages = items / 48 + 1;
page = 1;
this.pages.setText(page + "/" + maxPages);
@@ -128,7 +127,7 @@ public class GuiJewelryModifier extends GuiContainer }
int i = 0;
for(ItemStack item: JewelrycraftUtil.objects){
- if (this.searchField.getText() == "" || item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase())){
+ if (item != 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)){
if (!((GuiButton)buttonList.get(0)).enabled || !((GuiButton)buttonList.get(1)).enabled || !((GuiButton)buttonList.get(2)).enabled){
this.selectedItem = item;
@@ -153,7 +152,17 @@ public class GuiJewelryModifier extends GuiContainer }
}
if (((GuiButton)buttonList.get(5)).mousePressed(mc, x, y) && page > 1) page--;
- if (((GuiButton)buttonList.get(6)).mousePressed(mc, x, y) && page < maxPages) page++;
+ i = 0;
+ if (((GuiButton)buttonList.get(6)).mousePressed(mc, x, y) && page < maxPages){
+ page++;
+ for(ItemStack item: JewelrycraftUtil.objects){
+ if (item != null && (this.searchField.getText() == "" || item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase()))){
+ if (i >= (page - 1) * 48 && i < page * 48)
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(item + " " + " item no " + i));
+ i++;
+ }
+ }
+ }
if (jMod.modInv.getStackInSlot(36) != null){
ItemStack targetItem = jMod.modInv.getStackInSlot(36).copy();
if (((GuiButton)buttonList.get(4)).mousePressed(mc, x, y) && !((GuiButton)buttonList.get(0)).enabled){
|
