From 6312636fd9a4d0f56dc7c9ff474a99d879bcb4e9 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Mon, 23 Mar 2015 14:51:06 +0000 Subject: Reworked the whole repo. --- .../jewelrycraft/client/AbstractTab.java | 74 ------- .../jewelrycraft/client/ClientProxy.java | 87 -------- java/darkknight/jewelrycraft/client/GuiGuide.java | 241 --------------------- .../darkknight/jewelrycraft/client/GuiJewelry.java | 69 ------ .../jewelrycraft/client/GuiRingChest.java | 50 ----- .../jewelrycraft/client/InventoryTabVanilla.java | 24 -- .../darkknight/jewelrycraft/client/TabJewelry.java | 27 --- .../jewelrycraft/client/TabRegistry.java | 86 -------- 8 files changed, 658 deletions(-) delete mode 100644 java/darkknight/jewelrycraft/client/AbstractTab.java delete mode 100644 java/darkknight/jewelrycraft/client/ClientProxy.java delete mode 100644 java/darkknight/jewelrycraft/client/GuiGuide.java delete mode 100644 java/darkknight/jewelrycraft/client/GuiJewelry.java delete mode 100644 java/darkknight/jewelrycraft/client/GuiRingChest.java delete mode 100644 java/darkknight/jewelrycraft/client/InventoryTabVanilla.java delete mode 100644 java/darkknight/jewelrycraft/client/TabJewelry.java delete mode 100644 java/darkknight/jewelrycraft/client/TabRegistry.java (limited to 'java/darkknight/jewelrycraft/client') diff --git a/java/darkknight/jewelrycraft/client/AbstractTab.java b/java/darkknight/jewelrycraft/client/AbstractTab.java deleted file mode 100644 index 6728181..0000000 --- a/java/darkknight/jewelrycraft/client/AbstractTab.java +++ /dev/null @@ -1,74 +0,0 @@ -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; - -/** - * @author TinkersCOnstruct - */ -@SideOnly(Side.CLIENT) -public abstract class AbstractTab extends GuiButton -{ - ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); - ItemStack renderStack; - RenderItem itemRenderer = new RenderItem(); - - public AbstractTab(int id, int posX, int posY, ItemStack renderStack) - { - super(id, posX, posY, 28, 32, ""); - 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 yTexPos = this.enabled ? 3 : 32; - int ySize = this.enabled ? 25 : 32; - int xOffset = this.id == 2 ? 0 : 1; - int yPos = this.yPosition + (this.enabled ? 3 : 0); - - mc.renderEngine.bindTexture(this.texture); - this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); - - 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 + 6, yPosition + 8); - this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); - GL11.glDisable(GL11.GL_LIGHTING); - this.itemRenderer.zLevel = 0.0F; - this.zLevel = 0.0F; - RenderHelper.disableStandardItemLighting(); - } - } - - @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/java/darkknight/jewelrycraft/client/ClientProxy.java b/java/darkknight/jewelrycraft/client/ClientProxy.java deleted file mode 100644 index 9baadcb..0000000 --- a/java/darkknight/jewelrycraft/client/ClientProxy.java +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.client; - -import net.minecraft.client.Minecraft; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.MinecraftForge; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.VillagerRegistry; -import darkknight.jewelrycraft.CommonProxy; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.entities.renders.HeartRender; -import darkknight.jewelrycraft.events.PlayerRenderHandler; -import darkknight.jewelrycraft.events.ScreenHandler; -import darkknight.jewelrycraft.model.ModelDisplayer; -import darkknight.jewelrycraft.model.ModelHalfHeart; -import darkknight.jewelrycraft.model.ModelHandPedestal; -import darkknight.jewelrycraft.model.ModelHeart; -import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; -import darkknight.jewelrycraft.model.ModelMolder; -import darkknight.jewelrycraft.model.ModelShadowEye; -import darkknight.jewelrycraft.model.ModelShadowHand; -import darkknight.jewelrycraft.model.ModelSmelter; -import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; -import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; -import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; -import darkknight.jewelrycraft.tileentity.TileEntityMolder; -import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; -import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; -import darkknight.jewelrycraft.tileentity.TileEntitySmelter; -import darkknight.jewelrycraft.tileentity.renders.ItemRender; -import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; -import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; -import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; -import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; -import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; -import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; -import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -public class ClientProxy extends CommonProxy -{ - @Override - public void preInit() - { - ResourceLocation pedestalResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/BricksPedestal.png"); - TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); - ResourceLocation shadowResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/ShadowHand.png"); - TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); - - ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); - - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); - VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation("jewelrycraft", "textures/entities/jeweler.png")); - - RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); - RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); - - TabRegistry.registerTab(new InventoryTabVanilla()); - TabRegistry.registerTab(new TabJewelry()); - MinecraftForge.EVENT_BUS.register(new TabRegistry()); - MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); - ResourceLocation jeweleryTexture = new ResourceLocation("jewelrycraft", "textures/gui/curses.png"); - MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); - } - - @Override - public void postInit() - { - JewelrycraftUtil.addStuff(); - } -} diff --git a/java/darkknight/jewelrycraft/client/GuiGuide.java b/java/darkknight/jewelrycraft/client/GuiGuide.java deleted file mode 100644 index 09fc6a3..0000000 --- a/java/darkknight/jewelrycraft/client/GuiGuide.java +++ /dev/null @@ -1,241 +0,0 @@ -package darkknight.jewelrycraft.client; - -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.block.BlockAir; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.entity.item.EntityItem; -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 darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.block.BlockShadowEye; -import darkknight.jewelrycraft.container.GuiRectangle; -import darkknight.jewelrycraft.container.GuiTab; -import darkknight.jewelrycraft.container.GuiTabBlocks; -import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; -import darkknight.jewelrycraft.container.GuiTabIntroduction; -import darkknight.jewelrycraft.container.GuiTabItems; -import darkknight.jewelrycraft.container.GuiTabModifiers; -import darkknight.jewelrycraft.container.GuiTabRitual; - -public class GuiGuide extends GuiContainer -{ - public int page, rot, del; - public boolean prevHover, nextHover; - World world; - private final GuiTab[] tabs; - private GuiTab activeTab; - ResourceLocation pageTexture, flippedPageTexture; - - /** - * @param container - * @param world - * @param pageTex - * @param flipPageTex - */ - public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) - { - super(container); - page = 1; - rot = 0; - del = 0; - this.world = world; - tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; - activeTab = tabs[0]; - pageTexture = pageTex; - flippedPageTexture = flipPageTex; - } - - /** - * @param f - * @param i - * @param j - */ - @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, 180); - Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); - drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); - 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 text = new ArrayList(); - text.add(Integer.toString(page)); - drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); - text.remove(Integer.toString(page)); - text.add(Integer.toString(page + 1)); - drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); - for(int tab = 0; tab < tabs.length; tab++) - renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); - } - - /** - * @param x - * @param y - */ - @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()); - } - - /** - * @param x - * @param y - * @param button - */ - @Override - protected void mouseClicked(int x, int y, int button) - { - if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; - else if (prevHover && page > 1) page -= 2; - activeTab.mouseClick(this, x, y, button); - for(GuiTab tab: tabs) - if (activeTab != tab) if (tab.inRect(this, x, y)){ - activeTab = tab; - page = 1; - break; - } - } - - /** - * @param item - * @param x - * @param y - * @param activeIcon - */ - public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) - { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); - entityitem.hoverStart = 0.0F; - if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; - 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.jewelAltar))){ - GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){ - GL11.glScalef(1.2F, 1.2F, 1.2F); - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(0F, 0.05F, 0F); - }else 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(); - } - - /** - * @param item - * @param x - * @param y - * @param scale - */ - 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(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); - 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(); - } - - /** - * @return - */ - public int getLeft() - { - return guiLeft; - } - - /** - * @return - */ - public int getTop() - { - return guiTop; - } - - /** - * @return - */ - public FontRenderer getFont() - { - return fontRendererObj; - } - - /** - * @param lst - * @param x - * @param y - */ - @SuppressWarnings ("rawtypes") - public void drawHoverString(List lst, int x, int y) - { - drawHoveringText(lst, x, y, fontRendererObj); - } -} \ No newline at end of file diff --git a/java/darkknight/jewelrycraft/client/GuiJewelry.java b/java/darkknight/jewelrycraft/client/GuiJewelry.java deleted file mode 100644 index 0f8e59a..0000000 --- a/java/darkknight/jewelrycraft/client/GuiJewelry.java +++ /dev/null @@ -1,69 +0,0 @@ -package darkknight.jewelrycraft.client; - -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.container.ContainerJewelryTab; -import darkknight.jewelrycraft.container.JewelryInventory; -import darkknight.jewelrycraft.events.KeyBindings; - -public class GuiJewelry extends GuiContainer -{ - ResourceLocation texture; - - /** - * @param containerJewelryTab - * @param texture - */ - public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) - { - super(containerJewelryTab); - xSize = 194; - 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) - {} - - /** - * @param charecter - * @param key - */ - @Override - protected void keyTyped(char charecter, int key) - { - super.keyTyped(charecter, key); - if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen(); - } - - @Override - public void initGui () - { - super.initGui(); - int cornerX = guiLeft; - int cornerY = guiTop; - this.buttonList.clear(); - TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class); - TabRegistry.addTabsToList(this.buttonList); - } -} diff --git a/java/darkknight/jewelrycraft/client/GuiRingChest.java b/java/darkknight/jewelrycraft/client/GuiRingChest.java deleted file mode 100644 index 2504d6f..0000000 --- a/java/darkknight/jewelrycraft/client/GuiRingChest.java +++ /dev/null @@ -1,50 +0,0 @@ -package darkknight.jewelrycraft.client; - -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.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); - } -} diff --git a/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java b/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java deleted file mode 100644 index c8d598c..0000000 --- a/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java +++ /dev/null @@ -1,24 +0,0 @@ -package darkknight.jewelrycraft.client; - -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; - -public class InventoryTabVanilla extends AbstractTab -{ - public InventoryTabVanilla() - { - super(0, 0, 0, new ItemStack(Blocks.crafting_table)); - } - - @Override - public void onTabClicked () - { - TabRegistry.openInventoryGui(); - } - - @Override - public boolean shouldAddToList () - { - return true; - } -} \ No newline at end of file diff --git a/java/darkknight/jewelrycraft/client/TabJewelry.java b/java/darkknight/jewelrycraft/client/TabJewelry.java deleted file mode 100644 index 4598962..0000000 --- a/java/darkknight/jewelrycraft/client/TabJewelry.java +++ /dev/null @@ -1,27 +0,0 @@ -package darkknight.jewelrycraft.client; - -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketKeyPressEvent; -import net.minecraft.init.Items; -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/java/darkknight/jewelrycraft/client/TabRegistry.java b/java/darkknight/jewelrycraft/client/TabRegistry.java deleted file mode 100644 index 2765b73..0000000 --- a/java/darkknight/jewelrycraft/client/TabRegistry.java +++ /dev/null @@ -1,86 +0,0 @@ -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.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.client.*; - -/** - * @author TinkersConstruct - */ -public class TabRegistry -{ - private static ArrayList tabList = new ArrayList(); - - public static void registerTab (AbstractTab tab) - { - tabList.add(tab); - } - - public static ArrayList getTabList () - { - return tabList; - } - - @SideOnly(Side.CLIENT) - @SubscribeEvent - public void guiPostInit (GuiScreenEvent.InitGuiEvent.Post event) - { - if ((event.gui instanceof GuiInventory)) - { - int xSize = 176; - int ySize = 166; - int guiLeft = (event.gui.width - xSize) / 2; - int guiTop = (event.gui.height - ySize) / 2; - if(!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; - - updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); - addTabsToList(event.buttonList); - } - } - - private static Minecraft mc = FMLClientHandler.instance().getClient(); - - public static void openInventoryGui () - { - mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); - GuiInventory inventory = new GuiInventory(mc.thePlayer); - mc.displayGuiScreen(inventory); - } - - public static void updateTabValues (int cornerX, int cornerY, Class selectedButton) - { - int count = 2; - for (int i = 0; i < tabList.size(); i++) - { - AbstractTab t = tabList.get(i); - - if (t.shouldAddToList()) - { - t.id = count; - t.xPosition = cornerX + (count - 2) * 28; - t.yPosition = cornerY - 28; - t.enabled = !t.getClass().equals(selectedButton); - count++; - } - } - } - - public static void addTabsToList (List buttonList) - { - for (AbstractTab tab : tabList) - { - if (tab.shouldAddToList()) - { - buttonList.add(tab); - } - } - } -} \ No newline at end of file -- cgit v1.2.3