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 a block class that extends BlockFurnace, and its constructor starts as follows:

 

public MyBlock(boolean isBurning){

        super(Material.rock);

 

Material.rock is underlined red, and when I mouse over it it tells me this:

 

BlockFurnace (boolean) in BlockFurnace cannot be applied to (net.minecraft.block.material.Material)

 

This confuses me greatly, as this is basically the same code as the actual BlockFurnace constructor (except that one is protected rather than public, but changing that doesn't fix the problem). The rest of the constructor works just fine and doesn't crash the game or anything. Please help me figure out what's going on and how to fix it!

 

EDIT: Actually it does crash when compiling, telling me this:

 

warning: [options] bootstrap class path not set in conjunction with -source 1.6

[filepath]MyBlock.java:55: error: incompatible types: Material cannot be converted to boolean

        super(Material.rock);

                      ^

 

EDIT2: I replaced Material.rock with true and now it's happy. Is there some other way I can set the material, or whether or not it requires a tool?

  • Author

"Cannot assign a value to final variable 'blockMaterial'"

 

Is what it says when I mouse over this.blockMaterial, which is underlined red

If you just want the material to be rock, nothing needs to be done. You're extending BlockFurnace which already passed Material.rock as its material.

 

EDIT: This is also the reason why you get that error. blockMaterial, which is final, has already been assigned by BlockFurnace.

  • Author

I don't want it to be rock, although I haven't decided what I do want it to be yet. Is there any way I can change the material to something else?

The only way I can think of is to not extend BlockFurnace and instead mimic it's functionality, but someone smarter than me may have a better idea. :P

  • Author

You could use reflection. But why are you extending BlockFurnace anyways? That to me sounds like a bad idea.

I don't know what reflection is. I'm extending it because the block I'm making is basically a furnace, and I didn't want to copy-paste or recreate its functionality. Why is extending it a bad idea?

The same thing BlockFurnace extends?

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.