screenshot plugin: screenshot pvp kills

This commit is contained in:
Adam
2018-06-04 09:49:55 -04:00
parent f72071f5bf
commit 18ee215f6d
2 changed files with 22 additions and 0 deletions

View File

@@ -133,4 +133,15 @@ public interface ScreenshotConfig extends Config
{
return false;
}
@ConfigItem(
keyName = "kills",
name = "Screenshot PvP Kills",
description = "Configures whether or not screenshots are automatically taken of PvP kills",
position = 9
)
default boolean screenshotKills()
{
return false;
}
}

View File

@@ -111,6 +111,11 @@ public class ScreenshotPlugin extends Plugin
"You feel something weird sneaking into your backpack",
"You have a funny feeling like you would have been followed");
private static final ImmutableList<String> KILL_MESSAGES = ImmutableList.of("into tiny pieces and sat on them", "you have obliterated",
"falls before your might", "A humiliating defeat for", "With a crushing blow you", "thinking challenging you",
"Can anyone defeat you? Certainly", "was no match for you", "You were clearly a better fighter than", "RIP",
"You have defeated", "What an embarrassing performance by", "was no match for your awesomeness");
private String clueType;
private Integer clueNumber;
@@ -258,6 +263,12 @@ public class ScreenshotPlugin extends Plugin
String fileName = "Pet " + TIME_FORMAT.format(new Date());
takeScreenshot(fileName);
}
if (config.screenshotKills() && KILL_MESSAGES.stream().anyMatch(chatMessage::contains))
{
String fileName = "Kill " + " " + LocalDate.now();
takeScreenshot(fileName);
}
}
@Subscribe