Skip to content

Commit c4ba93f

Browse files
committed
Add Enderman particle reduction
- Added a config option to reduce the number of particles emitted by hidden Endermen when Pehkui is installed (#25) - Fixed possibility of the poof animaion playing multiple times when "Play Animation on Unsupported Blocks" is off - Added a compatibility warning when Tschipcraft's Dynamic Lights v1.8.8 or below is installed - Changed exclude tag from `exclude` to `ts.sa.exclude`
1 parent ec3b495 commit c4ba93f

File tree

50 files changed

+171
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+171
-49
lines changed

CHANGES.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
- **Entities with emissive layers are now properly hidden** (Endermen, Spiders, and Cave Spiders) (closes [#25](https://github.com/Tschipcraft/spawnanimations/issues/25))
22
- For this feature to work in Minecraft 1.20.4 and below, [Pehkui](https://modrinth.com/project/t5W7Jfwy) must be installed. Pehkui can still be installed in newer versions for smoother poof animations
3-
- Added config options to enable/disable poof animation ([#40](https://github.com/Tschipcraft/spawnanimations/issues/40)), animation sounds (closes [#39](https://github.com/Tschipcraft/spawnanimations/issues/39)), and hiding emissive mob layers
3+
- Added config options to enable/disable the poof animation ([#40](https://github.com/Tschipcraft/spawnanimations/issues/40)), animation sounds (closes [#39](https://github.com/Tschipcraft/spawnanimations/issues/39)), reducing the number of particles emitted by hidden Endermen, and hiding emissive mob layers ([#25](https://github.com/Tschipcraft/spawnanimations/issues/25))
44
- Improved performance by refactoring entity activation distance calculations to bundle and cache position data retrieval calls, and updating batch activation logic (the whole data pack is now up to 1ms (~45%ish) faster per tick!)
55
- Modified the attack predicate of the secondary dig-up requirements so that it disregards the Y-distance. This allows mobs to, for example, appear at the bottom of pillars, if a player decides to build up during the night
6+
- Improved hide armor and tools option to include the vanishing curse enchantment in the root proxy chest item
67
- Added an activation distance recommendation message when using the vanilla activation mode
8+
- Added a compatibility warning when Tschipcraft's Dynamic Lights v1.8.8 or below is installed
9+
- Fixed possibility of the poof animaion playing multiple times when "Play Animation on Unsupported Blocks" is off
710
- Fixed possibility for hidden falling mobs to lose their fall distance NBT when appearing
811
- Fixed v0 save format not correctly upgrading to v1 from 24w11a to 24w20a, affecting major releases 1.20.5 and 1.20.6
9-
- Improved hide armor and tools option to include the vanishing curse enchantment in the root proxy chest item
12+
- Changed exclude tag from `exclude` to `ts.sa.exclude`

assets/spawnanimations/lang/en_us.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"spawnanimations.midnightconfig.hide_worn_armor_and_tools": "Hide Worn Armor and Tools",
2626
"spawnanimations.midnightconfig.hide_worn_armor_and_tools.tooltip": "Default: §aYes§f\nIf enabled, worn armor and tools are stored in the body, feet, or in some versions, leggings slot of a hidden entity.\n§6⚠ Note: This may impact worn armor and tool drop rates from mob farms when enabled.",
2727
"spawnanimations.midnightconfig.hide_emissive_mob_layers": "Hide Emissive Mob Layers",
28-
"spawnanimations.midnightconfig.hide_emissive_mob_layers.tooltip": "Default: §aYes§f\nIf enabled, emissive layers of some mobs (e.g., Endermen, Spiders, and Cave Spiders), or with Pehkui all mobs, will be hidden by shrinking them.\nRequires Pehkui to be installed in Minecraft 1.20.4 and below.\n§6⚠ Note: This may decrease the efficiency of mob farms due to the changed hitbox size for hidden entities when Pehkui is §nnot§r installed and the feature is enabled.",
28+
"spawnanimations.midnightconfig.hide_emissive_mob_layers.tooltip": "Default: §aYes§f\nIf enabled, emissive layers of some mobs (e.g., Endermen, Spiders, and Cave Spiders), or with Pehkui all mobs, will be hidden by shrinking them.\nRequires Pehkui to be installed in Minecraft 1.20.4 and below.\n§6⚠ Note: This may decrease the efficiency of mob farms due to the changed hitbox size for hidden entities when Pehkui is §nnot§r§6 installed and the feature is enabled.",
29+
"spawnanimations.midnightconfig.reduce_enderman_particles": "Reduce Hidden Enderman Particles",
30+
"spawnanimations.midnightconfig.reduce_enderman_particles.tooltip": "Default: §aYes§f\nIf enabled, the number of particles emitted by hidden Endermen will be reduced by shrinking their hitbox scale.\nOnly applicable when Pehkui is installed.\n§6⚠ Note: This may decrease the efficiency of Enderman mob farms when enabled.",
2931
"spawnanimations.midnightconfig.play_animation_on_unsupported_blocks": "Play Block Break Animation on Unsupported Blocks",
3032
"spawnanimations.midnightconfig.play_animation_on_unsupported_blocks.tooltip": "Default: §cNo§f\nIf enabled, the block breaking animation plays on blocks not explicitly supported by Spawn Animations.\n§6⚠ Note: This could lead to unwanted block updates when enabled.",
3133

data/spawnanimations/function/internal/animation/dig_up/prepare.mcfunction

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## by Tschipcraft
22
# Prepares an entity for hiding
33

4-
# Exclude entities that have the glowing, levitation or invisibility potion effect, are riding another entity or are burning
4+
# Exclude entities that have the glowing, levitation or invisibility potion effect, are riding another entity, or are burning
55
execute as @s[predicate=!spawnanimations:exclude] run tag @s add ts.sa.verified
6-
# Exclude silent or no ai mobs
6+
# Exclude silent or no AI mobs
77
execute as @s[tag=!ts.sa.verified,nbt={Silent:1b}] run tag @s add ts.sa.verified
88
execute as @s[tag=!ts.sa.verified,nbt={NoAI:1b}] run tag @s add ts.sa.verified
99

data/spawnanimations/function/internal/animation/dig_up/start.mcfunction

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@ function spawnanimations:internal/entity/protect
1818

1919
# Prevent animation midair
2020
execute if block ~ ~-0.5 ~ #spawnanimations:nonsolid run function spawnanimations:internal/animation/dig_up/verify_in_air
21-
execute if entity @s[type=minecraft:giant] unless block ~ ~-1 ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/verify_in_air
21+
execute as @s[type=minecraft:giant] unless block ~ ~-1 ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/verify_in_air
2222

2323
# Prevent animation on bedrock
2424
execute if block ~ ~-0.5 ~ minecraft:bedrock run function spawnanimations:internal/animation/dig_up/verify_in_air
2525

2626
# Prevent animation in mob crusher
27-
execute if entity @e[type=!#spawnanimations:exclude,distance=0.001..1.1] run function spawnanimations:internal/animation/dig_up/verify_in_air
27+
execute as @s[tag=ts.sa.verify] if entity @e[type=!#spawnanimations:exclude,distance=0.001..0.9] run function spawnanimations:internal/animation/dig_up/verify_in_air
2828

2929
# Prevent animation on unsupported blocks if disabled
30-
execute if score $play_unsupport ts.sa.settings matches -1..0 unless block ~ ~-0.5 ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/verify_in_air
31-
32-
# I don't remember why I put this here
33-
#execute as @s[tag=ts.sa.to_verify] positioned ~ ~0.2 ~ align y unless block ~ ~ ~ #spawnanimations:exclude unless block ~ ~-1 ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/verify_in_air
30+
execute as @s[tag=ts.sa.verify] if score $play_unsupport ts.sa.settings matches -1..0 unless block ~ ~-0.5 ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/verify_in_air

data/spawnanimations/function/internal/entity/ehs/hide.mcfunction

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ effect give @s invisibility 10 0 true
1010

1111
# Pehkui integration (overlay_pre_49)
1212
execute if score $hide_emissive ts.sa.settings matches 1..2 run function spawnanimations:internal/entity/ehs/pehkui/hide
13+
14+
# Entity specific
15+
execute if score $hide_emissive ts.sa.settings matches 1..2 if entity @s[type=#spawnanimations:has_emissive_layer,tag=!ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide
16+
execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/hide

data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,3 @@ tag @s add ts.sa.hidden
77

88
# Save Armor and Hand Items
99
execute if score $hide_armor ts.sa.settings matches 1..2 as @s[type=#spawnanimations:can_wear_armor] run function spawnanimations:internal/entity/ehs/save_armor
10-
11-
# Entity specific
12-
execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/hide
13-
execute if score $hide_emissive ts.sa.settings matches 1..2 if entity @s[type=#spawnanimations:has_emissive_layer,tag=!ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide

data/spawnanimations/function/internal/version_checker/start.mcfunction

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,12 @@ execute unless score $global tvc_ignore matches 1 if score $version ts.sa.settin
77
# Announce escape sequence handling changes
88
execute unless score $global tvc_ignore matches 1 if score $version ts.sa.settings matches 4298..4316 run tellraw @a [{"text":"[Spawn Animations] ","color":"gray"},{"text":"!","bold":true,"color":"gold"},{"text":" Due to changes in escape sequence handling, all text menus (including the settings menu) are unavailable from 25w02a through 25w08a.","color":"gold"}]
99

10-
execute if score $version ts.sa.settings matches 0 run function spawnanimations:internal/version_checker/retry
10+
# Dynamic Lights Notice
11+
execute if score dynamiclights load.status matches ..18 run tellraw @a [{"text":"[Spawn Animations] ","color":"gray"},{"text":"\u26a0 Please use any version of Tschipcraft's Dynamic Lights above v1.8.8 alongside Spawn Animations!","color":"red"}]
12+
13+
# Pehkui Integration
14+
scoreboard players set $pehkui_installed ts.sa.settings 0
15+
function spawnanimations:internal/entity/ehs/pehkui/check_installed
16+
17+
# Retry if version retrieval failed
18+
execute unless score $version ts.sa.settings matches 1.. run function spawnanimations:internal/version_checker/retry

data/spawnanimations/function/loop.mcfunction

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ execute as @e[type=#spawnanimations:can_wear_armor,tag=ts.sa.to_verify,tag=ts.sa
1616

1717
# Escape protection for shrunk entities
1818
execute as @e[type=#spawnanimations:has_emissive_layer,tag=ts.sa.to_verify,tag=ts.sa.ehs.shrunk] at @s run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure
19+
execute if score $enderman_hack ts.sa.settings matches 1..2 as @e[type=minecraft:enderman,tag=ts.sa.to_verify,tag=ts.sa.ehs.pehkui.hitbox] at @s run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure
1920

2021
## Remove problematic items
2122
execute as @e[type=minecraft:item,tag=!ts.sa.i.checked,tag=!global.ignore] run function spawnanimations:internal/entity/ehs/remove_invalid_item/check

data/spawnanimations/function/main.mcfunction

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## by Tschipcraft
22

33
## Finish hiding entities
4-
execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_hide] run function spawnanimations:internal/entity/ehs/hide_exec
4+
execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_hide,limit=5] run function spawnanimations:internal/entity/ehs/hide_exec
55

66
## Detect new mobs
77
# To edit mobs that are affected, see ../tags/entity_types/dig_up_animation.json
88
# Normal
9-
execute if score $version ts.sa.settings matches 2587.. as @e[type=#spawnanimations:dig_up_animation,tag=!ts.sa.verify,tag=!ts.sa.verified,tag=!ts.sa.to_verify,tag=!ts.sa.to_hide,tag=!exclude,tag=!smithed.strict,tag=!smithed.block,tag=!global.ignore,tag=!global.ignore.pos,limit=10,sort=arbitrary] run function spawnanimations:internal/animation/dig_up/prepare
9+
execute if score $version ts.sa.settings matches 2587.. as @e[type=#spawnanimations:dig_up_animation,tag=!ts.sa.verify,tag=!ts.sa.verified,tag=!ts.sa.to_verify,tag=!ts.sa.to_hide,tag=!ts.sa.exclude,tag=!smithed.strict,tag=!smithed.block,tag=!global.ignore,tag=!global.ignore.pos,limit=10,sort=arbitrary] run function spawnanimations:internal/animation/dig_up/prepare
1010

1111

1212
## Animation trigger

0 commit comments

Comments
 (0)