Jump to content

Kander16

Members
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Kander16

  1. Nah, more like: "this block faces north, so we'll rotate it 90 degrees" (like as in the blockstates of furnaces etc... Where you say "y=90")
  2. Hi, I was wondering how I could take an IBakedModel (or IModel), and rotate that model (in code).
  3. With the precomputed models, like dirt: how does it render? Is getQuads called when you place or remove a block inside a chunk with dirt too? Thanks!
  4. Hi, I have some performance issues with my custom IBakedModel probably because it's pretty complex (it has many quads). I don't want to simplify the model so that it has less quads, because there has been put a lot of effort in. I've thought of something, but I don't know if this could work and how I could do this: The custom IBakedModel is a ripening rack. I made 24 new models to place in the ripening rack, the models I use for this depends on what items are inside of the ripening rack. But the point is, the "base" of the ripening rack doesn't ever change when placed (Only has a rotation depending on the facing). - Precompute: Could I somehow "precompute" this model, so that I don't need to return a list of BakedQuads for the base model everytime and that it's still rendered? So that I only need to return a list of bakedQuads for every model that renders depending on what items are inside? Or how does it work with normal blocks like dirt? Screenshots of ripening rack: If you got other ideas of letting the model render faster, please let me know. Thanks for helping out!
  5. Hi, I found out that the method getQuads is called 7 times when I place or remove a block with the custom IBakedModel. So I created a simple temporary counter to see if it would work if I only returned the full list of quads once (out of 7). The rest of the time I returned an empty list. This made the game run faster. So why does it call 7 times? And could I fix this so that the method is only called once. Thanks. Code: RipeningRackBakedModel: https://hastebin.com/ovokanamaf.java RipeningRackModel: https://hastebin.com/abovequlig.java ModelHandler: https://hastebin.com/uleguwoyib.java
  6. Okay, So I don't need it if I don't want to have a special transformation depending on where it's rendered?
  7. Hi, I was wondering why you would implement an IPerspectiveAwareModel instead of an IBakedModel. I've tried both, but I can't see any difference between them in the world. Does anybody know? Thanks.
  8. By the way, the model is made out of many parts. So the list of bakedQuads should be pretty big. But this can't be the problem, right?
  9. Hi, I've made a custom IBakedModel, and for testing purposes I've placed around 30 of these blocks with the custom IBakedModel in 1 chunk. Whenever I place / remove any block in the chunk or just change something inside the chunk, the game freezes for around a second and then continues with 60fps. I think this is because getQuads is called many times at once (for each block). When around 10 blocks with custom IBakedModel are placed, I still don't have a lot of problems. But when I go above that, whenever I place or remove any block in that chunk, the game freezes for a while. The more blocks with custom IBakedModel there are placed, the longer the game freezes when adding or removing blocks. Anyone that can help me with this? Code: RipeningRackModel: https://hastebin.com/jubohegora.java RipeningRackBakedModel: https://hastebin.com/emaqolizuj.java ModelHandler: https://hastebin.com/vedikamiku.java
  10. Okay then, now it only calls getQuads when something changes inside the chunk (I think). When I place/remove a block etc...
  11. Hi, In my custom IBakedModel, the method getQuads is called every tick (I think). Is there a way that getQuads will only be called when I say "call getQuads"? In the update method of my TileEntity, I did a check if the block has made a change. If so, I called the method "notifyBlockUpdate" once. When I called notifyBlockUpdate, the getExtendedState method in my block was called. But now that I've set my model to be a custom IBakedModel, the getExtendedState method gets called every tick. So, could I change this?
  12. I currently have for a custom IBakedModel for this block. I'm asking if you could change the texture of this model inside the IBakedModel. Because you can render the models in getQuads(). Thanks anyway
  13. Hi, I made a model in JSON and I managed to get a baked model from it to use in my custom IBakedModel. This model is rendering well, the only thing is: can I change the texture of that model (in code)? Because otherwise, I would need to create more json files with only a different texture.
  14. Hmmmm, indeed. I had another block placed, and that could have been the cause. When creating a new world and placing as many ripening racks as many as I can, it works just fine. I'll try to figure out why the other block makes it so slow. Thanks!
  15. I did the recalculations so that I could see changes directly when in debug client. I changed the code to this: https://hastebin.com/lifudijeba.java. It's working faster now, but I'm still getting quite a performance hit. At the moment I'm testing with fixed models in the quads.
  16. Hi, Some time ago I was also 14 years old.
  17. Okay, here it goes. ModelHandler.java: https://hastebin.com/acilesujaq.java RipeningRackModel.java: https://hastebin.com/emahuqibeq.java RipeningRackBakedModel.java: https://hastebin.com/obeviyacot.java
  18. Hi, I was wondering what the "long rand" parameter does in getQuads(). Also, I got the custom model working. I can render two models inside the block. The only thing is: I'm getting a huge performance hit (when it's rendering the game is around 8 fps, and when it isn't rendering the game is around 45 fps). Is this normal, And can this problem be solved when I'll use the guava's cache? Or am I probably doing something wrong? Thanks.
  19. Okay I got those two now, thanks! Let's try again...
×
×
  • Create New...

Important Information

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