Jump to content

[1.12] Best practice for a custom furnace?


Kinniken

Recommended Posts

Hi all,

 

I would like to know if there's a guide or an example I could follow with the best practice on making a custom furnace in 1.12. I pretty much need something that works like the vanilla one, except :

- only takes in wood as fuel

- burns slower

- placement is not directionnal

 

Should I be extending the default one or making something from scratch? If I have to make my own block, should I extend BlockContainer or Block directly? I've heard bad things about BlockContainer...

 

Thanks for any pointers.

 

K.

Link to comment
Share on other sites

You could probably make it extend BlockFurnace and override any methods that you want to change from the vanilla furnace such as setDefaultFacing to disable directional placement, onBlockActivated to change what GUI you want to display, and of course other methods like getItem to make it drop your furnace instead of the vanilla furnace.

But my best advice would be exploring net.minecraft.block.BlockFurnace to get a feel for how it works.

I know this doesn't answer everything but I hope it helps you out.

Edited by oreo
Link to comment
Share on other sites

15 minutes ago, Kinniken said:

Ah, that's a bit disappointing. Reimplementing everything from scratch just to change some marginal behaviour? Ah well.

Only because the original is full of garbage that will make it harder to do what you want to do.

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.

Link to comment
Share on other sites

Just now, Kinniken said:

Haven't looked at those classes in particular but I know what you mean.

IInventory is the vanilla way of handling item stacks. Nothing inherently wrong with it, per say, but Capabilities is a thousand times more flexible and mod-compat-friendly.

BlockContainer is outright rubbish though. No mod will ever want to use it. It's not even great for what vanilla wants to do with it.

  • Thanks 1

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.

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.



×
×
  • Create New...

Important Information

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