use of binnie.botany.api.genetics.IFlowerType in project Binnie by ForestryMC.
the class StateMapperFlower method getModelResourceLocation.
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
Map<IProperty<?>, Comparable<?>> properties = Maps.newLinkedHashMap(state.getProperties());
IFlowerType flowerType = (IFlowerType) state.getValue(BlockFlower.FLOWER);
if (flowerType.getSections() < 2) {
properties.remove(BlockFlower.SECTION);
} else if (flowerType.getSections() <= state.getValue(BlockFlower.SECTION)) {
properties.put(BlockFlower.SECTION, flowerType.getSections() - 1);
}
if (state.getValue(BlockFlower.SEED)) {
properties.remove(BlockFlower.SECTION);
properties.remove(BlockFlower.FLOWER);
properties.remove(BlockFlower.FLOWERED);
} else {
properties.remove(BlockFlower.SEED);
}
return new ModelResourceLocation(Constants.BOTANY_MOD_ID + ":flower", getPropertyString(properties));
}
Aggregations