TerraformersMC / Terraform

Base library for the Terraformers' mods
GNU Lesser General Public License v3.0
37 stars 16 forks source link

Terraform wood API updates and bug fixes #73

Closed gniftygnome closed 1 year ago

gniftygnome commented 1 year ago

These changes should allow existing mod code to function without modification (except [^1]). However, they are fairly large changes internally for all Terraform wood API log blocks and for ExtendedLeavesBlock.

[^1]: Direct references to ExtendedLeavesBlock.DISTANCE are no longer safe. Use LeavesBlock.DISTANCE instead.

gniftygnome commented 1 year ago

As long as vanilla leaves work the same this looks good to me!

No worries about that. I spent quite a while generating trees and then breaking trunks one piece at a time and counting taxicab distances. Vanilla still decomposes where it's supposed to (and so do our leaves).

It's frustrating to me I had to override the vanilla property but when I tried not to, I ran into limitations in Minecraft's properties system. You can have multiple properties of the same type with the same name and a different value range ... but you cannot have more than one of them defined within a single class ancestry. Vanilla registers class properties in the constructor, so that mandatory call to super() causes the wrong version of the class to be registered which then conflicts with the later registration by the descendant.