diff options
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/client')
30 files changed, 966 insertions, 2312 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java index 0db57c7..5070e7c 100755 --- a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java +++ b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java @@ -18,13 +18,11 @@ import net.minecraft.util.ResourceLocation; */
@SideOnly(Side.CLIENT)
public abstract class AbstractTab extends GuiButton {
- ResourceLocation texture = new ResourceLocation(
- Variables.MODID, "textures/gui/hearts.png");
- ItemStack renderStack;
- RenderItem itemRenderer = new RenderItem();
+ ResourceLocation texture = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png");
+ ItemStack renderStack;
+ RenderItem itemRenderer = new RenderItem();
- public AbstractTab(int id, int posX, int posY,
- ItemStack renderStack) {
+ public AbstractTab(int id, int posX, int posY, ItemStack renderStack) {
super(id, posX, posY, 18, 18, "");
this.renderStack = renderStack;
}
@@ -36,9 +34,7 @@ public abstract class AbstractTab extends GuiButton { int xOffset = this.enabled ? 0 : 8;
mc.renderEngine.bindTexture(this.texture);
- this.drawTexturedModalRect(this.xPosition,
- yPosition, 144 + xOffset, 32, 18,
- 18);
+ this.drawTexturedModalRect(this.xPosition, yPosition, 144 + xOffset, 32, 18, 18);
GL11.glPushMatrix();
RenderHelper.enableGUIStandardItemLighting();
@@ -46,13 +42,9 @@ public abstract class AbstractTab extends GuiButton { this.itemRenderer.zLevel = 100.0F;
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- this.itemRenderer.renderItemAndEffectIntoGUI(
- mc.fontRenderer, mc.renderEngine,
- renderStack, xPosition + 1,
+ this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1,
yPosition + 1);
- this.itemRenderer.renderItemOverlayIntoGUI(
- mc.fontRenderer, mc.renderEngine,
- renderStack, xPosition + 1,
+ this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1,
yPosition + 1);
GL11.glDisable(GL11.GL_LIGHTING);
this.itemRenderer.zLevel = 0.0F;
@@ -64,11 +56,8 @@ public abstract class AbstractTab extends GuiButton { @Override
public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) {
- boolean inWindow = this.enabled && this.visible
- && mouseX >= this.xPosition
- && mouseY >= this.yPosition
- && mouseX < this.xPosition + this.width
- && mouseY < this.yPosition + this.height;
+ boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition
+ && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
if (inWindow)
this.onTabClicked();
return inWindow;
diff --git a/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java b/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java index 6571634..da28504 100755 --- a/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java +++ b/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java @@ -12,19 +12,17 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound;
public class JewelryInventory implements IInventory {
- public EntityPlayer player;
- public ItemStack[] inventory = new ItemStack[18];
+ public EntityPlayer player;
+ public ItemStack[] inventory = new ItemStack[18];
/**
* @param player
*/
public JewelryInventory(EntityPlayer player) {
this.player = player;
- NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(
- player, Variables.MODID);
+ NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
for (int i = 0; i < 18; i++)
- inventory[i] = ItemStack.loadItemStackFromNBT(
- nbt.getCompoundTag("ext" + i));
+ inventory[i] = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("ext" + i));
}
/**
@@ -79,8 +77,7 @@ public class JewelryInventory implements IInventory { @Override
public void setInventorySlotContents(int slot, ItemStack stack) {
inventory[slot] = stack;
- if (stack != null
- && stack.stackSize > getInventoryStackLimit())
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
stack.stackSize = getInventoryStackLimit();
markDirty();
}
@@ -114,13 +111,10 @@ public class JewelryInventory implements IInventory { */
@Override
public void markDirty() {
- NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(
- player, Variables.MODID);
+ NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
for (int i = 0; i < 18; i++)
if (inventory[i] != null)
- nbt.setTag("ext" + i, inventory[i]
- .writeToNBT(nbt.getCompoundTag(
- "ext" + i)));
+ nbt.setTag("ext" + i, inventory[i].writeToNBT(nbt.getCompoundTag("ext" + i)));
else
nbt.removeTag("ext" + i);
}
@@ -157,17 +151,13 @@ public class JewelryInventory implements IInventory { */
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
- if (slot >= 0 && slot <= 9
- && stack.getItem() instanceof ItemRing)
+ if (slot >= 0 && slot <= 9 && stack.getItem() instanceof ItemRing)
return true;
- else if (slot >= 10 && slot <= 13
- && stack.getItem() instanceof ItemBracelet)
+ else if (slot >= 10 && slot <= 13 && stack.getItem() instanceof ItemBracelet)
return true;
- else if (slot >= 14 && slot <= 16
- && stack.getItem() instanceof ItemNecklace)
+ else if (slot >= 14 && slot <= 16 && stack.getItem() instanceof ItemNecklace)
return true;
- else if (slot == 17
- && stack.getItem() instanceof ItemEarrings)
+ else if (slot == 17 && stack.getItem() instanceof ItemEarrings)
return true;
return false;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/Page.java b/src/main/java/darkknight/jewelrycraft/client/Page.java index 4d67c81..b23345a 100755 --- a/src/main/java/darkknight/jewelrycraft/client/Page.java +++ b/src/main/java/darkknight/jewelrycraft/client/Page.java @@ -13,81 +13,44 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation;
public class Page {
- static ResourceLocation pageFlipped = new ResourceLocation(
- Variables.MODID, "textures/gui/guidePageFlip.png");
+ static ResourceLocation pageFlipped = new ResourceLocation(Variables.MODID, "textures/gui/guidePageFlip.png");
- public static void addCraftingRecipeTextPage(GuiGuide gui, int x,
- int y, boolean isSmall, String text, int mouseX,
+ public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX,
int mouseY, boolean rotate, ItemStack... items) {
y += 5;
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
- GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE
- + "\u00a7n" + items[0].getDisplayName(),
- x + Math.abs(70 - gui.getFont()
- .getStringWidth(items[0]
- .getDisplayName())
- / 2) - 10,
- y - 2, 0);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(),
+ x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0);
GL11.glColor4f(1, 1, 1, 1);
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(pageFlipped);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
ArrayList<String> name = new ArrayList<>();
if (isSmall) {
- gui.drawTexturedModalRect(x, y + 10, 145, 54, 111,
- 46);
- gui.renderItem(items[0], x + 89, y + 22 + 10, 30f,
- rotate, 0, 0, 0);
+ gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46);
+ gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate, 0, 0, 0);
for (int i = 1; i <= 4; i++)
if (items.length > i && items[i] != null) {
- int posX = x + 8 + (i - 1) % 2
- * 22;
- int posY = y + 26
- + (i - 1) / 2 * 22;
- gui.renderItem(items[i], posX,
- posY, 30f, rotate,
- 0, 0, 0);
- name.add(items[i]
- .getDisplayName());
- if (mouseX >= posX - 8
- && mouseX <= posX
- + 8
- && mouseY >= posY
- - 16
- && mouseY <= posY)
- gui.drawHoverString(name,
- posX - 20,
- posY - 14);
+ int posX = x + 8 + (i - 1) % 2 * 22;
+ int posY = y + 26 + (i - 1) / 2 * 22;
+ gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
+ name.add(items[i].getDisplayName());
+ if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY)
+ gui.drawHoverString(name, posX - 20, posY - 14);
name.removeAll(name);
GL11.glDisable(GL11.GL_LIGHTING);
}
drawText(gui, text, x, y + 25);
} else {
- gui.drawTexturedModalRect(x, y + 12, 145, 0, 111,
- 54);
- gui.renderItem(items[0], x + 91, y + 28 + 10, 30f,
- rotate, 0, 0, 0);
+ gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54);
+ gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate, 0, 0, 0);
for (int i = 1; i <= 9; i++)
if (items.length > i && items[i] != null) {
- int posX = x + 8 + (i - 1) % 3
- * 19;
- int posY = y + 22
- + (i - 1) / 3 * 17;
- gui.renderItem(items[i], posX,
- posY, 30f, rotate,
- 0, 0, 0);
- name.add(items[i]
- .getDisplayName());
- if (mouseX >= posX - 8
- && mouseX <= posX
- + 8
- && mouseY >= posY
- - 10
- && mouseY <= posY)
- gui.drawHoverString(name,
- posX - 20,
- posY - 12);
+ int posX = x + 8 + (i - 1) % 3 * 19;
+ int posY = y + 22 + (i - 1) / 3 * 17;
+ gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
+ name.add(items[i].getDisplayName());
+ if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY)
+ gui.drawHoverString(name, posX - 20, posY - 12);
name.removeAll(name);
GL11.glDisable(GL11.GL_LIGHTING);
}
@@ -97,151 +60,103 @@ public class Page { GL11.glDisable(GL11.GL_BLEND);
}
- public static void addSmeltingRecipeTextPage(GuiGuide gui, int x,
- int y, String text, int mouseX, int mouseY,
+ public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY,
boolean rotate, ItemStack... items) {
ArrayList<String> name = new ArrayList<>();
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE
- + "\u00a7n" + items[1].getDisplayName(),
- x + 30 - items[0].getDisplayName().length()
- / 2,
- y + 2, 0);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(),
+ x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0);
GL11.glColor4f(1, 1, 1, 1);
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(pageFlipped);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
- GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52);
- gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate,
- 0, 0, 0);
+ gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate, 0, 0, 0);
name.add(items[0].getDisplayName());
- if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20
- && mouseY <= y + 20 + 16)
+ if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16)
gui.drawHoverString(name, x, y + 20);
name.removeAll(name);
GL11.glDisable(GL11.GL_LIGHTING);
- gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate,
- 0, 0, 0);
+ gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate, 0, 0, 0);
drawText(gui, text, x, y + 30);
GL11.glColor4f(1, 1, 1, 1);
GL11.glDisable(GL11.GL_BLEND);
}
- public static void addImageTextPage(GuiGuide gui, int x, int y,
- ItemStack item, String text, float size,
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size,
boolean rotate) {
y += 5;
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
- GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
- + item.getDisplayName(),
- x + Math.abs(70 - gui.getFont()
- .getStringWidth(item
- .getDisplayName())
- / 2) - 10,
- y + (int) size / 5, 0);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(),
+ x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int) size / 5, 0);
GL11.glColor4f(1, 1, 1, 1);
- gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0,
- 0);
+ gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0, 0);
drawText(gui, text, x - 2, y - (int) (250 / size));
GL11.glDisable(GL11.GL_BLEND);
}
- public static void addSlotItem(GuiGuide gui, int x, int y,
- int mouseX, int mouseY, ItemStack item, float xRot,
+ public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item, float xRot,
float yRot, float zRot) {
ArrayList<String> name = new ArrayList<>();
GL11.glColor4f(1, 1, 1, 1);
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(pageFlipped);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
- GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12);
if (item.getItem() != null) {
name.add(item.getDisplayName());
- if (mouseX >= x + 10 && mouseX <= x + 20
- && mouseY >= y + 20
- && mouseY <= y + 30)
+ if (mouseX >= x + 10 && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 30)
gui.drawHoverString(name, x, y + 10);
name.removeAll(name);
}
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glColor4f(1, 1, 1, 1);
if (item.getItem() != null)
- gui.renderItem(item, x + 15, y + 25, 40f, false,
- xRot, yRot, zRot);
+ gui.renderItem(item, x + 15, y + 25, 40f, false, xRot, yRot, zRot);
GL11.glDisable(GL11.GL_BLEND);
}
- public static void addImageTextPage(GuiGuide gui, int x, int y,
- ItemStack item, String text, float size, int txtX,
- int txtY, boolean showName, int imgX, int imgY,
- boolean rotate) {
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX,
+ int txtY, boolean showName, int imgX, int imgY, boolean rotate) {
y += 5;
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
- GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if (showName)
gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + item.getDisplayName()
- .substring(0, item
- .getDisplayName()
- .length() > 23 ? 23
- : item.getDisplayName()
- .length()),
- x + Math.abs(70 - gui.getFont()
- .getStringWidth(item
- .getDisplayName())
- / 2) - 10,
- y + 2, 0);
+ EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ + item.getDisplayName().substring(0,
+ item.getDisplayName().length() > 23 ? 23 : item.getDisplayName().length()),
+ x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0);
GL11.glColor4f(1, 1, 1, 1);
- gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size,
- rotate, 0, 0, 0);
+ gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0);
drawText(gui, text, x + txtX, y + txtY);
GL11.glDisable(GL11.GL_BLEND);
}
- public static void addImageTextPage(GuiGuide gui, int x, int y,
- ItemStack item, String text, float size, int txtX,
- int txtY, String title, int imgX, int imgY,
- boolean rotate) {
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX,
+ int txtY, String title, int imgX, int imgY, boolean rotate) {
y += 5;
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
- GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + title.substring(0, item.getDisplayName()
- .length() > 23 ? 23
- : title.length()),
- x + Math.abs(70 - gui.getFont()
- .getStringWidth(title) / 2)
- - 10,
- y + 2, 0);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(
+ EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ + title.substring(0, item.getDisplayName().length() > 23 ? 23 : title.length()),
+ x + Math.abs(70 - gui.getFont().getStringWidth(title) / 2) - 10, y + 2, 0);
GL11.glColor4f(1, 1, 1, 1);
- gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size,
- rotate, 0, 0, 0);
+ gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0);
drawText(gui, text, x + txtX, y + txtY);
GL11.glDisable(GL11.GL_BLEND);
}
- public static void addTextPage(GuiGuide gui, int x, int y,
- String text) {
+ public static void addTextPage(GuiGuide gui, int x, int y, String text) {
y -= 25;
drawText(gui, text, x, y);
GL11.glColor4f(1, 1, 1, 1);
}
- public static void drawText(GuiGuide gui, String text, int x,
- int y) {
+ public static void drawText(GuiGuide gui, String text, int x, int y) {
String[] s = text.split(" ");
String displayText = "";
float scale = 0.75F;
@@ -257,10 +172,7 @@ public class Page { for (int i = 0; i < textLines.size(); i++) {
GL11.glPushMatrix();
GL11.glScalef(scale, scale, 0f);
- gui.getFont().drawString(textLines.get(i),
- (int) (x / scale),
- (int) ((y + 32 + i * 9) / scale),
- 0);
+ gui.getFont().drawString(textLines.get(i), (int) (x / scale), (int) ((y + 32 + i * 9) / scale), 0);
GL11.glPopMatrix();
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabCurses.java b/src/main/java/darkknight/jewelrycraft/client/TabCurses.java index 09ccb36..ca5a84a 100755 --- a/src/main/java/darkknight/jewelrycraft/client/TabCurses.java +++ b/src/main/java/darkknight/jewelrycraft/client/TabCurses.java @@ -12,8 +12,7 @@ public class TabCurses extends AbstractTab { @Override
public void onTabClicked() {
- JewelrycraftMod.netWrapper
- .sendToServer(new PacketKeyPressEvent(1));
+ JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(1));
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java b/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java index 44d2118..eb555eb 100755 --- a/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java @@ -12,8 +12,7 @@ public class TabJewelry extends AbstractTab { @Override
public void onTabClicked() {
- JewelrycraftMod.netWrapper
- .sendToServer(new PacketKeyPressEvent(0));
+ JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0));
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java index 9b30274..2179816 100755 --- a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java +++ b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java @@ -36,71 +36,52 @@ public class TabRegistry { int ySize = 166;
int guiLeft = (event.gui.width - xSize) / 2;
int guiTop = (event.gui.height - ySize) / 2;
- if (!mc.thePlayer.getActivePotionEffects()
- .isEmpty())
+ if (!mc.thePlayer.getActivePotionEffects().isEmpty())
if (Loader.isModLoaded("NotEnoughItems")) {
try {
// Check whether NEI is
// hidden and enabled
- Class<?> c = Class.forName(
- "codechicken.nei.NEIClientConfig");
- Object hidden = c
- .getMethod("isHidden")
- .invoke(null);
- Object enabled = c
- .getMethod("isEnabled")
- .invoke(null);
- if (hidden != null
- && hidden instanceof Boolean
- && enabled != null
+ Class<?> c = Class.forName("codechicken.nei.NEIClientConfig");
+ Object hidden = c.getMethod("isHidden").invoke(null);
+ Object enabled = c.getMethod("isEnabled").invoke(null);
+ if (hidden != null && hidden instanceof Boolean && enabled != null
&& enabled instanceof Boolean)
- if ((Boolean) hidden
- || !((Boolean) enabled))
+ if ((Boolean) hidden || !((Boolean) enabled))
guiLeft += 60;
} catch (Exception e) {
// Do nothing
}
} else
guiLeft += 60;
- updateTabValues(guiLeft, guiTop,
- InventoryTabVanilla.class);
+ updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class);
addTabsToList(event.buttonList);
}
}
- private static Minecraft mc = FMLClientHandler.instance()
- .getClient();
+ private static Minecraft mc = FMLClientHandler.instance().getClient();
public static void openInventoryGui() {
- mc.thePlayer.sendQueue
- .addToSendQueue(new C0DPacketCloseWindow(
- mc.thePlayer.openContainer.windowId));
+ mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId));
GuiInventory inventory = new GuiInventory(mc.thePlayer);
mc.displayGuiScreen(inventory);
}
- public static void updateTabValues(int cornerX, int cornerY,
- Class<?> selectedButton) {
+ public static void updateTabValues(int cornerX, int cornerY, Class<?> selectedButton) {
int count = 0;
for (int i = 0; i < tabList.size(); i++) {
AbstractTab t = tabList.get(i);
if (t.shouldAddToList()) {
- if (selectedButton
- .equals(TabCurses.class)) {
+ if (selectedButton.equals(TabCurses.class)) {
t.xPosition = cornerX + 195;
t.yPosition = cornerY + count * 20;
- } else if (selectedButton.equals(
- TabJewelry.class)) {
- t.xPosition = cornerX + 140
- + count * 20;
+ } else if (selectedButton.equals(TabJewelry.class)) {
+ t.xPosition = cornerX + 140 + count * 20;
t.yPosition = cornerY + 64;
} else {
- t.xPosition = cornerX + 131
- + count * 20;
+ t.xPosition = cornerX + 131 + count * 20;
t.yPosition = cornerY + 64;
}
- t.enabled = !t.getClass()
- .equals(selectedButton);
+ t.enabled = !t.getClass().equals(selectedButton);
if (t.enabled)
count++;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java index 0c833ec..da3d340 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java @@ -25,14 +25,13 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class GuiCurseInfo extends GuiContainer {
- World world;
- EntityPlayer player;
- ResourceLocation texture;
- int page = 0, maxPages = 1;
- String selectedCurse = "";
+ World world;
+ EntityPlayer player;
+ ResourceLocation texture;
+ int page = 0, maxPages = 1;
+ String selectedCurse = "";
- public GuiCurseInfo(Container container, World world,
- EntityPlayer player, ResourceLocation texture) {
+ public GuiCurseInfo(Container container, World world, EntityPlayer player, ResourceLocation texture) {
super(container);
this.world = world;
this.player = player;
@@ -47,73 +46,46 @@ public class GuiCurseInfo extends GuiContainer { }
@Override
- public void drawGuiContainerBackgroundLayer(float f, int mouseX,
- int mouseY) {
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(texture);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (player != null) {
- NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player,
- Variables.MODID);
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
if (!player.capabilities.isCreativeMode)
- maxPages = playerInfo.getInteger(
- "activeCurses") / 5
- - (playerInfo.getInteger(
- "activeCurses")
- % 5 == 0 ? 1
- : 0);
+ maxPages = playerInfo.getInteger("activeCurses") / 5
+ - (playerInfo.getInteger("activeCurses") % 5 == 0 ? 1 : 0);
else
- maxPages = Curse.getCurseList().size() / 5
- - (Curse.getCurseList()
- .size()
- % 5 == 0 ? 1
- : 0);
+ maxPages = Curse.getCurseList().size() / 5 - (Curse.getCurseList().size() % 5 == 0 ? 1 : 0);
if (!player.capabilities.isCreativeMode)
survivalCurses(playerInfo);
else
creativeCurses(playerInfo);
if (playerInfo.hasKey("cursePoints"))
- this.drawString(fontRendererObj,
- "Curse points: " + playerInfo
- .getInteger("cursePoints")
- + " | Active curses: "
- + playerInfo.getInteger(
- "activeCurses"),
- guiLeft, guiTop - 10,
- 0xffffff);
+ this.drawString(fontRendererObj, "Curse points: " + playerInfo.getInteger("cursePoints")
+ + " | Active curses: " + playerInfo.getInteger("activeCurses"), guiLeft, guiTop - 10, 0xffffff);
}
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(texture);
- drawTexturedModalRect(guiLeft + 5, guiTop + ySize - 14, 0,
- ySize, 13, 11);
- drawTexturedModalRect(guiLeft + xSize - 38,
- guiTop + ySize - 14, 13, ySize, 13, 11);
- this.drawString(fontRendererObj,
- (page + 1) + "/" + (maxPages + 1),
- guiLeft + 90, guiTop + 153, 0xffffff);
- this.drawString(fontRendererObj,
- "Click on an active curse to see its description",
- guiLeft, guiTop + 170, 0xffffff);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ drawTexturedModalRect(guiLeft + 5, guiTop + ySize - 14, 0, ySize, 13, 11);
+ drawTexturedModalRect(guiLeft + xSize - 38, guiTop + ySize - 14, 13, ySize, 13, 11);
+ this.drawString(fontRendererObj, (page + 1) + "/" + (maxPages + 1), guiLeft + 90, guiTop + 153, 0xffffff);
+ this.drawString(fontRendererObj, "Click on an active curse to see its description", guiLeft, guiTop + 170,
+ 0xffffff);
if (player.capabilities.isCreativeMode) {
- drawText(this, "To enable or disable a curse simply hold the CTRL key and click on one.",
- guiLeft - 100, guiTop, 20,
- 0xff0000);
- drawText(this, "If you do not have any curse points you need to type the command '/jw addCursePoints [playerUsername] [no of curse points]'. If you don't do this any curse you activate won't have any effect.",
- guiLeft - 100, guiTop + 50, 20,
- 0xff0000);
+ drawText(this, "To enable or disable a curse simply hold the CTRL key and click on one.", guiLeft - 100,
+ guiTop, 20, 0xff0000);
+ drawText(this,
+ "If you do not have any curse points you need to type the command '/jw addCursePoints [playerUsername] [no of curse points]'. If you don't do this any curse you activate won't have any effect.",
+ guiLeft - 100, guiTop + 50, 20, 0xff0000);
}
}
- public static void drawText(GuiCurseInfo gui, String text, int x,
- int y, int characters, int color) {
+ public static void drawText(GuiCurseInfo gui, String text, int x, int y, int characters, int color) {
String[] s = text.split(" ");
String displayText = "";
ArrayList<String> textLines = new ArrayList<>();
for (String element : s)
- if ((displayText + element + " ")
- .length() <= characters)
+ if ((displayText + element + " ").length() <= characters)
displayText += element + " ";
else {
textLines.add(displayText.trim());
@@ -121,8 +93,7 @@ public class GuiCurseInfo extends GuiContainer { }
textLines.add(displayText.trim());
for (int i = 0; i < textLines.size(); i++)
- gui.drawString(gui.getFont(), textLines.get(i), x,
- y + i * 9, color);
+ gui.drawString(gui.getFont(), textLines.get(i), x, y + i * 9, color);
}
public FontRenderer getFont() {
@@ -134,130 +105,51 @@ public class GuiCurseInfo extends GuiContainer { int ind = 0;
if (!playerInfo.hasNoTags()) {
for (Curse curse : Curse.getCurseList()) {
- if (playerInfo.getInteger(
- curse.getName()) > 0) {
- if (ind >= page * 5 && ind < (page
- + 1) * 5) {
- if (ind == page * 5
- && selectedCurse == "")
- selectedCurse = curse
- .getName();
- mc.renderEngine.bindTexture(
- Variables.MISC_TEXTURE);
- drawTexturedModalRect(
- guiLeft + 43,
- guiTop + 8 + (size
- - 8)
- * (ind - page * 5),
- 0, 32, 112,
- 22);
- if (selectedCurse == curse
- .getName()) {
+ if (playerInfo.getInteger(curse.getName()) > 0) {
+ if (ind >= page * 5 && ind < (page + 1) * 5) {
+ if (ind == page * 5 && selectedCurse == "")
+ selectedCurse = curse.getName();
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
+ drawTexturedModalRect(guiLeft + 43, guiTop + 8 + (size - 8) * (ind - page * 5), 0, 32, 112, 22);
+ if (selectedCurse == curse.getName()) {
GL11.glPushMatrix();
- GL11.glScalef(1.2f,
- 1.5f,
- 0f);
- drawTexturedModalRect(
- (int) (guiLeft / (1.2))
- + 126,
- (int) (guiTop / (1.5))
- + 7
- + (size - 16) * (ind
- - page * 5),
- 48,
- 16,
- 32,
- 16);
- drawTexturedModalRect(
- (int) (guiLeft / (1.2))
- + 5,
- (int) (guiTop / (1.5))
- + 7
- + (size - 16) * (ind
- - page * 5),
- 80,
- 16,
- 32,
- 16);
+ GL11.glScalef(1.2f, 1.5f, 0f);
+ drawTexturedModalRect((int) (guiLeft / (1.2)) + 126,
+ (int) (guiTop / (1.5)) + 7 + (size - 16) * (ind - page * 5), 48, 16, 32, 16);
+ drawTexturedModalRect((int) (guiLeft / (1.2)) + 5,
+ (int) (guiTop / (1.5)) + 7 + (size - 16) * (ind - page * 5), 80, 16, 32, 16);
GL11.glPopMatrix();
GL11.glPushMatrix();
- List<?> descr = fontRendererObj
- .listFormattedStringToWidth(
- curse.getDescription(),
- 238);
- GL11.glScalef(0.75F,
- 0.75F,
- 0F);
- for (int i = 0; i < descr
- .size(); i++)
- this.drawString(fontRendererObj,
- descr.get(i).toString(),
- (int) (guiLeft / 0.75F)
- + 12,
- (int) (guiTop / 0.75F)
- + 184
- + i * 12
- - (descr.size() > 1
- ? 6
- : 0),
- 0xffffff);
+ List<?> descr = fontRendererObj.listFormattedStringToWidth(curse.getDescription(), 238);
+ GL11.glScalef(0.75F, 0.75F, 0F);
+ for (int i = 0; i < descr.size(); i++)
+ this.drawString(fontRendererObj, descr.get(i).toString(), (int) (guiLeft / 0.75F) + 12,
+ (int) (guiTop / 0.75F) + 184 + i * 12 - (descr.size() > 1 ? 6 : 0), 0xffffff);
GL11.glPopMatrix();
}
- if (playerInfo.getInteger(
- curse.getName()) == 2) {
- mc.renderEngine.bindTexture(
- Variables.MISC_TEXTURE);
+ if (playerInfo.getInteger(curse.getName()) == 2) {
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(
- GL11.GL_SRC_ALPHA,
- GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glColor4f(1f,
- 1f,
- 1f,
- 0.5f);
- drawTexturedModalRect(
- guiLeft + 134,
- guiTop + 11 + (size
- - 8)
- * (ind - page * 5),
- 3 * 16,
- 0,
- 16,
- 16);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glColor4f(1f, 1f, 1f, 0.5f);
+ drawTexturedModalRect(guiLeft + 134, guiTop + 11 + (size - 8) * (ind - page * 5), 3 * 16, 0,
+ 16, 16);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
- mc.renderEngine.bindTexture(
- new ResourceLocation(
- Variables.MODID,
- "textures/gui/" + curse
- .getTexturePack()
- + ".png"));
+ mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID,
+ "textures/gui/" + curse.getTexturePack() + ".png"));
int tag = curse.getTextureID();
GL11.glPushMatrix();
- GL11.glColor4f(1.0F, 1.0F,
- 1.0F,
- 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glScalef(0.5f, 0.5f,
- 0.0f);
- drawTexturedModalRect(
- guiLeft * 2 + 100,
- guiTop * 2 + 22 + (ind
- - page * 5)
- * 48,
- tag % 8 * 32,
- tag / 8 * 32,
- 32, 32);
+ GL11.glScalef(0.5f, 0.5f, 0.0f);
+ drawTexturedModalRect(guiLeft * 2 + 100, guiTop * 2 + 22 + (ind - page * 5) * 48, tag % 8 * 32,
+ tag / 8 * 32, 32, 32);
GL11.glPopMatrix();
- this.drawString(fontRendererObj,
- curse.getDisplayName(),
- guiLeft + 70,
- guiTop + 15 + (ind
- - page * 5)
- * (size - 8),
- 0xffffff);
+ this.drawString(fontRendererObj, curse.getDisplayName(), guiLeft + 70,
+ guiTop + 15 + (ind - page * 5) * (size - 8), 0xffffff);
}
ind++;
}
@@ -272,103 +164,50 @@ public class GuiCurseInfo extends GuiContainer { if (ind >= page * 5 && ind < (page + 1) * 5) {
if (ind == page * 5 && selectedCurse == "")
selectedCurse = curse.getName();
- if (playerInfo.getInteger(
- curse.getName()) <= 0) {
+ if (playerInfo.getInteger(curse.getName()) <= 0) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
- GL11.GL_ONE_MINUS_SRC_ALPHA);
- if (!curse.canCurseBeActivated()
- || !ConfigHandler.CURSES_ENABLED)
- GL11.glColor4f(1f, 0f, 0f,
- 0.5f);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ if (!curse.canCurseBeActivated() || !ConfigHandler.CURSES_ENABLED)
+ GL11.glColor4f(1f, 0f, 0f, 0.5f);
else
- GL11.glColor4f(1f, 1f, 1f,
- 0.5f);
+ GL11.glColor4f(1f, 1f, 1f, 0.5f);
}
- mc.renderEngine.bindTexture(
- Variables.MISC_TEXTURE);
- drawTexturedModalRect(guiLeft + 43, guiTop
- + 8
- + (size - 8) * (ind - page
- * 5),
- 0, 32, 112, 22);
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
+ drawTexturedModalRect(guiLeft + 43, guiTop + 8 + (size - 8) * (ind - page * 5), 0, 32, 112, 22);
if (selectedCurse == curse.getName()) {
GL11.glPushMatrix();
GL11.glScalef(1.2f, 1.5f, 0f);
- drawTexturedModalRect(
- (int) (guiLeft / (1.2))
- + 126,
- (int) (guiTop / (1.5))
- + 7
- + (size - 16) * (ind
- - page * 5),
- 48, 16, 32, 16);
- drawTexturedModalRect(
- (int) (guiLeft / (1.2))
- + 5,
- (int) (guiTop / (1.5))
- + 7
- + (size - 16) * (ind
- - page * 5),
- 80, 16, 32, 16);
+ drawTexturedModalRect((int) (guiLeft / (1.2)) + 126,
+ (int) (guiTop / (1.5)) + 7 + (size - 16) * (ind - page * 5), 48, 16, 32, 16);
+ drawTexturedModalRect((int) (guiLeft / (1.2)) + 5,
+ (int) (guiTop / (1.5)) + 7 + (size - 16) * (ind - page * 5), 80, 16, 32, 16);
GL11.glPopMatrix();
GL11.glPushMatrix();
- List<?> descr = fontRendererObj
- .listFormattedStringToWidth(
- curse.getDescription(),
- 238);
+ List<?> descr = fontRendererObj.listFormattedStringToWidth(curse.getDescription(), 238);
GL11.glScalef(0.75F, 0.75F, 0F);
- for (int i = 0; i < descr
- .size(); i++)
- this.drawString(fontRendererObj,
- descr.get(i).toString(),
- (int) (guiLeft / 0.75F)
- + 12,
- (int) (guiTop / 0.75F)
- + 184
- + i * 12
- - (descr.size() > 1
- ? 6
- : 0),
- 0xffffff);
+ for (int i = 0; i < descr.size(); i++)
+ this.drawString(fontRendererObj, descr.get(i).toString(), (int) (guiLeft / 0.75F) + 12,
+ (int) (guiTop / 0.75F) + 184 + i * 12 - (descr.size() > 1 ? 6 : 0), 0xffffff);
GL11.glPopMatrix();
}
mc.renderEngine.bindTexture(
- new ResourceLocation(
- Variables.MODID,
- "textures/gui/" + curse
- .getTexturePack()
- + ".png"));
+ new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png"));
int tag = curse.getTextureID();
GL11.glPushMatrix();
- if (playerInfo.getInteger(
- curse.getName()) <= 0)
- GL11.glColor4f(1.0F, 1.0F, 1.0F,
- 0.5F);
+ if (playerInfo.getInteger(curse.getName()) <= 0)
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
else
- GL11.glColor4f(1.0F, 1.0F, 1.0F,
- 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(0.5f, 0.5f, 0.0f);
- drawTexturedModalRect(guiLeft * 2 + 100,
- guiTop * 2 + 22 + (ind
- - page * 5)
- * 48,
- tag % 8 * 32, tag / 8 * 32,
- 32, 32);
+ drawTexturedModalRect(guiLeft * 2 + 100, guiTop * 2 + 22 + (ind - page * 5) * 48, tag % 8 * 32,
+ tag / 8 * 32, 32, 32);
GL11.glPopMatrix();
- this.drawString(fontRendererObj,
- curse.getDisplayName(),
- guiLeft + 70,
- guiTop + 15 + (ind
- - page * 5)
- * (size - 8),
- playerInfo.getInteger(curse
- .getName()) > 0 ? 0xffffffff
- : 0xaaffffff);
- if (playerInfo.getInteger(
- curse.getName()) <= 0) {
+ this.drawString(fontRendererObj, curse.getDisplayName(), guiLeft + 70,
+ guiTop + 15 + (ind - page * 5) * (size - 8),
+ playerInfo.getInteger(curse.getName()) > 0 ? 0xffffffff : 0xaaffffff);
+ if (playerInfo.getInteger(curse.getName()) <= 0) {
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
@@ -378,8 +217,7 @@ public class GuiCurseInfo extends GuiContainer { }
@Override
- public void drawGuiContainerForegroundLayer(int mouseX,
- int mouseY) {
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
// Do nothing
}
@@ -396,8 +234,7 @@ public class GuiCurseInfo extends GuiContainer { int cornerX = guiLeft;
int cornerY = guiTop;
this.buttonList.clear();
- TabRegistry.updateTabValues(cornerX, cornerY,
- TabCurses.class);
+ TabRegistry.updateTabValues(cornerX, cornerY, TabCurses.class);
TabRegistry.addTabsToList(this.buttonList);
}
@@ -407,101 +244,47 @@ public class GuiCurseInfo extends GuiContainer { int ind = 0;
int size = 32;
if (player != null) {
- NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player,
- Variables.MODID);
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
for (Curse curse : Curse.getCurseList()) {
if (player.capabilities.isCreativeMode) {
- if (x > (guiLeft + 43)
- && y > (guiTop + 8
- + (size - 8) * (ind
- - page * 5))
- && x < (guiLeft + 43
- + 112)
- && y < (guiTop + 40
- + (size - 8) * (ind
- - page * 5))
- && ind >= page * 5
- && ind < (page + 1)
- * 5) {
- if (player.capabilities.isCreativeMode
- && isCtrlKeyDown()
- && playerInfo.getInteger(
- curse.getName()) > 0) {
- playerInfo.setInteger(
- curse.getName(),
- 0);
- playerInfo.setInteger(
- "activeCurses",
- playerInfo.getInteger(
- "activeCurses")
- - 1);
- Curse.availableCurses
- .add(curse);
- JewelrycraftMod.netWrapper
- .sendToServer(new PacketSendServerPlayerInfo(
- "remove",
- curse.getName(),
- playerInfo));
- JewelrycraftMod.netWrapper
- .sendToAll(new PacketSendServerPlayersInfo());
- } else if (player.capabilities.isCreativeMode
- && isCtrlKeyDown()
- && playerInfo.getInteger(
- curse.getName()) <= 0
- && curse.canCurseBeActivated()
+ if (x > (guiLeft + 43) && y > (guiTop + 8 + (size - 8) * (ind - page * 5))
+ && x < (guiLeft + 43 + 112) && y < (guiTop + 40 + (size - 8) * (ind - page * 5))
+ && ind >= page * 5 && ind < (page + 1) * 5) {
+ if (player.capabilities.isCreativeMode && isCtrlKeyDown()
+ && playerInfo.getInteger(curse.getName()) > 0) {
+ playerInfo.setInteger(curse.getName(), 0);
+ playerInfo.setInteger("activeCurses", playerInfo.getInteger("activeCurses") - 1);
+ Curse.availableCurses.add(curse);
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketSendServerPlayerInfo("remove", curse.getName(), playerInfo));
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendServerPlayersInfo());
+ } else if (player.capabilities.isCreativeMode && isCtrlKeyDown()
+ && playerInfo.getInteger(curse.getName()) <= 0 && curse.canCurseBeActivated()
&& ConfigHandler.CURSES_ENABLED) {
- playerInfo.setInteger(
- curse.getName(),
- 1);
- playerInfo.setInteger(
- "activeCurses",
- playerInfo.getInteger(
- "activeCurses")
- + 1);
- Curse.availableCurses
- .remove(curse);
+ playerInfo.setInteger(curse.getName(), 1);
+ playerInfo.setInteger("activeCurses", playerInfo.getInteger("activeCurses") + 1);
+ Curse.availableCurses.remove(curse);
JewelrycraftMod.netWrapper
- .sendToServer(new PacketSendServerPlayerInfo(
- "add",
- curse.getName(),
- playerInfo));
- JewelrycraftMod.netWrapper
- .sendToAll(new PacketSendServerPlayersInfo());
+ .sendToServer(new PacketSendServerPlayerInfo("add", curse.getName(), playerInfo));
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendServerPlayersInfo());
} else
- selectedCurse = curse
- .getName();
+ selectedCurse = curse.getName();
}
ind++;
- } else if (playerInfo.getInteger(
- curse.getName()) > 0) {
- if (x > (guiLeft + 43)
- && y > (guiTop + 8
- + (size - 8) * (ind
- - page * 5))
- && x < (guiLeft + 43
- + 112)
- && y < (guiTop + 40
- + (size - 8) * (ind
- - page * 5))
- && ind >= page * 5
- && ind < (page + 1)
- * 5)
- selectedCurse = curse
- .getName();
+ } else if (playerInfo.getInteger(curse.getName()) > 0) {
+ if (x > (guiLeft + 43) && y > (guiTop + 8 + (size - 8) * (ind - page * 5))
+ && x < (guiLeft + 43 + 112) && y < (guiTop + 40 + (size - 8) * (ind - page * 5))
+ && ind >= page * 5 && ind < (page + 1) * 5)
+ selectedCurse = curse.getName();
ind++;
}
}
}
- if (page > 0 && x > guiLeft + 5 && x < guiLeft + 18
- && y > guiTop + ySize - 14
- && y < guiTop + ySize - 3) {
+ if (page > 0 && x > guiLeft + 5 && x < guiLeft + 18 && y > guiTop + ySize - 14 && y < guiTop + ySize - 3) {
page--;
selectedCurse = "";
}
- if (page < maxPages && x > guiLeft + xSize - 38
- && x < guiLeft + xSize - 25
- && y > guiTop + ySize - 14
+ if (page < maxPages && x > guiLeft + xSize - 38 && x < guiLeft + xSize - 25 && y > guiTop + ySize - 14
&& y < guiTop + ySize - 3) {
page++;
selectedCurse = "";
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java index d322761..446f7bd 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java @@ -21,25 +21,18 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class GuiGuide extends GuiContainer {
- public int page, rot, del;
- public boolean prevHover, nextHover;
- World world;
- private final GuiTab[] tabs = new GuiTab[] {
- new GuiTabIntroduction(0), new GuiTabBlocks(1),
- new GuiTabItems(2), new GuiTabGemsAndIngots(3),
- new GuiTabCurses(4), new GuiTabModifiers(5),
- new GuiTabRitual(6)
- };
- private GuiTab activeTab;
- ResourceLocation pageTexture, flippedPageTexture;
+ public int page, rot, del;
+ public boolean prevHover, nextHover;
+ World world;
+ private final GuiTab[] tabs = new GuiTab[] { new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2),
+ new GuiTabGemsAndIngots(3), new GuiTabCurses(4), new GuiTabModifiers(5), new GuiTabRitual(6) };
+ private GuiTab activeTab;
+ ResourceLocation pageTexture, flippedPageTexture;
// GUIDE
- public static GuiTab prevActive = new GuiTabIntroduction(
- 0);
- public static int prevPage = 1;
+ public static GuiTab prevActive = new GuiTabIntroduction(0);
+ public static int prevPage = 1;
- public GuiGuide(Container container, World world,
- ResourceLocation pageTex,
- ResourceLocation flipPageTex) {
+ public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) {
super(container);
page = prevPage;
rot = 0;
@@ -52,8 +45,7 @@ public class GuiGuide extends GuiContainer { }
@Override
- protected void drawGuiContainerBackgroundLayer(float f, int i,
- int j) {
+ protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
nextHover = false;
prevHover = false;
if (del == 0)
@@ -61,14 +53,10 @@ public class GuiGuide extends GuiContainer { del++;
if (del >= 2)
del = 0;
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(pageTexture);
- drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10,
- 0, 0, 145, 179);
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(flippedPageTexture);
- drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10,
- 0, 0, 145, 179);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture);
+ drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 179);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture);
+ drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 179);
for (GuiRectangle tab : tabs) {
int srcX = 24;
int sizeX = 19;
@@ -79,44 +67,28 @@ public class GuiGuide extends GuiContainer { srcX += 19;
tab.draw(this, srcX, 180, sizeX, 18);
}
- if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11
- && j >= guiTop + 127 + 20
- && j <= guiTop + 127 + 20 + 14
- && page + 2 <= activeTab.getMaxPages()) {
- drawTexturedModalRect(guiLeft + 195 + 20,
- guiTop + 127 + 20, 0, 180, 11, 14);
+ if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20
+ && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()) {
+ drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14);
nextHover = true;
}
- if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11
- && j >= guiTop + 127 + 20
- && j <= guiTop + 127 + 20 + 14
- && page - 2 > 0) {
- drawTexturedModalRect(guiLeft - 61 + 20,
- guiTop + 127 + 20, 11, 180, 11,
- 14);
+ if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20
+ && j <= guiTop + 127 + 20 + 14 && page - 2 > 0) {
+ drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14);
prevHover = true;
}
activeTab.drawBackground(this, i, j, page);
activeTab.drawBackground(this, i, j, page + 1);
ArrayList<String> text = new ArrayList<>();
text.add(page + "/" + activeTab.getMaxPages());
- drawHoveringText(text,
- guiLeft - 10 + 20 - text.get(0).length(),
- guiTop + 150 + 25, fontRendererObj);
+ drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 25, fontRendererObj);
if (page < activeTab.getMaxPages()) {
text.remove(0);
- text.add((page + 1) + "/"
- + activeTab.getMaxPages());
- drawHoveringText(text,
- guiLeft - 10 + 20 + 147 - text
- .get(0).length(),
- guiTop + 150 + 25,
- fontRendererObj);
+ text.add((page + 1) + "/" + activeTab.getMaxPages());
+ drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 25, fontRendererObj);
}
for (int tab = 0; tab < tabs.length; tab++)
- renderItem(tabs[tab].getIcon(), guiLeft - 52,
- guiTop + 26 + tab * 19,
- activeTab.getIcon());
+ renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon());
}
@Override
@@ -148,12 +120,10 @@ public class GuiGuide extends GuiContainer { }
}
- public void renderItem(ItemStack item, float x, float y,
- ItemStack activeIcon) {
+ public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
- EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D,
- 0.0D, item);
+ EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
entityitem.hoverStart = 0.0F;
if (item.isItemEqual(new ItemStack(BlockList.smelter))) {
y -= 3;
@@ -166,40 +136,31 @@ public class GuiGuide extends GuiContainer { GL11.glRotatef(rot, 0, 1, 0);
if (item.isItemEqual(new ItemStack(BlockList.smelter)))
GL11.glScalef(1.5F, 1.5F, 1.5F);
- else if (item.isItemEqual(
- new ItemStack(BlockList.handPedestal))) {
+ else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))) {
GL11.glScalef(1.2F, 1.2F, 1.2F);
GL11.glTranslatef(0F, -0.05F, 0F);
}
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- if (!(Block.getBlockFromItem(entityitem.getEntityItem()
- .getItem()) instanceof BlockAir))
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir))
RenderHelper.enableStandardItemLighting();
if (RenderManager.instance.options.fancyGraphics)
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F,
- 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
else {
GL11.glRotatef(180F, 0F, 1F, 0F);
RenderManager.instance.options.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F,
- 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
- if (!(Block.getBlockFromItem(entityitem.getEntityItem()
- .getItem()) instanceof BlockAir))
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir))
RenderHelper.disableStandardItemLighting();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
- public void renderItem(ItemStack item, float x, float y,
- float scale, boolean rotate, float xRot,
- float yRot, float zRot) {
+ public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot,
+ float zRot) {
GL11.glPushMatrix();
- EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D,
- 0.0D, item);
+ EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
entityitem.hoverStart = 0.0F;
GL11.glTranslatef(x, y, 100);
GL11.glScalef(-scale, scale, scale);
@@ -212,27 +173,19 @@ public class GuiGuide extends GuiContainer { GL11.glRotatef(zRot, 0, 0, 1);
if (xRot >= 90F || zRot >= 90F)
GL11.glTranslatef(0F, -0.2F, 0F);
- if (Block.getBlockFromItem(entityitem
- .getEntityItem()
- .getItem()) instanceof BlockShadowEye)
+ if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye)
GL11.glTranslatef(0F, 0F, 0.025F);
}
- if (!(Block.getBlockFromItem(entityitem.getEntityItem()
- .getItem()) instanceof BlockAir))
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir))
RenderHelper.enableStandardItemLighting();
if (RenderManager.instance.options.fancyGraphics)
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F,
- 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
else {
RenderManager.instance.options.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F,
- 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
- if (!(Block.getBlockFromItem(entityitem.getEntityItem()
- .getItem()) instanceof BlockAir))
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir))
RenderHelper.disableStandardItemLighting();
GL11.glPopMatrix();
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java index be4a907..6e0f399 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java @@ -4,11 +4,7 @@ import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry;
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.client.JewelryInventory;
-import darkknight.jewelrycraft.client.gui.container.ContainerCurseInfo;
-import darkknight.jewelrycraft.client.gui.container.ContainerGuide;
-import darkknight.jewelrycraft.client.gui.container.ContainerJewelryModifier;
-import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab;
-import darkknight.jewelrycraft.client.gui.container.ContainerRingChest;
+import darkknight.jewelrycraft.client.gui.container.*;
import darkknight.jewelrycraft.util.Variables;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryBasic;
@@ -17,26 +13,18 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler {
- ResourceLocation pageTexture = new ResourceLocation(
- Variables.MODID, "textures/gui/guidePage.png");
- ResourceLocation flippedPageTexture = new ResourceLocation(
- Variables.MODID, "textures/gui/guidePageFlip.png");
- ResourceLocation chestTexture = new ResourceLocation(
- Variables.MODID, "textures/gui/chest_ring.png");
- ResourceLocation jewelryInvTexture = new ResourceLocation(
- Variables.MODID, "textures/gui/jewelry_tab.png");
- ResourceLocation cursesInvTexture = new ResourceLocation(
- Variables.MODID, "textures/gui/curses_tab.png");
- ResourceLocation jewlryModTexture = new ResourceLocation(
- Variables.MODID,
- "textures/gui/jewelry_modifier.png");
+ ResourceLocation pageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePage.png");
+ ResourceLocation flippedPageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePageFlip.png");
+ ResourceLocation chestTexture = new ResourceLocation(Variables.MODID, "textures/gui/chest_ring.png");
+ ResourceLocation jewelryInvTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_tab.png");
+ ResourceLocation cursesInvTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses_tab.png");
+ ResourceLocation jewlryModTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_modifier.png");
/**
*
*/
public GuiHandler() {
- NetworkRegistry.INSTANCE.registerGuiHandler(
- JewelrycraftMod.instance, this);
+ NetworkRegistry.INSTANCE.registerGuiHandler(JewelrycraftMod.instance, this);
}
/**
@@ -49,34 +37,20 @@ public class GuiHandler implements IGuiHandler { * @return
*/
@Override
- public Object getServerGuiElement(int ID, EntityPlayer player,
- World world, int x, int y, int z) {
+ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
switch (ID) {
- case 0:
- return new ContainerRingChest(
- player.inventory,
- (TileEntityChest) world
- .getTileEntity(x,
- y,
- z));
- case 1:
- return new ContainerGuide();
- case 2:
- return new ContainerJewelryTab(player,
- player.inventory,
- new JewelryInventory(
- player));
- case 3:
- return new ContainerJewelryModifier(
- player.inventory,
- new InventoryBasic(
- "ItemModifier",
- false,
- 37));
- case 4:
- return new ContainerCurseInfo();
- default:
- return null;
+ case 0:
+ return new ContainerRingChest(player.inventory, (TileEntityChest) world.getTileEntity(x, y, z));
+ case 1:
+ return new ContainerGuide();
+ case 2:
+ return new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player));
+ case 3:
+ return new ContainerJewelryModifier(player.inventory, new InventoryBasic("ItemModifier", false, 37));
+ case 4:
+ return new ContainerCurseInfo();
+ default:
+ return null;
}
}
@@ -90,49 +64,24 @@ public class GuiHandler implements IGuiHandler { * @return
*/
@Override
- public Object getClientGuiElement(int ID, EntityPlayer player,
- World world, int x, int y, int z) {
+ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
switch (ID) {
- case 0:
- return new GuiRingChest(
- (ContainerRingChest) getServerGuiElement(
- ID, player,
- world, x,
- y, z),
- chestTexture);
- case 1:
- return new GuiGuide(
- (ContainerGuide) getServerGuiElement(
- ID, player,
- world, x,
- y, z),
- world, pageTexture,
- flippedPageTexture);
- case 2:
- return new GuiJewelry(
- new ContainerJewelryTab(
- player,
- player.inventory,
- new JewelryInventory(
- player)),
- jewelryInvTexture);
- case 3:
- return new GuiJewelryModifier(
- (ContainerJewelryModifier) getServerGuiElement(
- ID, player,
- world, x,
- y, z),
- jewlryModTexture);
- case 4:
- return new GuiCurseInfo(
- (ContainerCurseInfo) getServerGuiElement(
- ID, player,
- world, x,
- y, z),
- world, player,
- cursesInvTexture);
- default:
- return null;
+ case 0:
+ return new GuiRingChest((ContainerRingChest) getServerGuiElement(ID, player, world, x, y, z), chestTexture);
+ case 1:
+ return new GuiGuide((ContainerGuide) getServerGuiElement(ID, player, world, x, y, z), world, pageTexture,
+ flippedPageTexture);
+ case 2:
+ return new GuiJewelry(new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player)),
+ jewelryInvTexture);
+ case 3:
+ return new GuiJewelryModifier((ContainerJewelryModifier) getServerGuiElement(ID, player, world, x, y, z),
+ jewlryModTexture);
+ case 4:
+ return new GuiCurseInfo((ContainerCurseInfo) getServerGuiElement(ID, player, world, x, y, z), world, player,
+ cursesInvTexture);
+ default:
+ return null;
}
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java index 1498f75..9ca4f2e 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java @@ -18,8 +18,7 @@ public class GuiJewelry extends GuiContainer { * @param containerJewelryTab
* @param texture
*/
- public GuiJewelry(ContainerJewelryTab containerJewelryTab,
- ResourceLocation texture) {
+ public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) {
super(containerJewelryTab);
xSize = 194;
ySize = 166;
@@ -32,17 +31,13 @@ public class GuiJewelry extends GuiContainer { * @param mouseY
*/
@Override
- public void drawGuiContainerBackgroundLayer(float f, int mouseX,
- int mouseY) {
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(texture);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
GL11.glPushMatrix();
- GuiInventory.func_147046_a(guiLeft - 24, guiTop + 124, 60,
- (float) (guiLeft - 24) - mouseX,
- (float) (guiTop + 124 - 90) - mouseY,
- this.mc.thePlayer);
+ GuiInventory.func_147046_a(guiLeft - 24, guiTop + 124, 60, (float) (guiLeft - 24) - mouseX,
+ (float) (guiTop + 124 - 90) - mouseY, this.mc.thePlayer);
GL11.glPopMatrix();
}
@@ -51,8 +46,7 @@ public class GuiJewelry extends GuiContainer { * @param mouseY
*/
@Override
- public void drawGuiContainerForegroundLayer(int mouseX,
- int mouseY) {
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
// Do nothing
}
@@ -73,8 +67,7 @@ public class GuiJewelry extends GuiContainer { int cornerX = guiLeft;
int cornerY = guiTop;
this.buttonList.clear();
- TabRegistry.updateTabValues(cornerX, cornerY,
- TabJewelry.class);
+ TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class);
TabRegistry.addTabsToList(this.buttonList);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java index 30f0b5b..44984a5 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java @@ -22,20 +22,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation;
public class GuiJewelryModifier extends GuiContainer {
- private ResourceLocation texture;
- private GuiTextField searchField,
- pages;
- private int page = 1,
- maxPages = 1, selectedX = 0, selectedY = 0,
- selectedPage = 0, enabled = 0;
- private ItemStack selectedItem;
- private ArrayList<ItemStack> selectedItems = new ArrayList<>();
- private List<Map<Integer, Map<Integer, Integer>>> selectedItemsPos = new ArrayList<>();
- ContainerJewelryModifier jMod;
+ private ResourceLocation texture;
+ private GuiTextField searchField, pages;
+ private int page = 1, maxPages = 1, selectedX = 0, selectedY = 0, selectedPage = 0, enabled = 0;
+ private ItemStack selectedItem;
+ private ArrayList<ItemStack> selectedItems = new ArrayList<>();
+ private List<Map<Integer, Map<Integer, Integer>>> selectedItemsPos = new ArrayList<>();
+ ContainerJewelryModifier jMod;
- public GuiJewelryModifier(
- ContainerJewelryModifier containerJewelryTab,
- ResourceLocation texture) {
+ public GuiJewelryModifier(ContainerJewelryModifier containerJewelryTab, ResourceLocation texture) {
super(containerJewelryTab);
xSize = 211;
ySize = 247;
@@ -45,29 +40,19 @@ public class GuiJewelryModifier extends GuiContainer { }
@Override
- public void drawGuiContainerBackgroundLayer(float f, int mouseX,
- int mouseY) {
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(texture);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
- if (selectedX != 0 && selectedY != 0
- && page == selectedPage)
- drawTexturedModalRect(k + selectedX, l + selectedY,
- 211, 0, 18, 18);
+ if (selectedX != 0 && selectedY != 0 && page == selectedPage)
+ drawTexturedModalRect(k + selectedX, l + selectedY, 211, 0, 18, 18);
for (Map<Integer, Map<Integer, Integer>> items : selectedItemsPos) {
for (Object itemPage : items.keySet()) {
if (page == (Integer) itemPage)
- for (int x : items.get(itemPage)
- .keySet())
- drawTexturedModalRect(
- k + x,
- l + items.get(itemPage)
- .get(x),
- 211, 0, 18,
- 18);
+ for (int x : items.get(itemPage).keySet())
+ drawTexturedModalRect(k + x, l + items.get(itemPage).get(x), 211, 0, 18, 18);
}
}
this.searchField.drawTextBox();
@@ -75,37 +60,22 @@ public class GuiJewelryModifier extends GuiContainer { }
@Override
- public void drawGuiContainerForegroundLayer(int mouseX,
- int mouseY) {
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
int i = 0;
for (ItemStack item : JewelrycraftUtil.objects) {
- if (item != null && item.getItem() != null
- && (this.searchField
- .getText() == ""
- || item.getDisplayName()
- .toLowerCase()
- .contains(this.searchField
- .getText()
- .toLowerCase()))) {
+ if (item != null && item.getItem() != null && (this.searchField.getText() == ""
+ || item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase()))) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glColor3f(1F, 1F, 1F);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
if (i >= (page - 1) * 48 && i < page * 48)
try {
- itemRender.renderItemAndEffectIntoGUI(
- this.fontRendererObj,
- this.mc.getTextureManager(),
- item,
- 88 + 20 * (i % 6),
- 7 + 17 * (i / 6) - 136
- * (page - 1));
+ itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), item,
+ 88 + 20 * (i % 6), 7 + 17 * (i / 6) - 136 * (page - 1));
} catch (Exception e) {
- JewelrycraftMod.logger
- .info("Trying to display an item but gets this error: "
- + e.getMessage()
- + "\nThe item causing the issue is: "
- + item);
+ JewelrycraftMod.logger.info("Trying to display an item but gets this error: " + e.getMessage()
+ + "\nThe item causing the issue is: " + item);
}
GL11.glDisable(GL11.GL_LIGHTING);
i++;
@@ -118,14 +88,8 @@ public class GuiJewelryModifier extends GuiContainer { if (this.searchField.textboxKeyTyped(character, key)) {
int items = 0;
for (ItemStack item : JewelrycraftUtil.objects)
- if (item != null && searchField != null
- && searchField.getText() != ""
- && item.getItem() != null
- && item.getDisplayName()
- .toLowerCase()
- .contains(this.searchField
- .getText()
- .toLowerCase()))
+ if (item != null && searchField != null && searchField.getText() != "" && item.getItem() != null
+ && item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase()))
items++;
maxPages = items / 48 + 1;
page = 1;
@@ -137,179 +101,96 @@ public class GuiJewelryModifier extends GuiContainer { @Override
protected void mouseClicked(int x, int y, int id) {
super.mouseClicked(x, y, id);
- if (x >= this.searchField.xPosition
- && x <= this.searchField.xPosition
- + this.searchField.width
- && y >= this.searchField.yPosition
- && y <= this.searchField.yPosition
- + this.searchField.height) {
+ if (x >= this.searchField.xPosition && x <= this.searchField.xPosition + this.searchField.width
+ && y >= this.searchField.yPosition && y <= this.searchField.yPosition + this.searchField.height) {
this.searchField.setText("");
this.searchField.setFocused(true);
- maxPages = JewelrycraftUtil.objects.size() / 48
- + 1;
+ maxPages = JewelrycraftUtil.objects.size() / 48 + 1;
} else
this.searchField.setFocused(false);
for (Object button : this.buttonList) {
- if (((GuiButton) button).id < 4
- && ((GuiButton) button)
- .mousePressed(mc,
- x,
- y)) {
+ if (((GuiButton) button).id < 4 && ((GuiButton) button).mousePressed(mc, x, y)) {
if (((GuiButton) button).id != 3) {
- this.selectedItems.removeAll(
- selectedItems);
- this.selectedItemsPos.removeAll(
- selectedItemsPos);
+ this.selectedItems.removeAll(selectedItems);
+ this.selectedItemsPos.removeAll(selectedItemsPos);
} else {
this.selectedX = 0;
this.selectedY = 0;
this.selectedItem = null;
}
- ((GuiButton) buttonList
- .get(0)).enabled = true;
- ((GuiButton) buttonList
- .get(1)).enabled = true;
- ((GuiButton) buttonList
- .get(2)).enabled = true;
- ((GuiButton) buttonList
- .get(3)).enabled = true;
+ ((GuiButton) buttonList.get(0)).enabled = true;
+ ((GuiButton) buttonList.get(1)).enabled = true;
+ ((GuiButton) buttonList.get(2)).enabled = true;
+ ((GuiButton) buttonList.get(3)).enabled = true;
((GuiButton) button).enabled = false;
enabled = ((GuiButton) button).id;
}
}
int i = 0;
for (ItemStack item : JewelrycraftUtil.objects) {
- if (item != null && item.getItem() != 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 (item != null && item.getItem() != 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)) {
try {
- if (!((GuiButton) buttonList
- .get(0)).enabled
- || !((GuiButton) buttonList
- .get(1)).enabled
- || !((GuiButton) buttonList
- .get(2)).enabled) {
+ if (!((GuiButton) buttonList.get(0)).enabled || !((GuiButton) buttonList.get(1)).enabled
+ || !((GuiButton) buttonList.get(2)).enabled) {
this.selectedItem = item;
- this.selectedX = 87
- + 20 * (i % 6);
- this.selectedY = 6
- + 17 * (i / 6)
- - 136 * (page - 1);
+ this.selectedX = 87 + 20 * (i % 6);
+ this.selectedY = 6 + 17 * (i / 6) - 136 * (page - 1);
this.selectedPage = page;
- } else if (!((GuiButton) buttonList
- .get(3)).enabled) {
+ } else if (!((GuiButton) buttonList.get(3)).enabled) {
Map<Integer, Map<Integer, Integer>> itemPage = new HashMap<>();
Map<Integer, Integer> pos = new HashMap<>();
- pos.put(87 + 20 * (i
- % 6),
- 6 + 17 * (i / 6) - 136
- * (page - 1));
- itemPage.put(page,
- pos);
- if (!this.selectedItems
- .contains(item)) {
- this.selectedItems
- .add(item);
- this.selectedItemsPos
- .add(itemPage);
+ pos.put(87 + 20 * (i % 6), 6 + 17 * (i / 6) - 136 * (page - 1));
+ itemPage.put(page, pos);
+ if (!this.selectedItems.contains(item)) {
+ this.selectedItems.add(item);
+ this.selectedItemsPos.add(itemPage);
} else {
- this.selectedItems
- .remove(item);
- this.selectedItemsPos
- .remove(itemPage);
+ this.selectedItems.remove(item);
+ this.selectedItemsPos.remove(itemPage);
}
}
} catch (Exception e) {
- JewelrycraftMod.logger
- .info("Trying to display an item but gets this error: "
- + e.getMessage()
- + "\nThe item causing the issue is: "
- + item);
+ JewelrycraftMod.logger.info("Trying to display an item but gets this error: " + e.getMessage()
+ + "\nThe item causing the issue is: " + item);
}
}
i++;
}
}
- if (((GuiButton) buttonList.get(5)).mousePressed(mc, x, y)
- && page > 1)
+ if (((GuiButton) buttonList.get(5)).mousePressed(mc, x, y) && page > 1)
page--;
- if (((GuiButton) buttonList.get(6)).mousePressed(mc, x, y)
- && page < maxPages)
+ if (((GuiButton) buttonList.get(6)).mousePressed(mc, x, y) && page < maxPages)
page++;
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) {
- JewelryNBT.addIngotColor(targetItem,
- 16777215);
- JewelryNBT.addMetal(targetItem,
- new ItemStack(Item
- .getItemById(0),
- 0, 0));
+ ItemStack targetItem = jMod.modInv.getStackInSlot(36).copy();
+ if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y) && !((GuiButton) buttonList.get(0)).enabled) {
+ JewelryNBT.addIngotColor(targetItem, 16777215);
+ JewelryNBT.addMetal(targetItem, new ItemStack(Item.getItemById(0), 0, 0));
if (selectedItem != null)
- JewelryNBT.addMetal(targetItem,
- this.selectedItem);
- JewelrycraftMod.netWrapper.sendToServer(
- new PacketRequestSetSlot(
- targetItem));
+ JewelryNBT.addMetal(targetItem, this.selectedItem);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestSetSlot(targetItem));
}
- if (((GuiButton) buttonList.get(4))
- .mousePressed(mc, x, y)
- && !((GuiButton) buttonList
- .get(1)).enabled) {
- JewelryNBT.addGemColor(targetItem,
- 16777215);
- JewelryNBT.addGem(targetItem,
- new ItemStack(Item
- .getItemById(0),
- 0, 0));
+ if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y) && !((GuiButton) buttonList.get(1)).enabled) {
+ JewelryNBT.addGemColor(targetItem, 16777215);
+ JewelryNBT.addGem(targetItem, new ItemStack(Item.getItemById(0), 0, 0));
if (selectedItem != null)
- JewelryNBT.addGem(targetItem,
- this.selectedItem);
- JewelrycraftMod.netWrapper.sendToServer(
- new PacketRequestSetSlot(
- targetItem));
+ JewelryNBT.addGem(targetItem, this.selectedItem);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestSetSlot(targetItem));
}
- if (((GuiButton) buttonList.get(4))
- .mousePressed(mc, x, y)
- && !((GuiButton) buttonList
- .get(2)).enabled) {
+ if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y) && !((GuiButton) buttonList.get(2)).enabled) {
if (selectedItem != null)
- JewelryNBT.addItem(targetItem,
- selectedItem);
- JewelrycraftMod.netWrapper.sendToServer(
- new PacketRequestSetSlot(
- targetItem));
+ JewelryNBT.addItem(targetItem, selectedItem);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestSetSlot(targetItem));
}
- if (((GuiButton) buttonList.get(4))
- .mousePressed(mc, x, y)
- && !((GuiButton) buttonList
- .get(3)).enabled) {
+ if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y) && !((GuiButton) buttonList.get(3)).enabled) {
if (!selectedItems.isEmpty())
- JewelryNBT.addModifiers(targetItem,
- selectedItems);
- JewelrycraftMod.netWrapper.sendToServer(
- new PacketRequestSetSlot(
- targetItem));
+ JewelryNBT.addModifiers(targetItem, selectedItems);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestSetSlot(targetItem));
}
}
this.pages.setText(page + "/" + maxPages);
@@ -318,34 +199,25 @@ public class GuiJewelryModifier extends GuiContainer { @Override
public void initGui() {
super.initGui();
- this.searchField = new GuiTextField(this.fontRendererObj,
- this.guiLeft + 89, this.guiTop + 148, 115,
+ this.searchField = new GuiTextField(this.fontRendererObj, this.guiLeft + 89, this.guiTop + 148, 115,
this.fontRendererObj.FONT_HEIGHT + 3);
this.searchField.setMaxStringLength(15);
this.searchField.setTextColor(16777215);
this.searchField.setVisible(true);
this.searchField.setCanLoseFocus(true);
- this.pages = new GuiTextField(this.fontRendererObj,
- this.guiLeft + 20, this.guiTop + 146, 50,
+ this.pages = new GuiTextField(this.fontRendererObj, this.guiLeft + 20, this.guiTop + 146, 50,
this.fontRendererObj.FONT_HEIGHT + 3);
this.pages.setMaxStringLength(15);
this.pages.setTextColor(16777215);
this.pages.setVisible(true);
this.pages.setText(page + "/" + maxPages);
- this.buttonList.add(new GuiButton(0, this.guiLeft + 17,
- this.guiTop + 30, 52, 20, "Metal"));
- this.buttonList.add(new GuiButton(1, this.guiLeft + 17,
- this.guiTop + 52, 52, 20, "Gem"));
- this.buttonList.add(new GuiButton(2, this.guiLeft + 17,
- this.guiTop + 74, 52, 20, "Item"));
- this.buttonList.add(new GuiButton(3, this.guiLeft + 17,
- this.guiTop + 96, 52, 20, "Modifiers"));
- this.buttonList.add(new GuiButton(4, this.guiLeft + 17,
- this.guiTop + 118, 52, 20, "Add Items"));
- this.buttonList.add(new GuiButton(5, this.guiLeft + 5,
- this.guiTop + 142, 13, 20, "<<"));
- this.buttonList.add(new GuiButton(6, this.guiLeft + 73,
- this.guiTop + 142, 13, 20, ">>"));
+ this.buttonList.add(new GuiButton(0, this.guiLeft + 17, this.guiTop + 30, 52, 20, "Metal"));
+ this.buttonList.add(new GuiButton(1, this.guiLeft + 17, this.guiTop + 52, 52, 20, "Gem"));
+ this.buttonList.add(new GuiButton(2, this.guiLeft + 17, this.guiTop + 74, 52, 20, "Item"));
+ this.buttonList.add(new GuiButton(3, this.guiLeft + 17, this.guiTop + 96, 52, 20, "Modifiers"));
+ this.buttonList.add(new GuiButton(4, this.guiLeft + 17, this.guiTop + 118, 52, 20, "Add Items"));
+ this.buttonList.add(new GuiButton(5, this.guiLeft + 5, this.guiTop + 142, 13, 20, "<<"));
+ this.buttonList.add(new GuiButton(6, this.guiLeft + 73, this.guiTop + 142, 13, 20, ">>"));
((GuiButton) buttonList.get(enabled)).enabled = false;
}
@@ -355,34 +227,17 @@ public class GuiJewelryModifier extends GuiContainer { int i = 0;
List<String> list = new ArrayList<>();
for (ItemStack item : JewelrycraftUtil.objects) {
- if (item != null && item.getItem() != 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 (item != null && item.getItem() != 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);
+ if (item.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips) != null)
+ this.renderToolTip(item, x, y);
else
- this.drawHoveringText(list,
- x, y,
- this.fontRendererObj);
+ this.drawHoveringText(list, x, y, this.fontRendererObj);
}
i++;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java index d5e2451..8951a8d 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java @@ -5,10 +5,10 @@ import java.util.Arrays; import net.minecraft.item.ItemStack;
public class GuiRectangle {
- private int x;
- private int y;
- private int w;
- private int h;
+ private int x;
+ private int y;
+ private int w;
+ private int h;
/**
* @param x
@@ -32,8 +32,7 @@ public class GuiRectangle { public boolean inRect(GuiGuide gui, int mouseX, int mouseY) {
mouseX -= gui.getLeft();
mouseY -= gui.getTop();
- return x <= mouseX && mouseX <= x + w && y <= mouseY
- && mouseY <= y + h;
+ return x <= mouseX && mouseX <= x + w && y <= mouseY && mouseY <= y + h;
}
/**
@@ -56,8 +55,7 @@ public class GuiRectangle { * @param srcY
*/
public void draw(GuiGuide gui, int srcX, int srcY) {
- gui.drawTexturedModalRect(gui.getLeft() + x,
- gui.getTop() + y, srcX, srcY, w, h);
+ gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, w, h);
}
/**
@@ -67,11 +65,8 @@ public class GuiRectangle { * @param width
* @param height
*/
- public void draw(GuiGuide gui, int srcX, int srcY, int width,
- int height) {
- gui.drawTexturedModalRect(gui.getLeft() + x,
- gui.getTop() + y, srcX, srcY, width,
- height);
+ public void draw(GuiGuide gui, int srcX, int srcY, int width, int height) {
+ gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, width, height);
}
/**
@@ -80,12 +75,9 @@ public class GuiRectangle { * @param mouseY
* @param str
*/
- public void drawString(GuiGuide gui, int mouseX, int mouseY,
- String str) {
+ public void drawString(GuiGuide gui, int mouseX, int mouseY, String str) {
if (inRect(gui, mouseX, mouseY))
- gui.drawHoverString(Arrays.asList(str.split("\n")),
- mouseX - gui.getLeft(),
- mouseY - gui.getTop());
+ gui.drawHoverString(Arrays.asList(str.split("\n")), mouseX - gui.getLeft(), mouseY - gui.getTop());
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java index 8013440..e20f888 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java @@ -8,15 +8,14 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation;
public class GuiRingChest extends GuiContainer {
- public ContainerRingChest container;
- ResourceLocation texture;
+ public ContainerRingChest container;
+ ResourceLocation texture;
/**
* @param container
* @param texture
*/
- public GuiRingChest(ContainerRingChest container,
- ResourceLocation texture) {
+ public GuiRingChest(ContainerRingChest container, ResourceLocation texture) {
super(container);
this.container = container;
xSize = 176;
@@ -30,11 +29,9 @@ public class GuiRingChest extends GuiContainer { * @param mouseY
*/
@Override
- public void drawGuiContainerBackgroundLayer(float f, int mouseX,
- int mouseY) {
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager()
- .bindTexture(texture);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
@@ -43,8 +40,7 @@ public class GuiRingChest extends GuiContainer { * @param mouseY
*/
@Override
- public void drawGuiContainerForegroundLayer(int mouseX,
- int mouseY) {
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
fontRendererObj.drawString("Linked Chest", 8, 6, 0x404040);
fontRendererObj.drawString("Inventory", 8, 72, 0x404040);
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTab.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTab.java index 27ad51f..3e5fbc6 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTab.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTab.java @@ -5,8 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public abstract class GuiTab extends GuiRectangle { - protected int values; - protected int del; + protected int values; + protected int del; public GuiTab(int id) { super(-62, 10 + 19 * id, 19, 18); @@ -18,17 +18,14 @@ public abstract class GuiTab extends GuiRectangle { return ""; } - public abstract void drawBackground(GuiGuide gui, int x, int y, - int page); + public abstract void drawBackground(GuiGuide gui, int x, int y, int page); - public abstract void drawForeground(GuiGuide gui, int x, int y, - int page); + public abstract void drawForeground(GuiGuide gui, int x, int y, int page); public void mouseClick(GuiGuide gui, int x, int y, int button) { } - public void mouseMoveClick(GuiGuide gui, int x, int y, int button, - long timeSinceClicked) { + public void mouseMoveClick(GuiGuide gui, int x, int y, int button, long timeSinceClicked) { } public void mouseReleased(GuiGuide gui, int x, int y, int button) { diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java index 6c72a13..63fa5bf 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java @@ -20,8 +20,7 @@ public class GuiTabBlocks extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal("guide."
- + Variables.MODID + ".tab.blocks");
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.blocks");
}
/**
@@ -43,198 +42,114 @@ public class GuiTabBlocks extends GuiTab { String text = "";
int xPos = page % 2 == 0 ? 107 : -35;
switch (page) {
- case 1:
- text = "This ore is extremely rare and can be found only between Y-level 5 and 8. It can only be mined using a diamond pickaxe.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(),
- new ItemStack(BlockList.shadowOre),
- text, 180f, 0, -18, true,
- 42, 100, true);
- break;
- case 2:
- text = "Magicians believed this block held the ability to merge with the shadows. It becomes more transparent as it gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in.";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(BlockList.shadowBlock),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(ItemList.shadowIngot));
- break;
- case 3:
- text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(BlockList.smelter),
- new ItemStack(Blocks.cobblestone),
- new ItemStack(Items.bucket),
- new ItemStack(Blocks.cobblestone),
- new ItemStack(Blocks.cobblestone),
- null,
- new ItemStack(Blocks.cobblestone),
- new ItemStack(Blocks.cobblestone),
- new ItemStack(Items.lava_bucket),
- new ItemStack(Blocks.cobblestone));
- break;
- case 4:
- text = "is right click on it with any ore or ingot. It can melt multiple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items added. If right clicked when done smelting, it will say what the block contains.";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 5:
- text = "The molder is a key piece in creating jewelry. You need to pour the molten metal out of the smelter somewhere. That somewhere is the molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(BlockList.molder),
- new ItemStack(Blocks.cobblestone),
- null,
- new ItemStack(Blocks.cobblestone),
- new ItemStack(Blocks.cobblestone),
- new ItemStack(Blocks.cobblestone),
- new ItemStack(Blocks.cobblestone));
- break;
- case 6:
- text = "choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 7:
- text = "This table allows you to add a gem to a piece of jewelry. Right click the block while holding jewelry to add it in. Then do the same with a gem (you can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the";
- if (del == 0)
- values++;
- del++;
- if (del >= 300)
- del = 0;
- if (values >= 4)
- values = 0;
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(BlockList.jewelCraftingTable),
- new ItemStack(Blocks.planks,
- 1, values),
- new ItemStack(Blocks.planks,
- 1, values),
- new ItemStack(Blocks.planks,
- 1, values),
- new ItemStack(Blocks.stone),
- null,
- new ItemStack(Blocks.stone),
- new ItemStack(Blocks.stone),
- null,
- new ItemStack(Blocks.stone));
- break;
- case 8:
- text = "progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem.";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 9:
- text = "The Storage Displayer, as the name suggests, can store a large amount (Up to: "
- + Integer.MAX_VALUE
- + ") of a single item/block placed in it. It will display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(BlockList.displayer),
- null,
- new ItemStack(Items.iron_ingot),
- null,
- new ItemStack(Items.iron_ingot),
- new ItemStack(Items.iron_ingot),
- new ItemStack(Items.iron_ingot),
- new ItemStack(Blocks.emerald_block),
- new ItemStack(Blocks.emerald_block),
- new ItemStack(Blocks.emerald_block));
- break;
- case 10:
- text = "simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside. If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 11:
- text = "Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory.";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 12:
- text = "This mysterious shaped block is used in the ritual. The acient ones claimed it had the power to travel through worlds. They would use these to offer sacrifices to 'The Dark One' in exchange for unimaginable powers.";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(BlockList.handPedestal),
- new ItemStack(Blocks.cobblestone_wall),
- new ItemStack(Blocks.cobblestone_wall),
- new ItemStack(Blocks.cobblestone_wall),
- null,
- new ItemStack(Blocks.stonebrick),
- null,
- new ItemStack(Blocks.stone_slab,
- 1, 5),
- new ItemStack(Blocks.stonebrick),
- new ItemStack(Blocks.stone_slab,
- 1, 5));
- break;
- case 13:
- text = "The Cursed Eye is an ancient artifact also known as 'The Dark One's Eye'. It is part of the sacrifice ritual the ancient ones talk about. Be careful though, for He sees everything. To see how to create the ritual look in the Ritual tab. One you created the ritual, simply place a";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(BlockList.shadowEye),
- new ItemStack(Blocks.stonebrick),
- new ItemStack(Blocks.stained_hardened_clay,
- 1, 15),
- new ItemStack(Blocks.stonebrick),
- new ItemStack(Blocks.stained_hardened_clay,
- 1, 15),
- new ItemStack(Items.ender_eye),
- new ItemStack(Blocks.stained_hardened_clay,
- 1, 15),
- new ItemStack(Blocks.stonebrick),
- new ItemStack(Blocks.stained_hardened_clay,
- 1, 15),
- new ItemStack(Blocks.stonebrick));
- break;
- case 14:
- text = "piece of jewelry in the middle pedestal and your modifiers of choice in the other ones (you don't need to put an item in every single pedestal). After you do that simply right click the eye to activate the ritual. Be careful not to leave the premise or you'll die! When the ritual is done, Shift+Right Click on the central hand pedestal to retrieve your newly modified item!";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 15:
- if (del == 0)
- values++;
- del++;
- if (del >= 50)
- del = 0;
- if (values >= 15)
- values = 0;
- text = "Crystals don't do much as of yet. They spawn naturally in caves and come in all 16 colors.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(),
- new ItemStack(BlockList.crystal,
- 1, values),
- text, 180f, 0, -18, true,
- 48, 120, true);
- break;
- default:
- ;
+ case 1:
+ text = "This ore is extremely rare and can be found only between Y-level 5 and 8. It can only be mined using a diamond pickaxe.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.shadowOre), text,
+ 180f, 0, -18, true, 42, 100, true);
+ break;
+ case 2:
+ text = "Magicians believed this block held the ability to merge with the shadows. It becomes more transparent as it gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(BlockList.shadowBlock), new ItemStack(ItemList.shadowIngot),
+ new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot),
+ new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot),
+ new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot),
+ new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot));
+ break;
+ case 3:
+ text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(BlockList.smelter), new ItemStack(Blocks.cobblestone), new ItemStack(Items.bucket),
+ new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null,
+ new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone),
+ new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone));
+ break;
+ case 4:
+ text = "is right click on it with any ore or ingot. It can melt multiple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items added. If right clicked when done smelting, it will say what the block contains.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 5:
+ text = "The molder is a key piece in creating jewelry. You need to pour the molten metal out of the smelter somewhere. That somewhere is the molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(BlockList.molder), new ItemStack(Blocks.cobblestone), null,
+ new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone),
+ new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone));
+ break;
+ case 6:
+ text = "choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 7:
+ text = "This table allows you to add a gem to a piece of jewelry. Right click the block while holding jewelry to add it in. Then do the same with a gem (you can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the";
+ if (del == 0)
+ values++;
+ del++;
+ if (del >= 300)
+ del = 0;
+ if (values >= 4)
+ values = 0;
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(BlockList.jewelCraftingTable), new ItemStack(Blocks.planks, 1, values),
+ new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values),
+ new ItemStack(Blocks.stone), null, new ItemStack(Blocks.stone), new ItemStack(Blocks.stone), null,
+ new ItemStack(Blocks.stone));
+ break;
+ case 8:
+ text = "progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 9:
+ text = "The Storage Displayer, as the name suggests, can store a large amount (Up to: " + Integer.MAX_VALUE
+ + ") of a single item/block placed in it. It will display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(BlockList.displayer), null, new ItemStack(Items.iron_ingot), null,
+ new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot),
+ new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block),
+ new ItemStack(Blocks.emerald_block));
+ break;
+ case 10:
+ text = "simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside. If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 11:
+ text = "Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 12:
+ text = "This mysterious shaped block is used in the ritual. The acient ones claimed it had the power to travel through worlds. They would use these to offer sacrifices to 'The Dark One' in exchange for unimaginable powers.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(BlockList.handPedestal), new ItemStack(Blocks.cobblestone_wall),
+ new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), null,
+ new ItemStack(Blocks.stonebrick), null, new ItemStack(Blocks.stone_slab, 1, 5),
+ new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stone_slab, 1, 5));
+ break;
+ case 13:
+ text = "The Cursed Eye is an ancient artifact also known as 'The Dark One's Eye'. It is part of the sacrifice ritual the ancient ones talk about. Be careful though, for He sees everything. To see how to create the ritual look in the Ritual tab. One you created the ritual, simply place a";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(BlockList.shadowEye), new ItemStack(Blocks.stonebrick),
+ new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick),
+ new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Items.ender_eye),
+ new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick),
+ new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick));
+ break;
+ case 14:
+ text = "piece of jewelry in the middle pedestal and your modifiers of choice in the other ones (you don't need to put an item in every single pedestal). After you do that simply right click the eye to activate the ritual. Be careful not to leave the premise or you'll die! When the ritual is done, Shift+Right Click on the central hand pedestal to retrieve your newly modified item!";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 15:
+ if (del == 0)
+ values++;
+ del++;
+ if (del >= 50)
+ del = 0;
+ if (values >= 15)
+ values = 0;
+ text = "Crystals don't do much as of yet. They spawn naturally in caves and come in all 16 colors.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.crystal, 1, values),
+ text, 180f, 0, -18, true, 48, 120, true);
+ break;
+ default:
+ ;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java index cd18b64..f93d9de 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java @@ -14,8 +14,7 @@ public class GuiTabCurses extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal("guide."
- + Variables.MODID + ".tab.curses");
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.curses");
}
@Override
@@ -28,151 +27,63 @@ public class GuiTabCurses extends GuiTab { String text = "";
int xPos = page % 2 == 0 ? 107 : -35;
switch (page) {
- case 1:
- text = "You are poisoned for as long as this curse is active.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 0),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 2:
- text = "Whenever you attack an entity you are set on fire.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 1),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 3:
- text = "You can no longer throw any item. I mean, you might need them later, right?";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 2),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 4:
- text = "You are blinded. Literally. I mean, what did you expect?";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 3),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 5:
- text = "There is a random chance that when you attack a passive mob you will lose a full heart, but gain a black heart.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 4),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 6:
- text = "Whatever you touch turns into gold. Believe me, this is no good to you, you can't even harvest this gold. At lest the items you can't. But if you touched an entity with your bear hands while the curse is active and then no longer have it, you should be able to mine it with an iron pick or higher. THe golden statue will drop gold nuggets depending on the size of the entity.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 5),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 7:
- text = "Entities have a higher chance of dropping more items and hearts when killed.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 6),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 8:
- text = "There is a random chance that you'll steal 1 heart from an entity that is collided with you. If you are low on health, you will heal. If you are fully healed, an extra heart will be added to you. You can steal up to 2 hearts per entity (3 if you complete the challenge). When you steal a heart, that entity will have their max health reduced by 1. Challenges are found in the Achievements menu.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 7),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 9:
- text = "When you attack an entity and are low on health, there is a 50% chance that you'll heal half a heart. Also you will catch on fire if you're exposed to sun.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 8),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 10:
- text = "Any mob you kill or block you destroy(eg. Diamond Ore, Redstone Ore, stuff that drops items not the block itself) drops double the amount of items it normally would.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 9),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- case 11:
- text = "All the damage you do pierces through armor or any other type of defense, but creatures no longer drop XP.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.testItem,
- 1, 10),
- text, 40f, 0, 0,
- Curse.getCurseList().get(
- page - 1)
- .getDisplayName(),
- 45, 10, false);
- break;
- default:
- ;
+ case 1:
+ text = "You are poisoned for as long as this curse is active.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 0),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 2:
+ text = "Whenever you attack an entity you are set on fire.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 1),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 3:
+ text = "You can no longer throw any item. I mean, you might need them later, right?";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 2),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 4:
+ text = "You are blinded. Literally. I mean, what did you expect?";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 3),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 5:
+ text = "There is a random chance that when you attack a passive mob you will lose a full heart, but gain a black heart.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 4),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 6:
+ text = "Whatever you touch turns into gold. Believe me, this is no good to you, you can't even harvest this gold. At lest the items you can't. But if you touched an entity with your bear hands while the curse is active and then no longer have it, you should be able to mine it with an iron pick or higher. THe golden statue will drop gold nuggets depending on the size of the entity.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 5),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 7:
+ text = "Entities have a higher chance of dropping more items and hearts when killed.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 6),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 8:
+ text = "There is a random chance that you'll steal 1 heart from an entity that is collided with you. If you are low on health, you will heal. If you are fully healed, an extra heart will be added to you. You can steal up to 2 hearts per entity (3 if you complete the challenge). When you steal a heart, that entity will have their max health reduced by 1. Challenges are found in the Achievements menu.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 7),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 9:
+ text = "When you attack an entity and are low on health, there is a 50% chance that you'll heal half a heart. Also you will catch on fire if you're exposed to sun.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 8),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 10:
+ text = "Any mob you kill or block you destroy(eg. Diamond Ore, Redstone Ore, stuff that drops items not the block itself) drops double the amount of items it normally would.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 9),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ case 11:
+ text = "All the damage you do pierces through armor or any other type of defense, but creatures no longer drop XP.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 10),
+ text, 40f, 0, 0, Curse.getCurseList().get(page - 1).getDisplayName(), 45, 10, false);
+ break;
+ default:
+ ;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java index f161cdd..f7adc74 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java @@ -20,8 +20,7 @@ public class GuiTabGemsAndIngots extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal(
- "guide." + Variables.MODID + ".tab.misc");
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.misc");
}
/**
@@ -46,106 +45,46 @@ public class GuiTabGemsAndIngots extends GuiTab { if (i < JewelrycraftUtil.gem.size()) {
GL11.glPushMatrix();
if (i == (page - 1) * 12)
- gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + "Gems",
- gui.getLeft() + xPos
- + 40,
- gui.getTop(), 0);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems",
+ gui.getLeft() + xPos + 40, gui.getTop(), 0);
GL11.glScalef(scale, scale, 0f);
- gui.getFont().drawString(String.format(
- "%-1.26s",
- JewelrycraftUtil.gem.get(i)
- .getDisplayName()),
- (int) ((gui.getLeft()
- + xPos
- + 12)
- / scale),
- (int) ((gui.getTop() + 12
- + 12 * (i - 12 * (page
- - 1)))
- / scale),
- 0);
+ gui.getFont().drawString(String.format("%-1.26s", JewelrycraftUtil.gem.get(i).getDisplayName()),
+ (int) ((gui.getLeft() + xPos + 12) / scale),
+ (int) ((gui.getTop() + 12 + 12 * (i - 12 * (page - 1))) / scale), 0);
GL11.glPopMatrix();
- gui.renderItem(JewelrycraftUtil.gem.get(i),
- gui.getLeft() + xPos + 5,
- gui.getTop() + 18 + 12 * (i
- - 12 * (page - 1)),
- 24f, true, 0, 0, 0);
+ gui.renderItem(JewelrycraftUtil.gem.get(i), gui.getLeft() + xPos + 5,
+ gui.getTop() + 18 + 12 * (i - 12 * (page - 1)), 24f, true, 0, 0, 0);
}
page -= JewelrycraftUtil.gem.size() / 13 + 1;
for (int i = (page - 1) * 12; i < page * 12; i++)
- if (i < JewelrycraftUtil.metal.size()
- && page > 0) {
+ if (i < JewelrycraftUtil.metal.size() && page > 0) {
GL11.glPushMatrix();
if (i == (page - 1) * 12)
- gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + "Ingots",
- gui.getLeft() + xPos
- + 40,
- gui.getTop(), 0);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots",
+ gui.getLeft() + xPos + 40, gui.getTop(), 0);
GL11.glScalef(scale, scale, 0f);
- gui.getFont().drawString(String.format(
- "%-1.18s",
- JewelrycraftUtil.metal
- .get(i)
- .copy()
- .getDisplayName()),
- (int) ((gui.getLeft()
- + xPos
- + 12)
- / scale),
- (int) ((gui.getTop() + 12
- + 12 * (i - 12 * (page
- - 1)))
- / scale),
- 0);
+ gui.getFont().drawString(
+ String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()),
+ (int) ((gui.getLeft() + xPos + 12) / scale),
+ (int) ((gui.getTop() + 12 + 12 * (i - 12 * (page - 1))) / scale), 0);
GL11.glPopMatrix();
- gui.renderItem(JewelrycraftUtil.metal
- .get(i),
- gui.getLeft() + xPos + 5,
- gui.getTop() + 18 + 12 * (i
- - 12 * (page - 1)),
- 24f, true, 0, 0, 0);
+ gui.renderItem(JewelrycraftUtil.metal.get(i), gui.getLeft() + xPos + 5,
+ gui.getTop() + 18 + 12 * (i - 12 * (page - 1)), 24f, true, 0, 0, 0);
}
page -= JewelrycraftUtil.metal.size() / 13 + 1;
for (int i = (page - 1) * 12; i < page * 12; i++)
if (i < JewelrycraftUtil.ores.size() && page > 0) {
GL11.glPushMatrix();
if (i == (page - 1) * 12)
- gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + "Ores",
- gui.getLeft() + xPos
- + 40,
- gui.getTop(), 0);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ores",
+ gui.getLeft() + xPos + 40, gui.getTop(), 0);
GL11.glScalef(scale, scale, 0f);
- gui.getFont().drawString(String.format(
- "%-1.18s",
- JewelrycraftUtil.ores
- .get(i)
- .copy()
- .getDisplayName()),
- (int) ((gui.getLeft()
- + xPos
- + 12)
- / scale),
- (int) ((gui.getTop() + 12
- + 12 * (i - 12 * (page
- - 1)))
- / scale),
- 0);
+ gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.ores.get(i).copy().getDisplayName()),
+ (int) ((gui.getLeft() + xPos + 12) / scale),
+ (int) ((gui.getTop() + 12 + 12 * (i - 12 * (page - 1))) / scale), 0);
GL11.glPopMatrix();
- gui.renderItem(JewelrycraftUtil.ores
- .get(i),
- gui.getLeft() + xPos + 5,
- gui.getTop() + 18 + 12 * (i
- - 12 * (page - 1)),
- 24f, true, 0, 0, 0);
+ gui.renderItem(JewelrycraftUtil.ores.get(i), gui.getLeft() + xPos + 5,
+ gui.getTop() + 18 + 12 * (i - 12 * (page - 1)), 24f, true, 0, 0, 0);
}
}
@@ -154,8 +93,7 @@ public class GuiTabGemsAndIngots extends GuiTab { */
@Override
public int getMaxPages() {
- return (JewelrycraftUtil.gem.size() / 13)
- + (JewelrycraftUtil.metal.size() / 13)
+ return (JewelrycraftUtil.gem.size() / 13) + (JewelrycraftUtil.metal.size() / 13)
+ (JewelrycraftUtil.ores.size() / 13) + 3;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java index fe22374..c05cf30 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java @@ -18,8 +18,7 @@ public class GuiTabIntroduction extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal("guide."
- + Variables.MODID + ".tab.introduction");
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction");
}
@Override
@@ -27,22 +26,14 @@ public class GuiTabIntroduction extends GuiTab { String text = "";
int xPos = page % 2 == 0 ? 107 : -35;
switch (page) {
- case 1:
- text = StatCollector.translateToLocal(
- "guide." + Variables.MODID
- + ".tab.introduction."
- + page);
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 2:
- text = StatCollector.translateToLocal(
- "guide." + Variables.MODID
- + ".tab.introduction."
- + page);
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
+ case 1:
+ text = StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction." + page);
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 2:
+ text = StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction." + page);
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java index 5b9bf55..af07477 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java @@ -26,8 +26,7 @@ public class GuiTabItems extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal(
- "guide." + Variables.MODID + ".tab.items");
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.items");
}
/**
@@ -49,218 +48,119 @@ public class GuiTabItems extends GuiTab { String text = "";
int xPos = page % 2 == 0 ? 107 : -35;
switch (page) {
- case 1:
- text = "Shadow ingots are obtained by smelting shadow ore. They are used in a few recipes and an important key for making some jewelry work.";
- Page.addSmeltingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), text, x, y,
- true,
- new ItemStack(BlockList.shadowOre),
- new ItemStack(ItemList.shadowIngot));
- break;
- case 2:
- text = "These gloves give you the chance to steal the trades those pesky Testificates have to offer. To use these simply open their gui at least once, then Crouch and right click on the them to hopefully steal the trades. If you traded with him before, then you have a chance of getting the traded";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(ItemList.thiefGloves),
- new ItemStack(ItemList.shadowIngot),
- null,
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(Blocks.wool,
- 1, 15),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(Blocks.wool,
- 1, 15),
- new ItemStack(Blocks.wool,
- 1, 15),
- new ItemStack(ItemList.shadowIngot),
- new ItemStack(Blocks.wool,
- 1, 15));
- break;
- case 3:
- text = "emeralds back as well. This has a maximum of 10 uses before it breaks.";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 4:
- text = "In order to get the ingot back from the smelter you need a mold for it. However, this mold can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), true, text,
- x, y, true,
- new ItemStack(ItemList.clayMolds,
- 1, 0),
- new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball));
- break;
- case 5:
- text = "To create a ring you need a mold for it. However, this one is too soft to be used. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(ItemList.clayMolds,
- 1, 1),
- null,
- new ItemStack(Items.clay_ball),
- null,
- new ItemStack(Items.clay_ball),
- null,
- new ItemStack(Items.clay_ball),
- null,
- new ItemStack(Items.clay_ball),
- null);
- break;
- case 6:
- text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(ItemList.clayMolds,
- 1, 2),
- new ItemStack(Items.clay_ball),
- null,
- new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball),
- null,
- new ItemStack(Items.clay_ball),
- null,
- new ItemStack(Items.clay_ball),
- null);
- break;
- case 7:
- text = "To create a bracelet you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(ItemList.clayMolds,
- 1, 3),
- new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball),
- null,
- new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball));
- break;
- case 8:
- text = "To create earrings you need a mold for them. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), false, text,
- x, y, true,
- new ItemStack(ItemList.clayMolds,
- 1, 4),
- null, null, null,
- new ItemStack(Items.clay_ball),
- null,
- new ItemStack(Items.clay_ball),
- null, null, null);
- break;
- case 9:
- if (del == 0)
- values++;
- del++;
- if (del >= 300)
- del = 0;
- if (values > 4)
- values = 0;
- text = "By smelting a clay mold you get a harder version which can be used to create jewelry. Simply right click with this on a molder to attach it and you're ready to go.";
- Page.addSmeltingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), text, x, y,
- true,
- new ItemStack(ItemList.clayMolds,
- 1, values),
- new ItemStack(ItemList.molds,
- 1,
- values));
- break;
- case 10:
- if (del == 0)
- values++;
- del++;
- if (del >= 300)
- del = 0;
- if (values > 4)
- values = 0;
- text = "It's this exact guide. I don't even know why you're reading this. I added this recipe in case you lose the original. Even if this is more helpful than NEI, I do suggest installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really";
- Page.addCraftingRecipeTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop(), true, text,
- x, y, true,
- new ItemStack(ItemList.guide),
- new ItemStack(ItemList.molds,
- 1, values),
- new ItemStack(Items.book));
- break;
- case 11:
- String link = "HERE";
- if (x >= gui.getLeft() - 7
- && x <= gui.getLeft() + 10
- && y >= gui.getTop() + 20
- && y <= gui.getTop() + 34)
- link = EnumChatFormatting.DARK_BLUE
- + "HERE"
- + EnumChatFormatting.BLACK;
- text = "appreciate it. After that you can share it in the main thread "
- + link + ".";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 12:
- ItemStack item = new ItemStack(
- ItemList.bucket);
- if (del == 0)
- values++;
- del++;
- if (del >= 50)
- del = 0;
- if (values > JewelrycraftUtil.metal.size()
- - 1)
- values = 0;
- JewelryNBT.addMetal(item,
- JewelrycraftUtil.metal.get(
- values)
- .copy());
- text = "These buckets contain molten metal. To obtain one simply Right Click a full Smelter to get a bucket. You can pour the metal, other than that it has no use. You can place the molten metal back in a Smelter by Right Clicking one with it.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5, item,
- text, 40f, 0, 0, true, 45,
- 10, false);
- break;
- case 13:
- text = "This item is a creative only item! Right click it while in creative mode to open a GUI. Place a piece of jewelery inside the slot, select what you want to add, then click on 'Add Items'. If you selected Modifiers, you can select multiple items at once. The 'Item' button is to add an Item to a Golden Object, which can not be obtained normally. This tool can be really useful, especially for those";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.jewelryModifier),
- text, 40f, 0, 0, true, 45,
- 10, false);
- break;
- case 14:
- text = "who want to test the mod and can't wait for the normal processes to finish (Smelter, Jeweler's Table, Ritual).";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 15:
- text = "This item is a creative only item! If you right click in the air while holding this item you'll increment the number of the structure to spawn. Crouch and right click to go backwards. To spawn a structure simply right click on a block with this.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 5,
- new ItemStack(ItemList.structureGen),
- text, 40f, 0, 0, true, 45,
- 10, false);
- break;
- default:
- ;
+ case 1:
+ text = "Shadow ingots are obtained by smelting shadow ore. They are used in a few recipes and an important key for making some jewelry work.";
+ Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true,
+ new ItemStack(BlockList.shadowOre), new ItemStack(ItemList.shadowIngot));
+ break;
+ case 2:
+ text = "These gloves give you the chance to steal the trades those pesky Testificates have to offer. To use these simply open their gui at least once, then Crouch and right click on the them to hopefully steal the trades. If you traded with him before, then you have a chance of getting the traded";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(ItemList.thiefGloves), new ItemStack(ItemList.shadowIngot), null,
+ new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15),
+ new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15),
+ new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot),
+ new ItemStack(Blocks.wool, 1, 15));
+ break;
+ case 3:
+ text = "emeralds back as well. This has a maximum of 10 uses before it breaks.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 4:
+ text = "In order to get the ingot back from the smelter you need a mold for it. However, this mold can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 0), new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball));
+ break;
+ case 5:
+ text = "To create a ring you need a mold for it. However, this one is too soft to be used. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 1), null, new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null);
+ break;
+ case 6:
+ text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 2), new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null);
+ break;
+ case 7:
+ text = "To create a bracelet you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 3), new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball),
+ null, new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball));
+ break;
+ case 8:
+ text = "To create earrings you need a mold for them. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 4), null, null, null, new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null, null, null);
+ break;
+ case 9:
+ if (del == 0)
+ values++;
+ del++;
+ if (del >= 300)
+ del = 0;
+ if (values > 4)
+ values = 0;
+ text = "By smelting a clay mold you get a harder version which can be used to create jewelry. Simply right click with this on a molder to attach it and you're ready to go.";
+ Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, values), new ItemStack(ItemList.molds, 1, values));
+ break;
+ case 10:
+ if (del == 0)
+ values++;
+ del++;
+ if (del >= 300)
+ del = 0;
+ if (values > 4)
+ values = 0;
+ text = "It's this exact guide. I don't even know why you're reading this. I added this recipe in case you lose the original. Even if this is more helpful than NEI, I do suggest installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true,
+ new ItemStack(ItemList.guide), new ItemStack(ItemList.molds, 1, values), new ItemStack(Items.book));
+ break;
+ case 11:
+ String link = "HERE";
+ if (x >= gui.getLeft() - 7 && x <= gui.getLeft() + 10 && y >= gui.getTop() + 20 && y <= gui.getTop() + 34)
+ link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK;
+ text = "appreciate it. After that you can share it in the main thread " + link + ".";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 12:
+ ItemStack item = new ItemStack(ItemList.bucket);
+ if (del == 0)
+ values++;
+ del++;
+ if (del >= 50)
+ del = 0;
+ if (values > JewelrycraftUtil.metal.size() - 1)
+ values = 0;
+ JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy());
+ text = "These buckets contain molten metal. To obtain one simply Right Click a full Smelter to get a bucket. You can pour the metal, other than that it has no use. You can place the molten metal back in a Smelter by Right Clicking one with it.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, item, text, 40f, 0, 0, true, 45, 10,
+ false);
+ break;
+ case 13:
+ text = "This item is a creative only item! Right click it while in creative mode to open a GUI. Place a piece of jewelery inside the slot, select what you want to add, then click on 'Add Items'. If you selected Modifiers, you can select multiple items at once. The 'Item' button is to add an Item to a Golden Object, which can not be obtained normally. This tool can be really useful, especially for those";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.jewelryModifier),
+ text, 40f, 0, 0, true, 45, 10, false);
+ break;
+ case 14:
+ text = "who want to test the mod and can't wait for the normal processes to finish (Smelter, Jeweler's Table, Ritual).";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 15:
+ text = "This item is a creative only item! If you right click in the air while holding this item you'll increment the number of the structure to spawn. Crouch and right click to go backwards. To spawn a structure simply right click on a block with this.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.structureGen),
+ text, 40f, 0, 0, true, 45, 10, false);
+ break;
+ default:
+ ;
}
}
@@ -280,14 +180,11 @@ public class GuiTabItems extends GuiTab { */
@Override
public void mouseClick(GuiGuide gui, int x, int y, int button) {
- if (gui.page == 11 && x >= gui.getLeft() - 7
- && x <= gui.getLeft() + 10
- && y >= gui.getTop() + 20
+ if (gui.page == 11 && x >= gui.getLeft() - 7 && x <= gui.getLeft() + 10 && y >= gui.getTop() + 20
&& y <= gui.getTop() + 34)
try {
- Desktop.getDesktop().browse(new URL(
- "http://minecraft.curseforge.com/mc-mods/229927-jewelrycraft-2")
- .toURI());
+ Desktop.getDesktop()
+ .browse(new URL("http://minecraft.curseforge.com/mc-mods/229927-jewelrycraft-2").toURI());
} catch (Exception e) {
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java index cf22586..e7e6e00 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java @@ -16,8 +16,7 @@ public class GuiTabModifiers extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal("guide."
- + Variables.MODID + ".tab.modifiers");
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.modifiers");
}
/**
@@ -39,51 +38,35 @@ public class GuiTabModifiers extends GuiTab { String text = "";
int xPos = page % 2 == 0 ? 107 : -35;
switch (page) {
- case 1:
- text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all modifiers that have a use and what they do, in the form of a story/riddle/poem. However, different jewellery have different effects for the same modifier.";
- Page.addTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text);
- break;
- case 2:
- text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 10,
- new ItemStack(Items.blaze_powder),
- text, 40f, true);
- break;
- case 3:
- text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 10,
- new ItemStack(Items.feather),
- text, 40f, true);
- break;
- case 4:
- text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 10,
- new ItemStack(Items.ender_eye),
- text, 40f, true);
- break;
- case 5:
- text = "Through the power of a pearl arrows don't know where to go. In confusion they can explode, making you a helpless toad. But if an enemy hits, they get damaged like a blitz. You may be weaker, water is bad, but you get saved if health is weak like a lilly pad.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 10,
- new ItemStack(Items.ender_pearl),
- text, 40f, true);
- break;
- case 6:
- text = "Toughest stone made on Earth, falling damage is absurd. Deal more damage, more protection, anvils and arrows need inspection. But after long and hard abuse, the stone is starting to get loose. You are weak and heavy, sink like a ship, arrows need only one hit, deal less damage overall, don't abuse its power now.";
- Page.addImageTextPage(gui,
- gui.getLeft() + xPos,
- gui.getTop() - 10,
- new ItemStack(Blocks.obsidian),
- text, 40f, true);
- break;
+ case 1:
+ text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all modifiers that have a use and what they do, in the form of a story/riddle/poem. However, different jewellery have different effects for the same modifier.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 2:
+ text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.blaze_powder), text,
+ 40f, true);
+ break;
+ case 3:
+ text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.feather), text, 40f,
+ true);
+ break;
+ case 4:
+ text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.ender_eye), text,
+ 40f, true);
+ break;
+ case 5:
+ text = "Through the power of a pearl arrows don't know where to go. In confusion they can explode, making you a helpless toad. But if an enemy hits, they get damaged like a blitz. You may be weaker, water is bad, but you get saved if health is weak like a lilly pad.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.ender_pearl), text,
+ 40f, true);
+ break;
+ case 6:
+ text = "Toughest stone made on Earth, falling damage is absurd. Deal more damage, more protection, anvils and arrows need inspection. But after long and hard abuse, the stone is starting to get loose. You are weak and heavy, sink like a ship, arrows need only one hit, deal less damage overall, don't abuse its power now.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Blocks.obsidian), text,
+ 40f, true);
+ break;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java index 36a8a1e..fea21b9 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java @@ -18,8 +18,7 @@ public class GuiTabOresToIngots extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal("guide."
- + Variables.MODID + ".tab.oretoingot");
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.oretoingot");
}
/**
@@ -40,39 +39,19 @@ public class GuiTabOresToIngots extends GuiTab { public void drawBackground(GuiGuide gui, int x, int y, int page) {
int xPos = page % 2 == 0 ? 107 : -35;
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
- GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
int i = 0;
- for (ItemStack ore : JewelrycraftUtil.oreToIngot
- .keySet()) {
+ for (ItemStack ore : JewelrycraftUtil.oreToIngot.keySet()) {
if (i >= (page - 1) * 5 && i < page * 5) {
- gui.renderItem(ore,
- gui.getLeft() + xPos + 10,
- gui.getTop() + 12 + 32 * (i
- - 5 * (page - 1)),
- 30f, true, 0, 0, 0);
- gui.renderItem(JewelrycraftUtil.oreToIngot
- .get(ore),
- gui.getLeft() + xPos + 10,
- gui.getTop() + 28 + 32 * (i
- - 5 * (page - 1)),
- 30f, true, 0, 0, 0);
- gui.getFont().drawString(String.format(
- "%-1.18s",
- ore.getDisplayName()),
- gui.getLeft() + xPos + 20,
- gui.getTop() + 2 + 32 * (i
- - 5 * (page - 1)),
- 0);
- gui.getFont().drawString(String.format(
- "%-1.18s",
- JewelrycraftUtil.oreToIngot
- .get(ore)
- .getDisplayName()),
- gui.getLeft() + xPos + 20,
- gui.getTop() + 18 + 32 * (i
- - 5 * (page - 1)),
- 0);
+ gui.renderItem(ore, gui.getLeft() + xPos + 10, gui.getTop() + 12 + 32 * (i - 5 * (page - 1)), 30f, true,
+ 0, 0, 0);
+ gui.renderItem(JewelrycraftUtil.oreToIngot.get(ore), gui.getLeft() + xPos + 10,
+ gui.getTop() + 28 + 32 * (i - 5 * (page - 1)), 30f, true, 0, 0, 0);
+ gui.getFont().drawString(String.format("%-1.18s", ore.getDisplayName()), gui.getLeft() + xPos + 20,
+ gui.getTop() + 2 + 32 * (i - 5 * (page - 1)), 0);
+ gui.getFont().drawString(
+ String.format("%-1.18s", JewelrycraftUtil.oreToIngot.get(ore).getDisplayName()),
+ gui.getLeft() + xPos + 20, gui.getTop() + 18 + 32 * (i - 5 * (page - 1)), 0);
GL11.glDisable(GL11.GL_LIGHTING);
}
i++;
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java index 863aa09..0e2b768 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java @@ -15,8 +15,7 @@ public class GuiTabRitual extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal("guide."
- + Variables.MODID + ".tab.ritual");
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.ritual");
}
@Override
@@ -28,392 +27,139 @@ public class GuiTabRitual extends GuiTab { public void drawBackground(GuiGuide gui, int x, int y, int page) {
int xPos = page % 2 == 0 ? 107 : -35;
switch (page) {
- case 1:
- Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + "Layer 1",
- gui.getLeft() + xPos + 35,
- gui.getTop() - 30);
- for (int i = -1; i < 10; i++)
- for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui
- .getLeft()
- + xPos
- + 11 * i,
- gui.getTop() + 11
- * j,
- x, y,
- new ItemStack(Blocks.air),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 8,
- gui.getTop() + 11 * 1, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 0,
- gui.getTop() + 11 * 1, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 8,
- gui.getTop() + 11 * 9, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 0,
- gui.getTop() + 11 * 9, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
-
- // Top
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 2,
- gui.getTop() + 11 * 1, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 45, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 4,
- gui.getTop() + 11 * 0, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 6,
- gui.getTop() + 11 * 1, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, -45, 0);
-
- // Left
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 0,
- gui.getTop() + 11 * 3, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 45, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * -1,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 90, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 0,
- gui.getTop() + 11 * 7, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 135, 0);
-
- // Bottom
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 2,
- gui.getTop() + 11 * 9, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 135, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 4,
- gui.getTop() + 11 * 10, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 180, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 6,
- gui.getTop() + 11 * 9, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 225, 0);
-
- // Right
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 8,
- gui.getTop() + 11 * 3, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, -35, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 9,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 270, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 8,
- gui.getTop() + 11 * 7, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 225, 0);
-
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 2,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 4,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(BlockList.handPedestal),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 6,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- break;
-
- case 2:
- Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + "Layer 2",
- gui.getLeft() + xPos + 35,
- gui.getTop() - 30);
- for (int i = -1; i < 10; i++)
- for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui
- .getLeft()
- + xPos
- + 11 * i,
- gui.getTop() + 11
- * j,
- x, y,
- new ItemStack(Blocks.air),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 8,
- gui.getTop() + 11 * 1, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 0,
- gui.getTop() + 11 * 1, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 8,
- gui.getTop() + 11 * 9, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 0,
- gui.getTop() + 11 * 9, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
-
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 2,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 6,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- break;
-
- case 3:
- Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + "Layer 3",
- gui.getLeft() + xPos + 35,
- gui.getTop() - 30);
- for (int i = -1; i < 10; i++)
- for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui
- .getLeft()
- + xPos
- + 11 * i,
- gui.getTop() + 11
- * j,
- x, y,
- new ItemStack(Blocks.air),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 8,
- gui.getTop() + 11 * 1, x,
- y,
- new ItemStack(BlockList.shadowBlock),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 0,
- gui.getTop() + 11 * 1, x,
- y,
- new ItemStack(BlockList.shadowBlock),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 8,
- gui.getTop() + 11 * 9, x,
- y,
- new ItemStack(BlockList.shadowBlock),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 0,
- gui.getTop() + 11 * 9, x,
- y,
- new ItemStack(BlockList.shadowBlock),
- 0, 0, 0);
-
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 2,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 6,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stonebrick),
- 0, 0, 0);
- break;
-
- case 4:
- Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + "Layer 4",
- gui.getLeft() + xPos + 35,
- gui.getTop() - 30);
- for (int i = -1; i < 10; i++)
- for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui
- .getLeft()
- + xPos
- + 11 * i,
- gui.getTop() + 11
- * j,
- x, y,
- new ItemStack(Blocks.air),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 2,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stone_brick_stairs),
- 0, 90, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 3,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stone_brick_stairs),
- 0, -90, 180);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 4,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(BlockList.shadowEye),
- 0, 90, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 5,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stone_brick_stairs),
- 0, 90, 180);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 6,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stone_brick_stairs),
- 0, -90, 0);
- break;
-
- case 5:
- Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE
- + "\u00a7n"
- + "Layer 5",
- gui.getLeft() + xPos + 35,
- gui.getTop() - 30);
- for (int i = -1; i < 10; i++)
- for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui
- .getLeft()
- + xPos
- + 11 * i,
- gui.getTop() + 11
- * j,
- x, y,
- new ItemStack(Blocks.air),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 3,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stone_slab,
- 1, 5),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 4,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stone_slab,
- 1, 5),
- 0, 0, 0);
- Page.addSlotItem(gui,
- gui.getLeft() + xPos
- + 11 * 5,
- gui.getTop() + 11 * 5, x,
- y,
- new ItemStack(Blocks.stone_slab,
- 1, 5),
- 0, 0, 0);
- break;
+ case 1:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * i, gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8, gui.getTop() + 11 * 1, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0, gui.getTop() + 11 * 1, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8, gui.getTop() + 11 * 9, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0, gui.getTop() + 11 * 9, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+
+ // Top
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2, gui.getTop() + 11 * 1, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 45, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4, gui.getTop() + 11 * 0, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6, gui.getTop() + 11 * 1, x, y,
+ new ItemStack(BlockList.handPedestal), 0, -45, 0);
+
+ // Left
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0, gui.getTop() + 11 * 3, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 45, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * -1, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 90, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0, gui.getTop() + 11 * 7, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 135, 0);
+
+ // Bottom
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2, gui.getTop() + 11 * 9, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 135, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4, gui.getTop() + 11 * 10, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 180, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6, gui.getTop() + 11 * 9, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 225, 0);
+
+ // Right
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8, gui.getTop() + 11 * 3, x, y,
+ new ItemStack(BlockList.handPedestal), 0, -35, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 9, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 270, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8, gui.getTop() + 11 * 7, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 225, 0);
+
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ break;
+
+ case 2:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * i, gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8, gui.getTop() + 11 * 1, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0, gui.getTop() + 11 * 1, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8, gui.getTop() + 11 * 9, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0, gui.getTop() + 11 * 9, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ break;
+
+ case 3:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * i, gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8, gui.getTop() + 11 * 1, x, y,
+ new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0, gui.getTop() + 11 * 1, x, y,
+ new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8, gui.getTop() + 11 * 9, x, y,
+ new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0, gui.getTop() + 11 * 9, x, y,
+ new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ break;
+
+ case 4:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * i, gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 3, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(BlockList.shadowEye), 0, 90, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 5, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0);
+ break;
+
+ case 5:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 5", gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * i, gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 3, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 5, gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ break;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java index 975dbd2..5405290 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java @@ -10,18 +10,14 @@ import net.minecraft.item.ItemStack; public class ContainerJewelryModifier extends Container {
public IInventory modInv;
- public ContainerJewelryModifier(InventoryPlayer inv,
- IInventory mod) {
+ public ContainerJewelryModifier(InventoryPlayer inv, IInventory mod) {
int x, y;
modInv = mod;
for (x = 0; x < 9; x++)
- addSlotToContainer(new Slot(inv, x, 26 + 18 * x,
- 225));
+ addSlotToContainer(new Slot(inv, x, 26 + 18 * x, 225));
for (y = 0; y < 3; y++)
for (x = 0; x < 9; x++)
- addSlotToContainer(new Slot(inv,
- x + 9 + y * 9, 26 + 18 * x,
- 167 + y * 18));
+ addSlotToContainer(new Slot(inv, x + 9 + y * 9, 26 + 18 * x, 167 + y * 18));
addSlotToContainer(new Slot(mod, 36, 37, 9));
}
@@ -31,20 +27,16 @@ public class ContainerJewelryModifier extends Container { }
@Override
- public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer,
- int par2) {
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
ItemStack itemstack = null;
Slot slot = (Slot) inventorySlots.get(par2);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2 < 27) {
- if (!mergeItemStack(itemstack1, 27,
- inventorySlots.size(),
- true))
+ if (!mergeItemStack(itemstack1, 27, inventorySlots.size(), true))
return null;
- } else if (!mergeItemStack(itemstack1, 0, 27,
- false))
+ } else if (!mergeItemStack(itemstack1, 0, 27, false))
return null;
if (itemstack1.stackSize == 0)
slot.putStack((ItemStack) null);
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java index d3fbab1..6a118dc 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java @@ -6,11 +6,7 @@ import darkknight.jewelrycraft.client.gui.container.slots.SlotBracelet; import darkknight.jewelrycraft.client.gui.container.slots.SlotEarrings;
import darkknight.jewelrycraft.client.gui.container.slots.SlotNecklace;
import darkknight.jewelrycraft.client.gui.container.slots.SlotRing;
-import darkknight.jewelrycraft.item.ItemBaseJewelry;
-import darkknight.jewelrycraft.item.ItemBracelet;
-import darkknight.jewelrycraft.item.ItemEarrings;
-import darkknight.jewelrycraft.item.ItemNecklace;
-import darkknight.jewelrycraft.item.ItemRing;
+import darkknight.jewelrycraft.item.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
@@ -18,33 +14,26 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack;
public class ContainerJewelryTab extends Container {
- public ContainerJewelryTab(EntityPlayer player, IInventory inv,
- IInventory extra) {
+ public ContainerJewelryTab(EntityPlayer player, IInventory inv, IInventory extra) {
int x, y;
// Rings
for (x = 0; x <= 9; x++)
- addSlotToContainer(new SlotRing(extra, x,
- 8 + x * 18, 7));
+ addSlotToContainer(new SlotRing(extra, x, 8 + x * 18, 7));
// Bracelets
for (x = 10; x <= 13; x++)
- addSlotToContainer(new SlotBracelet(extra, x,
- 8 + (x - 10) * 18, 26));
+ addSlotToContainer(new SlotBracelet(extra, x, 8 + (x - 10) * 18, 26));
// Necklaces
for (x = 14; x <= 16; x++)
- addSlotToContainer(new SlotNecklace(extra, x,
- 8 + (x - 14) * 18, 45));
+ addSlotToContainer(new SlotNecklace(extra, x, 8 + (x - 14) * 18, 45));
// Earrings
addSlotToContainer(new SlotEarrings(extra, 17, 8, 64));
// Hotbar
for (x = 0; x < 9; ++x)
- addSlotToContainer(new Slot(inv, x, 17 + x * 18,
- 142));
+ addSlotToContainer(new Slot(inv, x, 17 + x * 18, 142));
// Inventory
for (x = 0; x < 3; ++x)
for (y = 0; y < 9; ++y)
- addSlotToContainer(new Slot(inv,
- 9 + y + x * 9, 17 + y * 18,
- 84 + x * 18));
+ addSlotToContainer(new Slot(inv, 9 + y + x * 9, 17 + y * 18, 84 + x * 18));
}
@Override
@@ -53,56 +42,29 @@ public class ContainerJewelryTab extends Container { }
@Override
- public ItemStack slotClick(int slotID, int j, int k,
- EntityPlayer player) {
- if (slotID >= 0 && slotID <= 17
- && !player.worldObj.isRemote) {
+ public ItemStack slotClick(int slotID, int j, int k, EntityPlayer player) {
+ if (slotID >= 0 && slotID <= 17 && !player.worldObj.isRemote) {
try {
- if (player.inventory.getItemStack() == null
- && inventoryItemStacks.get(
- slotID) != null
- && ((ItemStack) inventoryItemStacks
- .get(slotID)).getItem() instanceof ItemBaseJewelry)
- ((ItemBaseJewelry) ((ItemStack) inventoryItemStacks
- .get(slotID)).getItem())
- .onJewelryUnequipped(
- (ItemStack) inventoryItemStacks
- .get(slotID));
- else if (player.inventory
- .getItemStack() != null
- && player.inventory
- .getItemStack()
- .getItem() instanceof ItemBaseJewelry
- && inventoryItemStacks.get(
- slotID) == null)
- ((ItemBaseJewelry) player.inventory
- .getItemStack()
- .getItem()).onJewelryEquipped(
- player.inventory.getItemStack());
- if (player.inventory.getItemStack() == null
- && inventoryItemStacks.get(
- slotID) != null
- && ((ItemStack) inventoryItemStacks
- .get(slotID)).getItem() instanceof IJewelryItem)
- ((IJewelryItem) ((ItemStack) inventoryItemStacks
- .get(slotID)).getItem())
- .onJewelryUnequipped(
- (ItemStack) inventoryItemStacks
- .get(slotID));
- else if (player.inventory
- .getItemStack() != null
- && player.inventory
- .getItemStack()
- .getItem() instanceof IJewelryItem
- && inventoryItemStacks.get(
- slotID) == null)
- ((IJewelryItem) player.inventory
- .getItemStack()
- .getItem()).onJewelryEquipped(
- player.inventory.getItemStack());
+ if (player.inventory.getItemStack() == null && inventoryItemStacks.get(slotID) != null
+ && ((ItemStack) inventoryItemStacks.get(slotID)).getItem() instanceof ItemBaseJewelry)
+ ((ItemBaseJewelry) ((ItemStack) inventoryItemStacks.get(slotID)).getItem())
+ .onJewelryUnequipped((ItemStack) inventoryItemStacks.get(slotID));
+ else if (player.inventory.getItemStack() != null
+ && player.inventory.getItemStack().getItem() instanceof ItemBaseJewelry
+ && inventoryItemStacks.get(slotID) == null)
+ ((ItemBaseJewelry) player.inventory.getItemStack().getItem())
+ .onJewelryEquipped(player.inventory.getItemStack());
+ if (player.inventory.getItemStack() == null && inventoryItemStacks.get(slotID) != null
+ && ((ItemStack) inventoryItemStacks.get(slotID)).getItem() instanceof IJewelryItem)
+ ((IJewelryItem) ((ItemStack) inventoryItemStacks.get(slotID)).getItem())
+ .onJewelryUnequipped((ItemStack) inventoryItemStacks.get(slotID));
+ else if (player.inventory.getItemStack() != null
+ && player.inventory.getItemStack().getItem() instanceof IJewelryItem
+ && inventoryItemStacks.get(slotID) == null)
+ ((IJewelryItem) player.inventory.getItemStack().getItem())
+ .onJewelryEquipped(player.inventory.getItemStack());
} catch (Exception e) {
- JewelrycraftMod.logger.error(
- "An error has occured while equipping an item.");
+ JewelrycraftMod.logger.error("An error has occured while equipping an item.");
e.printStackTrace();
}
}
@@ -110,67 +72,39 @@ public class ContainerJewelryTab extends Container { }
@Override
- public ItemStack transferStackInSlot(EntityPlayer player,
- int slotID) {
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotID) {
ItemStack itemstack = null;
Slot slot = (Slot) inventorySlots.get(slotID);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (slotID >= 18) {
- if (itemstack.getItem() instanceof ItemRing
- || (itemstack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) itemstack
- .getItem()).type() == 0)) {
- if (!mergeItemStack(itemstack, 0,
- 10, false)
- && !slot.getHasStack())
+ if (itemstack.getItem() instanceof ItemRing || (itemstack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) itemstack.getItem()).type() == 0)) {
+ if (!mergeItemStack(itemstack, 0, 10, false) && !slot.getHasStack())
return null;
- } else if (itemstack
- .getItem() instanceof ItemBracelet
- || (itemstack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) itemstack
- .getItem()).type() == 1)) {
- if (!mergeItemStack(itemstack, 10,
- 14, false)
- && !slot.getHasStack())
+ } else if (itemstack.getItem() instanceof ItemBracelet || (itemstack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) itemstack.getItem()).type() == 1)) {
+ if (!mergeItemStack(itemstack, 10, 14, false) && !slot.getHasStack())
return null;
- } else if (itemstack
- .getItem() instanceof ItemNecklace
- || (itemstack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) itemstack
- .getItem()).type() == 2)) {
- if (!mergeItemStack(itemstack, 14,
- 17, false)
- && !slot.getHasStack())
+ } else if (itemstack.getItem() instanceof ItemNecklace || (itemstack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) itemstack.getItem()).type() == 2)) {
+ if (!mergeItemStack(itemstack, 14, 17, false) && !slot.getHasStack())
return null;
- } else if (itemstack
- .getItem() instanceof ItemEarrings
- || (itemstack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) itemstack
- .getItem()).type() == 3)) {
- if (!mergeItemStack(itemstack, 17,
- 18, false)
- && !slot.getHasStack())
+ } else if (itemstack.getItem() instanceof ItemEarrings || (itemstack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) itemstack.getItem()).type() == 3)) {
+ if (!mergeItemStack(itemstack, 17, 18, false) && !slot.getHasStack())
return null;
} else {
if (slotID < 27) {
- if (!mergeItemStack(
- itemstack,
- 27,
- 36 + 18,
- false))
+ if (!mergeItemStack(itemstack, 27, 36 + 18, false))
return null;
} else {
- if (!mergeItemStack(
- itemstack,
- 18, 27,
- false))
+ if (!mergeItemStack(itemstack, 18, 27, false))
return null;
}
}
- } else if (!mergeItemStack(itemstack, 18,
- inventorySlots.size(), false))
+ } else if (!mergeItemStack(itemstack, 18, inventorySlots.size(), false))
return null;
if (itemstack.stackSize == 0)
slot.putStack(null);
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java index 825b737..3901f9c 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java @@ -15,25 +15,18 @@ public class ContainerRingChest extends Container { * @param inv * @param chest */ - public ContainerRingChest(InventoryPlayer inv, - TileEntityChest chest) { + public ContainerRingChest(InventoryPlayer inv, TileEntityChest chest) { theChest = chest; int x, y; for (x = 0; x < 9; x++) - addSlotToContainer(new SlotRingChest(inv, x, - 8 + 18 * x, 142, - x == inv.currentItem)); + addSlotToContainer(new SlotRingChest(inv, x, 8 + 18 * x, 142, x == inv.currentItem)); for (y = 0; y < 3; y++) for (x = 0; x < 9; x++) - addSlotToContainer(new Slot(inv, - x + 9 + y * 9, 8 + 18 * x, - 84 + y * 18)); + addSlotToContainer(new Slot(inv, x + 9 + y * 9, 8 + 18 * x, 84 + y * 18)); for (y = 0; y < 3; y++) for (x = 0; x < 9; x++) - addSlotToContainer(new SlotRingChest(chest, - 26 - (x + y * 9), - 8 + 18 * (8 - x), - 17 + (2 - y) * 18, false)); + addSlotToContainer( + new SlotRingChest(chest, 26 - (x + y * 9), 8 + 18 * (8 - x), 17 + (2 - y) * 18, false)); } /** @@ -51,20 +44,16 @@ public class ContainerRingChest extends Container { * @return */ @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, - int par2) { + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { ItemStack itemstack = null; Slot slot = (Slot) inventorySlots.get(par2); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (par2 < 27) { - if (!mergeItemStack(itemstack1, 27, - inventorySlots.size(), - true)) + if (!mergeItemStack(itemstack1, 27, inventorySlots.size(), true)) return null; - } else if (!mergeItemStack(itemstack1, 0, 27, - false)) + } else if (!mergeItemStack(itemstack1, 0, 27, false)) return null; if (itemstack1.stackSize == 0) slot.putStack((ItemStack) null); diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java index ab09015..c647c0a 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java @@ -25,10 +25,8 @@ public class SlotBracelet extends Slot { */
@Override
public boolean isItemValid(ItemStack stack) {
- return stack.getItem() instanceof ItemBracelet || (stack
- .getItem() instanceof IJewelryItem
- && ((IJewelryItem) stack.getItem())
- .type() == 1);
+ return stack.getItem() instanceof ItemBracelet
+ || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem) stack.getItem()).type() == 1);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java index 1527e29..e1f221a 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java @@ -25,10 +25,8 @@ public class SlotEarrings extends Slot { */
@Override
public boolean isItemValid(ItemStack stack) {
- return stack.getItem() instanceof ItemEarrings || (stack
- .getItem() instanceof IJewelryItem
- && ((IJewelryItem) stack.getItem())
- .type() == 3);
+ return stack.getItem() instanceof ItemEarrings
+ || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem) stack.getItem()).type() == 3);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java index ba39329..c7d0c4a 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java @@ -25,10 +25,8 @@ public class SlotNecklace extends Slot { */
@Override
public boolean isItemValid(ItemStack stack) {
- return stack.getItem() instanceof ItemNecklace || (stack
- .getItem() instanceof IJewelryItem
- && ((IJewelryItem) stack.getItem())
- .type() == 2);
+ return stack.getItem() instanceof ItemNecklace
+ || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem) stack.getItem()).type() == 2);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java index 41381b1..548b100 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java @@ -25,10 +25,8 @@ public class SlotRing extends Slot { */
@Override
public boolean isItemValid(ItemStack stack) {
- return stack.getItem() instanceof ItemRing || (stack
- .getItem() instanceof IJewelryItem
- && ((IJewelryItem) stack.getItem())
- .type() == 0);
+ return stack.getItem() instanceof ItemRing
+ || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem) stack.getItem()).type() == 0);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRingChest.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRingChest.java index 72c149d..d69eff8 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRingChest.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRingChest.java @@ -15,8 +15,7 @@ public class SlotRingChest extends Slot { * @param y * @param locked */ - public SlotRingChest(IInventory tile, int slotID, int x, int y, - boolean locked) { + public SlotRingChest(IInventory tile, int slotID, int x, int y, boolean locked) { super(tile, slotID, x, y); this.locked = locked; } |
