Jump to content

[RESOLVED] Rotating a "blockCrop" to grow upside down? [1.7.10]


Recommended Posts

Posted

This is in 1.7.10.

 

I want to make a plant grow upside down. I have my blockCrop working just fine as far as growing properly, can stay on my custom soil, ticks properly, etc.

 

However, since it's growing upside down I need to rotate the blockPlant (the block itself) 180 degrees when its placed by my "seed" item and can't seem to get it working.

 

I am trying to override onBlockAdded so when its added by the seed's onItemUse it rotates, and I'm failing with what I assume is the axis parameter.

 

http://pastebin.com/PijrLeHJ is the snippet of code I'm overriding. Am I on the right track or completely off here? Is there another method I can pass to rotate it? Am I using the wrong event? I feel like it's a matter of manipulating the axis parameter based on the java documentation, but I'm not getting it.

 

EDIT: I know I can rotate the texture 180 in any editor and it would give the same look, but because its a crop, the bound box is still at the bottom so I get a floating wireframe. Do I need to set the bounding box myself and rotate the texture? Or is there a way to just rotate the block as it seems much more probably to do a rotation of the block over the X or Z axis.

 

www.YouTube.com/WeiseGamer

www.twitter.com/WeiseGamer

Posted

Set a new bounding box.

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

Set a new bounding box.

 

Alright, so bottom line the blockRotate isn't doing what I think it's doing or intended for that. Block bounds it is...

 

Any clue as to when one would use blockRotate?

www.YouTube.com/WeiseGamer

www.twitter.com/WeiseGamer

Posted

Block bounds are not affected by rotation because they are axis aligned.

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

Makes complete sense, thank you. Got it all functioning just fine. Crops grow upside down, bound box even changes based on growth state (metadata).

 

Still curious when one would want to use blockRotate, but that will be for another day.

www.YouTube.com/WeiseGamer

www.twitter.com/WeiseGamer

Posted

Who knows. Maybe with something like this?

 

[embed=425,349]<iframe width="560" height="315" src="https://www.youtube.com/embed/hOn9rJdTnKg" frameborder="0" allowfullscreen></iframe>[/embed]

 

Seriously though Lex would *probably strangle me if saw my source.

 

Wow, that platform though, haha. Awesome stuff.

 

I'm marking topic resolved, thanks again for the help getting it done. I'd love to see blockRotate in some source somewhere, but I'll search on git later....time to work on other projects

www.YouTube.com/WeiseGamer

www.twitter.com/WeiseGamer

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.