From ee7dc27283f032f2c3beff1b28e4b3ba36dec953 Mon Sep 17 00:00:00 2001 From: wizjany Date: Thu, 7 Mar 2019 17:44:20 -0500 Subject: [PATCH] Actually report game rule values. Was just "" before, which is pretty useless. --- .../worldguard/commands/region/RegionPrintoutBuilder.java | 4 ++-- .../sk89q/worldguard/bukkit/util/report/WorldReport.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionPrintoutBuilder.java b/worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionPrintoutBuilder.java index b5b665d2..ee2a38b0 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionPrintoutBuilder.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionPrintoutBuilder.java @@ -91,7 +91,7 @@ public void appendBasics() { */ public void appendFlags() { builder.append(Style.BLUE); - builder.append("FlagUtil: "); + builder.append("Flags: "); appendFlagsList(true); @@ -99,7 +99,7 @@ public void appendFlags() { } /** - * 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 */ diff --git a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/report/WorldReport.java b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/report/WorldReport.java index c288f5b7..a4e45e6a 100644 --- a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/report/WorldReport.java +++ b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/report/WorldReport.java @@ -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 { @@ -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);