Add nest notification

This commit is contained in:
sethtroll
2017-07-12 16:25:36 -05:00
parent 63192e5249
commit bb170029a8
2 changed files with 19 additions and 6 deletions

View File

@@ -53,4 +53,14 @@ public interface WoodcuttingConfig
{
return 5;
}
@ConfigItem(
keyName = "showNestNotification",
name = "Bird nest notification",
description = "Configures whether to notify you of a bird nest spawn"
)
default boolean showNestNotification()
{
return true;
}
}

View File

@@ -72,14 +72,17 @@ public class WoodcuttingPlugin extends Plugin
@Subscribe
public void onChatMessage(ChatMessage event)
{
if (event.getType() != ChatMessageType.FILTERED)
if (event.getType() == ChatMessageType.FILTERED || event.getType() == ChatMessageType.SERVER)
{
return;
}
if (event.getMessage().startsWith("You get some") && event.getMessage().endsWith("logs."))
{
session.incrementLogCut();
}
if (event.getMessage().startsWith("You get some"))
{
session.incrementLogCut();
if (event.getMessage().contains("A bird's nest falls out of the tree") && config.showNestNotification())
{
runelite.notify("A bird nest has spawned!");
}
}
}