Browse Source

Added location command to get the current location of the player

remotes/origin/locations
David Hermann 2 years ago
parent
commit
06d01e97b4
  1. 1
      src/main/java/org/bitbiome/commands/CommandListener.java
  2. 13
      src/main/java/org/bitbiome/commands/LocationCommand.java

1
src/main/java/org/bitbiome/commands/CommandListener.java

@ -16,6 +16,7 @@ public class CommandListener {
commands.put("exit", new QuitCommand()); commands.put("exit", new QuitCommand());
commands.put("quit", new QuitCommand()); commands.put("quit", new QuitCommand());
commands.put("location", new LocationCommand());
} }
public HashMap<String, CommandAPI> returnCommands() { public HashMap<String, CommandAPI> returnCommands() {

13
src/main/java/org/bitbiome/commands/LocationCommand.java

@ -0,0 +1,13 @@
package org.bitbiome.commands;
import org.bitbiome.classes.TravelEngine;
import java.util.Scanner;
public class LocationCommand implements CommandAPI{
@Override
public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) {
System.out.println("Du befindest dich gerade hier: " + travelEngine.getPlayer().getLocation().getName());
}
}
Loading…
Cancel
Save