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

Hi.

 

I am currently updating an abandoned java/scala coremod. The java part compiles fine, but the scala bit has a compile error in 1.12.

:compileScala
[ant:scalac] C:\Users\Shinko\Desktop\MCNBS\Modding\NoteBetter-2-master\build\sources\main\scala\com\github\soniex2\notebetter\note\InstrumentBlock.scala:27: error: value getPropertyNames is not a member of net.minecraft.block.state.IBlockState
[ant:scalac]       state.getPropertyNames.asScala.flatMap((p) => v._1.get(p.getName).map((p, _))).forall((x) => x._2.contains(state.getValue(x._1).toString))
[ant:scalac]             ^

[ant:scalac] one error found        

 

The changelog doesn't say anything about block states being changed, and the mod used to compile fine in 1.11.2.

 

This is the code in question. It's purpose, I think, is for it to get the name of the instrument, filter the data, and adds it to the instrument list, but I could be wrong as I am more familiar with Java than Scala.

  def get(state: IBlockState): Option[NoteBetterInstrument] = {
    _predicates.find((v) => {
      state.getPropertyNames.asScala.flatMap((p) => v._1.get(p.getName).map((p, _))).forall((x) => x._2.contains(state.getValue(x._1).toString))
    }).map(_._2)
  }

 

What is the current alternative to this function, since I cannot use it with IBlockState anymore?

 

Thanks!

  • Author

Thanks, the mod now compiles fine and works as intended!

 

I'll make sure to use that bot in the future!

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.