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

  • Author
3 hours ago, diesieben07 said:

Call AbstractBlock.Properties#func_235838_a_ when creating your block properties.

do i assign int to it

I don't know, what's the method signature?

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.

1 hour ago, PutoPug said:

do i assign int to it

 
Call func_235838_a_  passing a lambda expression that returns the light level. Like this:

.func_235838_a_((lightLevel) -> 10)

Where 10 is the light level you expect it to have.

1 hour ago, samjviana said:

 
Call func_235838_a_  passing a lambda expression that returns the light level. Like this:


.func_235838_a_((lightLevel) -> 10)

Where 10 is the light level you expect it to have.

FYI, the parameter you've named "lightLevel" there is badly named. That's a parameter in and is most likely a BlockState

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.

30 minutes ago, Draco18s said:

FYI, the parameter you've named "lightLevel" there is badly named. That's a parameter in and is most likely a BlockState

I know that the function should receive ToIntFunction<BlockState>, i just named the parameter as "lightLevel" because the number returned is the light level that the block will have. And i couldn't think in a better/proper way to name it. But thanks, btw what would you recommend then?

42 minutes ago, samjviana said:

i just named the parameter as "lightLevel" because the number returned is the light level that the block will have

But that's not what that means.

What you just said is equivalent to this:

int anonymousFunction(BlockState lightLevelToReturn) {
    return 10;
}

Notice how the thing named "light level" is not, in fact, the light level?

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.

1 hour ago, Draco18s said:

But that's not what that means.

What you just said is equivalent to this:


int anonymousFunction(BlockState lightLevelToReturn) {
    return 10;
}

Notice how the thing named "light level" is not, in fact, the light level?

🤔🤔 Ooh, you're right. So to get the light level first the BlockState is passed as parameters. Now i get it, didn't realize that.
I haven't gotten used to lamba expressions yet

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.