Jump to content

McJty

Members
  • Posts

    129
  • Joined

  • Last visited

Everything posted by McJty

  1. Hi all, I need to render a 3D representation of any block in a GUI. Is there some code or guides on how I can do that? For MC 1.7.10. Thanks!
  2. The base Block.getPickBlock() simply ignores the target and coordinate parameters and just calls Item.getItemFromBlock(block). I suspect that EnderIO conduit blocks will override this to provide the correct item instead. So that means I have to go with getPickBlock to ensure I have the correctly overridden method. I'll try to come up with good/working target,x,y,z parameters. Thanks
  3. I'm a bit confused about the parameters for this function though: block.getPickBlock(MovingPositionTarget target, World world, int x, int y, int z) What exactly is MovingPositionTarget in this context?
  4. Hi all, I know the basics of GUI in Minecraft now and managed to make my first GUI. However, I'm looking around to see how to implement the basic GUI things like buttons, sliders, checkboxes, ... I was hoping this would be implemented already somewhere in Forge or Minecraft (always nice not to have to reinvent the wheel) but I couldn't find anyhing like that. Are there things for this or does every mod developer have to develop his own GUI components when he needs a GUI? Thanks!
  5. Ok, that didn't seem to work. I couldn't find a getPickedBlock function but I found Item.getItemForBlock() which seems to be what I need. This gives as result: Item itemDropped = Item.getItemFromBlock(block); System.out.println("itemDropped.getUnlocalizedName() = " + itemDropped.getUnlocalizedName()); System.out.println("new ItemStack(itemDropped).getDisplayName() = " + new ItemStack(itemDropped).getDisplayName()); This gives as output for an EnderIO item conduit: itemDropped.getUnlocalizedName() = tile.blockConduitBundle new ItemStack(itemDropped).getDisplayName() = tile.blockConduitBundle.name So that's still not what I'm looking for. Thanks
  6. Aha thank you! That's useful to know. I'll try that then.
  7. Ok, but what should I do then? I know it is possible because WAILA shows a good name in its tooltip.
  8. @Override public void drawScreen(int xSize_lo, int ySize_lo, float par3) { super.drawScreen(xSize_lo, ySize_lo, par3); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(iconLocation); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); // this.drawVerticalLine(k + 15, l, l + 100, 0x334455); int y = 0; HashMap<Coordinate,BlockInfo> connectedBlocks = monitorItem.getConnectedBlocks(); for (Map.Entry<Coordinate,BlockInfo> me : connectedBlocks.entrySet()) { Block block = me.getValue().getBlock(); Coordinate coordinate = me.getKey(); ItemStack s = new ItemStack(block, 1, 0); String lname = block.getLocalizedName(); System.out.println("I18n = " + I18n.format(lname)); System.out.println("Stat = " + StatCollector.translateToLocal(lname)); mc.fontRenderer.drawString(s.getDisplayName(), k + 5, l + 5 + y, 1677215); mc.fontRenderer.drawString(coordinate.toString(), k+160, l+5+y, 1677215); y += mc.fontRenderer.FONT_HEIGHT + 2; } this.drawGradientRect(k + xSize-20, l + 5, k + xSize-5, l + ySize - 5, 0xFFFF0000, 0xFF00FF00); mc.fontRenderer.drawString("###", k + 15, l, 0x334455); // this.drawVerticalLine(k+15, l, l + 50, -9408400); } } The s.getDisplayName() is what I'm currently using as that gives the best result. But nothing of the above methods manages to give a nice name for the EnderIO energy conduits.
  9. Solved! Apparently text ignores alpha but the other calls don't.
  10. I'm trying to draw my GUI: I have the following code: @Override public void drawScreen(int xSize_lo, int ySize_lo, float par3) { super.drawScreen(xSize_lo, ySize_lo, par3); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(iconLocation); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); this.drawVerticalLine(k + 15, l, l + 100, 0x334455); int y = 0; HashMap<Coordinate,BlockInfo> connectedBlocks = monitorItem.getConnectedBlocks(); for (Map.Entry<Coordinate,BlockInfo> me : connectedBlocks.entrySet()) { Block block = me.getValue().getBlock(); Coordinate coordinate = me.getKey(); ItemStack s = new ItemStack(block, 1, 0); // String lname = block.getLocalizedName(); // System.out.println("I18n = " + I18n.format(lname)); // System.out.println("Stat = " + StatCollector.translateToLocal(lname)); mc.fontRenderer.drawString(s.getDisplayName(), k + 5, l + 5 + y, 1677215); mc.fontRenderer.drawString(coordinate.toString(), k+160, l+5+y, 1677215); y += mc.fontRenderer.FONT_HEIGHT + 2; } this.drawGradientRect(k + xSize-20, l + 5, k + xSize-5, l + ySize - 5, 0xFF0000, 0x00FF00); this.drawGradientRect(k + 5, l + 5, k + 10, l + ySize - 5, 0xFF0000, 0x00FF00); mc.fontRenderer.drawString("###", k + 15, l, 0x334455); this.drawVerticalLine(k+15, l, l + 50, 0x334455); } I can see the background texture. I can see all the text that has been rendered. But I cannot see the gradient rects and I cannot see the vertical lines. The coordinates should be right as I'm also using them for the text. Any idea what I'm missing and why only text is visible? Thanks!
  11. Thanks but that still returns "tile.blockConduitBundle.name" for the EnderIO conduits. Any other ways I could use?
  12. Hi all, I'm using 1.7.10 and latest forge and I'm trying to get the nice name (like WAILA would show to the player) of any block. I have tried this: String name = block.getLocalizedName(); and this: String name = new ItemStack(block).getDisplayName(); Both pieces of code work and give me nice names for some of the blocks. I get "Stirling Generator" for a stirling generator from EnderIO for example. However, for some blocks it doesn't work. EnderIO conduits give me 'tile.blockConduitBundle.name' instead of 'Energy Conduit' which WAILA shows me. So how can I achieve what WAILA does and give me a good name for any block in the game? Thanks!
  13. Well the GUI that I want to make is a scrollable list of text (selectable). That's it basically. Nothing more. No more interaction with that GUI then simply being able to select a line and scroll the text. I see the Gui class and it has many subclasses but I'm a bit confused about what the best way would be to tackle this and which subclass I should use so I was hoping for a tutorial on something like this which is *not* a container or furnace. Thanks,
  14. I'm trying to find a tutorial on how to make a custom GUI (*not* for a typical container that uses GuiContainer) but haven't been able to find one. All tutorials focus on inventory GUI's but that's not what I need in this case. What I actually want to make is a scrollable list of text. Preferably where it is possible to select lines in that list. Any pointers to where I can find more info on this subject? For 1.7.10 Thanks!
  15. Hi, I'm trying to add a custom creature (learning how to mod) in 1.7.10. I followed some tutorial for 1.7.2 (didn't find any for 1.7.10 on this subject) but the mob isn't appearing. My code is here: https://github.com/McJty/TestMod The model is just a blaze. I don't see my mob appearing anywhere and also /summon TestMob isn't working. Any ideas? Thanks! Edit: I just found out that I have to summon it with /summon examplemod.TestMob However, now another problem appears. The mob is summoned but gets killed automatically for some reason. Will have to investigate that.
  16. Apparently it was a socks proxy problem and I solved it. This can be closed
  17. Hi all, I'm trying to setup forge 1.7.10 for development with IntelliJ. So I extracted the Forge source (forge-1.7.10-10.13.0.1186-src.zip) and now I'm trying to open build.gradle. All seems to work for some time (it is doing various things) but finally I get this error: 2014-07-17 08:31:21,052 [ 613948] WARN - nal.AbstractExternalSystemTask - Could not GET 'http://repo1.maven.org/maven2/net/minecraftforge/gradle/ForgeGradle/1.2-SNAPSHOT/maven-metadata.xml'. Received status code 401 from server: Unauthorized com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not GET 'http://repo1.maven.org/maven2/net/minecraftforge/gradle/ForgeGradle/1.2-SNAPSHOT/maven-metadata.xml'. Received status code 401 from server: Unauthorized at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:185) at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:115) at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:63) at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41) at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37) at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59) Any idea why I get this error and how I can solve it? Thanks in advance!
  18. Hi all, I'm trying to setup forge development for 1.7.10 with IntelliJ. I was following this tutorial: http://www.minecraftforge.net/wiki/Forge_Development_in_IntelliJ_IDEA However at some point it tells me to download a source package for forge and extract that so that a single 'forge' directory is created. I'm not sure what I should download to get that as it seems that the structure of the 1.7.10 forge src package is totally different? There is also no install.sh as the tutorial seems to indicate. Any suggestions on how I can setup this? I'm on linux btw. Thanks
  19. Ok thanks. It also seems that there is no real API reference either? How do you get to know what kind of functions or API the forge classes support and what these do?
  20. Thanks for these suggestions. I will most certainly look at them. However as I'm often offline when I have time to read documentation I'm hoping more for documentation I can print out or download so I can read it without internet connection. Is any of that possible?
  21. Hi all, I want to start how to learn to mod on the 1.7.2 version of MineCraft. I can find lots of tutorials on how to use Forge and modding with forge in general but most of them are for 1.6.4 or older versions. Are there any good resources on modding with Forge and 1.7.2? And how useful are the 1.6.4 tutorials still? Has a lot changed between 1.6.4 and 1.7.2 with relation to Forge? Thanks for any info you can give me.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.