diff options
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/client')
27 files changed, 1232 insertions, 1228 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java index 5ff4d2f..cdfb394 100644 --- a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java +++ b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java @@ -1,68 +1,69 @@ -package darkknight.jewelrycraft.client; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.*; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.util.Variables; - -/** - * @author TinkersCOnstruct - */ -@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(); - - public AbstractTab(int id, int posX, int posY, ItemStack renderStack) - { - super(id, posX, posY, 18, 18, ""); - this.renderStack = renderStack; - } - - @Override - public void drawButton (Minecraft mc, int mouseX, int mouseY) - { - if (this.visible) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int xOffset = this.enabled ? 0 : 8; - - mc.renderEngine.bindTexture(this.texture); - this.drawTexturedModalRect(this.xPosition, yPosition, 144 + xOffset, 32, 18, 18); - - GL11.glPushMatrix(); - RenderHelper.enableGUIStandardItemLighting(); - this.zLevel = 100.0F; - 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, yPosition + 1); - this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1, yPosition + 1); - GL11.glDisable(GL11.GL_LIGHTING); - this.itemRenderer.zLevel = 0.0F; - this.zLevel = 0.0F; - RenderHelper.disableStandardItemLighting(); - GL11.glPopMatrix(); - } - } - - @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; - if (inWindow) this.onTabClicked(); - return inWindow; - } - - public abstract void onTabClicked (); - - public abstract boolean shouldAddToList (); +package darkknight.jewelrycraft.client;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+
+/**
+ * @author TinkersCOnstruct
+ */
+@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();
+
+ public AbstractTab(int id, int posX, int posY, ItemStack renderStack)
+ {
+ super(id, posX, posY, 18, 18, "");
+ this.renderStack = renderStack;
+ }
+
+ @Override
+ public void drawButton (Minecraft mc, int mouseX, int mouseY)
+ {
+ if (this.visible)
+ {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ int xOffset = this.enabled ? 0 : 8;
+
+ mc.renderEngine.bindTexture(this.texture);
+ this.drawTexturedModalRect(this.xPosition, yPosition, 144 + xOffset, 32, 18, 18);
+
+ GL11.glPushMatrix();
+ RenderHelper.enableGUIStandardItemLighting();
+ this.zLevel = 100.0F;
+ 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, yPosition + 1);
+ this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1, yPosition + 1);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ this.itemRenderer.zLevel = 0.0F;
+ this.zLevel = 0.0F;
+ RenderHelper.disableStandardItemLighting();
+ GL11.glPopMatrix();
+ }
+ }
+
+ @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;
+ if (inWindow) this.onTabClicked();
+ return inWindow;
+ }
+
+ public abstract void onTabClicked ();
+
+ public abstract boolean shouldAddToList ();
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java b/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java index cf8543e..895b345 100644 --- a/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java +++ b/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java @@ -1,166 +1,166 @@ -package darkknight.jewelrycraft.client; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class JewelryInventory implements IInventory -{ - 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); - for(int i = 0; i < 18; i++) - inventory[i] = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("ext" + i)); - } - - /** - * @return - */ - @Override - public int getSizeInventory() - { - return inventory.length; - } - - /** - * @param slot - * @return - */ - @Override - public ItemStack getStackInSlot(int slot) - { - return inventory[slot]; - } - - /** - * @param slot - * @param amount - * @return - */ - @Override - public ItemStack decrStackSize(int slot, int amount) - { - ItemStack stack = getStackInSlot(slot); - if (stack != null) if (stack.stackSize > amount){ - stack = stack.splitStack(amount); - markDirty(); - }else setInventorySlotContents(slot, null); - return stack; - } - - /** - * @param slot - * @return - */ - @Override - public ItemStack getStackInSlotOnClosing(int slot) - { - ItemStack stack = getStackInSlot(slot); - setInventorySlotContents(slot, null); - return stack; - } - - /** - * @param slot - * @param stack - */ - @Override - public void setInventorySlotContents(int slot, ItemStack stack) - { - inventory[slot] = stack; - if (stack != null && stack.stackSize > getInventoryStackLimit()) stack.stackSize = getInventoryStackLimit(); - markDirty(); - } - - /** - * @return - */ - @Override - public String getInventoryName() - { - return "Jewelry"; - } - - /** - * @return - */ - @Override - public boolean hasCustomInventoryName() - { - return false; - } - - /** - * @return - */ - @Override - public int getInventoryStackLimit() - { - return 1; - } - - /** - * - */ - @Override - public void markDirty() - { - 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))); - else nbt.removeTag("ext" + i); - } - - /** - * @param player - * @return - */ - @Override - public boolean isUseableByPlayer(EntityPlayer player) - { - return true; - } - - /** - * - */ - @Override - public void openInventory() - {} - - /** - * - */ - @Override - public void closeInventory() - {} - - /** - * @param slot - * @param stack - * @return - */ - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) - { - if (slot >= 0 && slot <= 9 && stack.getItem() instanceof ItemRing) return true; - else if (slot >= 10 && slot <= 13 && stack.getItem() instanceof ItemBracelet) return true; - else if (slot >= 14 && slot <= 16 && stack.getItem() instanceof ItemNecklace) return true; - else if (slot == 17 && stack.getItem() instanceof ItemEarrings) return true; - return false; - } +package darkknight.jewelrycraft.client;
+
+import darkknight.jewelrycraft.item.ItemBracelet;
+import darkknight.jewelrycraft.item.ItemEarrings;
+import darkknight.jewelrycraft.item.ItemNecklace;
+import darkknight.jewelrycraft.item.ItemRing;
+import darkknight.jewelrycraft.util.PlayerUtils;
+import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+public class JewelryInventory implements IInventory
+{
+ 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);
+ for(int i = 0; i < 18; i++)
+ inventory[i] = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("ext" + i));
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getSizeInventory()
+ {
+ return inventory.length;
+ }
+
+ /**
+ * @param slot
+ * @return
+ */
+ @Override
+ public ItemStack getStackInSlot(int slot)
+ {
+ return inventory[slot];
+ }
+
+ /**
+ * @param slot
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ if (stack != null) if (stack.stackSize > amount){
+ stack = stack.splitStack(amount);
+ markDirty();
+ }else setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ /**
+ * @param slot
+ * @return
+ */
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ /**
+ * @param slot
+ * @param stack
+ */
+ @Override
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ inventory[slot] = stack;
+ if (stack != null && stack.stackSize > getInventoryStackLimit()) stack.stackSize = getInventoryStackLimit();
+ markDirty();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public String getInventoryName()
+ {
+ return "Jewelry";
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean hasCustomInventoryName()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getInventoryStackLimit()
+ {
+ return 1;
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void markDirty()
+ {
+ 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)));
+ else nbt.removeTag("ext" + i);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer player)
+ {
+ return true;
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void openInventory()
+ {}
+
+ /**
+ *
+ */
+ @Override
+ public void closeInventory()
+ {}
+
+ /**
+ * @param slot
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack stack)
+ {
+ if (slot >= 0 && slot <= 9 && stack.getItem() instanceof ItemRing) return true;
+ else if (slot >= 10 && slot <= 13 && stack.getItem() instanceof ItemBracelet) return true;
+ else if (slot >= 14 && slot <= 16 && stack.getItem() instanceof ItemNecklace) return true;
+ else if (slot == 17 && stack.getItem() instanceof ItemEarrings) return true;
+ return false;
+ }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/client/Page.java b/src/main/java/darkknight/jewelrycraft/client/Page.java index d1ca8fd..866f6f3 100644 --- a/src/main/java/darkknight/jewelrycraft/client/Page.java +++ b/src/main/java/darkknight/jewelrycraft/client/Page.java @@ -1,10 +1,8 @@ package darkknight.jewelrycraft.client;
import java.util.ArrayList;
-
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
-
import darkknight.jewelrycraft.client.gui.GuiGuide;
import darkknight.jewelrycraft.util.Variables;
import net.minecraft.client.Minecraft;
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabCurses.java b/src/main/java/darkknight/jewelrycraft/client/TabCurses.java index d5e8fdd..3468324 100644 --- a/src/main/java/darkknight/jewelrycraft/client/TabCurses.java +++ b/src/main/java/darkknight/jewelrycraft/client/TabCurses.java @@ -1,10 +1,9 @@ package darkknight.jewelrycraft.client;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.item.ItemList;
import darkknight.jewelrycraft.network.PacketKeyPressEvent;
+import net.minecraft.item.ItemStack;
public class TabCurses extends AbstractTab
{
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java b/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java index 65d4a3b..31cd7b4 100644 --- a/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java @@ -1,26 +1,26 @@ -package darkknight.jewelrycraft.client; - -import net.minecraft.item.ItemStack; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketKeyPressEvent; - -public class TabJewelry extends AbstractTab -{ - public TabJewelry() - { - super(0, 0, 0, new ItemStack(ItemList.necklace)); - } - - @Override - public void onTabClicked () - { - JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0)); - } - - @Override - public boolean shouldAddToList () - { - return true; - } +package darkknight.jewelrycraft.client;
+
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.network.PacketKeyPressEvent;
+import net.minecraft.item.ItemStack;
+
+public class TabJewelry extends AbstractTab
+{
+ public TabJewelry()
+ {
+ super(0, 0, 0, new ItemStack(ItemList.necklace));
+ }
+
+ @Override
+ public void onTabClicked ()
+ {
+ JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0));
+ }
+
+ @Override
+ public boolean shouldAddToList ()
+ {
+ return true;
+ }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java index e35f305..fdc579f 100644 --- a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java +++ b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java @@ -2,16 +2,15 @@ package darkknight.jewelrycraft.client; import java.util.ArrayList;
import java.util.List;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.inventory.GuiInventory;
-import net.minecraft.network.play.client.C0DPacketCloseWindow;
-import net.minecraftforge.client.event.GuiScreenEvent;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import darkknight.jewelrycraft.client.*;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiInventory;
+import net.minecraft.network.play.client.C0DPacketCloseWindow;
+import net.minecraftforge.client.event.GuiScreenEvent;
/**
* @author TinkersConstruct
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java index 6708ec5..16b946c 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java @@ -2,32 +2,25 @@ package darkknight.jewelrycraft.client.gui; import java.util.ArrayList;
import java.util.List;
-import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.api.Curse;
-import darkknight.jewelrycraft.client.Page;
import darkknight.jewelrycraft.client.TabCurses;
import darkknight.jewelrycraft.client.TabRegistry;
import darkknight.jewelrycraft.config.ConfigHandler;
import darkknight.jewelrycraft.events.KeyBindings;
-import darkknight.jewelrycraft.network.PacketSendClientPlayerInfo;
import darkknight.jewelrycraft.network.PacketSendServerPlayerInfo;
import darkknight.jewelrycraft.network.PacketSendServerPlayersInfo;
-import darkknight.jewelrycraft.util.JewelrycraftUtil;
import darkknight.jewelrycraft.util.PlayerUtils;
import darkknight.jewelrycraft.util.Variables;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-import scala.swing.event.Key;
public class GuiCurseInfo extends GuiContainer {
World world;
@@ -125,7 +118,6 @@ public class GuiCurseInfo extends GuiContainer { GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
- int halfDescrSize = fontRendererObj.getStringWidth(curse.getDescription()) / 2;
mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png"));
int tag = curse.getTextureID();
GL11.glPushMatrix();
@@ -170,7 +162,6 @@ public class GuiCurseInfo extends GuiContainer { 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();
}
- int halfDescrSize = fontRendererObj.getStringWidth(curse.getDescription()) / 2;
mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png"));
int tag = curse.getTextureID();
GL11.glPushMatrix();
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java index 5f52897..aa47840 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java @@ -2,6 +2,9 @@ package darkknight.jewelrycraft.client.gui; import java.util.ArrayList;
import java.util.List;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.block.BlockShadowEye;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.client.Minecraft;
@@ -14,180 +17,201 @@ import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-import org.lwjgl.opengl.GL11;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import darkknight.jewelrycraft.JewelrycraftMod;
-import darkknight.jewelrycraft.block.BlockList;
-import darkknight.jewelrycraft.block.BlockShadowEye;
-import darkknight.jewelrycraft.util.JewelrycraftUtil;
-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;
-
- //GUIDE
+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;
+ // GUIDE
public static GuiTab prevActive = new GuiTabIntroduction(0);
public static int prevPage = 1;
-
- public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) {
- super(container);
- page = prevPage;
- rot = 0;
- del = 0;
- this.world = world;
- activeTab = prevActive;
- pageTexture = pageTex;
- flippedPageTexture = flipPageTex;
- this.xSize = 240;
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
- nextHover = false;
- prevHover = false;
- if (del == 0) rot++;
- 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);
- for (GuiRectangle tab : tabs) {
- int srcX = 24;
- int sizeX = 19;
- if (tab == activeTab) {
- srcX += 38;
- sizeX += 3;
- }
- else if (tab.inRect(this, i, j)) 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);
- 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);
- prevHover = true;
- }
- activeTab.drawBackground(this, i, j, page);
- activeTab.drawBackground(this, i, j, page + 1);
- ArrayList<String> text = new ArrayList<String>();
- text.add(Integer.toString(page));
- drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 25, fontRendererObj);
- text.remove(Integer.toString(page));
- text.add(Integer.toString(page + 1));
- 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());
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int x, int y) {
- activeTab.drawForeground(this, x, y, page);
- activeTab.drawForeground(this, x, y, page + 1);
- for (GuiTab tab : tabs)
- tab.drawString(this, x, y, tab.getName());
- }
-
- @Override
- protected void mouseClicked(int x, int y, int button) {
- if (nextHover && page + 2 <= activeTab.getMaxPages()) {
- page += 2;
- prevPage = page;
- }
- else if (prevHover && page > 1) {
- page -= 2;
- prevPage = page;
- }
- activeTab.mouseClick(this, x, y, button);
- for (GuiTab tab : tabs)
- if (activeTab != tab) if (tab.inRect(this, x, y)) {
- activeTab = tab;
- prevActive = tab;
- page = 1;
- prevPage = page;
- break;
- }
- }
-
- 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.hoverStart = 0.0F;
- if (item.isItemEqual(new ItemStack(BlockList.smelter))) {
- y -= 3;
- x += 1;
- }
- GL11.glTranslatef(x, y, 100);
- float scale = 30F;
- GL11.glScalef(-scale, scale, scale);
- if (activeIcon != null && item.isItemEqual(activeIcon)) 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))) {
- 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)) RenderHelper.enableStandardItemLighting();
- if (RenderManager.instance.options.fancyGraphics) 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.options.fancyGraphics = false;
- }
- 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) {
- GL11.glPushMatrix();
- 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);
- GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F);
- if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F);
- else {
- GL11.glRotatef(xRot, 1, 0, 0);
- GL11.glRotatef(yRot, 0, 1, 0);
- 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) GL11.glTranslatef(0F, 0F, 0.025F);
- }
- 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);
- else {
- RenderManager.instance.options.fancyGraphics = true;
- 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)) RenderHelper.disableStandardItemLighting();
- GL11.glPopMatrix();
- }
-
- public int getLeft() {
- return guiLeft;
- }
-
- public int getTop() {
- return guiTop;
- }
-
- public FontRenderer getFont() {
- return fontRendererObj;
- }
-
- @SuppressWarnings("rawtypes")
- public void drawHoverString(List lst, int x, int y) {
- drawHoveringText(lst, x, y, fontRendererObj);
- }
+
+ public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex)
+ {
+ super(container);
+ page = prevPage;
+ rot = 0;
+ del = 0;
+ this.world = world;
+ activeTab = prevActive;
+ pageTexture = pageTex;
+ flippedPageTexture = flipPageTex;
+ this.xSize = 240;
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
+ {
+ nextHover = false;
+ prevHover = false;
+ if (del == 0)
+ rot++;
+ 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);
+ for(GuiRectangle tab: tabs){
+ int srcX = 24;
+ int sizeX = 19;
+ if (tab == activeTab) {
+ srcX += 38;
+ sizeX += 3;
+ }else
+ if (tab.inRect(this, i, j))
+ 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);
+ 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);
+ prevHover = true;
+ }
+ activeTab.drawBackground(this, i, j, page);
+ activeTab.drawBackground(this, i, j, page + 1);
+ ArrayList<String> text = new ArrayList<String>();
+ text.add(page + "/" + activeTab.getMaxPages());
+ 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);
+ }
+ for(int tab = 0; tab < tabs.length; tab++)
+ renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon());
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int x, int y)
+ {
+ activeTab.drawForeground(this, x, y, page);
+ activeTab.drawForeground(this, x, y, page + 1);
+ for(GuiTab tab: tabs)
+ tab.drawString(this, x, y, tab.getName());
+ }
+
+ @Override
+ protected void mouseClicked(int x, int y, int button)
+ {
+ if (nextHover && page + 2 <= activeTab.getMaxPages()) {
+ page += 2;
+ prevPage = page;
+ }else
+ if (prevHover && page > 1) {
+ page -= 2;
+ prevPage = page;
+ }
+ activeTab.mouseClick(this, x, y, button);
+ for(GuiTab tab: tabs)
+ if (activeTab != tab)
+ if (tab.inRect(this, x, y)) {
+ activeTab = tab;
+ prevActive = tab;
+ page = 1;
+ prevPage = page;
+ break;
+ }
+ }
+
+ 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.hoverStart = 0.0F;
+ if (item.isItemEqual(new ItemStack(BlockList.smelter))) {
+ y -= 3;
+ x += 1;
+ }
+ GL11.glTranslatef(x, y, 100);
+ float scale = 30F;
+ GL11.glScalef(-scale, scale, scale);
+ if (activeIcon != null && item.isItemEqual(activeIcon))
+ 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))) {
+ 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))
+ RenderHelper.enableStandardItemLighting();
+ if (RenderManager.instance.options.fancyGraphics)
+ 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.options.fancyGraphics = false;
+ }
+ 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)
+ {
+ GL11.glPushMatrix();
+ 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);
+ GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F);
+ if (rotate)
+ GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F);
+ else{
+ GL11.glRotatef(xRot, 1, 0, 0);
+ GL11.glRotatef(yRot, 0, 1, 0);
+ 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)
+ GL11.glTranslatef(0F, 0F, 0.025F);
+ }
+ 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);
+ else{
+ RenderManager.instance.options.fancyGraphics = true;
+ 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))
+ RenderHelper.disableStandardItemLighting();
+ GL11.glPopMatrix();
+ }
+
+ public int getLeft()
+ {
+ return guiLeft;
+ }
+
+ public int getTop()
+ {
+ return guiTop;
+ }
+
+ public FontRenderer getFont()
+ {
+ return fontRendererObj;
+ }
+
+ @SuppressWarnings ("rawtypes")
+ public void drawHoverString(List lst, int x, int y)
+ {
+ drawHoveringText(lst, x, y, fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java index e91abc0..0218886 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java @@ -1,10 +1,5 @@ package darkknight.jewelrycraft.client.gui;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.InventoryBasic;
-import net.minecraft.tileentity.TileEntityChest;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import darkknight.jewelrycraft.JewelrycraftMod;
@@ -15,6 +10,11 @@ import darkknight.jewelrycraft.client.gui.container.ContainerJewelryModifier; import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab;
import darkknight.jewelrycraft.client.gui.container.ContainerRingChest;
import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.InventoryBasic;
+import net.minecraft.tileentity.TileEntityChest;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler
{
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java index 3ca0a20..b08ea37 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java @@ -1,14 +1,14 @@ package darkknight.jewelrycraft.client.gui;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.gui.inventory.GuiInventory;
-import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import darkknight.jewelrycraft.client.TabJewelry;
import darkknight.jewelrycraft.client.TabRegistry;
import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab;
import darkknight.jewelrycraft.events.KeyBindings;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.gui.inventory.GuiInventory;
+import net.minecraft.util.ResourceLocation;
public class GuiJewelry extends GuiContainer
{
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java index a083f57..23f137f 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java @@ -4,31 +4,24 @@ import java.util.ArrayList; import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.logging.Level;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.GuiButton;
-import net.minecraft.client.gui.GuiTextField;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.ChatComponentText;
-import net.minecraft.util.ResourceLocation;
-
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
-
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.client.gui.container.ContainerJewelryModifier;
import darkknight.jewelrycraft.network.PacketRequestSetSlot;
import darkknight.jewelrycraft.util.JewelryNBT;
import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.client.gui.GuiTextField;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
public class GuiJewelryModifier extends GuiContainer {
private ResourceLocation texture;
- private GuiButton addItems;
private GuiTextField searchField, pages;
- private boolean clicked;
private int page = 1, maxPages = 1, selectedX = 0, selectedY = 0, selectedPage = 0, enabled = 0;
private ItemStack selectedItem;
private ArrayList<ItemStack> selectedItems = new ArrayList<ItemStack>();
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java index f4c35fb..7a20854 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java @@ -1,96 +1,96 @@ -package darkknight.jewelrycraft.client.gui; - -import java.util.Arrays; -import net.minecraft.item.ItemStack; - -public class GuiRectangle -{ - private int x; - private int y; - private int w; - private int h; - - /** - * @param x - * @param y - * @param w - * @param h - */ - public GuiRectangle(int x, int y, int w, int h) - { - this.x = x; - this.y = y; - this.w = w; - this.h = h; - } - - /** - * @param gui - * @param mouseX - * @param mouseY - * @return - */ - 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; - } - - /** - * @param x - */ - public void setX(int x) - { - this.x = x; - } - - /** - * @param y - */ - public void setY(int y) - { - this.y = y; - } - - /** - * @param gui - * @param srcX - * @param srcY - */ - public void draw(GuiGuide gui, int srcX, int srcY) - { - gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, w, h); - } - - /** - * @param gui - * @param srcX - * @param srcY - * @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); - } - - /** - * @param gui - * @param mouseX - * @param mouseY - * @param 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()); - } - - /** - * @return - */ - public ItemStack getIcon() - { - return null; - } -} +package darkknight.jewelrycraft.client.gui;
+
+import java.util.Arrays;
+import net.minecraft.item.ItemStack;
+
+public class GuiRectangle
+{
+ private int x;
+ private int y;
+ private int w;
+ private int h;
+
+ /**
+ * @param x
+ * @param y
+ * @param w
+ * @param h
+ */
+ public GuiRectangle(int x, int y, int w, int h)
+ {
+ this.x = x;
+ this.y = y;
+ this.w = w;
+ this.h = h;
+ }
+
+ /**
+ * @param gui
+ * @param mouseX
+ * @param mouseY
+ * @return
+ */
+ 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;
+ }
+
+ /**
+ * @param x
+ */
+ public void setX(int x)
+ {
+ this.x = x;
+ }
+
+ /**
+ * @param y
+ */
+ public void setY(int y)
+ {
+ this.y = y;
+ }
+
+ /**
+ * @param gui
+ * @param srcX
+ * @param srcY
+ */
+ public void draw(GuiGuide gui, int srcX, int srcY)
+ {
+ gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, w, h);
+ }
+
+ /**
+ * @param gui
+ * @param srcX
+ * @param srcY
+ * @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);
+ }
+
+ /**
+ * @param gui
+ * @param mouseX
+ * @param mouseY
+ * @param 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());
+ }
+
+ /**
+ * @return
+ */
+ public ItemStack getIcon()
+ {
+ return null;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java index e72fd81..c31b311 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java @@ -1,50 +1,50 @@ -package darkknight.jewelrycraft.client.gui; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import darkknight.jewelrycraft.client.gui.container.ContainerRingChest; - -public class GuiRingChest extends GuiContainer -{ - public ContainerRingChest container; - ResourceLocation texture; - - /** - * @param container - * @param texture - */ - public GuiRingChest(ContainerRingChest container, ResourceLocation texture) - { - super(container); - this.container = container; - xSize = 176; - ySize = 166; - this.texture = texture; - } - - /** - * @param f - * @param mouseX - * @param mouseY - */ - @Override - public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) - { - GL11.glColor3f(1, 1, 1); - Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - } - - /** - * @param mouseX - * @param mouseY - */ - @Override - public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) - { - fontRendererObj.drawString("Linked Chest", 8, 6, 0x404040); - fontRendererObj.drawString("Inventory", 8, 72, 0x404040); - } -} +package darkknight.jewelrycraft.client.gui;
+
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.client.gui.container.ContainerRingChest;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.util.ResourceLocation;
+
+public class GuiRingChest extends GuiContainer
+{
+ public ContainerRingChest container;
+ ResourceLocation texture;
+
+ /**
+ * @param container
+ * @param texture
+ */
+ public GuiRingChest(ContainerRingChest container, ResourceLocation texture)
+ {
+ super(container);
+ this.container = container;
+ xSize = 176;
+ ySize = 166;
+ this.texture = texture;
+ }
+
+ /**
+ * @param f
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY)
+ {
+ GL11.glColor3f(1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
+ }
+
+ /**
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ 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/GuiTabBlocks.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java index d3f92e3..afbcc3e 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java @@ -1,16 +1,13 @@ package darkknight.jewelrycraft.client.gui;
-import java.awt.Desktop;
-import java.net.URL;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.client.Page;
import darkknight.jewelrycraft.item.ItemList;
import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.StatCollector;
public class GuiTabBlocks extends GuiTab
{
@@ -63,11 +60,11 @@ public class GuiTabBlocks extends GuiTab 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 multimple 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.";
+ 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 jewellery. 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";
+ 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:
@@ -75,7 +72,7 @@ public class GuiTabBlocks extends GuiTab 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 jewellery. Right click the block while holding a jewellery 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";
+ 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;
@@ -107,7 +104,7 @@ public class GuiTabBlocks extends GuiTab 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 jewelery 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!";
+ 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:
@@ -129,7 +126,7 @@ public class GuiTabBlocks extends GuiTab @Override
public int getMaxPages()
{
- return 16;
+ return 15;
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java index 4157a38..9e544cb 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java @@ -1,19 +1,11 @@ package darkknight.jewelrycraft.client.gui;
-import java.awt.Desktop;
-import java.net.URL;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
import darkknight.jewelrycraft.api.Curse;
-import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.client.Page;
import darkknight.jewelrycraft.item.ItemList;
-import darkknight.jewelrycraft.util.JewelryNBT;
-import darkknight.jewelrycraft.util.JewelrycraftUtil;
import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.StatCollector;
public class GuiTabCurses extends GuiTab
{
@@ -56,7 +48,7 @@ public class GuiTabCurses extends GuiTab 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.";
+ 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:
@@ -64,7 +56,7 @@ public class GuiTabCurses extends GuiTab 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.";
+ 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:
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java index a124703..f72766a 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java @@ -1,12 +1,12 @@ package darkknight.jewelrycraft.client.gui;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.Variables;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
-import org.lwjgl.opengl.GL11;
-import darkknight.jewelrycraft.util.JewelrycraftUtil;
-import darkknight.jewelrycraft.util.Variables;
public class GuiTabGemsAndIngots extends GuiTab
{
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java index 158a1f5..1aac70e 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java @@ -1,11 +1,10 @@ package darkknight.jewelrycraft.client.gui;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
import darkknight.jewelrycraft.client.Page;
import darkknight.jewelrycraft.item.ItemList;
import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.StatCollector;
public class GuiTabIntroduction extends GuiTab
{
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java index e6883f9..a66798b 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java @@ -2,17 +2,17 @@ package darkknight.jewelrycraft.client.gui; import java.awt.Desktop;
import java.net.URL;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.client.Page;
import darkknight.jewelrycraft.item.ItemList;
import darkknight.jewelrycraft.util.JewelryNBT;
import darkknight.jewelrycraft.util.JewelrycraftUtil;
import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
public class GuiTabItems extends GuiTab
{
@@ -81,7 +81,7 @@ public class GuiTabItems extends GuiTab 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 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.";
+ 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:
@@ -121,7 +121,7 @@ public class GuiTabItems extends GuiTab 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, Jewelers Table, Ritual).";
+ 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:
@@ -139,7 +139,7 @@ public class GuiTabItems extends GuiTab @Override
public int getMaxPages()
{
- return 16;
+ return 15;
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java index dd8573f..4f155c5 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java @@ -1,11 +1,11 @@ package darkknight.jewelrycraft.client.gui;
+import darkknight.jewelrycraft.client.Page;
+import darkknight.jewelrycraft.util.Variables;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-import darkknight.jewelrycraft.client.Page;
-import darkknight.jewelrycraft.util.Variables;
public class GuiTabModifiers extends GuiTab
{
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java index b7f192d..a0b0e4b 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java @@ -1,81 +1,78 @@ -package darkknight.jewelrycraft.client.gui; - -import java.util.HashMap; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.Variables; - -public class GuiTabOresToIngots extends GuiTab -{ - /** - * @param id - */ - public GuiTabOresToIngots(int id) - { - super(id); - } - - public String getName() - { - return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.oretoingot"); - } - - /** - * @return - */ - @Override - public ItemStack getIcon() - { - return new ItemStack(BlockList.shadowOre); - } - - /** - * @param gui - * @param x - * @param y - * @param page - */ - @Override - 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); - int i = 0; - 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); - GL11.glDisable(GL11.GL_LIGHTING); - } - i++; - } - GL11.glDisable(GL11.GL_BLEND); - } - - /** - * @return - */ - @Override - public int getMaxPages() - { - return JewelrycraftUtil.oreToIngot.size() / 5 + 2; - } - - /** - * @param gui - * @param x - * @param y - * @param page - */ - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - {} -} +package darkknight.jewelrycraft.client.gui;
+
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.StatCollector;
+
+public class GuiTabOresToIngots extends GuiTab
+{
+ /**
+ * @param id
+ */
+ public GuiTabOresToIngots(int id)
+ {
+ super(id);
+ }
+
+ public String getName()
+ {
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.oretoingot");
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(BlockList.shadowOre);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ 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);
+ int i = 0;
+ 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);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ i++;
+ }
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return JewelrycraftUtil.oreToIngot.size() / 5 + 2;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java index 5e3c06e..30f220c 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java @@ -1,132 +1,131 @@ -package darkknight.jewelrycraft.client.gui; - -import org.lwjgl.opengl.GL11; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.client.Page; -import darkknight.jewelrycraft.util.Variables; - -public class GuiTabRitual extends GuiTab -{ - public GuiTabRitual(int id) - { - super(id); - } - - public String getName() - { - return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.ritual"); - } - - @Override - public ItemStack getIcon() - { - return new ItemStack(BlockList.handPedestal); - } - - @Override - 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; - } - } - - @Override - public int getMaxPages() - { - return 5; - } - - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - {} -} +package darkknight.jewelrycraft.client.gui;
+
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.Page;
+import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+
+public class GuiTabRitual extends GuiTab
+{
+ public GuiTabRitual(int id)
+ {
+ super(id);
+ }
+
+ public String getName()
+ {
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.ritual");
+ }
+
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(BlockList.handPedestal);
+ }
+
+ @Override
+ 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;
+ }
+ }
+
+ @Override
+ public int getMaxPages()
+ {
+ return 5;
+ }
+
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
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 afb32d7..e749506 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java @@ -1,50 +1,47 @@ -package darkknight.jewelrycraft.client.gui.container; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.client.gui.container.slots.SlotRing; - -public class ContainerJewelryModifier extends Container -{ - public IInventory modInv; - 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)); - 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(mod, 36, 37, 9)); - } - - @Override - public boolean canInteractWith(EntityPlayer player) - { - return true; - } - - @Override - 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)) return null; - }else if (!mergeItemStack(itemstack1, 0, 27, false)) return null; - if (itemstack1.stackSize == 0) slot.putStack((ItemStack)null); - else slot.onSlotChanged(); - } - return itemstack; - } -} +package darkknight.jewelrycraft.client.gui.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class ContainerJewelryModifier extends Container
+{
+ public IInventory modInv;
+ 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));
+ 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(mod, 36, 37, 9));
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return true;
+ }
+
+ @Override
+ 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)) return null;
+ }else if (!mergeItemStack(itemstack1, 0, 27, false)) return null;
+ if (itemstack1.stackSize == 0) slot.putStack((ItemStack)null);
+ else slot.onSlotChanged();
+ }
+ return itemstack;
+ }
+}
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 634782c..dd12540 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java @@ -1,96 +1,114 @@ -package darkknight.jewelrycraft.client.gui.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import darkknight.jewelrycraft.api.IJewelryItem; -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.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; - -public class ContainerJewelryTab extends Container -{ - /** - * @param player - * @param inv - * @param 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)); - // Bracelets - for(x = 10; x <= 13; x++) - 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)); - // Earrings - addSlotToContainer(new SlotEarrings(extra, 17, 8, 64)); - // Hotbar - for(x = 0; x < 9; ++x) - 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)); - } - - /** - * @param player - * @return - */ - @Override - public boolean canInteractWith(EntityPlayer player) - { - return true; - } - - /** - * @param player - * @param slotID - * @return - */ - @Override - 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()) 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()) 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()) 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()) return null; - } - else{ - if (slotID < 27){ - if (!mergeItemStack(itemstack, 27, 36 + 18, false)) return null; - }else{ - if (!mergeItemStack(itemstack, 18, 27, false)) return null; - } - } - }else if (!mergeItemStack(itemstack, 18, inventorySlots.size(), false)) return null; - if (itemstack.stackSize == 0) slot.putStack(null); - else slot.onSlotChanged(); - if (itemstack.stackSize != itemstack.stackSize) slot.onPickupFromSlot(player, itemstack); - else return null; - } - return itemstack; - } -} +package darkknight.jewelrycraft.client.gui.container;
+
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.api.IJewelryItem;
+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 net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class ContainerJewelryTab extends Container
+{
+ 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));
+ // Bracelets
+ for(x = 10; x <= 13; x++)
+ 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));
+ // Earrings
+ addSlotToContainer(new SlotEarrings(extra, 17, 8, 64));
+ // Hotbar
+ for(x = 0; x < 9; ++x)
+ 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));
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return true;
+ }
+
+ 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());
+ }
+ catch(Exception e){
+ JewelrycraftMod.logger.error("An error has occured while equipping an item.");
+ e.printStackTrace();
+ }
+ }
+ return super.slotClick(slotID, j, k, player);
+ }
+
+ @Override
+ 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())
+ 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())
+ 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())
+ 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())
+ return null;
+ }else{
+ if (slotID < 27) {
+ if (!mergeItemStack(itemstack, 27, 36 + 18, false))
+ return null;
+ }else{
+ if (!mergeItemStack(itemstack, 18, 27, false))
+ return null;
+ }
+ }
+ }else
+ if (!mergeItemStack(itemstack, 18, inventorySlots.size(), false))
+ return null;
+ if (itemstack.stackSize == 0)
+ slot.putStack(null);
+ else slot.onSlotChanged();
+ if (itemstack.stackSize != itemstack.stackSize)
+ slot.onPickupFromSlot(player, itemstack);
+ else return null;
+ }
+ return itemstack;
+ }
+}
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 bab265b..cfd2e20 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java @@ -1,53 +1,53 @@ -package darkknight.jewelrycraft.client.gui.container.slots; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import darkknight.jewelrycraft.api.IJewelryItem; -import darkknight.jewelrycraft.item.ItemBracelet; - -public class SlotBracelet extends Slot -{ - - /** - * @param tile - * @param slotID - * @param x - * @param y - */ - public SlotBracelet(IInventory tile, int slotID, int x, int y) - { - super(tile, slotID, x, y); - } - - /** - * @param stack - * @return - */ - @Override - public boolean isItemValid(ItemStack stack) - { - return stack.getItem() instanceof ItemBracelet || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 1); - } - - /** - * @param amount - * @return - */ - @Override - public ItemStack decrStackSize(int amount) - { - return super.decrStackSize(amount); - } - - /** - * @param player - * @return - */ - @Override - public boolean canTakeStack(EntityPlayer player) - { - return true; - } -} +package darkknight.jewelrycraft.client.gui.container.slots;
+
+import darkknight.jewelrycraft.api.IJewelryItem;
+import darkknight.jewelrycraft.item.ItemBracelet;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotBracelet extends Slot
+{
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotBracelet(IInventory tile, int slotID, int x, int y)
+ {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack)
+ {
+ return stack.getItem() instanceof ItemBracelet || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 1);
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount)
+ {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return true;
+ }
+}
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 c968fc0..e0603a3 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java @@ -1,53 +1,53 @@ -package darkknight.jewelrycraft.client.gui.container.slots; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import darkknight.jewelrycraft.api.IJewelryItem; -import darkknight.jewelrycraft.item.ItemEarrings; - -public class SlotEarrings extends Slot -{ - - /** - * @param tile - * @param slotID - * @param x - * @param y - */ - public SlotEarrings(IInventory tile, int slotID, int x, int y) - { - super(tile, slotID, x, y); - } - - /** - * @param stack - * @return - */ - @Override - public boolean isItemValid(ItemStack stack) - { - return stack.getItem() instanceof ItemEarrings || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 3); - } - - /** - * @param amount - * @return - */ - @Override - public ItemStack decrStackSize(int amount) - { - return super.decrStackSize(amount); - } - - /** - * @param player - * @return - */ - @Override - public boolean canTakeStack(EntityPlayer player) - { - return true; - } -} +package darkknight.jewelrycraft.client.gui.container.slots;
+
+import darkknight.jewelrycraft.api.IJewelryItem;
+import darkknight.jewelrycraft.item.ItemEarrings;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotEarrings extends Slot
+{
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotEarrings(IInventory tile, int slotID, int x, int y)
+ {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack)
+ {
+ return stack.getItem() instanceof ItemEarrings || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 3);
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount)
+ {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return true;
+ }
+}
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 d102ba8..4b810be 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java @@ -1,53 +1,53 @@ -package darkknight.jewelrycraft.client.gui.container.slots; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import darkknight.jewelrycraft.api.IJewelryItem; -import darkknight.jewelrycraft.item.ItemNecklace; - -public class SlotNecklace extends Slot -{ - - /** - * @param tile - * @param slotID - * @param x - * @param y - */ - public SlotNecklace(IInventory tile, int slotID, int x, int y) - { - super(tile, slotID, x, y); - } - - /** - * @param stack - * @return - */ - @Override - public boolean isItemValid(ItemStack stack) - { - return stack.getItem() instanceof ItemNecklace || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 2); - } - - /** - * @param amount - * @return - */ - @Override - public ItemStack decrStackSize(int amount) - { - return super.decrStackSize(amount); - } - - /** - * @param player - * @return - */ - @Override - public boolean canTakeStack(EntityPlayer player) - { - return true; - } -} +package darkknight.jewelrycraft.client.gui.container.slots;
+
+import darkknight.jewelrycraft.api.IJewelryItem;
+import darkknight.jewelrycraft.item.ItemNecklace;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotNecklace extends Slot
+{
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotNecklace(IInventory tile, int slotID, int x, int y)
+ {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack)
+ {
+ return stack.getItem() instanceof ItemNecklace || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 2);
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount)
+ {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return true;
+ }
+}
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 6a7e956..4fb9265 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java @@ -1,53 +1,53 @@ -package darkknight.jewelrycraft.client.gui.container.slots; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import darkknight.jewelrycraft.api.IJewelryItem; -import darkknight.jewelrycraft.item.ItemRing; - -public class SlotRing extends Slot -{ - - /** - * @param tile - * @param slotID - * @param x - * @param y - */ - public SlotRing(IInventory tile, int slotID, int x, int y) - { - super(tile, slotID, x, y); - } - - /** - * @param stack - * @return - */ - @Override - public boolean isItemValid(ItemStack stack) - { - return stack.getItem() instanceof ItemRing || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 0); - } - - /** - * @param amount - * @return - */ - @Override - public ItemStack decrStackSize(int amount) - { - return super.decrStackSize(amount); - } - - /** - * @param player - * @return - */ - @Override - public boolean canTakeStack(EntityPlayer player) - { - return true; - } -} +package darkknight.jewelrycraft.client.gui.container.slots;
+
+import darkknight.jewelrycraft.api.IJewelryItem;
+import darkknight.jewelrycraft.item.ItemRing;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotRing extends Slot
+{
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotRing(IInventory tile, int slotID, int x, int y)
+ {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack)
+ {
+ return stack.getItem() instanceof ItemRing || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 0);
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount)
+ {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return true;
+ }
+}
|
