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 an issue with a custom block when I change the light value of it.

 

I use Block#getLightValue(IBlockState, IBlockAccess, BlockPos) to change the light value, and it works.

However, as seen in the picture, the light only affects the adjacent blocks.

 

nsRDleg.png

 

So how do I cause an update of lighting in a wider area?

  • Author
4 minutes ago, diesieben07 said:

Please post your full block code.

https://pastebin.com/5Lg5xbbK

 

EDIT: I use World#markAndNotifyBlock(BlockPos, Chunk, IBlockState, IBlockState, flags) under update() in the TileEntity to update the light, if that's relevant.

Edited by ObliCoo

  • Author
1 minute ago, diesieben07 said:
  • Do not implement ITileEntityProvider, override hasTileEntity and createTileEntity from the Block class.
  • Why are you using getTileData on your own TileEntity?
  1. Alright, I'll test it out.
  2. I store the variable to see if the block is burning in the TileEntity, but judging by your response, I assume there's a more logical way to work around this.
  • Author
3 hours ago, diesieben07 said:

No, you do not. You are using getTileData, which is for storing NBT data in TileEntities that are not yours. If you want to store data in your own TileEntity just add a field in the TileEntity class.

I see, thank you. Could you explain why one should not use ITileEntityProvider?

20 minutes ago, ObliCoo said:

I see, thank you. Could you explain why one should not use ITileEntityProvider?

Because it is old and not needed.

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.