diff options
author | Cow <cow@volloeko.de> | 2020-08-02 23:40:24 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2020-08-02 23:40:24 +0200 |
commit | f8c8c5a4c16338349a5a9e38608cdfcd603d339b (patch) | |
tree | fa81dfbb2306c13ba896bc6888a1ddbf7899a1ed /src/main/java/de/cowtipper/cowlection/handler | |
parent | cc7c9f5b88cd7cf2dc64cb46c1b417ae7e82e6b4 (diff) | |
download | Cowlection-f8c8c5a4c16338349a5a9e38608cdfcd603d339b.tar.gz Cowlection-f8c8c5a4c16338349a5a9e38608cdfcd603d339b.tar.bz2 Cowlection-f8c8c5a4c16338349a5a9e38608cdfcd603d339b.zip |
Added more ways to detect if a player is in a SkyBlock dungeon
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/handler')
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java b/src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java index 3df9048..b687ef2 100644 --- a/src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java +++ b/src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java @@ -34,12 +34,24 @@ public class DungeonCache { return isInDungeon; } + public void onDungeonEnterOrLeave(boolean isInDungeonNow) { + boolean wasInDungeon = isInDungeon; + + if (!wasInDungeon && isInDungeonNow) { + onDungeonEntered(); + } else if (wasInDungeon && !isInDungeonNow) { + onDungeonLeft(); + } + } + public void onDungeonEntered() { + main.getLogger().info("Entered SkyBlock Dungeon!"); isInDungeon = true; resetCounters(); } public void onDungeonLeft() { + main.getLogger().info("Leaving SkyBlock Dungeon!"); isInDungeon = false; resetCounters(); } |