Jump to content

_gjkf_

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by _gjkf_

  1. Thank you so much again, now it works perfectly!!!
  2. Thanks to everybody for your explanation, I'll try both methods. Thanks again.
  3. So what if I want to use a texture that covers the whole screen? How can I do it? Why is it restricted to 256x256? Thanks and sorry if I ask too many questions, I'm curious.
  4. Thank you so much. I have now another problem. I want to use a custom background image that covers all the screen. I made one that's 512x256. For some reason when I add it to the gui using this: @Override public void drawGuiContainerBackgroundLayer(float f, int x, int y){ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(new ResourceLocation("forecraft", "/textures/gui/coreBackground.png")); this.drawTexturedModalRect(0, 0, 0, 0, width, height); } I see this background: https://www.dropbox.com/s/i4o7zwgji8jew7u/Schermata%2010-2456950%20alle%2016.07.39.png?dl=0 This is the actual image and how I want it to look. https://www.dropbox.com/s/f3tgjy8xh0rjew7/coreBackground.png?dl=0 I also would love some explanation about the drawTexturedModalRect method. How does it work? what are 'u' and 'v'? Thanks a lot.
  5. I suggest you to look into Chicken-Bones CommonUtils Class, here: https://github.com/Chicken-Bones/CodeChickenCore/blob/master/src/codechicken/core/CommonUtils.java#L35-L37 For the mods folder use this public static File getModsFolder(){ return new File(getMinecraftDir(), "mods"); } It's kinda a complicated route but it works
  6. 1) That was a stupid mistake of mine 2) Because those are the only coords I have. I looked at Pahimar's example here ( https://github.com/gjkf/Equivalent-Exchange-3/blob/master/src/main/java/com/pahimar/ee3/handler/GuiHandler.java#L87-L88 ) and he uses the given coords too. If that's wrong, which coords should I use? Thanks for the reply.
  7. Hello everyone, as the title says, I made a block that's a TileEntity and a Container that has a custom Gui. I crash the moment I open the Gui. If I don't add the slot to the container I won't crash and open it will the gui smoothly. Here's the crash report: http://pastebin.com/cmPEpJYL Here are the used classes: Gui: https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/client/gui/inventory/CoreGui.java GuiHandler: https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/handler/GuiHandler.java Block: https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/blocks/BaseCore.java Container: https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/blocks/container/CoreContainer.java TileEntity: https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/blocks/te/BaseCoreTE.java I am pretty new to Containers and TileEntities so I might have made some stupid errors. In that case, please explain how I should do it.
  8. Thanks for the help, it works!!!
  9. I got it to work properly. Instead of doing what you suggested me, I used a double for the temperature, then I calculated the Atmospherical Pressure based on that. The temperature I choose is arbitrary, not related to the Minecraft one. I have a last question: What if there's Biomes O' Plenty installed along with my mod? I choose Biomes O' Plenty but I could choose any mod that add Biomes. How can I detect if there are another biomes a part of the Vanilla ones? If you want code examples go here: https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/Main.java#L82-L119 //Main where the Map is https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/weather/Pressure.java#L39-L41 //The Pressure Class https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/blocks/Station.java#L111-L117 //The Weather Station Block Class Thanks for your huge help.
  10. Thanks, I will look into maps, you are right about learning Java while modding isn't a good idea. I tried because I thought I had enough knowledge. Apparently I don't. Back to study then!!!
  11. Ok, so something like this biomesMap.put(new BiomeGenOcean(0), new Pressure()); biomesMap.put(new BiomeGenPlains(1), new Pressure()); biomesMap.put(new BiomeGenDesert(2), new Pressure()); just for all the biomes, right? Here's Pressure package com.gjkf.fc.weather; import net.minecraft.world.biome.BiomeGenBase; public class Pressure { public float pressure; public float getPressure(){ return pressure; } public void setPressure(float temperature, float humidity){ pressure = temperature * 25 + humidity * 100; } } Am I doing it right? If so, how would I then be sure that that's actually working? If not, what am I doing wrong? I have never used Maps, I'm only 15.
  12. That's why I asked you where I create the instance, I mean in which class. I guess it would make sense to do it in the same class where the Map is.
  13. Thanks for your quick reply. Does my class need to extend something? Where do I create the new instance of that class and in the end, where do I put the map? Sorry for my dumbness
  14. Hello everyone!!!I'm trying to make a mod that would allow the player to forecast the weather. I added a Block that - when placed - writes to NBT the temperature and the humidity of the biome where the block is placed in. Now, I was able to get the temperature and the humidity of the biome but one of the factors of forecasting is Atmospheric Pressure. How can I add atmospheric pressure into Minecraft? I found the Temperature and the Humidity of the Biome from the BiomeGenBase class. How can I add to that class my variable with it's own methods (getters and setters) and make sure that every new world/chunk has that in? Is there any other better way to do it? This is what I've got so far: https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/blocks/Station.java // The Weather Station block https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/blocks/te/StationTE.java // The Weather Station TileEntity https://github.com/gjkf/ForeCraft/blob/master/src/main/java/com/gjkf/fc/proxy/CommonProxy.java // Common Proxy, I register the TEs Thanks guys, any help would be really appreciated.
  15. IT: Davvero fantastica, complimenti, davvero molto fluido (sembra). Supporto assolutamente. EN: Really fantastic, many compliments, really fluid (it seems). I absolutely support.
  16. Thanks for pointing me to the right direction, I'll look into some examples and then I'll try to do my best. Thanks again.
  17. I'm sure this is possible. If you have ever played with OpenBlocks, there's the radio that has some tuned crystal with stations configurable via config. As I said I tried using it but with no success.
  18. Hey everybody! As some of you recall, I'm making a mod that should allow the player to listen to the radio while playing. Now, I got to a point where I need a way to connect to the given URL. I admit I have no idea on how to use Java to connect to the net. I looked into this: https://github.com/OpenMods/OpenBlocks/tree/master/src/main/java/openblocks/client/radio (OpenBlocks' way to do this) but it didn't really help me. My mod can be found here: https://github.com/gjkf/HeadPhones-Radio I have a gui with a "connect" button in it that should connect to the given URL and a key bind that will start and stop the transmission. My problem is how to actually connect to that URL and how to play the actual music. I'm not asking for ready code, I'm asking for help, some code will be appreciated but I want to learn. Thanks in advance.
  19. This is the log I get (I print into the log minX and minY) [14:42:37] [Client thread/INFO] [HeadPhonesRadio]: MinX: 0 [14:42:37] [Client thread/INFO] [HeadPhonesRadio]: MinY: 0 I get this with both your methods. This is how I did it Main.log.info("MinX: " + minX); Main.log.info("MinY: " + minY); I'm sorry if I made some stupid errors but I can't really figure it out. Couldn't I just do width/2 and height/2 to find the middle point, that should always be the same? EDIT: Look at the same classes for what I came up now. I keep getting 0 using the library, in the actual mod I get the correct result EDIT: Fixed it, thanks for the help
  20. for some reason, it gives me the most top left pixel of the screen. It kinda helps me, I can set up the coords for it but only at the resolution of my screen. Here are the classes: https://github.com/gjkf/GjkfLib/blob/master/src/main/java/com/gjkf/lib/gui/GuiScreenWidget.java https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/client/gui/RadioCrystalGui.java Thanks for the help
  21. I guess I have to copy it into my build.gradle then do "sh gradlew build -deobfJar" ? Am I right? EDIT: it worked, I figured it out, now keeps crashing but for another reason that I'll have fun to find out myself. Thanks you really helped me.
  22. I did included into the project the .jar I get when building the mod by doing "sh gradlew build" (I'm on Mac) Is it a problem? If so, how can I solve it?
  23. Hello everyone, I'm crashing over and over, I don't really know why. Here are the used classes: Library GuiScreenWidget: https://github.com/gjkf/GjkfLib/blob/master/src/main/java/com/gjkf/lib/gui/GuiScreenWidget.java IGuiActionPerformed: https://github.com/gjkf/GjkfLib/blob/master/src/main/java/com/gjkf/lib/gui/IGuiActionListener.java GuiGJTextField: https://github.com/gjkf/GjkfLib/blob/master/src/main/java/com/gjkf/lib/gui/GuiGJTextField.java GuiGJButton: https://github.com/gjkf/GjkfLib/blob/master/src/main/java/com/gjkf/lib/gui/GuiGJButton.java: Actual mod RadioCrystalGui: https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/client/gui/RadioCrystalGui.java GuiHandler: https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/handler/GuiHandler.java Crash Report http://pastebin.com/nnaKyYA9 I hope someone can help me, any help would be really appreciated. If you need any other informations, just ask
  24. Hey everyone, I'm making a mod that adds a container, so it adds slots. When developing I leave my minecraft's screen small (it doesn't cover the whole screen) so I , when developing, put the coords of the slots based on the small Gui. I was wondering if there's any way to detect if the Minecraft screen is or not in Fullscreen, so that I could put the coords based on that. I know I could go with the width and height, but it was too messy, and I didn't really want to spend hours finding it. Any ideas would be really appreciated.
×
×
  • Create New...

Important Information

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