-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d1b498
commit 11c33f8
Showing
6 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/com/laytonsmith/abstraction/MCPlayerInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.laytonsmith.abstraction; | ||
|
||
public interface MCPlayerInput { | ||
boolean forward(); | ||
boolean backward(); | ||
boolean left(); | ||
boolean right(); | ||
boolean jump(); | ||
boolean sneak(); | ||
boolean sprint(); | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/com/laytonsmith/abstraction/bukkit/BukkitMCPlayerInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.laytonsmith.abstraction.bukkit; | ||
|
||
import com.laytonsmith.abstraction.MCPlayerInput; | ||
import org.bukkit.Input; | ||
|
||
public class BukkitMCPlayerInput implements MCPlayerInput { | ||
|
||
private final Input input; | ||
|
||
public BukkitMCPlayerInput(Input input) { | ||
this.input = input; | ||
} | ||
|
||
@Override | ||
public boolean forward() { | ||
return this.input.isForward(); | ||
} | ||
|
||
@Override | ||
public boolean backward() { | ||
return this.input.isBackward(); | ||
} | ||
|
||
@Override | ||
public boolean left() { | ||
return this.input.isLeft(); | ||
} | ||
|
||
@Override | ||
public boolean right() { | ||
return this.input.isRight(); | ||
} | ||
|
||
@Override | ||
public boolean jump() { | ||
return this.input.isJump(); | ||
} | ||
|
||
@Override | ||
public boolean sneak() { | ||
return this.input.isSneak(); | ||
} | ||
|
||
@Override | ||
public boolean sprint() { | ||
return this.input.isSprint(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters