Posted April 4, 201510 yr 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?
April 4, 201510 yr this.blockMaterial=Material.* after the super. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
April 4, 201510 yr Author "Cannot assign a value to final variable 'blockMaterial'" Is what it says when I mouse over this.blockMaterial, which is underlined red
April 4, 201510 yr 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.
April 4, 201510 yr 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?
April 4, 201510 yr 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.
April 4, 201510 yr 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?
April 4, 201510 yr 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.