Everything posted by GooberGunter
-
[1.12.2] [Solved] .obj Tesselating block model Error & Texture error
That’s an error I got when loading a .obj that didn’t have triangulated faces. Now the texture isn’t showing up
-
[1.12.2] [Solved] .obj Tesselating block model Error & Texture error
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!
-
[1.12.2] [Solved] .obj Tesselating block model Error & Texture error
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?
-
[1.12.2] [Solved] .obj Tesselating block model Error & Texture error
Ugh, It's because I didn't triangulate the faces...
-
[1.12.2] [Solved] .obj Tesselating block model Error & Texture error
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
-
[1.12.2] [SOLVED] Getting <Chunk> capability data
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?
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
Oh, got it. Thank you so much for your help!
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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?
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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?
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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?
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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.
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
"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.
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
So I looked at some more examples and I managed this: GuiArcana: The problem I'm having now is that it's not drawing
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
OH! Thank makes a lot more sense, when I was looking at some examples I found, it looked like something was missing
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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:
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
I’ve seen this notation before but I’m not too sure what that translates to in code, what does the double colon mean?
-
[1.12.2] [Solved!] How to detect what’s in the player’s hand and drawing an overlay
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
-
[1.12.2] [Solved] TileEntity: the validated object is null
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
IPS spam blocked by CleanTalk.