Deadrik/TFCraft — pull request #561 by ProgrammerHero (2014-07-25 11:09:06+00:00)
Title: Fixed horizontal log placement and oak/acacia texture overwrite bug

So this is two bug fixes at once and two additional behaviour update (which I know isn't a terribly good idea).

Bug 1) Horizontal logs were always being placed with the same orientation regardless of how/where you placed them.
I tracked this one down to BlockLogHoriz:34 and BlockLogHoriz2:25, the direction of the log was calculated after a metadata transform had removed the orientation information, I told it to calculate the direction first, then the metadata and they were aligned correctly.

Bug 2) Oak logs were using the Acacia textures.
This one is also pretty simple but there are a lot of changes to make it work. BlockLogNatural declared its icons as static, so BlockLogNatural2 was using the exact same variables. The result was the acacia textures loaded into the oak slots. I made the icons non-static to fix it, and had to change all references to BlockLogNatural.icon -> TFCBlocks.LogNatural.icon (and the same for LogNatural2). The vertical logs just directly call BlockLogNatural.getIcon() since they don't have to worry about orientation. I also added some sideonly annotations to getIcon functions.

Behaviour update 1) Logs were checking for air blocks on placement, I changed it to check for replaceable blocks so they can now overwrite grass. This is visible in ItemLogs:202-228. This should also affect log placement in water/lava.

Behaviour update 2) Logs were using the players facing to calculate their orientation, but vanilla logs use the side you clicked on, so to be consistent with vanilla, I changed log placement to use the clicked side. As a result I was able to shorten the ItemLogs:setSide function.

I can break this apart into multiple PRs or removed some of the behavioural updates if so desired.