Jump to content

[1.8] Custom block renderer?


gcewing

Recommended Posts

Is there any way to register a custom block renderer in 1.8?

 

In Greg's Blocks for 1.7 I have a block renderer that dynamically computes what to render based on information in the block's tile entity and those of surrounding blocks. There are too many variations on the shape to use a separate model for each one. The textures to be used also depend on the tile entity. I don't want to use a TESR because these blocks are typically used in large numbers, and re-rendered on every frame would be very inefficient.

 

I can't see how to handle this with the new rendering system in 1.8.

Link to comment
Share on other sites

Someone please tell me this is all a bad dream...

 

It seems that to use ISmartModel I need to pass information from the tile entity to the model via an IBlockState.

 

That's not going to work. There are far too many possible states to encode that way. Plus I need information from adjacent blocks as well.

Link to comment
Share on other sites

Hi

 

You can have as many states or flags combined in IBlockState as you want.  You can't store more than 4 bits' worth in metadata, but that doesn't matter:

 

Some multiblock structures, such as BlockDoor or BlockBed, use a third method called Block.getActualState() which checks the IBlockState of the other blocks in the multiblock - this allows the multiblock to

synchronise the state of all blocks in the multiblock (eg BlockBed - OCCUPIED); and/or

store more than 4 bits' worth information- for example BlockDoor:

- the upper block of the door stores the HINGE position (LEFT/RIGHT), and whether the door is POWERED or not.

- the lower block of the door stores the FACING (NORTH, SOUTH, EAST, WEST) and whether the door is OPEN or not.

The same method Block.getActualState() is also used by blocks which change appearance depending on their neighbours - for example BlockFence, BlockRedstoneWire.

Block.getActualState() is generally called just before a render, to make sure the block has the correct appearance.

 

-TGG

 

Link to comment
Share on other sites

It still seems like terribly convoluted way of going about things. Seemingly I have to extract all the information out of my tile entity and encode it as Properties, only to immediately decode it again in my model. It would be much easier if I just got the world and position passed in directly.

 

Then in the model, instead of just rendering things using the tessellator, I have to construct a list of quads in a screwy low level format that involves shoehorning floats into ints? Really?

 

The whole thing feels like a massive kludge. The old way may not have been ideal, but it was easy to do unusual things with it. This seems very constraining.

 

I hate to think how mods such as Forge Multipart will deal with this. It's not going to be fun for them.

Link to comment
Share on other sites

Hi

 

The reason for introducing BlockModels is for the benefit of the resource pack creators, not the programmers.  IMHO that's the way it should be, no more ridiculous switch() statements in RenderBlocks for every type of block and special cases and instance of all over the place.  Much more extensible and modular too.

 

But yeah it is a lot more complicated for us.

 

-TGG

Link to comment
Share on other sites

Don't get me wrong, I don't object to the model-based system. For mostly-static rendering, it's fine, and a great improvement. But I don't like being forced to use it, and having to use ugly workarounds to make it more dynamic when needed.

 

The frustrating thing is that it doesn't need to be that hard. There's a place in BlockRendererDispatcher that switches on the block's renderType to choose between model rendering and fluid rendering. If there were a Forge hook in there to allow you to plug in a custom renderer at that point, like there used to be, all would be well.

 

Is there an official place to make Forge feature requests?

Link to comment
Share on other sites

Models are the way Minecraft is going. Don't like it don't mod for Minecraft.

It's been mandated that we do not encourage people to use direct tesselator/GL calls.

