Everything posted by Roboguy99
-
[1.8.9] Different item model for inventory/held in hand
Ok, ok. That code for rotation is all there to try and fix whatever is happening. The crash happens WITHOUT any of that rotation code. See previous version.
-
[1.8.9] Different item model for inventory/held in hand
Sorry to bring this thread up again. I've got everything working (helps if you don't name every model with the prefix used to in the loader ) except I still can't throw anything on the floor - as soon as they're turned to EntityItems the game crashes rendering them. As can be seen in the crash report. The only occurrence I've found of this happening before after a Google (with 4 results) was here, but this seems unlikely for something as simple as what I've done. Do I need to follow what you said to do in that guide or have I just done something really stupid again? If yes to following that post, could you explain the steps in a little more detail. I've sorta realised I was obviously doing something wrong, but wasn't sure where to go and what to fix and got stumped (see here).
-
[1.8.9] Sending a tileentity (with IInventory) through a packet
Oh right, I didn't realise you could get the container through the player. That was what I was looking for, thanks!
-
[1.8.9] Sending a tileentity (with IInventory) through a packet
As far as I know the only way of encoding data is using ByteBufUtils , but this requires a byte size for any integer, which I can't be certain about for co-ordinates. Should I encode them as a string, or is there another method I should know about? That's what happens if I let muscle memory take over and don't properly check the word word Ok but the button actionListener is in the GUI, which is client-side. How do I send it to the container? I will probably look further into the more in-depth tutorial, because I can sense a large number of packets needed for what lies ahead...
-
[1.8.9] Sending a tileentity (with IInventory) through a packet
So how do I tell the container to alter the inventory, and how do I then access the inventory from the container? I would assume something like this. Is it worth looking at http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/2137055-1-7-x-1-8-customizing-packet-handling-with? On a side-note, how do you link a world to a url rather than pasting the whole url? EDIT: It's probably worth noting that my knowledge of packets extends literally as far as diesieben07's tutorial.
-
[1.8.9] Sending a tileentity (with IInventory) through a packet
My aim is to update the inventory of a TileEntity when a button on its GUI is clicked. Obviously the GUI is client-side, and so when the button is clicked (I think) I need to send a packet telling the inventory to update server-side. What is the correct/best/recommended way of sending the TileEntity (or its inventory) across a packet? The only way I can think of is to send the co-ordinates as a string to avoid byte limits and then find the TileEntity from the co-ordinates, but this seems like a pretty rough way of doing it. Or maybe this is the wrong approach to updating a TileEntity altogether? I'm sure this is pretty straight-forward, but I've just completely blanked and can't find anything online.
-
[1.8.9] Different item model for inventory/held in hand
Possibly the strangest thing about it is that there are no errors in the console about the model not being found. It just...ignores...it...
-
[1.8.9] Different item model for inventory/held in hand
It seems that you're right, but I have no idea why... The JSON file for it is in the same place as all the others. The contents of the JSON file is literally a copied+pasted version of one of the elements in which I have changed nothing at all. I tried fully disabling all of the model code and just sticking to a static model like I was using before this whole thread, and putting in the ModelResourceLocation of the model and it just completely ignored it. I then tried using on of the standard element models, and it worked fine. Sticking a breakpoint on getting the ModelResourceLocation showed a message variable saying that the path was null. Which I presume it shouldn't... When you say "use a debugger" is there some tool other than outputting variables + breakpoints I should know about? EDIT: The elementHeld model, which *was* working absolutely fine now isn't working. I changed nothing. I am beyond confused.
-
[1.8.9] Different item model for inventory/held in hand
Well I've just completely removed the loop for now and corrected the incorrect model path, and now I'm back to the same crash as before... Did I actually break something in the process or is there something else wrong?
-
[1.8.9] Different item model for inventory/held in hand
I've appropriately re-named everything so that I'm not registering every item in my mod, and the held textures are now showing up in-game. The models are being rendered separately. I think I did everything you said. But: Things in the GUI are still not being textured, and throwing things on the floor still crash the game. Did I miss something or is it something else? EDIT: I tried using elementModel and testModel to pass to ModelLoader.setCustomModelResourceLocation , both of which had the exact same result.
-
[1.8.9] Different item model for inventory/held in hand
Ok, I think (at long last!) I've gotcha and it's *almost* working. The biggest indication of this is that a) the game no longer crashes and b) items are rendered differently in the inventory than anywhere else (they're flat). I've hardcoded the inventory JSON file for now so there's only one. Two problems exist now: 1) Nothing is textured (and in the case of held items they're rendered in the same way anything without a JSON file are) and 2) Any elements on the floor crash the game with a NullPointerException in RenderEntityItem If you wouldn't mind helping me with that I'd be very grateful.
-
[1.8.9] Different item model for inventory/held in hand
That image helped a lot, and cleared quite a bit up, but I still don't understand *how* I should be "choosing the proper JSON model" for each element. After quite a lot of thinking (maybe over-thinking) and researching, I've possibly understood what you mean. But probably not. Here goes: Do I need to have 2 JSON models - one which points straight to the texture for when the item is held, and one which points to all of the element JSON files (like how fire works, I think...)? Or: Do I just need to change the syntax of that second line? If so, could you please tell me EXACTLY what it should be. My understanding of the JSON model system is (evidently) very lacking, so although I'm understanding what you're saying, I don't know what I actually should be doing to fix it. Or: Something else? If so, how am I doing such a bad job of understanding what on earth is going on? I feel at this point, before I'm banned from the modding community forever for sheer stupidity and you quit the forums due to frustration (there must be people worse than me sometimes, no?), we need to get this over and done with. Again, I'm sorry for the pain you undergo.
-
[1.8.9] Different item model for inventory/held in hand
I'd like to say this is over and I get it, but I still don't. I slept on it, came back to it and I still can't make proper sense of what you're saying. I feel like this thread has reached a point where we're getting nowhere. As much as I hate to say this, I think it might just benefit the both of us if you just outright tell me what should be where. Basically I don't understand what the significant difference between those two lines is - surely they both point to a JSON model? Also, if I hard-code the return of the first one, the game still crashes with the same error. Maybe I'm still not getting it at all. Sorry...
-
[1.8.9] Different item model for inventory/held in hand
You do it just 2 lines above... Maybe I'm brain-dead, but I'm still not getting you. When you say return, are you referring to setting model on the else line or the actual method return? What's the significant difference between those two lines? If I simply return the model from the first of the 2 lines, I get the same crash. Why? What were Mojang thinking when they switched to blockstates from the perfectly adequate previous system? Apologies for the high-levels of brain-deaded-ness and inevitable face-palms
-
[1.8.9] Different item model for inventory/held in hand
Ah, right. I see what you're saying. So the problem is, currently I'm setting the model to itself, which you obviously can't do. How do I actually get the model then? Bare in mind that this is the first time, other than learning how to give an item a texture yesterday, that I've used any of the 'new' 1.8 rendering system. I am pretty confused right now
-
[1.8.9] Different item model for inventory/held in hand
Ok, so I have the separate JSON models. Do you mean I should be returning something other than an IBakedModel ? If so, what and how? If not, then what?
-
[1.8.9] Different item model for inventory/held in hand
Sorry, you're going to have to explain further what you mean by this.
-
[1.8.9] Different item model for inventory/held in hand
Yeah, I stuck some code in both of the quad methods and sure enough it was run. I even tried exactly what you said and threw an exception, which was thrown. Perhaps this was a change in one of the minor updates? I found some code somebody else had for a block where they were calling it on another model, so it doesn't quite work, but might be a step in the right direction. Any ideas? I've modified it a bit, so now it calls itself indefinitely, which didn't really help... (Source: http://www.minecraftforge.net/forum/index.php?topic=30271.5;wap2)
-
[1.8.9] Different item model for inventory/held in hand
So I put it in my preInit, in the same place as the item variants are registered. When the game goes to render the item the game is throwing a NullPointerException. The crash log gives no indication of anything wrong in my code (see below). I've got a feeling this is something to do with the method in the baked model class that you said I should leave blank. Is this the case, or is it something else and I'm being really dumb again? Again, changes pushed to repo. EDIT: I'm almost certain this is related to getGeneralQuads in the baked model class
-
[1.8.9] Different item model for inventory/held in hand
Ok, I've changed it to what you put, but I'm still not getting any textures in-game. Presumably, this is because I haven't actually implemented ModelLoader.setCustomModelResourceLocation anywhere. Where does this go? Do I need one for both models?
-
[1.8.9] Different item model for inventory/held in hand
I'm still unsure as to where I should be analysing it, and what to do with the interpreted element name. I've updated the accepts method with the interpretation code, which is where I assumed it went. Again, sorry if I'm being really dumb...
-
[1.8.9] Different item model for inventory/held in hand
I'm sorta getting it, but I'm afraid I'm still not there. I know I'm being really dumb... I'm not sure where to actually put the ModelLoader.setCustomModelResourceLocation . I tried putting it in the preInit, but doing this obviously resulted in this being the only texture that item has. Also, I think my accepts method is broken, ignoring the fact that it creates a new ModelResourceLocation for every single model in the game and it's still hard-coded to Hydrogen because I haven't figured out what I should be doing there. I've pushed the changes to the repo, so if you wouldn't mind taking a look and basically pointing out where I've gone wrong and what it should be, that would be absolutely fantastic. https://github.com/JakeStanger/Chemistry/tree/master/src/main/java/roboguy99/chemistry/item/element/render https://github.com/JakeStanger/Chemistry/blob/master/src/main/java/roboguy99/chemistry/Chemistry.java
-
[1.8.9] Different item model for inventory/held in hand
Sorry, I'm still not quite getting it... Where do these ResourceLocations go? I see loadModel takes a ResourceLocation, so I presume it has something to do with this?
-
[1.8.9] Different item model for inventory/held in hand
How would I go about doing this? I'm unsure as to what you mean. If it means anything, I tried hard-coding element as a single element and passing that to the IModel , but I still had 0 textures in-game.
-
[1.8.9] Different item model for inventory/held in hand
Ok so as far as I can work out, I've done everything you said, but nothing has a texture in game. The console doesn't appear to be throwing out any errors when loading models either. I've updated my repo with the code, if you wouldn't mind having a look and spotting my inevitably obvious and stupid mistake: https://github.com/JakeStanger/Chemistry/tree/master/src/main/java/roboguy99/chemistry/item/element/render EDIT: I just realised that element isn't actually set anywhere by me, and I assume that Forge isn't a supercomputer capable of guessing my mind. Where would I pass it? Also, I haven't ever created an instance of the model loader class. (Where) would I do that?
IPS spam blocked by CleanTalk.