Skip to content

Commit

Permalink
Ignore Y speed and add map to scoreboard
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Dec 5, 2021
1 parent a02a731 commit 86fc3e2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String

bridgingPractice.getWorldArray().add(player.getUniqueId().toString().replaceAll("-", ""));

String schematicName = (args.length == 2) ? args[1] : "default";
String schematicName = (args.length == 2) ? args[1] : file.getName().replaceAll(".schematic", "");

File prev = file;
file = customSchematicFound ? prev : new File(bridgingPractice.getDataFolder() + File.separator + "/schematics/" + bridgingPractice.getConfig().getString("defaults.schematic"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public void startPlayerSpeed(Player player) {
Location oldLoc = player.getLocation();
@Override
public void run() {
oldLoc.setY(0.0);
Location newLoc = player.getLocation();
newLoc.setY(0.0);
double equation = newLoc.distance(oldLoc) * 2;
hMaps.getPlayerSpeed().put(player, equation);
oldLoc = newLoc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public void run() {
"",
"Name: " + ChatColor.GREEN + player.getName(),
"",
"Map: " + ChatColor.GREEN + hMaps.getPlayerSchematic().get(player),
"",
"Blocks Placed: " + ChatColor.GREEN + hMaps.getBlocksPlaced().get(player),
"Speed: " + ChatColor.GREEN + String.format("%.2f", hMaps.getPlayerSpeed().get(player)) + " m/s",
"",
Expand All @@ -56,6 +58,8 @@ public void run() {
"",
"Name: " + ChatColor.GREEN + target.getName(),
"",
"Map: " + ChatColor.GREEN + hMaps.getPlayerSchematic().get(target),
"",
"Blocks Placed: " + ChatColor.GREEN + hMaps.getBlocksPlaced().get(target),
"Speed: " + ChatColor.GREEN + String.format("%.2f", hMaps.getPlayerSpeed().get(target)) + " m/s",
"",
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ commands:
aliases:
- bridging
- b
- iamasweatybridger
- deeznuts
- suckingass
- gay
- urmom
usage: "/<command> <practice|leave|changecolor|restart>"
description: "The main command for the BridgingPractice Plugin."

Expand Down

0 comments on commit 86fc3e2

Please sign in to comment.