Applied-Energistics-2-tiler.../src/main/java/appeng/client/texture/FullIcon.java
2015-12-24 02:03:16 +01:00

117 lines
2.3 KiB
Java

/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.client.texture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class FullIcon implements IAESprite
{
private final TextureAtlasSprite p;
public FullIcon( final TextureAtlasSprite o )
{
if( o == null )
{
throw new IllegalArgumentException( "Cannot create a wrapper icon with a null icon." );
}
this.p = o;
}
@Override
public TextureAtlasSprite getAtlas()
{
return this.p;
}
@Override
public int getIconWidth()
{
return this.p.getIconWidth();
}
@Override
public int getIconHeight()
{
return this.p.getIconHeight();
}
@Override
@SideOnly( Side.CLIENT )
public float getMinU()
{
return this.p.getMinU();
}
@Override
@SideOnly( Side.CLIENT )
public float getMaxU()
{
return this.p.getMaxU();
}
@Override
@SideOnly( Side.CLIENT )
public float getInterpolatedU( final double d0 )
{
if( d0 > 8.0 )
{
return this.p.getMaxU();
}
return this.p.getMinU();
}
@Override
@SideOnly( Side.CLIENT )
public float getMinV()
{
return this.p.getMinV();
}
@Override
@SideOnly( Side.CLIENT )
public float getMaxV()
{
return this.p.getMaxV();
}
@Override
@SideOnly( Side.CLIENT )
public float getInterpolatedV( final double d0 )
{
if( d0 > 8.0 )
{
return this.p.getMaxV();
}
return this.p.getMinV();
}
@Override
@SideOnly( Side.CLIENT )
public String getIconName()
{
return this.p.getIconName();
}
}