Skip to content

Commit

Permalink
Fixed Bal triggering magma boss detection
Browse files Browse the repository at this point in the history
Added a blazing fortress location check so Bal from Crystal Hollows isn't detected as a magma boss. This is an edit of the fix in d153d7d. Thank you, @NopoTheGamer!
  • Loading branch information
ILikePlayingGames committed Oct 31, 2021
1 parent f77f093 commit ae881cf
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -793,11 +793,13 @@ public boolean isZealot(Entity enderman) {
public void onClientTickMagma(TickEvent.ClientTickEvent e) {
if (e.phase == TickEvent.Phase.START) {
Minecraft mc = Minecraft.getMinecraft();
if (main.getConfigValues().isEnabled(Feature.MAGMA_WARNING) && main.getUtils().isOnSkyblock()) {
if (main.getUtils().isOnSkyblock() && main.getConfigValues().isEnabled(Feature.MAGMA_WARNING) &&
main.getUtils().getLocation() == Location.BLAZING_FORTRESS) {
if (mc != null && mc.theWorld != null) {
if (magmaTick % 5 == 0) {
boolean foundBoss = false;
long currentTime = System.currentTimeMillis();

for (Entity entity : mc.theWorld.loadedEntityList) { // Loop through all the entities.
if (entity instanceof EntityMagmaCube) {
EntitySlime magma = (EntitySlime) entity;
Expand All @@ -818,9 +820,11 @@ public void onClientTickMagma(TickEvent.ClientTickEvent e) {
}
}
}

if (!foundBoss && main.getRenderListener().getTitleFeature() == Feature.MAGMA_WARNING) {
main.getRenderListener().setTitleFeature(null);
}

if (!foundBoss && magmaAccuracy == EnumUtils.MagmaTimerAccuracy.SPAWNED) {
magmaAccuracy = EnumUtils.MagmaTimerAccuracy.ABOUT;
magmaTime = 7200;
Expand All @@ -830,6 +834,7 @@ public void onClientTickMagma(TickEvent.ClientTickEvent e) {
}
}
}

if (main.getRenderListener().getTitleFeature() == Feature.MAGMA_WARNING && magmaTick % 4 == 0) { // Play sound every 4 ticks or 1/5 second.
main.getUtils().playLoudSound("random.orb", 0.5);
}
Expand Down

0 comments on commit ae881cf

Please sign in to comment.