Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

A block should never be more than a 16x16x16 area or else these any many other issues start to occur. You must split the block in two and make it a multipart of sorts. Also, assuming you understand the render types, make sure you are not unnecessarily using one which is not relevant to what you are doing.

  • Author

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.

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.

  • Author

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?

3 I would say is correct. As for the other two, they might be already handled in the BlockItem implementation you'll probably need to extend. I think there's already some tall block placements used for that, but I forget the class name.

(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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.