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

Hello everyone,

Very junior mod maker here. I'm making a floating plank that sits over water. There's this heavy shadow on it when there's a block over it for some reason.

spacer.png

As you can see in the picture, the lily pad that has a block over it is just a little darker from the shadow. however my custom plank is almost dark.

I have no idea what might cause this.
If it is how I generate the block model, here's the code I'm using:
 

 getBuilder(block.getId().getPath())
                .ao(false)
                .texture("particle", new ResourceLocation(xxxxx.MODID, "block/" + block.getId().getPath()))
                .texture("texture", new ResourceLocation(xxxxx.MODID, "block/" + block.getId().getPath()))
                .element()
                .from(0.01f, -2f, 0.01f)
                .to(15.99f, 0.01f, 15.99f)
                .face(Direction.DOWN).uvs(0f, 0f, 16f,  16f).texture("#texture").cullface(Direction.DOWN).tintindex(0).end()
                .face(Direction.UP).uvs(0f, 0f, 16f, 16f).texture("#texture").cullface(Direction.UP).tintindex(0).end()
                .face(Direction.NORTH).uvs(0f, 0f, 16f, 2.01f).texture("#texture").cullface(Direction.NORTH).tintindex(0).end()
                .face(Direction.SOUTH).uvs(0f, 0f, 16f, 2.01f).texture("#texture").cullface(Direction.SOUTH).tintindex(0).end()
                .face(Direction.EAST).uvs(0f, 0f, 2.01f, 16f).texture("#texture").rotation(ModelBuilder.FaceRotation.CLOCKWISE_90).cullface(Direction.EAST).tintindex(0).end()
                .face(Direction.WEST).uvs(0f, 0f, 2.01f, 16f).texture("#texture").rotation(ModelBuilder.FaceRotation.CLOCKWISE_90).cullface(Direction.WEST).tintindex(0).end()
                .end();

 

  • Author

Found the problem. The cullfaces were reversed. You need to set the cullface to UP on the DOWN face and vice-versa to all other faces. So that heavy shadow isn't a shadow, it's actually inside the block because the up face isn't rendered. And inside the block is almost dark because there's no light in there.

Here's the final code with a few more tweaks if anyone is interested:
 

getBuilder(block.getId().getPath())
    .ao(false)
    .texture("particle", new ResourceLocation(xxxxx.MODID, "block/" + block.getId().getPath()))
    .texture("texture", new ResourceLocation(xxxxx.MODID, "block/" + block.getId().getPath()))
    .element()
    .from(0f, -2f, 0f)
    .to(16f, 0.01f, 16f)
    .face(Direction.DOWN).uvs(0f, 0f, 16f,  16f).texture("#texture").cullface(Direction.UP).end()
    .face(Direction.UP).uvs(0f, 0f, 16f, 16f).texture("#texture").cullface(Direction.DOWN).end()
    .face(Direction.NORTH).uvs(0f, 0f, 16f, 2.01f).texture("#texture").rotation(ModelBuilder.FaceRotation.UPSIDE_DOWN).cullface(Direction.SOUTH).end()
    .face(Direction.SOUTH).uvs(0f, 0f, 16f, 2.01f).texture("#texture").cullface(Direction.NORTH).end()
    .face(Direction.EAST).uvs(0f, 0f, 2.01f, 16f).texture("#texture").rotation(ModelBuilder.FaceRotation.CLOCKWISE_90).cullface(Direction.WEST).end()
    .face(Direction.WEST).uvs(0f, 0f, 2.01f, 16f).texture("#texture").rotation(ModelBuilder.FaceRotation.COUNTERCLOCKWISE_90).cullface(Direction.EAST).end()
    .end();

 

Edited by DnDev

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.