The current system is functional, and if you design your TE/Models correctly highly efficient.

 

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Baba  Serege [[+27-73 590 8989]] has experience of 27 years in helping and guiding many people from all over the world. His psychic abilities may help you answer and resolve many unanswered questions. He specialize in helping women and men from all walks of life.. 1) – Bring back lost lover. even if lost for a long time. 2) – My lover is abusing alcohol, partying and cheating on me I urgently need help” 3) – Divorce or court issues. 4) – Is your love falling apart? 5) – Do you want your love to grow stronger? 6) – Is your partner losing interest in you? 7) – Do you want to catch your partner cheating on you? – We help to keep your partner faithful and loyal to you. 9) – We recover love and happiness when relationship breaks down. 10) – Making your partner loves you alone. 11) – We create loyalty and everlasting love between couples. 12) – Get a divorce settlement quickly from your ex-partner. 13) – We create everlasting love between couples. 14) – We help you look for the best suitable partner. 15) – We bring back lost lover even if lost for a long time. 16) – We strengthen bonds in all love relationship and marriages 17) – Are you an herbalist who wants to get more powers? 18) – Buy a house or car of your dream. 19) – Unfinished jobs by other doctors come to me. 20) – I help those seeking employment. 21) – Pensioners free treatment. 22) – Win business tenders and contracts. 23) – Do you need to recover your lost property? 24) – Promotion at work and better pay. 25) – Do you want to be protected from bad spirits and nightmares? 26) – Financial problems. 27) – Why you can’t keep money or lovers? 28) – Why you have a lot of enemies? 29) – Why you are fired regularly on jobs? 30) – Speed up money claim spell, delayed payments, pension and accident funds 31) – I help students pass their exams/interviews. 33) – Removal of bad luck and debts. 34) – Are struggling to sleep because of a spiritual wife or husband. 35- ) Recover stolen property
    • OLXTOTO adalah situs bandar togel online resmi terbesar dan terpercaya di Indonesia. Bergabunglah dengan OLXTOTO dan nikmati pengalaman bermain togel yang aman dan terjamin. Koleksi toto 4D dan togel toto terlengkap di OLXTOTO membuat para member memiliki pilihan taruhan yang lebih banyak. Sebagai situs togel terpercaya, OLXTOTO menjaga keamanan dan kenyamanan para membernya dengan sistem keamanan terbaik dan enkripsi data. Transaksi yang cepat, aman, dan terpercaya merupakan jaminan dari OLXTOTO. Nikmati layanan situs toto terbaik dari OLXTOTO dengan tampilan yang user-friendly dan mudah digunakan. Layanan pelanggan tersedia 24/7 untuk membantu para member. Bergabunglah dengan OLXTOTO sekarang untuk merasakan pengalaman bermain togel yang menyenangkan dan menguntungkan.
    • Baba  Serege [[+27-73 590 8989]] has experience of 27 years in helping and guiding many people from all over the world. His psychic abilities may help you answer and resolve many unanswered questions. He specialize in helping women and men from all walks of life.. 1) – Bring back lost lover. even if lost for a long time. 2) – My lover is abusing alcohol, partying and cheating on me I urgently need help” 3) – Divorce or court issues. 4) – Is your love falling apart? 5) – Do you want your love to grow stronger? 6) – Is your partner losing interest in you? 7) – Do you want to catch your partner cheating on you? – We help to keep your partner faithful and loyal to you. 9) – We recover love and happiness when relationship breaks down. 10) – Making your partner loves you alone. 11) – We create loyalty and everlasting love between couples. 12) – Get a divorce settlement quickly from your ex-partner. 13) – We create everlasting love between couples. 14) – We help you look for the best suitable partner. 15) – We bring back lost lover even if lost for a long time. 16) – We strengthen bonds in all love relationship and marriages 17) – Are you an herbalist who wants to get more powers? 18) – Buy a house or car of your dream. 19) – Unfinished jobs by other doctors come to me. 20) – I help those seeking employment. 21) – Pensioners free treatment. 22) – Win business tenders and contracts. 23) – Do you need to recover your lost property? 24) – Promotion at work and better pay. 25) – Do you want to be protected from bad spirits and nightmares? 26) – Financial problems. 27) – Why you can’t keep money or lovers? 28) – Why you have a lot of enemies? 29) – Why you are fired regularly on jobs? 30) – Speed up money claim spell, delayed payments, pension and accident funds 31) – I help students pass their exams/interviews. 33) – Removal of bad luck and debts. 34) – Are struggling to sleep because of a spiritual wife or husband. 35- ) Recover stolen property
  • Topics

×
×
  • Create New...

Important Information

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