Skip to content

Commit

Permalink
Implement Mr. Cat's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
AzureAaron committed Aug 1, 2024
1 parent bdd5cb5 commit 87fcbf9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.util.function.Supplier;

import org.apache.commons.lang3.ObjectUtils;

import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.utils.Utils;
import de.hysky.skyblocker.utils.render.RenderHelper;
Expand Down Expand Up @@ -32,18 +30,17 @@ static void init() {

private static void updateIndicator() {
if (Utils.isInKuudra() && SkyblockerConfigManager.get().crimsonIsle.kuudra.dangerWarning && CLIENT.player != null && CLIENT.world != null) {
BlockPos under = CLIENT.player.getBlockPos().down();
BlockPos under2 = CLIENT.player.getBlockPos().down(2);
BlockPos under3 = CLIENT.player.getBlockPos().down(3);
BlockPos under4 = CLIENT.player.getBlockPos().down(4);
BlockPos under5 = CLIENT.player.getBlockPos().down(5);
for (int i = 1; i <= 5; i++) {
BlockPos under = CLIENT.player.getBlockPos().down(i);
Title title = getDangerTitle(under);

Title title = ObjectUtils.firstNonNull(getDangerTitle(under), getDangerTitle(under2), getDangerTitle(under3), getDangerTitle(under4), getDangerTitle(under5));
if (title != null) {
RenderHelper.displayInTitleContainerAndPlaySound(title);

if (title != null) {
RenderHelper.displayInTitleContainerAndPlaySound(title);
} else {
TitleContainer.removeTitle(TITLE);
return;
} else if (i == 5) { //Prevent removing the title prematurely
TitleContainer.removeTitle(TITLE);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;

public class Kuudra {
public class Kuudra {
public static final int KUUDRA_MAGMA_CUBE_SIZE = 30;

static KuudraPhase phase = KuudraPhase.OTHER;

public static void init() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.google.common.collect.Streams;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.crimson.dojo.DojoManager;
import de.hysky.skyblocker.skyblock.crimson.kuudra.KuudraGlow;
import de.hysky.skyblocker.skyblock.crimson.kuudra.Kuudra;
import de.hysky.skyblocker.skyblock.dungeon.LividColor;
import de.hysky.skyblocker.skyblock.end.TheEnd;
import de.hysky.skyblocker.utils.ItemUtils;
Expand Down Expand Up @@ -70,7 +70,7 @@ public static boolean shouldMobGlow(Entity entity) {
case ZombieEntity zombie when Utils.isInCrimson() && DojoManager.inArena -> DojoManager.shouldGlow(getArmorStandName(zombie));

//Kuudra
case MagmaCubeEntity magmaCube when Utils.isInKuudra() -> KuudraGlow.shouldGlow(magmaCube, name);
case MagmaCubeEntity magmaCube when Utils.isInKuudra() -> SkyblockerConfigManager.get().crimsonIsle.kuudra.kuudraGlow && magmaCube.getSize() == Kuudra.KUUDRA_MAGMA_CUBE_SIZE;

default -> false;
};
Expand Down

0 comments on commit 87fcbf9

Please sign in to comment.