Skip to content

Commit

Permalink
LoreLocator - Now properly highlights armor with stacked protection e…
Browse files Browse the repository at this point in the history
…nchants.

Also adjusted the default highlight color.
  • Loading branch information
0xTas committed Jun 29, 2024
1 parent 764bf58 commit b5291d7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/dev/stardust/modules/LoreLocator.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.render.color.SettingColor;


/**
* @author Tas [0xTas] <[email protected]>
**/
Expand Down Expand Up @@ -118,7 +117,7 @@ public class LoreLocator extends Module {
public final Setting<SettingColor> color = settings.getDefaultGroup().add(
new ColorSetting.Builder()
.name("Highlight Color")
.defaultValue(new SettingColor(69, 200, 255, 169))
.defaultValue(new SettingColor(138, 71, 221, 69))
.build()
);

Expand Down Expand Up @@ -206,6 +205,7 @@ public boolean shouldHighlightSlot(ItemStack stack) {

boolean hasMending = false;
boolean hasInfinity = false;
boolean hasProtection = false;
HashMap<Enchantment, Integer> dupes = new HashMap<>();
for (int n = 0; n < nbt.size(); n++) {
if (hasMending && hasInfinity) break;
Expand All @@ -214,6 +214,11 @@ public boolean shouldHighlightSlot(ItemStack stack) {
if (enchant == null) return true;
if (enchant == Enchantments.MENDING) hasMending = true;
if (enchant == Enchantments.INFINITY) hasInfinity = true;
if (enchant == Enchantments.PROTECTION || enchant == Enchantments.PROJECTILE_PROTECTION
|| enchant == Enchantments.BLAST_PROTECTION || enchant == Enchantments.FIRE_PROTECTION) {
if (!hasProtection) hasProtection = true;
else return true;
}

if (dupes.containsKey(enchant)) {
dupes.put(enchant, dupes.get(enchant) + 1);
Expand Down

0 comments on commit b5291d7

Please sign in to comment.