|
16 | 16 | import net.minecraft.entity.Entity; |
17 | 17 | import net.minecraft.entity.ItemEntity; |
18 | 18 | import net.minecraft.entity.LivingEntity; |
19 | | -import net.minecraft.entity.player.PlayerEntity; |
| 19 | +import net.minecraft.entity.decoration.ArmorStandEntity; |
20 | 20 | import net.minecraft.entity.decoration.ItemFrameEntity; |
| 21 | +import net.minecraft.entity.passive.VillagerEntity; |
| 22 | +import net.minecraft.entity.player.PlayerEntity; |
21 | 23 | import net.minecraft.item.Item; |
22 | 24 | import net.minecraft.item.ItemStack; |
23 | 25 | import net.minecraft.registry.Registries; |
@@ -111,6 +113,15 @@ private enum SpecialMode |
111 | 113 | "Highlight equipped special", |
112 | 114 | "Also highlight when a special item is held or worn on the head by a player/mob.", |
113 | 115 | true); |
| 116 | + private final CheckboxSetting ignoreArmorStands = |
| 117 | + new CheckboxSetting("Ignore armor stands", |
| 118 | + "Won't highlight equipped special items on armor stands.", false); |
| 119 | + private final CheckboxSetting ignoreOtherPlayers = |
| 120 | + new CheckboxSetting("Ignore other players", |
| 121 | + "Won't highlight equipped special items on other players.", false); |
| 122 | + private final CheckboxSetting ignoreVillagers = |
| 123 | + new CheckboxSetting("Ignore villagers", |
| 124 | + "Won't highlight equipped special items on villagers.", false); |
114 | 125 |
|
115 | 126 | // New: include item frames holding special items |
116 | 127 | private final CheckboxSetting includeItemFrames = |
@@ -159,6 +170,9 @@ public ItemEspHack() |
159 | 170 | addSetting(ignoredList); |
160 | 171 | addSetting(linesOnlyForSpecial); |
161 | 172 | addSetting(includeEquippedSpecial); |
| 173 | + addSetting(ignoreArmorStands); |
| 174 | + addSetting(ignoreOtherPlayers); |
| 175 | + addSetting(ignoreVillagers); |
162 | 176 | addSetting(includeItemFrames); |
163 | 177 | // above-ground filter |
164 | 178 | addSetting(onlyAboveGround); |
@@ -331,11 +345,19 @@ public void onRender(MatrixStack matrixStack, float partialTicks) |
331 | 345 | { |
332 | 346 | for(Entity ent : MC.world.getEntities()) |
333 | 347 | { |
334 | | - if(!(ent instanceof LivingEntity)) |
| 348 | + if(!(ent instanceof LivingEntity le)) |
| 349 | + continue; |
| 350 | + if(ignoreArmorStands.isChecked() |
| 351 | + && le instanceof ArmorStandEntity) |
| 352 | + continue; |
| 353 | + boolean isPlayer = le instanceof PlayerEntity; |
| 354 | + if(ignoreVillagers.isChecked() && le instanceof VillagerEntity) |
| 355 | + continue; |
| 356 | + if(ignoreOtherPlayers.isChecked() && isPlayer |
| 357 | + && le != MC.player) |
335 | 358 | continue; |
336 | | - LivingEntity le = (LivingEntity)ent; |
337 | 359 | if(le == MC.player) |
338 | | - continue; // skip local player |
| 360 | + continue; |
339 | 361 | // hands |
340 | 362 | ItemStack main = le.getMainHandStack(); |
341 | 363 | if(main != null && !main.isEmpty() && !isIgnored(main) |
|
0 commit comments