Jump to content

[1.12.2] Different Rotation methods in one Class


Recommended Posts

Currently i have 2 Block classes, BlockBase and BlockAdv, BlockBase handles name, material and tab. Adv is meant to handle Fullcube(for models), collision and rotation method.
Full cube and Collision currently work, however setting rotation method is being a pain. there are 3 states meant for rotation
0=No rotation
1=NSEW Playerbased
2=UDNSEW Block Face Based

However with the way forge loads things, createBlockState Loads before the blocks, meaning i cant assign the block to a rotation method... Here's the chunk of code that's causing me issues

public static int rotation = 0;

    public static final PropertyDirection HFACING = BlockHorizontal.FACING; //NSEW Player based
    public static final PropertyDirection DFACING = BlockDirectional.FACING; //UDNSEW Block face Based
    //Everything defaults to NSEW to avoid issues.
    protected BlockStateContainer createBlockState() {
        if (rotation == 2) return new BlockStateContainer(this, new IProperty[]{DFACING});
        if (rotation == 1) return new BlockStateContainer(this, new IProperty[]{HFACING});
        return super.createBlockState();

Since this loads before the Blocks it causes issues, is there a way to delay this or put this after blocks load. If not possible i can write in separate classes, not that big of an issue, just seeing if its possible.
Thanks ?

Link to comment
Share on other sites

This topic is now closed to further replies.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.