aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-21 13:58:20 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-21 13:58:20 +0100
commite76fc4f40e5edf01527472f6cecdd59fd008c647 (patch)
treec9d0cab481c0705215479c0abda041a3eb3108fe /src/main/java/at/hannibal2
parent51f4ed20276b2ab75d5766dd4556c76f9e5eb415 (diff)
downloadskyhanni-e76fc4f40e5edf01527472f6cecdd59fd008c647.tar.gz
skyhanni-e76fc4f40e5edf01527472f6cecdd59fd008c647.tar.bz2
skyhanni-e76fc4f40e5edf01527472f6cecdd59fd008c647.zip
Show new visitors and fixed bugs.
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Garden.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt8
2 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
index 967c2487b..78ddb5e37 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
@@ -72,6 +72,12 @@ public class Garden {
public boolean visitorNeedsOnlyWhenClose = false;
@Expose
+ @ConfigOption(name = "Notification", desc = "Show as title and in chat when a new visitor is visiting your island.")
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 1)
+ public boolean visitorNotification = true;
+
+ @Expose
@ConfigOption(name = "Highlight Ready", desc = "Highlight the visitor when the required items are in the inventory.")
@ConfigEditorBoolean
@ConfigAccordionId(id = 1)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
index 3d58a9714..c3d26c90f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.garden
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.IslandType
+import at.hannibal2.skyhanni.data.SendTitleHelper
import at.hannibal2.skyhanni.events.*
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
import at.hannibal2.skyhanni.utils.*
@@ -190,14 +191,15 @@ class GardenVisitorFeatures {
}
}
if (visitors.keys.removeIf { it !in visitorsInTab }) {
- println("removed an npc")
update()
}
for (name in visitorsInTab) {
if (!visitors.containsKey(name)) {
visitors[name] = Visitor(-1)
- // todo notification? (check world age first)
- println("found an npc: '$name'")
+ if (SkyHanniMod.feature.garden.visitorNotification) {
+ SendTitleHelper.sendTitle("§eNew Visitor", 5_000)
+ LorenzUtils.chat("§e[SkyHanni] $name §eis visiting your garden!")
+ }
update()
}
}