@@ -0,0 +1,1797 @@
+package com.ferreusveritas.dynamictrees.blocks;%0A%0Aimport java.util.LinkedHashMap;%0Aimport java.util.Map;%0A%0Aimport com.ferreusveritas.dynamictrees.api.treedata.ILeavesProperties;%0A%0Aimport net.minecraft.block.Block;%0Aimport net.minecraft.block.BlockLeaves;%0Aimport net.minecraft.block.state.IBlockState;%0Aimport net.minecraft.client.Minecraft;%0Aimport net.minecraft.client.renderer.block.model.ModelResourceLocation;%0Aimport net.minecraft.client.renderer.block.statemap.BlockStateMapper;%0Aimport net.minecraft.client.renderer.block.statemap.IStateMapper;%0A%0Apublic class LeavesStateMapper implements IStateMapper %7B%0A%0A%09@Override%0A%09public Map%3CIBlockState, ModelResourceLocation%3E putStateModelLocations(Block blockIn) %7B%0A%09%09%0A%09%09Map%3CIBlockState,ModelResourceLocation%3E modelMap = new LinkedHashMap%3C%3E();%0A%09%09%0A%09%09if(blockIn instanceof BlockDynamicLeaves) %7B%0A%09%09%09BlockDynamicLeaves leaves = (BlockDynamicLeaves) blockIn;%0A%09%09%09%0A%09%09%09BlockStateMapper mapper = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getBlockStateMapper();%0A%09%09%09%0A%09%09%09for(int tree = 0; tree %3C 4; tree++) %7B%0A%09%09%09%09IBlockState state = leaves.getDefaultState().withProperty(BlockDynamicLeaves.TREE, tree);%0A%09%09%09%09ILeavesProperties properties = leaves.getProperties(state);%0A%09%09%09%09%0A%09%09%09%09IBlockState primState = properties.getPrimitiveLeaves();%0A%09%09%09%09Map%3CIBlockState, ModelResourceLocation%3E variantMap = mapper.getVariants(primState.getBlock());%0A%09%09%09%09ModelResourceLocation mrl = variantMap.get(primState);%0A%09%09%09%09%0A%09%09%09%09for(int iDecay = 0; iDecay %3C 2; iDecay++) %7B%0A%09%09%09%09%09for(int hydro = 1; hydro %3C 5; hydro++) %7B%0A%09%09%09%09%09%09boolean decay = iDecay == 1;%0A%09%09%09%09%09%09IBlockState keyState = state.withProperty(BlockDynamicLeaves.HYDRO, hydro).withProperty(BlockLeaves.DECAYABLE, decay);%0A%09%09%09%09%09%09modelMap.put(keyState, mrl);%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09%0A%09%09%7D%0A%09%09%0A%09%09return modelMap;%0A%09%7D%0A%09%0A%7D%0A

add experimental LeavesStateMapper