2019-09-16 12:27:28 +02:00
|
|
|
package com.simibubi.create.compat.jei;
|
|
|
|
|
2020-05-23 14:02:38 +02:00
|
|
|
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
2019-09-16 12:27:28 +02:00
|
|
|
|
|
|
|
import mezz.jei.api.gui.drawable.IDrawable;
|
|
|
|
import net.minecraft.client.gui.AbstractGui;
|
|
|
|
|
|
|
|
public class ScreenResourceWrapper implements IDrawable {
|
|
|
|
|
2020-05-23 14:02:38 +02:00
|
|
|
private AllGuiTextures resource;
|
2019-09-16 12:27:28 +02:00
|
|
|
|
2020-05-23 14:02:38 +02:00
|
|
|
public ScreenResourceWrapper(AllGuiTextures resource) {
|
2019-09-16 12:27:28 +02:00
|
|
|
this.resource = resource;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getWidth() {
|
|
|
|
return resource.width;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getHeight() {
|
|
|
|
return resource.height;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void draw(int xOffset, int yOffset) {
|
|
|
|
resource.bind();
|
|
|
|
AbstractGui.blit(xOffset, yOffset, 0, resource.startX, resource.startY, resource.width, resource.height, 256,
|
|
|
|
256);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|