Jump to content

[1.16.3] Lighting/Shadow issues with blocks taller than 1m


Fubar

Recommended Posts

I have some lighting issues since 1.15
I'm using a block that is 1m wide and 2m high. The problem I have are shadows on the upper part of the model that seem to be affected by the bottom part.
Any idea how I can get rid of them? I'm registering the block render layer on FMLClientSetupEvent as RenderType.Cutout since the upper part will not be a full block.

I'm not setting the block's lighting property, only the material (earth) and hardness/resistance.

 

Example (White texture for testing purposes):

 

yhAOKh7.png

RxKqXzY.png

ia1h33D.png

PtnyX1p.png

Edited by Fubar
Link to comment
Share on other sites

I thought about splitting it in two blocks, but I hoped there's an easier 1-block-solution. It worked before 1.15 and I had no problems with it. I would even go so far as to say that there are less problems with a single block since you don't have to care about other blocks that belong to the model.

Link to comment
Share on other sites

8 minutes ago, Fubar said:

I would even go so far as to say that there are less problems with a single block since you don't have to care about other blocks that belong to the model

Just because something is easier doesn't mean it is right. Feel free to try and find a fix the way you are doing it. However, the correct way would be to create two separate blocks that are within the bounds.

Link to comment
Share on other sites

Okay, I guess I'll go with the two-block solution then. Could you tell me, if the following approach would be correct?

Source block (A) will be at the bottom, Child block (B) on top. Both blocks can not be moved by pistons.

 

1. Block A: Use Block.isValidPosition to check if the block above is free (air). Cancel/Allow placement depending on the outcome.

2. Block A: Use Block.onBlockPlacedBy to spawn block B on top

3. Block A & B: Use Block.onReplaced to destroy the connected block A/B.

 

Anything else I need to consider?

Link to comment
Share on other sites

(FWIW, there's no "one block" solution: the game doesn't know that the upper half is occupied, so you can place other blocks there and mobs will pathfind through it)

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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