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 am trying to update my mod to work in 1.5.  Much of it was trivial or little changes, but a core mechanic I was relying on seems different and I'm not sure what it is doing or how to adjust.

 

I was relying on setBlock to in World to call notifyBlockChange with the id of the block, in this case, the fire block (id 51).  Before, it worked great.  Now, however, instead of just passing the block id (par4), it passes k1 which is "k1 = chunk.getBlockID(par1 & 15, par2, par3 & 15);"  Why is it ANDing the coordinates of the block with 15? 

 

Tracing it through that area, it seems to find 51 again, but then decides to return 0.  It then uses this 0 instead of passing the 51 in par4 into notifyBlockChange.  Grrrr!!!

 

Anyhow, my important question is this: I need to know when a block is next to a fire block.  I was previously overriding the "onNeighborBlockChange" and checking to see if the id was fire.  Now the id is always 0.  Is there another way I can do this?

  • Author

I am trying to update my mod to work in 1.5.  Much of it was trivial or little changes, but a core mechanic I was relying on seems different and I'm not sure what it is doing or how to adjust.

 

I was relying on setBlock to in World to call notifyBlockChange with the id of the block, in this case, the fire block (id 51).  Before, it worked great.  Now, however, instead of just passing the block id (par4), it passes k1 which is "k1 = chunk.getBlockID(par1 & 15, par2, par3 & 15);"  Why is it ANDing the coordinates of the block with 15? 

 

Tracing it through that area, it seems to find 51 again, but then decides to return 0.  It then uses this 0 instead of passing the 51 in par4 into notifyBlockChange.  Grrrr!!!

 

Anyhow, my important question is this: I need to know when a block is next to a fire block.  I was previously overriding the "onNeighborBlockChange" and checking to see if the id was fire.  Now the id is always 0.  Is there another way I can do this?

  • Author

OK, I experimented a little bit and it seems that the logic is reversed from how it used to behave.  The block id that is used in the notify neighbor is of the block that was there before the update.  So, if you are placing fire in a spot that was just air, it will be a 0, but if you knock down a block, it will give the id of the block. 

 

So, to look for fire, I just have to let it check for 0 and then check the status of the block as it is now.  It will call the check more frequently, since it will also be 0 whenever any block is placed, but it won't call it abusively nor generate lag, so it is tolerable.

  • Author

OK, I experimented a little bit and it seems that the logic is reversed from how it used to behave.  The block id that is used in the notify neighbor is of the block that was there before the update.  So, if you are placing fire in a spot that was just air, it will be a 0, but if you knock down a block, it will give the id of the block. 

 

So, to look for fire, I just have to let it check for 0 and then check the status of the block as it is now.  It will call the check more frequently, since it will also be 0 whenever any block is placed, but it won't call it abusively nor generate lag, so it is tolerable.

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.