6f2bbfab4c
- Refactored boostrap code: * Completely reworked item/block/tile registration. * Fixed server side startup. * Fixed server side startup. * More documentation. * More heavy cleanup * More cleanups. * Major refactoring of state mapping and fixes a lot of other issue related to item rendering. * Fixes sky chest item models (no item TESR). * Only use CachingRotatingBakedModel for tile entities automatically. Fix default rotation of quartz pillar for item model. * Used method reference instead of lambda for ItemMeshDefinition for multiparts. * Removed unnecessary IHasSpecialItemModel * Removed unused IconReg class. * Updated resource pack version.
40 lines
1.1 KiB
Java
40 lines
1.1 KiB
Java
package appeng.block.networking;
|
|
|
|
|
|
import net.minecraft.block.state.IBlockState;
|
|
import net.minecraft.client.renderer.color.IBlockColor;
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.world.IBlockAccess;
|
|
import net.minecraftforge.common.property.IExtendedBlockState;
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
import appeng.api.util.AEPartLocation;
|
|
import appeng.parts.CableBusContainer;
|
|
|
|
|
|
@SideOnly( Side.CLIENT )
|
|
public class CableBusColor implements IBlockColor
|
|
{
|
|
|
|
@Override
|
|
public int colorMultiplier( IBlockState state, IBlockAccess worldIn, BlockPos pos, int color )
|
|
{
|
|
AEPartLocation side = AEPartLocation.fromOrdinal( ( color >> 2 ) & 7 );
|
|
CableBusContainer bus = ( (IExtendedBlockState) state ).getValue( BlockCableBus.cableBus );
|
|
switch( color & 3 )
|
|
{
|
|
case 0:
|
|
return bus.getGridNode( side ) != null && bus.getGridNode( side ).isActive() ? 0xffffff : 0;
|
|
case 1:
|
|
return bus.getColor().blackVariant;
|
|
case 2:
|
|
return bus.getColor().mediumVariant;
|
|
case 3:
|
|
return bus.getColor().whiteVariant;
|
|
default:
|
|
return color;
|
|
}
|
|
}
|
|
}
|