aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/TexLoc.java
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-16 15:50:41 -0400
committerGitHub <noreply@github.com>2021-10-16 15:50:41 -0400
commit7c00af18febf6c0b833c7633b4fb60a9a1bb93af (patch)
treef02de145362d6a1399651ade4a130d565d7f0ba3 /src/main/java/io/github/moulberry/notenoughupdates/util/TexLoc.java
parentb11742988dec635b5c5da7c2363803cbfafb37b1 (diff)
downloadnotenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.gz
notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.bz2
notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.zip
Code Clean Up (#2)
* intellij code clean up * optimize imports * format * intellij suggestions * fix empty catch issues
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/TexLoc.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/TexLoc.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/TexLoc.java b/src/main/java/io/github/moulberry/notenoughupdates/util/TexLoc.java
index 5e792cf5..8fb31cc4 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/TexLoc.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/TexLoc.java
@@ -9,7 +9,7 @@ public class TexLoc {
public int x;
public int y;
- private int toggleKey;
+ private final int toggleKey;
private boolean toggled;
private boolean pressedLastTick;
private boolean dirPressed;
@@ -21,28 +21,28 @@ public class TexLoc {
}
public boolean handleKeyboardInput() {
- int mult=1;
- if(Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) mult=10;
- if(Keyboard.isKeyDown(toggleKey)) {
- if(!pressedLastTick) {
+ int mult = 1;
+ if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) mult = 10;
+ if (Keyboard.isKeyDown(toggleKey)) {
+ if (!pressedLastTick) {
toggled = !toggled;
}
pressedLastTick = true;
} else {
pressedLastTick = false;
}
- if(toggled || toggleKey == 0) {
- if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
- if(!dirPressed) x-=mult;
+ if (toggled || toggleKey == 0) {
+ if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
+ if (!dirPressed) x -= mult;
dirPressed = true;
- } else if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
- if(!dirPressed) x+=mult;
+ } else if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
+ if (!dirPressed) x += mult;
dirPressed = true;
- } else if(Keyboard.isKeyDown(Keyboard.KEY_UP)) {
- if(!dirPressed) y-=mult;
+ } else if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
+ if (!dirPressed) y -= mult;
dirPressed = true;
- } else if(Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
- if(!dirPressed) y+=mult;
+ } else if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
+ if (!dirPressed) y += mult;
dirPressed = true;
} else {
dirPressed = false;