public void onTick() {
boolean isDown = Keyboard.isKeyDown(//ID KNOPKI//);
if (this.isPressed && isDown) {
this.pressed++;
} else if (!this.isPressed && isDown) {
this.isPressed = true;
this.pressed = 0;
} else if (this.isPressed && !isDown) {
this.isPressed = false;
this.pressed = 0;
}
}
public boolean isPressed() {
return this.isPressed && this.pressed == 0;
}