Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GooberGunter

Members
  • Joined

  • Last visited

Everything posted by GooberGunter

  1. That’s an error I got when loading a .obj that didn’t have triangulated faces. Now the texture isn’t showing up
  2. Ah ok, then perhaps my problem lies in this line: [18:20:11] [main/INFO] [FML]: OBJModel: A color has already been defined for material 'Material.001' in 'grandsorcery:models/block/crystal.mtl'. The color defined by key 'Ks' will not be applied!
  3. Update: so I got the model to load, but when the block's texture was being loaded, I got the following error, this one I can't figure out Edit: after doing some googling, it looks like forge's object loader doesn't support uv mapping yet, is that right?
  4. Ugh, It's because I didn't triangulate the faces...
  5. Hey, I'm trying to load a model and I'm getting the following error when loading this model. This is my first time rendering an obj, I don't know if this is because models can't have more than 4 vertices, if there's something wrong with my .obj model, or if I missed something in the code. The crash happens when placing the block
  6. So, I have an Item, when it is right clicked it fetches the capability data stored in the player's current chunk: However, while I was testing some gui code that also fetched the same data, I noticed a difference in the result leading to the above test. In the first test, I get an instance of the Chunk from the worldIn object In the second test, I get an instance of the Chunk from Minecraft's (I think it's called a singleton) main world instance I then print both and get two different outcomes. Question: Why are they different? Can I just run my code (i.e. subtracting and adding to the chunk capability) based off of Minecraft::world without any consequences?
  7. Ok. I'm planning on having the overlay draw 5 integers read from a chunk capability, on top of a .png, which will require updates, would I then use ITickable and GL helper methods to avoid using a gui? Or is this not a case where extending gui will result in a greater chance of incompatibility
  8. Ok, thanks for clearing that up So I checked the source code of some of the vanilla overlays and managed to get the overlay where I wanted, but I did my own gui: If I use the Gl helper classes to draw in one location, couldn't another mod draw over it anyway or vice versa? What's the best way to ensure some level of compatibility?
  9. Ok, so I have a class that subscribes to a RenderGameOverlayEvent, which I’ve had. And if I don’t extend a GUI class, how to I draw the png along with 5 integers on the display?
  10. Oh, I changed it from a GuiScreen to a Gui because while the png would load, it would also expose the mouse and I couldn’t find the method to disable it. MouseHandler looked kind of promising but I only looked into it a little bit Edit: so I guess I have one question Would I extend GUI or GuiScreen for a game overlay?
  11. What I meant was that you can’t make static references to non static fields or methods, it gives an error in the IDE. I tried to get the GUI scale from GuiScreen but since it’s not static I got an error. And that the event method has to be static for the event bus to register, unless the old registering method still works
  12. The problem here is that the event has to be static in order to be registered, which greatly limits options here for things like drawing a string on the gui since that method is not static in the GUI class, or get the actual display width that is compatible with the Gui. I always see source code where the event isn't static, but every time I've done that it doesn't work so it's not really an option ...Unless, of course, I'm missing something
  13. So something is wrong with using Minecraft.getminecraft().displaywidth, causing it not to render originally I had x=mc.displaywidth-(picture width) and it didn't work, when I replaced it with 0, it worked it might have something to do with the event being static but something tells me that's not the problem From what I can tell: Minecraft::displayWidth isn't the width in terms of pixels which is what the GUI goes off of, but some other unit. So if I had the length of a pixel on screen I could theoretically get the display width in terms of pixels but I'm sure there's an easier way
  14. Wow that took way too long to do *Sigh* i didn't even see the drag files here
  15. what's the easiest way to accomplish that? Somehow, I missed the "choose files" and spent the next hour trying to upload my source code to github (I've been meaning to do it anyway), which was a fun labyrinthine experience, only to get a small version of the picture, then I saw the attachment option.
  16. "this" and the "mc" field were old code that I hadn't cleared out, I've simplified the class to this: the if statements are working, the logger displaying "test" is being executed the the next two lines are not showing any signs of execution. I've gotten no errors about the resource location, and nothing is being displayed.
  17. So I looked at some more examples and I managed this: GuiArcana: The problem I'm having now is that it's not drawing
  18. So, it seems that GuiScreen is treating the overlay as an actual gui, exposing the mouse. Am I using the wrong class? Edit: Ok, so it seems that I need to extend Gui not GuiScreen and I need to use the event to actually draw things with GL
  19. OH! Thank makes a lot more sense, when I was looking at some examples I found, it looked like something was missing
  20. Yeah, I'm overthinking this, I got that part working: @SubscribeEvent public static void onRenderGui(RenderGameOverlayEvent.Post e) { Minecraft mc = Minecraft.getMinecraft(); if(ItemStack.areItemsEqual(mc.player.getHeldItem(EnumHand.OFF_HAND), ModItems.arcanometer.getDefaultInstance())) { new GuiArcanometer(); } } and I've tested it with a logger, but I think there's a problem with the line new GuiArcanometer(); because it's not showing up. And I understand everything up until this point. Gui Class:
  21. So to get an instance of Minecraft, I wouldn’t want to directly set an instance to Minecraft.getMinecraft would I? Would I need a packet for that or am I overthinking this
  22. I’ve seen this notation before but I’m not too sure what that translates to in code, what does the double colon mean?
  23. So I’m trying to show a hud when the player is holding a certain item, but I don’t know how to achieve this Attempt 1: I thought of having the hud render only if the player’s held item is the same as the instance of the item that was registered. Using ItemStack#areItemsEqual (I don’t have it in front of me rn so I’m going off memory). But i don’t know how to get an instance of the player to test it. Also would I need packets? Is the test run on the client side since it is an event dependent on the player
  24. So then, the insertItem and extractItem methods are all ready to be used, nothing needs to be overwritten, I can just call the ItemStackHandler to insert and extract things in the GUI Container class? And do I have to attach the Item Handler Capability in an event? Edit: they are, nothing needs to be overwritten afaik, I can call the ItemStackHandle, now I don’t need to attach the capability

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.