Jump to content

Recommended Posts

Posted

So I've created a new block type (that extends from BlockFlower) that uses a differing texture & some different logic on where it can be placed, but for the life of me I can't work out how to get it to sit in a flower pot nicely.

 

Looking at the BlockFlowerPot code, it appears that it explicitly returns the metadata for each vanilla flower/sapling. If I can't edit the original vanilla code, do I have to create my own flower pot to hold my new flower? If so, how does one go about doing it?

 

FYI, I'm pretty good with Java but new to the Minecraft code-base; I've seen mention that flowers need TileEntitys, anyone care to explain the purpose of these to a noobie modder?

 

Thanks :)

Posted
I've seen mention that flowers need TileEntitys, anyone care to explain the purpose of these to a noobie modder?

 

No they don't.  Whoever said that was dumb.

 

Anyway, TileEntities are for blocks that need to know more information than the limits of metadata.  Like the furnace or a chest.

 

TEs can also be used for things that need complex rendering, like BuildCraft's engines.*  Though such things should be used sparingly as TEs have a higher overhead than regular blocks.

 

*Which have extra data associated with them too, but the comparison is still accurate.

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.

Posted

Awesome, thanks for the info.

 

So if I create a custom block that extends BlockFlowerPot (lets call it VaseBlock for now), and edit the getPlantForMeta() and getMetaForPlant() methods to return the ItemStack/blockID of my new flower respectively, will I then be able to place my flower within the VaseBlock?

Posted

I suggest you catch the PlayerInteractEvent and check for the vanilla flower pot, then change the block to your own version (VaseBlock) with the necessary data to display the flower. This way, you wouldn't need a new recipe for your flower pot.

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.