mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
33 lines
804 B
Java
33 lines
804 B
Java
package vazkii.botania.common.integration.buildcraft;
|
|
|
|
import buildcraft.api.core.render.ISprite;
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
|
import net.minecraft.client.renderer.texture.TextureMap;
|
|
|
|
/**
|
|
* Adapts Minecraft TAS to buildcraft ISprite
|
|
*/
|
|
public class TASprite implements ISprite {
|
|
private final TextureAtlasSprite sprite;
|
|
|
|
public TASprite(TextureAtlasSprite sprite) {
|
|
this.sprite = sprite;
|
|
}
|
|
|
|
@Override
|
|
public void bindTexture() {
|
|
Minecraft.getInstance().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
|
}
|
|
|
|
@Override
|
|
public double getInterpU(double u) {
|
|
return sprite.getInterpolatedU(u * 16);
|
|
}
|
|
|
|
@Override
|
|
public double getInterpV(double v) {
|
|
return sprite.getInterpolatedV(v * 16);
|
|
}
|
|
}
|