use of me.xmrvizzy.skyblocker.mixin.HandledScreenAccessor in project Skyblocker by LifeIsAParadox.
the class QuickNavButton method updateCoordinates.
private void updateCoordinates() {
Screen screen = MinecraftClient.getInstance().currentScreen;
if (screen instanceof HandledScreen<?>) {
HandledScreen<?> handledScreen = (HandledScreen<?>) screen;
int x = ((HandledScreenAccessor) handledScreen).getX();
int y = ((HandledScreenAccessor) handledScreen).getY();
int w = ((HandledScreenAccessor) handledScreen).getBackgroundWidth();
int h = ((HandledScreenAccessor) handledScreen).getBackgroundHeight();
// why is this even a thing
if (h > 166)
--h;
this.x = x + this.index % 6 * 28 + 4;
this.y = this.index < 6 ? y - 28 : y + h - 4;
this.u = 28;
this.v = (index < 6 ? 0 : 64) + (toggled ? 32 : 0);
}
}
Aggregations