-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #406 from kevinthegreat1/livid-color
Livid Color Highlight
- Loading branch information
Showing
12 changed files
with
160 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/de/hysky/skyblocker/skyblock/dungeon/MobGlow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package de.hysky.skyblocker.skyblock.dungeon; | ||
|
||
import de.hysky.skyblocker.config.SkyblockerConfigManager; | ||
import de.hysky.skyblocker.utils.Utils; | ||
import de.hysky.skyblocker.utils.render.culling.OcclusionCulling; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.decoration.ArmorStandEntity; | ||
import net.minecraft.entity.passive.BatEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.predicate.entity.EntityPredicates; | ||
import net.minecraft.util.math.Box; | ||
import net.minecraft.world.World; | ||
|
||
import java.util.List; | ||
|
||
public class MobGlow { | ||
public static boolean shouldMobGlow(Entity entity) { | ||
Box box = entity.getBoundingBox(); | ||
|
||
if (Utils.isInDungeons() && !entity.isInvisible() && OcclusionCulling.isVisible(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ)) { | ||
String name = entity.getName().getString(); | ||
|
||
// Minibosses | ||
if (entity instanceof PlayerEntity) { | ||
switch (name) { | ||
case "Lost Adventurer", "Shadow Assassin", "Diamond Guy": return SkyblockerConfigManager.get().locations.dungeons.starredMobGlow; | ||
case "Arcade Livid", "Crossed Livid", "Doctor Livid", "Frog Livid", "Hockey Livid", | ||
"Purple Livid", "Scream Livid", "Smile Livid", "Vendetta Livid": return LividColor.shouldGlow(name); | ||
} | ||
} | ||
|
||
// Regular Mobs | ||
if (!(entity instanceof ArmorStandEntity)) { | ||
List<ArmorStandEntity> armorStands = getArmorStands(entity.getWorld(), box); | ||
|
||
if (!armorStands.isEmpty() && armorStands.get(0).getName().getString().contains("✯")) return SkyblockerConfigManager.get().locations.dungeons.starredMobGlow; | ||
} | ||
|
||
// Bats | ||
return SkyblockerConfigManager.get().locations.dungeons.starredMobGlow && entity instanceof BatEntity; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
private static List<ArmorStandEntity> getArmorStands(World world, Box box) { | ||
return world.getEntitiesByClass(ArmorStandEntity.class, box.expand(0, 2, 0), EntityPredicates.NOT_MOUNTED); | ||
} | ||
|
||
public static int getGlowColor(Entity entity) { | ||
String name = entity.getName().getString(); | ||
|
||
if (entity instanceof PlayerEntity) { | ||
return switch (name) { | ||
case "Lost Adventurer" -> 0xfee15c; | ||
case "Shadow Assassin" -> 0x5b2cb2; | ||
case "Diamond Guy" -> 0x57c2f7; | ||
case "Arcade Livid", "Crossed Livid", "Doctor Livid", "Frog Livid", "Hockey Livid", | ||
"Purple Livid", "Scream Livid", "Smile Livid", "Vendetta Livid" -> LividColor.getGlowColor(name); | ||
default -> 0xf57738; | ||
}; | ||
} | ||
|
||
return 0xf57738; | ||
} | ||
} |
56 changes: 0 additions & 56 deletions
56
src/main/java/de/hysky/skyblocker/skyblock/dungeon/StarredMobGlow.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.