Everything posted by Bedrock_Miner
-
Item Tooltip is under other GUI Icons because its drawn earlier
You mean you store the information what to render in a variable and go back to it later? Sounds good, I'll try..
-
What is a coremod and what can it be used for?
Hello guys! Some time ago I thought about creating a coremod to have all the classes I need frequently, like PacketHandler or RenderingUtility in a mod which can be accessed by all of my other mods, rather than having the same code in several mods. But then I read something about: Coremods are only for modifying base classes and so on. Is this true? I have no clue how to use this ASM and I don't want to deal with it if it's not necessary. And until now it wasn't and it doesn't look like it will be in future. So, can I create a coremod just to store some basic structures, register them and use them from my other mods? And is there anything you have to look for or can you just create a normal Mod and use it from elsewhere? Well and if it would go like this there's still the question how to compile the mods which use the coremod... Many questions, I hope anyone can make this clearer to me
-
Item Tooltip is under other GUI Icons because its drawn earlier
…If you can read you have an advantage. And I can't change the order because the crafting grid should be rendered twice on screen and this must happen one after another because of some other code structures. I looked into the Code of NEI and I didn't understand much, but it seems like ChickenBones renders the tooltips after the items, exactly like it's done in GUIContainer. I also checked out the drawToolTip method and found out that it diaables GL_DEPTH_TEST while it draws the tooltip on the screen. Its re-enabled afterwards, but can this be the cause of this problem? And if, what can I do against it?
-
Item Tooltip is under other GUI Icons because its drawn earlier
The methods renderToolTip and renderItemStack are taken from GuiContainer
-
Item Tooltip is under other GUI Icons because its drawn earlier
Heyho Guys! I have a small problem concerning GUIs. I created a GUI wich should show you how to craft something. I didnt use a container for this, I created the rendering positions and textures on my own. Basically there are a few itemstacks rendered after each other. When you hover over them you can see their ItemTooltip. Each tooltip is shown (if necessary) directly after the corresponding stack has been rendered. The problem is: The tooltip is rendered below the stacks that are drawn later although it shouldn't because of the zLevel (200 for the Items and 300 for the tooltip). How can I fix this?
-
[Solved] Rendering a NURBS Curve
It really was the texture which caused the problem! I now added glBindTexture(GL_TEXTURE_2D, 0) to clear it and it works fine!(except from some zLevel problems)
-
[Solved] Rendering a NURBS Curve
If I write this piece of code at the beginning of the method, the line is in a very dark green. Maybe this helps you.. GL11.glDisable(GL11.GL_LIGHTING); if (Codex.getStatusFor(mc.thePlayer, this) == 1) { GLUtil.setColour(0, 0, 0); } else { GLUtil.setColour((this.lineColour >> 16) % 256, (this.lineColour >> % 256, this.lineColour % 256); } GL11.glColor3f(0, 1, 0); for (Vertex2D[] line : this.lines) { if (line.length > 2) { this.renderBezier(gui, line, x - this.getX(), y - this.getY()); } else { GL11.glBegin(GL11.GL_LINE); GL11.glVertex3d(line[0].x + x - this.getX(), line[0].y + y - this.getY(), gui.getZLevel() - 2); GL11.glVertex3d(line[1].x + x - this.getX(), line[1].y + y - this.getY(), gui.getZLevel() - 2); GL11.glEnd(); } } } } If I use only this piece of code, without the rest, nothing is rendered. Is it possible that the Lines are rendered with the actual texture? Its the Purple/Black Missing Texture, this would explain the green colour problem. How can I disable the texture, if this is the problem?
-
[Solved] Rendering a NURBS Curve
I dont want to make it green. It should be white. But if I set it to white it turns out purple because green doesnt work. The set to green is just a test.
-
[Solved] Rendering a NURBS Curve
But (for tests) The line should be green
-
[Solved] Rendering a NURBS Curve
I meant the code I posted. Edit:I also tried glColorMask(true, true, true, true) but with no Effect. And I encountered that the line is green for one tick and then switches to black.
-
[Solved] Rendering a NURBS Curve
The line where I set the color to green was a test; I wanted to check if green is really disabled. With this code the curve is rendered black instead of bright green
-
[Solved] Rendering a NURBS Curve
@SideOnly(Side.CLIENT) public void renderToCodex(GuiCodexMagicum gui, Minecraft mc, int x, int y) { if (Codex.getStatusFor(mc.thePlayer, this) > 0) { mc.getTextureManager().bindTexture(this.icons); GLUtil.resetColour(); GL11.glDisable(GL11.GL_LIGHTING); gui.drawTexturedModalRect(x, y, (Codex.getStatusFor(mc.thePlayer, this) - 1) * 26, this.hasSpecialLayout ? 26 : 0, 26, 26); if (this.isIconItem) { gui.drawItemStack(this.iconItem, x + 5, y + 5, ""); } else { mc.getTextureManager().bindTexture(this.labels); gui.drawTexturedModalRect(x + 5, y + 5, this.iconX * 16, this.iconY * 16, 16, 16); } GL11.glDisable(GL11.GL_LIGHTING); if (Codex.getStatusFor(mc.thePlayer, this) == 1) { GLUtil.setColour(0, 0, 0); } else { GLUtil.setColour((this.lineColour >> 16) % 256, (this.lineColour >> % 256, this.lineColour % 256); } GL11.glColor3f(0, 1, 0); for (Vertex2D[] line : this.lines) { if (line.length > 2) { this.renderBezier(gui, line, x - this.getX(), y - this.getY()); } else { GL11.glBegin(GL11.GL_LINE); GL11.glVertex3d(line[0].x + x - this.getX(), line[0].y + y - this.getY(), gui.getZLevel() - 2); GL11.glVertex3d(line[1].x + x - this.getX(), line[1].y + y - this.getY(), gui.getZLevel() - 2); GL11.glEnd(); } } } } private void renderBezier(GuiCodexMagicum gui, Vertex2D[] controlpoints, int x, int y) { FloatBuffer buf = BufferUtils.createFloatBuffer(controlpoints.length * 6); for (int i = 0; i < controlpoints.length; i ++) { buf.put(i*3, (float) controlpoints[i].x + x); buf.put(i*3+1, (float) controlpoints[i].y + y); buf.put(i*3+2, gui.getZLevel() - 2); buf.put(i*3+3, (float) controlpoints[i].x + x); buf.put(i*3+4, (float) controlpoints[i].y + y); buf.put(i*3+5, gui.getZLevel() - 2); } GL11.glMap1f(GL11.GL_MAP1_VERTEX_3, 0.0f, 1.0f, 3, 4, buf); GL11.glEnable(GL11.GL_MAP1_VERTEX_3); GL11.glBegin(GL11.GL_LINE_STRIP); for (int i = 0; i < 24; i ++) { GL11.glEvalCoord1f(i / 24.0f); } GL11.glEnd(); }
-
[Solved] Rendering a NURBS Curve
Ok, I now used the GLMap methods and it works. Only one problem: It seems like the colour green is disabled. Can this have sonething to do with the drawing of a "missing-texture" before? And how can I re-enable the colour?
-
[Solved] Rendering a NURBS Curve
This looks quite useful, but I still cannot find out where the needed method gluNewNurbsRenderer is implemented. Either I'm totally blind or it doesn't exist in GLU.class or anywhere else. Edit: Looks like NURBS are not supported by this version of lwjgl. Take a look over here. Damn.. seems like I have to implement my own methods for this. I have no Idea how this works but I'll try.
-
[Solved] Rendering a NURBS Curve
But this is no NURBS Curve with multiple control vertices. Its just a generated curve between two points which looks lile its affected by gravity.
-
[Solved] Rendering a NURBS Curve
Heyho Guys! I searched for a method to draw NURBS Curves with GL. The problem is: I googled a bit and it told me that I can use the method GLU.newNurbsRenderer(). The problem is that this method doesnt exist. How can I draw one of these curves? Or is there another way of drawing Curves which are formed with controlpoints like the nurbs curve?
-
How to limit the GL11 Viewport?
Thanks, this works great!
-
How to limit the GL11 Viewport?
Heyho Guys! I want to create a gui which shows a map with several Icons on it. You are able to move the map within its frame. The problem is: If the Icons come near the edge of the frame they should be only partially visible. I think the best way to achieve this is to tell GL that it has to hide everything outside of this range. But how can I do this? I already tried out GLviewport() but this does no clipping but zooms out instead. Have you got any ideas how to do this?
-
How to get a file from a resourcelocation?
Well, I also used your method but I didnt put the files into assets to avoid trouble with resource pack makers
-
How to get a file from a resourcelocation?
I tried the method diesieben07 mentioned and it works great! Thanks
-
Tick Handlers?
Which version is this? Because in newer versions you have to subscribe to a tick event.
-
New Achievement system
Yeah, it should be quite similar to the vanilla system except that each achievement has three states: Not discovered, researched and crafted. So, I store them in ExtendedProperties, ok. Thanks.
-
[1.7.10 - 10.13.1.1217] Mod working fine in eclipse and crashing in launcher
Ok, the problem is that MC cant find the field Material.rock. This is because Minecraft is obfuscated, the field is named something like field_085468_a or so. How did you compile your mod? Forge gradle normally does the obfuscation for you, or did this build fail for some reason?
-
New Achievement system
Heyho Guys! I wanted to add a new achievement system and I have a few questions about this. First: How should I store the data for the Achievements? Linked to the players name in a map? Or in ExtendedProperties? And in which file do I have to save them? Can I use existing ones or should I create something new?
-
How to get a file from a resourcelocation?
Heyho Guys! Well, this time the title says everything .. How can I get a File object from a ResourceLocation object?
IPS spam blocked by CleanTalk.