Skip to content

Commit

Permalink
Fix issue with no input stream in async mode
Browse files Browse the repository at this point in the history
  • Loading branch information
callumnewlands committed Jul 12, 2021
1 parent 30284d8 commit d480d8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.newlands</groupId>
<artifactId>ForestGenerator</artifactId>
<version>1.1</version>
<version>1.2</version>

<properties>
<java.version>14</java.version>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,11 @@ private void blockAndProcessInputStream() {
final float LOOK_OFFSET = parameters.input.stdin.lookOffset * 30f / parameters.input.stdin.fps;
try {
glfwPollEvents();
String s = inputStream.readLine().toUpperCase();
String s = inputStream.readLine();
if (s == null) {
return;
}
s = s.toUpperCase();
for (char c : s.toCharArray()) {
switch (c) {
case 'W' -> camera.move(Camera.MovementDirection.FORWARD, (float) deltaTime);
Expand Down

0 comments on commit d480d8d

Please sign in to comment.