aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/skyblock
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2024-04-28 15:06:24 -0400
committerAaron <51387595+AzureAaron@users.noreply.github.com>2024-04-28 15:06:24 -0400
commit45bcbe967ac58a2dc5ef606381e1653003ac17e3 (patch)
tree65b14c285a6489acdc070f991b1ca9e798829246 /src/main/java/de/hysky/skyblocker/skyblock
parent75547cb59396252f8e5bde41181b9f27c655ccf2 (diff)
downloadSkyblocker-45bcbe967ac58a2dc5ef606381e1653003ac17e3.tar.gz
Skyblocker-45bcbe967ac58a2dc5ef606381e1653003ac17e3.tar.bz2
Skyblocker-45bcbe967ac58a2dc5ef606381e1653003ac17e3.zip
Add invisible armour stand toggle and dumping head textures to debug
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java20
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java8
2 files changed, 8 insertions, 20 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java
index 8343c6a5..75ba700e 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java
@@ -4,6 +4,7 @@ import com.mojang.authlib.properties.Property;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.dungeon.LividColor;
import de.hysky.skyblocker.skyblock.end.TheEnd;
+import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.SlayerUtils;
import de.hysky.skyblocker.utils.Utils;
import de.hysky.skyblocker.utils.render.culling.OcclusionCulling;
@@ -104,23 +105,12 @@ public class MobGlow {
private static boolean isNukekubiHead(ArmorStandEntity entity) {
for (ItemStack armorItem : entity.getArmorItems()) {
- // hacky way to check if an item is a player head w/o
- // some shenanigans
- if (!armorItem.isOf(Items.PLAYER_HEAD))
- continue;
-
// eb07594e2df273921a77c101d0bfdfa1115abed5b9b2029eb496ceba9bdbb4b3 is texture id for the nukekubi head,
// compare against it to exclusively find armorstands that are nukekubi heads
- ProfileComponent profile = armorItem.get(DataComponentTypes.PROFILE);
- if (profile != null) {
- // get the texture of the nukekubi head item itself and compare it
- String texture = profile.properties().get("textures").stream()
- .map(Property::value)
- .findFirst()
- .orElse("None");
-
- return texture.contains("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWIwNzU5NGUyZGYyNzM5MjFhNzdjMTAxZDBiZmRmYTExMTVhYmVkNWI5YjIwMjllYjQ5NmNlYmE5YmRiYjRiMyJ9fX0=");
- }
+ // get the texture of the nukekubi head item itself and compare it
+ String texture = ItemUtils.getHeadTexture(armorItem);
+
+ return texture.contains("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWIwNzU5NGUyZGYyNzM5MjFhNzdjMTAxZDBiZmRmYTExMTVhYmVkNWI5YjIwMjllYjQ5NmNlYmE5YmRiYjRiMyJ9fX0=");
}
return false;
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java b/src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java
index ff6086d3..d6015748 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java
@@ -96,11 +96,9 @@ public class VisitorHelper {
}
private static @Nullable String getTextureOrNull(ItemStack stack) {
- if (!stack.isOf(Items.PLAYER_HEAD) || stack.get(DataComponentTypes.PROFILE) == null) return null;
- return stack.get(DataComponentTypes.PROFILE).properties().get("textures").stream()
- .map(Property::value)
- .findFirst()
- .orElse(null);
+ String texture = ItemUtils.getHeadTexture(stack);
+
+ return texture.isEmpty() ? null : texture;
}
private static void processLore(String visitorName, @Nullable String visitorTexture, List<Text> loreList) {