Third update pass (3/?)

Last (?) update pass. AE2 can be launched and used (?) in game.

Rendering system changed again and again - rendering is NOT working, to
be rewritten and CAN be done a lot simpler.
This commit is contained in:
elix-x
2016-06-21 16:36:15 +02:00
parent 05aa6972c4
commit 8acee98b8f
20 changed files with 146 additions and 100 deletions
@@ -53,11 +53,6 @@ public class ItemPaintBall extends AEBaseItem
{
this.setFeature( EnumSet.of( AEFeature.PaintBalls ) );
this.setHasSubtypes( true );
if( Platform.isClient() )
{
Minecraft.getMinecraft().getItemColors().registerItemColorHandler( new ItemPaintBallColor(), this );
}
}
@Override
@@ -134,32 +129,4 @@ public class ItemPaintBall extends AEBaseItem
final int dmg = is.getItemDamage();
return dmg >= DAMAGE_THRESHOLD;
}
@SideOnly( Side.CLIENT )
public class ItemPaintBallColor implements IItemColor
{
@Override
public int getColorFromItemstack( ItemStack stack, int tintIndex )
{
final AEColor col = getColor( stack );
final int colorValue = stack.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant;
final int r = ( colorValue >> 16 ) & 0xff;
final int g = ( colorValue >> 8 ) & 0xff;
final int b = ( colorValue ) & 0xff;
if( stack.getItemDamage() >= 20 )
{
final float fail = 0.7f;
final int full = (int) ( 255 * 0.3 );
return (int) ( full + r * fail ) << 16 | (int) ( full + g * fail ) << 8 | (int) ( full + b * fail ) | 0xff << 24;
}
else
{
return r << 16 | g << 8 | b | 0xff << 24;
}
}
}
}