Fixes API compilation problem.

This commit is contained in:
Sebastian Hartte
2016-09-13 19:58:38 +02:00
parent 11625ea240
commit 9c561d550b
5 changed files with 67 additions and 72 deletions
@@ -17,6 +17,7 @@ import net.minecraft.util.ResourceLocation;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.core.AppEng;
/**
@@ -60,7 +61,7 @@ class CableBuilder
for( AEColor color : AEColor.values() )
{
colorTextures.put( color, bakedTextureGetter.apply( type.getConnectionTexture( color ) ) );
colorTextures.put( color, bakedTextureGetter.apply( getConnectionTexture( type, color ) ) );
}
connectionTextures.put( type, colorTextures );
@@ -69,6 +70,29 @@ class CableBuilder
smartCableTextures = new SmartCableTextures( bakedTextureGetter );
}
static ResourceLocation getConnectionTexture( AECableType cableType, AEColor color )
{
String textureFolder;
switch (cableType) {
case GLASS:
textureFolder = "parts/cable/glass/";
break;
case COVERED:
textureFolder = "parts/cable/covered/";
break;
case SMART:
textureFolder = "parts/cable/smart/";
break;
case DENSE:
textureFolder = "parts/cable/dense/";
break;
default:
throw new IllegalStateException( "Cable type " + cableType + " does not support connections." );
}
return new ResourceLocation( AppEng.MOD_ID, textureFolder + color.name().toLowerCase() );
}
/**
* Adds the core of a cable to the given list of quads.
*
@@ -656,7 +680,7 @@ class CableBuilder
{
for( AEColor color : AEColor.values() )
{
locations.add( cableType.getConnectionTexture( color ) );
locations.add( getConnectionTexture( cableType, color ) );
}
}