Skip to content

Commit

Permalink
Report teleport delay feature usage to bStats
Browse files Browse the repository at this point in the history
  • Loading branch information
HeroCC committed Jul 26, 2023
1 parent 0e51092 commit 773db82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/main/java/org/minecast/bedhome/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public void setConfigOpts() {
+ "\nconsole_messages - true/false. Should player actions (such as teleporting to a bed or setting one) be logged to the console?"
+ "\nday_beds - true/false. Should players be able to set beds at day? Or only allow beds at night?"
+ "\nrelaxed_checking - true/false. If you have problems using /bed, set this to true. However, this can cause bugs."
+ "\nteleportDelay - the delay between when the command is issued, and when someone is actually teleported. 0 disables the windup altogether."
+ "\nnobedmode - a/b/c."
+ "\na: Allow players to teleport to their previous bed if destroyed."
+ "\nb: Players will not be able to teleport to their past bed."
Expand All @@ -205,8 +206,8 @@ public void setConfigOpts() {
checkConfig("day_beds", false);
checkConfig("relaxed_checking", false);
checkConfig("nobedmode", 'c');
checkConfig("locale", "en");
checkConfig("teleportDelay", 0);
checkConfig("locale", "en");
this.getConfig().options().copyDefaults(true);
}

Expand Down Expand Up @@ -251,6 +252,13 @@ public String call() {
return getConfig().getString("nobedmode");
}
}));

metrics.addCustomChart(new SimplePie("teleportdelay_used", new Callable<String>() {
@Override
public String call() {
return String.valueOf(getConfig().getInt("teleportDelay") > 0);
}
}));
}

private boolean setupEconomy() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ nobedmode: c
locale: en
bedTpCost: 0.0
bedSetCost: 0.0
first-run: true
teleportDelay: 0
first-run: true

0 comments on commit 773db82

Please sign in to comment.