TerraformersMC / Terraform

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

Proposed update to wood API: #66

Closed gniftygnome closed 1 year ago

gniftygnome commented 1 year ago

I finally stopped ignoring the following comment in TraverseBlocks:

    // Todo: fix when Fabric API supports `of(Material material, Function<BlockState, MapColor> mapColor)`
    private static PillarBlock createLog(MapColor topColor, MapColor sideColor) {
        return new PillarBlock(FabricBlockSettings.copyOf(Blocks.OAK_LOG).strength(2.0F).sounds(BlockSoundGroup.WOOD));
    }

Fabric API now does support that pattern, and/but/also the same factory can be accessed directly via Block.Settings.

After I updated Traverse to follow the change and confirmed it works for stripped logs, I realized it does not work for non-stripped logs because they are created via Terraform API's StrippableLogBlock::new method. I am proposing to retire the ctor with an unused MapColor arg in favor of a couple new static factory methods.

Changes:

gniftygnome commented 1 year ago

Superseded by #73 so I'm closing this one.