7
7
import de .hysky .skyblocker .skyblock .slayers .boss .vampire .ManiaIndicator ;
8
8
import de .hysky .skyblocker .skyblock .slayers .boss .vampire .StakeIndicator ;
9
9
import de .hysky .skyblocker .skyblock .slayers .boss .vampire .TwinClawsIndicator ;
10
+ import de .hysky .skyblocker .utils .Area ;
10
11
import de .hysky .skyblocker .utils .Location ;
11
12
import de .hysky .skyblocker .utils .Utils ;
12
13
import de .hysky .skyblocker .utils .mayor .MayorUtils ;
@@ -56,20 +57,26 @@ public class SlayerManager {
56
57
public static void init () {
57
58
ClientReceiveMessageEvents .GAME .register (SlayerManager ::onChatMessage );
58
59
SkyblockEvents .LOCATION_CHANGE .register (SlayerManager ::onLocationChange );
60
+ SkyblockEvents .AREA_CHANGE .register (SlayerManager ::onAreaChange );
59
61
Scheduler .INSTANCE .scheduleCyclic (TwinClawsIndicator ::updateIce , SkyblockerConfigManager .get ().slayers .vampireSlayer .holyIceUpdateFrequency );
60
62
Scheduler .INSTANCE .scheduleCyclic (ManiaIndicator ::updateMania , SkyblockerConfigManager .get ().slayers .vampireSlayer .maniaUpdateFrequency );
61
63
Scheduler .INSTANCE .scheduleCyclic (StakeIndicator ::updateStake , SkyblockerConfigManager .get ().slayers .vampireSlayer .steakStakeUpdateFrequency );
62
64
}
63
65
64
- private static void onLocationChange (Location location ) {
65
- if (isBossSpawned ()) {
66
- slayerQuest = null ;
67
- bossFight = null ;
66
+ private static void onAreaChange (Area area ) {
67
+ if (area .equals (Area .CHATEAU )) {
68
+ getSlayerBossInfo (false );
68
69
}
69
70
}
70
71
72
+ private static void onLocationChange (Location location ) {
73
+ slayerQuest = null ;
74
+ bossFight = null ;
75
+ Scheduler .INSTANCE .schedule (() -> getSlayerBossInfo (false ), 20 * 2 );
76
+ }
77
+
71
78
private static void onChatMessage (Text text , boolean overlay ) {
72
- if (!Utils .isOnSkyblock () || overlay ) return ;
79
+ if (overlay || !Utils .isOnSkyblock ()) return ;
73
80
String message = text .getString ();
74
81
75
82
switch (message .replaceFirst ("^\\ s+" , "" )) {
@@ -156,13 +163,6 @@ public static void getSlayerBossInfo(boolean checkStatus) {
156
163
}
157
164
}
158
165
159
- /**
160
- * Gets The slayer info from scoreboard when player joins SkyBlock
161
- */
162
- public static void getSlayerInfoOnJoin () {
163
- Scheduler .INSTANCE .schedule (() -> getSlayerBossInfo (false ), 20 * 2 ); //2 seconds
164
- }
165
-
166
166
/**
167
167
* Checks if the given armor stand is a slayer boss or miniboss and saves it to the corresponding field.
168
168
* <p>This is the main mechanism for detecting slayer bosses and minibosses. All other features rely on information processed here.
@@ -171,7 +171,7 @@ public static void getSlayerInfoOnJoin() {
171
171
* {@link #findClosestMobEntity(EntityType, ArmorStandEntity)} could be modified and run more than once to ensure the correct entity is found.
172
172
*/
173
173
public static void checkSlayerBoss (ArmorStandEntity armorStand ) {
174
- if (slayerQuest == null || ( isBossSpawned () && bossFight .boss != null ) || ! armorStand . hasCustomName ( )) return ;
174
+ if (slayerQuest == null || ! armorStand . hasCustomName () || ( isBossSpawned () && bossFight .boss != null )) return ;
175
175
if (armorStand .getName ().getString ().contains (CLIENT .getSession ().getUsername ())) {
176
176
for (Entity otherArmorStands : getEntityArmorStands (armorStand , 1.5f )) {
177
177
Matcher matcher = SLAYER_PATTERN .matcher (otherArmorStands .getName ().getString ());
0 commit comments