Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
allow spoofing filesize
Browse files Browse the repository at this point in the history
  • Loading branch information
moom0o committed Jul 30, 2021
1 parent 486f208 commit 7a97332
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ setting in config.yml to the epoch.
# PlaceholderAPI

* %worldstats_filesize% - Get the cached file size.
* %worldstats_filesizespoof% - Get the spoofed file size, useful for when you shrink your world.
* %worldstats_players% - Get the cached unique players amount.
* %worldstats_days% - Get how old the map is in DAYS

Expand Down
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>me.moomoo</groupId>
<artifactId>worldstats</artifactId>
<version>1.7</version>
<version>1.8</version>
<packaging>jar</packaging>

<name>Worldstats</name>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/me/moomoo/worldstats/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
.replace("%months%", String.valueOf(mMonth))
.replace("%days%", String.valueOf(mDay))
.replace("%fileSize%", new DecimalFormat("#.##").format(plugin.size))
.replace("%fileSize_spoof%", new DecimalFormat("#.##").format(plugin.size + plugin.getConfig().getLong("spoofsize")))
.replace("%totalPlayers%", String.valueOf(plugin.offlinePlayers))));
} else {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', s)
.replace("%years%", String.valueOf(mYear))
.replace("%months%", String.valueOf(mMonth))
.replace("%days%", String.valueOf(mDay))
.replace("%fileSize%", new DecimalFormat("#.##").format(plugin.size))
.replace("%fileSize_spoof%", new DecimalFormat("#.##").format(plugin.size + plugin.getConfig().getLong("spoofsize")))
.replace("%totalPlayers%", String.valueOf(plugin.offlinePlayers)));
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/me/moomoo/worldstats/Expansions.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public String onPlaceholderRequest(Player player, @NotNull String identifier) {
if (identifier.equals("filesize")) {
return String.valueOf(new DecimalFormat("#.##").format(plugin.size));
}
if (identifier.equals("filesizespoof")) {
return String.valueOf(new DecimalFormat("#.##").format(plugin.size + plugin.getConfig().getLong("spoofsize")));
}
if (identifier.equals("players")) {
return String.valueOf(plugin.offlinePlayers);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ message:
- '&3The World is &6%years% years, %months% months and %days% days old &3and has a file
size of &6%fileSize% GB'
- '&7-----------------------------------------------------'
# %fileSize_spoof% for spoofed filesize
filesizeupdate_in_ticks: 72000
spoofsize: 0 # Specify how many gb should be added on top of the filesize, will be %fileSize_spoof%. Useful for if you shrink your world (deleting useless chunks)
Worlds:
- "./world/region"
- "./world_nether/DIM-1/region"
Expand Down

0 comments on commit 7a97332

Please sign in to comment.