Jump to content

[1.12] [Scala] getPropertyNames no longer part of IBlockState?


ShinkoNet

Recommended Posts

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!

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.