Jump to content

[1.7.10] BlockRenderer vs TileEntitySpecialRenderer


Recommended Posts

Posted

Hello,

I just started modding and cannot grasp some concepts yet. I've been using these documentations as a basis in combination with the vanilla code and big mods from github. However, the vanilla code has obfuscated method/variable names and the big mods use many custom libraries, making them harder to follow.

 

For starters, I wanted to created a sloped block like this: Super-Slopes-Mod-3.png

The slope block should be rendered as a 3D item in world and the inventory.

The Block should be a tile entity later on but for now I just wanted it to render like this.

 

1. In many projects I saw a BlockRenderer and a TileEntitySpecialRenderer implemented. Why do I need two renderers for the same block, even if the TileEntity is an empty class for now?

2. Isn't it possible to use the block's renderer to created a scaled item version? Do I really need to implement a new ItemRenderer?

3. Are there good documented tutorials/minimal examples for 1.7.10 I am missing? 

 

Thank you!

 

http://greyminecraftcoder.blogspot.de/2013/08/rendering-inventory-items.html

http://www.minecraftforge.net/wiki/Tile_entity_special_renderer

http://bedrockminer.jimdo.com/modding-tutorials/basic-modding-1-7/metadata-blocks-and-items/

Posted

In a nutshell: ISBRH is cached for efficiency and is called infrequently, TESR is not and gets called every frame.

 

in ISBRH you are already in a context of Tessellator.startDrawing(GL_QUADS). All you can do is specific quad geometries to the tessellator. The ISBRH represents a huge global draw call, where the draw call is sent once for every block in the world (or the blocks needed for render update). This is done only when world render state needs to update. (e.g. light state chagned).

 

in TESR you send out draw calls by yourself, and they get called every frame. This allows rendering of *dynamic* effects and complex geometries, also enables you to do transformation using ``GL11.glTranslate`` and ``glRotate``. However because that each TESR call needs at least one draw call, it is generally slower.

 

So, use TESR only when it's necessary.

 

NOTE: Those conclusion comes from reading the source code and might be somehow inaccurate. Feel free to correct me >.<

 

 

Posted
  On 11/13/2015 at 10:23 AM, WeAthFolD said:

NOTE: Those conclusion comes from reading the source code and might be somehow inaccurate. Feel free to correct me >.<

 

AFAIK that is an accurate statement.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Great, thank you!

 

So, I created the BlockRenderer and the corners look fine now. I am using setBlockBoundsBasedOnState to set the bounds to the corner slab for now.

1. When looking at the block, the inventory item changes according to the orientation, though always being the corner piece of the BlockBounds. Do I have to add a completely new renderer or is it possible to use the scaled model version of a certain block direction? What is the performance solution here?

 

2. How can set the BlockBounds to prevent an entity to stand inside the block, while allowing it to walk it like stairs? The corner block does not seem like a good solution. The borders should be customary rendered on the block. Is it enough to use addCollisionBoxesToList? (this thread was a dead end: http://www.minecraftforge.net/forum/index.php?topic=22129.0)

 

	@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
	int meta = world.getBlockMetadata(x, y, z);
	if (meta == LibRef.DIRECTION.NORTH) {
		setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
	}
	if (meta == LibRef.DIRECTION.EAST) {
		setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
	}
	if (meta == LibRef.DIRECTION.SOUTH) {
		setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
	}
	if (meta == LibRef.DIRECTION.WEST) {
		setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
	}
}

 

width=180 height=105http://s8.postimg.org/ei3ccoc4h/Screen_Shot_2015_11_14_at_18_18_49.jpg[/img]

Posted

Update to 1.8, this becomes infinitely more simple as you don't have to do any GL crap and can just use a sloped model.

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

Posted

I started with 1.8 but jumped back to 1.7.10 because major mods are not ported yet and might never be. I plan to use Thermal Foundation and AppleCore among others later on.

Posted

That's not an excuse, update. You're going to have to do this anyways so do it.

Stop feeding the 'chicken-egg' cycle.

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

Posted

Then you will receive no help here.

And that link you posted is 100% FLAT OUT WRONG.

It's nothing but spreading FUD.

Any mod that says they can not update is wrong and are just being lazy.

This has been proven many many times. Every time someone comes along and says "ITS IMPOSSIBLE!" We come back and show them it's not.

But retards like you only see the bitching and don't think for yourself or try for yourself.

So ya, you're not going to get any help here.

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

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • my game keeps crashing right before launching the game before full screen and keeps poping up this error message "error code 1 " The game crashed: rendering overlay Error: java.lang.IllegalAccessError: failed to access class com.mojang.blaze3d.platform.GlStateManager$TextureState from class net.coderbot.iris.gl.IrisRenderSystem$DSAARB (com.mojang.blaze3d.platform.GlStateManager$TextureState is in module minecraft@1.18.2 of loader 'TRANSFORMER' @d919544; net.coderbot.iris.gl.IrisRenderSystem$DSAARB is in module oculus@1.6.4 of loader 'TRANSFORMER' @d919544)
    • removing oculus or any of ETF or EMF or even embeddium doesn't change anything it just crashes again with error -1  https://gist.github.com/Tikalian-coconut/d49e8fb83bf57d5e04eb042522046786 this time i removed all 4 at same time and that gave it something is wrong with the game seriously..
    • crash report -> https://gist.github.com/Tikalian-coconut/18c41f97bdacef54725e5141f57697d7 from what i see it seems like Entity Texture Features doesn't like Oculus doing something or invert.. not sure it's why everything is all black textured but that causes a -1 error
    • well that's bad, cuz there's no crash report at all (the last crash report is from previous replies) it's probably another issue that doesn't fit in this bug report, the game works fine except that everything is black, no texture except the sky and skin, everything else is just black i've tried reloading the textures in game, see for drivers updates but it did nothing, seems like an issue with Embeddium or Oculus i think, but i know nothing compared to you i can still send the latest debug and latest.log files.. edit: it seems that when i re-add rechiseled (1.1.6-1.20.1) it crashes as error 1 (i can't remove it off from the modpack cuz that'll break all my builds on some maps) lemme start the game and get it to crash to get a crash report done)
    • If you've fallen victim to a crypto scam, you're not alone and thankfully, you're not without options. I highly recommend iBolt Cyber Hacker Company for anyone seeking professional and effective assistance in recovering scammed cryptocurrency. After extensive research and hearing from multiple satisfied clients, it's clear that iBolt stands out in a crowded and often unreliable market. Their team of experienced cyber experts and blockchain analysts uses advanced tracking techniques to follow stolen funds across the blockchain and engage with crypto exchanges when possible. They’re not just tech-savvy—they’re strategic and persistent. WHY CHOOSE iBOLT CYBER HACKER COMPANY? (1) Proven success in crypto asset recovery (2) Fast, professional, and discreet service (3) Skilled in blockchain forensics and cyber investigation (4) Committed to fighting online fraud and supporting victims Don’t give up. I strongly recommend reaching out to iBolt Cyber Hacker Company. ENQUIRIES: info @ iboltcyberhack . org/ www . iboltcyberhack. org/ +39. 351. 105. 3619.
  • Topics

×
×
  • Create New...

Important Information

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