|
@@ -15,15 +15,17 @@ public class PlayerHeadGui extends AbstractGui {
|
|
|
public final static PlayerHeadGui INSTANCE = new PlayerHeadGui(Minecraft.getInstance());
|
|
|
|
|
|
private class HeadData {
|
|
|
- private final int x;
|
|
|
- private final int y;
|
|
|
- private final int scale;
|
|
|
+ private final float x;
|
|
|
+ private final float y;
|
|
|
+ private final float width;
|
|
|
+ private final float height;
|
|
|
private final ResourceLocation rl;
|
|
|
|
|
|
- public HeadData(int x, int y, int scale, ResourceLocation rl) {
|
|
|
+ public HeadData(float x, float y, float width, float height, ResourceLocation rl) {
|
|
|
this.x = x;
|
|
|
this.y = y;
|
|
|
- this.scale = scale;
|
|
|
+ this.width = width;
|
|
|
+ this.height = height;
|
|
|
this.rl = rl;
|
|
|
}
|
|
|
|
|
@@ -31,8 +33,16 @@ public class PlayerHeadGui extends AbstractGui {
|
|
|
public void paint(Minecraft mc, MatrixStack matrixStack) {
|
|
|
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
|
mc.getTextureManager().bindTexture(rl);
|
|
|
- AbstractGui.blit(matrixStack, x, y, 8 * scale, 8 * scale, 8.0f, 8.0f, 8, 8, 64, 64);
|
|
|
- AbstractGui.blit(matrixStack, x, y, 8 * scale, 8 * scale, 40.0f, 8.0f, 8, 8, 64, 64);
|
|
|
+ int scaledWidth = mc.getMainWindow().getScaledWidth();
|
|
|
+ int scaledHeight = mc.getMainWindow().getScaledHeight();
|
|
|
+ int intX = (int) (x * scaledWidth);
|
|
|
+ int intY = (int) (y * scaledHeight);
|
|
|
+ int intWidth = (int) (width * scaledWidth);
|
|
|
+ int intHeight = (int) (height * scaledHeight);
|
|
|
+ AbstractGui.blit(matrixStack, intX, intY, intWidth, intHeight, 8.0f, 8.0f, 8, 8, 64,
|
|
|
+ 64);
|
|
|
+ AbstractGui.blit(matrixStack, intX, intY, intWidth, intHeight, 40.0f, 8.0f, 8, 8, 64,
|
|
|
+ 64);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -44,10 +54,10 @@ public class PlayerHeadGui extends AbstractGui {
|
|
|
this.data = new TreeMap<>();
|
|
|
}
|
|
|
|
|
|
- public void add(int i, int x, int y, int scale, String name) {
|
|
|
+ public void add(int i, float x, float y, float width, float height, String name) {
|
|
|
NetworkPlayerInfo info = this.mc.player.connection.getPlayerInfo(name);
|
|
|
if(info != null) {
|
|
|
- data.put(i, new HeadData(x, y, scale, info.getLocationSkin()));
|
|
|
+ data.put(i, new HeadData(x, y, width, height, info.getLocationSkin()));
|
|
|
}
|
|
|
}
|
|
|
|