BloodMagic/src/main/java/wayoftime/bloodmagic/client/Sprite.java
WayofTime cb2db9bc50 Finished implementation of Incense Altar and associated blocks.
Also added the recipe for the Ritual Tinkerer, as well as the finalized book entry for the Incense Altar.
2020-11-13 19:44:57 -05:00

58 lines
1.2 KiB
Java

package wayoftime.bloodmagic.client;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.util.ResourceLocation;
public class Sprite
{
private final ResourceLocation textureLocation;
private final int textureX;
private final int textureY;
private final int textureWidth;
private final int textureHeight;
public Sprite(ResourceLocation textureLocation, int textureX, int textureY, int textureWidth, int textureHeight)
{
this.textureLocation = textureLocation;
this.textureX = textureX;
this.textureY = textureY;
this.textureWidth = textureWidth;
this.textureHeight = textureHeight;
}
public ResourceLocation getTextureLocation()
{
return textureLocation;
}
public int getTextureX()
{
return textureX;
}
public int getTextureY()
{
return textureY;
}
public int getTextureWidth()
{
return textureWidth;
}
public int getTextureHeight()
{
return textureHeight;
}
public void draw(MatrixStack matrixStack, int x, int y)
{
Minecraft.getInstance().getTextureManager().bindTexture(getTextureLocation());
AbstractGui.blit(matrixStack, x, y, 0, getTextureX(), getTextureY(), getTextureWidth(), getTextureHeight(), 256, 256);
}
}