winnetrie Posted March 7, 2018 Posted March 7, 2018 I made many variations of existing vanilla blocks and therefore i have an IBlockState argument in my constructor in each class. For example for stairs and slabs you need to know on what block it is based. So i made a var called modelBlock wich i declare as "modelBlock = state.getBlock(); I use this also to get the mapcolor for the block: @Override public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos) { //return ((BlockBaseSlabColoredA.EnumType)state.getValue(COLOR)).getMapColor(); return this.modelBlock.getMapColor(modelBlock.getDefaultState(), null, null); } I used another aproach before, wich i commented out. I wanted to have a more/ better approach. I wonder if this is a good approach since it looks like this getMapColor: return this.modelBlock.getMapColor(modelBlock.getDefaultState(), null, null); Quote Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
winnetrie Posted March 7, 2018 Author Posted March 7, 2018 Oh right i see. I changed it to this: @Override public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos) { //return ((BlockBaseSlabColoredA.EnumType)state.getValue(COLOR)).getMapColor(); //return this.modelBlock.getMapColor(modelBlock.getDefaultState(), null, null); return this.modelState.getMapColor(null, null); } I'm putting "null" for both arguments. I'm not sure this is right, but it feels wrong to enter an IBlockAccess and a BlockPos here. Quote Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
Recommended Posts
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.