mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-20 15:11:36 +01:00
Wrote a program to print all placeholders for easy wiki updates.
This commit is contained in:
parent
f047f4389a
commit
b76ee7c358
@ -29,6 +29,7 @@ import utilities.TestConstants;
|
|||||||
import utilities.dagger.PlanPluginComponent;
|
import utilities.dagger.PlanPluginComponent;
|
||||||
import utilities.mocks.PluginMockComponent;
|
import utilities.mocks.PluginMockComponent;
|
||||||
|
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -57,6 +58,33 @@ class PlanPlaceholdersTest {
|
|||||||
storeSomeData();
|
storeSomeData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print all placeholders to console
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
prepareSystem(Files.createTempDirectory("temp-plan-"));
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("Player placeholders:\n\n```");
|
||||||
|
underTest.getRegisteredPlayerPlaceholders()
|
||||||
|
.stream()
|
||||||
|
.map(placeholder -> placeholder.replaceAll("\\d+", "{n}"))
|
||||||
|
.distinct()
|
||||||
|
.forEach(System.out::println);
|
||||||
|
System.out.println("```");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
System.out.println("Server placeholders:\n\n```");
|
||||||
|
underTest.getRegisteredServerPlaceholders()
|
||||||
|
.stream()
|
||||||
|
.map(placeholder -> placeholder.replaceAll("\\d+", "{n}"))
|
||||||
|
.distinct()
|
||||||
|
.forEach(System.out::println);
|
||||||
|
System.out.println("```");
|
||||||
|
|
||||||
|
component.system().disable();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
private static void storeSomeData() {
|
private static void storeSomeData() {
|
||||||
Database database = component.system().getDatabaseSystem().getDatabase();
|
Database database = component.system().getDatabaseSystem().getDatabase();
|
||||||
database.executeTransaction(new PlayerServerRegisterTransaction(
|
database.executeTransaction(new PlayerServerRegisterTransaction(
|
||||||
|
Loading…
Reference in New Issue
Block a user