blob: 326c85fedae0abc4a0dc94513056fd9e1e7f8efa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package com.thatgravyboat.skyblockhud.core;
import java.io.IOException;
import net.minecraft.client.gui.GuiScreen;
import org.lwjgl.input.Mouse;
public class GuiScreenElementWrapper extends GuiScreen {
public final GuiElement element;
public GuiScreenElementWrapper(GuiElement element) {
this.element = element;
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
element.render();
}
@Override
public void handleMouseInput() throws IOException {
super.handleMouseInput();
int i = Mouse.getEventX() * this.width / this.mc.displayWidth;
int j = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
element.mouseInput(i, j);
}
@Override
public void handleKeyboardInput() throws IOException {
super.handleKeyboardInput();
element.keyboardInput();
}
}
|