aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/hysky')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/EggFinder.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/EggFinder.java b/src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/EggFinder.java
index a38a7396..c4fd7d4d 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/EggFinder.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/EggFinder.java
@@ -76,8 +76,8 @@ public class EggFinder {
private static void handleArmorStand(ArmorStandEntity armorStand) {
for (ItemStack itemStack : armorStand.getArmorItems()) {
ItemUtils.getHeadTextureOptional(itemStack).ifPresent(texture -> {
- for (EggType type : EggType.entries) {
- if (texture.equals(type.texture) && type.egg.getValue() == null) {
+ for (EggType type : EggType.entries) { //Compare blockPos rather than entity to avoid incorrect matches when the entity just moves rather than a new one being spawned elsewhere
+ if (texture.equals(type.texture) && (type.egg.getValue() == null || !type.egg.getValue().entity.getBlockPos().equals(armorStand.getBlockPos()))) {
handleFoundEgg(armorStand, type);
return;
}