Everything posted by HappyKiller1O1
-
[1.7.10] How to render a gui over another gui?
So, creating my own would render it over the items? I do not see how this would work.
-
[1.7.10] [Solved] Textures not working.
If you want to use "getUnlocalizedName" do this: this.setBlockName(MODID + ":" + this.getUnlocalizedName().substring(5)); This removes the first five characters of the unlocalized name so you get "someblock". Java won't read past characters like "." and ":" unless you use splitString() I believe.
-
[1.7.10] How to render a gui over another gui?
No, it doesn't. I fixed it by rendering the items on the gui after I rendered the overlay. But, the items overlap the overlay. How would I render the items behind the overlay?
-
[1.7.10] How to render a gui over another gui?
That works but, it's still doing what was shown above. Am I doing something wrong with OpenGL? public class GuiShopBlock extends GuiScreen { public static final ResourceLocation texture = new ResourceLocation(MR.TNAME + "textures/gui/crew_shop.png"); private static final ResourceLocation crewShopPurchase = new ResourceLocation(MR.TNAME + "textures/gui/crew_shop_purchase.png"); private int xSize; private int ySize; RenderItem renderedItem; private static boolean displayE; public GuiShopBlock() { this.xSize = 176; this.ySize = 166; renderedItem = new RenderItem(); displayE = false; } public void initGui() { int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; buttonList.clear(); //buttonList.add(new GuiSlider(0, k + 25, l + 25, 30, 20, "", "", 1, 64, 1, false, true)); } public void actionPerformed(GuiButton button) { } public void drawScreen(int x, int y, float f) { //Add buttons for shop GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; mc.getTextureManager().bindTexture(texture); this.drawTexturedModalRect(k, l, 0, 0, xSize, ySize); this.drawString(mc.fontRenderer, "Crew Shop", k + 60, l + 4, 0xFFFFFF); this.renderItemOnGui(Items.emerald, 0, 0); this.renderItemOnGui(Items.diamond, 100, 0); this.drawToolTips(x, y); if(this.getDisplayE()) { this.drawPurchaseOverlay("Emerald", Items.emerald, 500); } super.drawScreen(x, y, f); } public void drawToolTips(int mouseX, int mouseY) { int boxX = (this.width - this.xSize) / 2 + 25; int boxY = (this.height - this.ySize) / 2 + 25; int defaultX = 16; int defaultY = 16; if(mouseX > boxX && mouseX < boxX + defaultX && mouseY > boxY && mouseY < boxY + defaultY) { List list = new ArrayList(); list.add("DEAFULT TEXT"); this.drawHoveringText(list, mouseX, mouseY, fontRendererObj); //System.out.println("SHOULD DRAW THE TEXT"); } } public void mouseClicked(int mouseX, int mouseY, int which) { int boxX = (this.width - this.xSize) / 2 + 25; int boxY = (this.height - this.ySize) / 2 + 25; int defaultX = 16; int defaultY = 16; if(mouseX > boxX && mouseX < boxX + defaultX && mouseY > boxY && mouseY < boxY + defaultY) { this.displayE = true; //FMLNetworkHandler.openGui(this.mc.thePlayer, CrewMod.instance, GuiId.guiPurchase, this.mc.theWorld, (int)this.mc.thePlayer.posX, (int)this.mc.thePlayer.posY, (int)this.mc.thePlayer.posZ); //System.out.println("SHOULD DISPLAY EMERALD SCREEN"); } super.mouseClicked(mouseX, mouseY, which); } public void renderItemOnGui(Item item, int mulX, int mulY) { int k = (this.width - this.xSize) / 2 + 25; int l = (this.height - this.ySize) / 2 + 25; GL11.glPushMatrix(); RenderHelper.enableGUIStandardItemLighting(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glEnable(GL11.GL_LIGHTING); //GL11.glScalef(2.00F, 2.00F, 2.00F); renderedItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(item), k + mulX, l + mulY); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glPopMatrix(); } private void drawPurchaseOverlay(String title, Item itemForRender, int price) { GL11.glPushMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; mc.getTextureManager().bindTexture(crewShopPurchase); this.drawTexturedModalRect(k, l, 0, 0, this.width, this.height); this.drawCenteredString(mc.fontRenderer, "Purchase: " + title + "'s", k, l, 0xFFFFFF); RenderHelper.enableGUIStandardItemLighting(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glEnable(GL11.GL_LIGHTING); //GL11.glScalef(2.00F, 2.00F, 2.00F); renderedItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(itemForRender), k + 25, l + 25); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glPopMatrix(); } public boolean doesGuiPauseGame() { return false; } public static boolean getDisplayE() { return displayE; } }
-
[1.7.10] How to render a gui over another gui?
I'm stupid huh? I'll go do that now
-
Cancel Water/Lava From Pouring
Wait, are you making this mod for like a factions server or something?
-
[1.7.10] How to render a gui over another gui?
If you're wondering, when I click the Emerald is when it attempts to draw the texture overlay.
-
[1.7.10] How to render a gui over another gui?
So, I am trying to do what you told me Ernio but, this happens. ;-; http://i.imgur.com/Lqfv5jY.png http://i.imgur.com/eWQHSBh.png Here's where I render it in my EventForgeClient Class: @SubscribeEvent public void onGuiScreenDrawn(DrawScreenEvent event) { int width = event.gui.width; int height = event.gui.height; int xSize = 80; int ySize = 40; if(event.gui instanceof GuiShopBlock) { if(GuiShopBlock.getDisplayE()) { this.drawPurchaseOverlay("Emerald", Items.emerald, 500, width, height, xSize, ySize, event.gui.mc, event.gui); System.out.println("Emerald is True"); } } } private void drawPurchaseOverlay(String title, Item itemForRender, int price, int width, int height, int xSize, int ySize, Minecraft mc, GuiScreen gui) { GL11.glPushMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int k = (width - xSize) / 2; int l = (height - ySize) / 2; mc.getTextureManager().bindTexture(crewShopPurchase); gui.drawTexturedModalRect(k, l, 0, 0, width, height); gui.drawCenteredString(mc.fontRenderer, "Purchase: " + title + "'s", k, l, 0xFFFFFF); RenderHelper.enableGUIStandardItemLighting(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glEnable(GL11.GL_LIGHTING); //GL11.glScalef(2.00F, 2.00F, 2.00F); renderedItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(itemForRender), k + 25, l + 25); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glPopMatrix(); }
-
[1.7.10] How to render a gui over another gui?
That is so much work. ;-; I think I'll just have to deal with not having it drawn over. I have way too many gui's to display over.
-
[1.7.10] [Solved] Textures not working.
diesieben07 is right, you should register them like: setBlockTexture(ModResources.MODID + ":" + "TextureName");
-
[1.7.10] How to render a gui over another gui?
I didn't know using displayGuiScreen did that, but thanks. I already know how to make a gui handler, just thought that way was easier. And, how would I use those events to display a Gui over another? Maybe just a simple example would be nice.
-
[1.7.10] Problems rendering GUI
Is this simply a GuiScreen or, a GuiContainer?
-
[1.7.10] Server Crash With Custom Particles
Hm. You load the entity texture in your client proxy, correct?
-
[1.7.10] Server Crash With Custom Particles
Because this is a client class, you can get the instance of Minecraft "Minecraft mc = Minecraft.getMinecraft" and use the "thePlayer". I believe when you do sendToAll, it thinks there is more than one player. Just try my idea and see if it works. If it doesn't, then your packet is returning null.
-
Ic2 API Energy
The TagCompound is like the "house" for data. The Tag is the "Category" and the Integer is a int or number that they are grabbing from that tag.
-
[1.7.10] Server Crash With Custom Particles
You're sending the packet to the server. Just do "sendTo" not "sendToAll".
-
Ic2 API Energy
NBT is the way Minecraft saves data to be collected in the future. Read this: http://www.minecraftforge.net/wiki/How_to_use_NBT_Tag_Compound
-
[1.7.10] How to render a gui over another gui?
The title says it all. I want to render a gui over another gui that is already displayed. I went to the Minecraft.displayGuiScreen to see if there is a work around but it seems to always close the gui if another is going to be displayed. Any way around this?
-
[1.7.10] [Solved] Textures not working.
If you go to your src folder, wherever it may be, you should be able to click main, resources, assets, YOURMODID, textures, blocks. I feel like you might of named "assets" "assets.sa".
-
[1.7.10] How to add a slider gui option?
It's kinda funny because cpw made a GuiSlider class so you can easily implement it. Thanks for the explanation though.
-
[1.7.10] How to add a slider gui option?
Actually, I can't use THAT one because it relays on GameSettings to work. I did find the GuiSlider class but, don't really know how to use it. See, I need it to set a value (like lets say 10) then take that value to be able to purchase 10 of that item.
-
[1.7.10] How to add a slider gui option?
Hey, so all I want to do is add a slider (like minecraft does for the FOV and such) to my Gui and use it for my own purpose. I just can't figure out what to do.
-
[RESOLVED][1.7.10] How can I make a Battery Item Based In Durability?
ScratchForFun on youtube actually made a few videos covering the creation of battery's and such. You should check them out!
-
How to use wither skulls in recipe?
Well, go into the game and hold F3 + H (To bring up detailed item tooltips) then, get the wither skull metadata. After this, make the crafting recipe: ItemStack stack = new ItemStack(Items.skull, 1, metadata); //Crafting recipe
-
Eclipse EXCEPTION_ACCESS_VIOLATION
I know it's a problem with eclipse but they have never helped me.
IPS spam blocked by CleanTalk.