Skip to content

Commit

Permalink
Actually report game rule values.
Browse files Browse the repository at this point in the history
Was just "<Recursive>" before, which is pretty useless.
  • Loading branch information
wizjany committed Mar 7, 2019
1 parent 54c3cda commit ee7dc27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -91,15 +91,15 @@ public void appendBasics() {
*/
public void appendFlags() {
builder.append(Style.BLUE);
builder.append("FlagUtil: ");
builder.append("Flags: ");

appendFlagsList(true);

newLine();
}

/**
* Append just the list of flags (without "FlagUtil:"), including colors.
* Append just the list of flags (without "Flags:"), including colors.
*
* @param useColors true to use colors
*/
Expand Down
Expand Up @@ -24,7 +24,9 @@
import org.bukkit.World;
import org.bukkit.generator.ChunkGenerator;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class WorldReport extends DataReport {

Expand Down Expand Up @@ -67,7 +69,9 @@ public WorldReport() {

DataReport protection = new DataReport("Protection");
protection.append("PVP?", world.getPVP());
protection.append("Game Rules", world.getGameRules());
protection.append("Game Rules", Arrays.stream(world.getGameRules())
.map(name -> name + "=" + world.getGameRuleValue(name))
.collect(Collectors.joining(", ")));
report.append(protection.getTitle(), protection);

append(report.getTitle(), report);
Expand Down

0 comments on commit ee7dc27

Please sign in to comment.