package info.sleeplessacorn.nomagi.client;

import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Loader;

/**
 * Used for blocks that implement the Chisel CTM format
 *
 * When Chisel is not loaded, a secondary blockstate file, with {@code _noctm} appended, is used instead.
 */
public class StateMapperNoCTM extends StateMapperBase {

    @Override
    protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
        ResourceLocation location = state.getBlock().getRegistryName();
        if (!Loader.isModLoaded("chisel"))
            location = new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + "_noctm");

        return new ModelResourceLocation(location, getPropertyString(state.getProperties()));
    }
}

@@ -389,21 +389,51 @@
 hen 
-Chisel is not
+neither Chisel nor ConnectedTexturesMod are
  loa
@@ -783,16 +783,46 @@
 chisel%22)
+ %7C%7C !Loader.isModLoaded(%22ctm%22)
 )%0A      

Update CTM statemapper to check for ConnectedTexturesMod