Skip to content

Commit 23dd599

Browse files
committed
Add missing entity tag recovery
- Fixed most compatibility issues with Hostile Mobs Improve Over Time by adding missing tag recovery logic when preparing an entity for hiding. This should generally improve compatibility with other packs that override entity tags (closes #26) - Reverted the inclusion of the vanishing curse enchantment in the root proxy chest item due to it being too much of a breaking change for Tschipcraft's Dynamic Lights - Adjusted CD workflow to include Pehkui as an optional dependency and upload Forge version separately
1 parent c4ba93f commit 23dd599

File tree

19 files changed

+145
-30
lines changed

19 files changed

+145
-30
lines changed

.github/workflows/cd.yml

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,37 @@ jobs:
248248

249249
dependencies: |
250250
mr_spawn_animationscompats(optional){modrinth:ofDka6PS}
251+
pehkui(optional){modrinth:t5W7Jfwy}
251252
loaders: |
252253
datapack
253254
files: |
254255
./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-datapack.zip
255-
256+
257+
- name: Upload Forge mod version to Modrinth # Forge mod version is uploaded separately atm due to it not being compatible with Minecraft 1.21.6 or above
258+
id: upload_forge_modrinth_mod
259+
uses: Kir-Antipov/mc-publish@v3.3
260+
if: steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == 'false'
261+
with:
262+
modrinth-id: zrzYrlm0
263+
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
264+
game-versions: |
265+
>=1.17 <=1.21.5
266+
game-version-filter: any
267+
fail-mode: skip
268+
269+
name: "[Mod] Release v${{ github.event.inputs.tag }}"
270+
version: ${{ github.event.inputs.tag }}+mod
271+
changelog-file: CHANGES.md
272+
273+
dependencies: |
274+
mr_spawn_animationscompats(optional){modrinth:ofDka6PS}
275+
midnightlib(optional){modrinth:codAaoxh}
276+
pehkui(optional){modrinth:t5W7Jfwy}
277+
loaders: |
278+
forge
279+
files: |
280+
./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-mod.jar
281+
256282
- name: Upload mod version to Modrinth
257283
id: upload_modrinth_mod
258284
uses: Kir-Antipov/mc-publish@v3.3
@@ -275,10 +301,10 @@ jobs:
275301
modmenu(optional){modrinth:mOgUt4GM}
276302
modmenu-badges-lib(optional){modrinth:eUw8l2Vi}
277303
midnightlib(optional){modrinth:codAaoxh}
304+
pehkui(optional){modrinth:t5W7Jfwy}
278305
loaders: |
279306
fabric
280307
quilt
281-
forge
282308
neoforge
283309
files: |
284310
./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-mod.jar
@@ -298,11 +324,41 @@ jobs:
298324
version: ${{ github.event.inputs.tag }}
299325
changelog-file: CHANGES.md
300326

327+
dependencies: |
328+
pehkui(optional){curseforge:319596}
301329
loaders: |
302330
datapack
303331
files: |
304332
./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-datapack.zip
305333
334+
- name: Upload Forge mod version to CurseForge # Same reason as above
335+
id: upload_forge_curseforge_mod
336+
uses: Kir-Antipov/mc-publish@v3.3
337+
if: steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == 'false'
338+
with:
339+
curseforge-id: 1223719
340+
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
341+
game-versions: |
342+
>=1.17 <=1.21.5
343+
game-version-filter: any
344+
fail-mode: skip
345+
346+
name: "Release v${{ github.event.inputs.tag }}"
347+
version: ${{ github.event.inputs.tag }}+mod
348+
changelog-file: CHANGES.md
349+
350+
dependencies: |
351+
catalogue(optional){curseforge:459701}
352+
midnightlib(optional){curseforge:488090}
353+
pehkui(optional){curseforge:319596}
354+
java: |
355+
Java 21
356+
Java 17
357+
loaders: |
358+
forge
359+
files: |
360+
./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-mod.jar
361+
306362
- name: Upload mod version to CurseForge
307363
id: upload_curseforge_mod
308364
uses: Kir-Antipov/mc-publish@v3.3
@@ -321,13 +377,13 @@ jobs:
321377
dependencies: |
322378
catalogue(optional){curseforge:459701}
323379
midnightlib(optional){curseforge:488090}
380+
pehkui(optional){curseforge:319596}
324381
java: |
325382
Java 21
326383
Java 17
327384
loaders: |
328385
fabric
329386
quilt
330-
forge
331387
neoforge
332388
files: |
333389
./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-mod.jar
@@ -400,6 +456,6 @@ jobs:
400456
<img alt="❌ Error" src="https://raw.githubusercontent.com/Mqxx/GitHub-Markdown/main/blockquotes/badge/dark-theme/error.svg">
401457
</picture><br>
402458
403-
The publish job for v${{ github.event.inputs.tag }} (mc${{ env.MC_HUMAN_VERSION_RANGE }}) failed! Please check the action logs for details.
459+
The publish job for **v${{ github.event.inputs.tag }}** (Minecraft ${{ env.MC_HUMAN_VERSION_RANGE }}) failed! Please check the action logs for details.
404460
EOF
405461
fi

CHANGES.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
- **Entities with emissive layers are now properly hidden** (Endermen, Spiders, and Cave Spiders) (closes [#25](https://github.com/Tschipcraft/spawnanimations/issues/25))
1+
- **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
33
- 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))
4-
- 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!)
5-
- 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
7-
- 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
10-
- Fixed possibility for hidden falling mobs to lose their fall distance NBT when appearing
11-
- Fixed v0 save format not correctly upgrading to v1 from 24w11a to 24w20a, affecting major releases 1.20.5 and 1.20.6
4+
- Improved performance by refactoring entity activation distance calculations to bundle and cache position data retrieval calls and by updating batch activation logic. The whole project is now up to 45% faster per tick!
5+
- 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+
- Added an activation distance recommendation message when using the Vanilla activation mode
7+
- Fixed most compatibility issues with [Hostile Mobs Improve Over Time](https://modrinth.com/project/ku4JD9TH) by adding missing tag recovery logic when preparing an entity for hiding. This should generally improve compatibility with other packs that override entity tags (closes [#26](https://github.com/Tschipcraft/spawnanimations/issues/26))
8+
- Fixed poof animation playing multiple times when "Play Animation on Unsupported Blocks" is off
9+
- Fixed possibility of hidden falling mobs losing their fall distance NBT when appearing
10+
- Fixed v0 save format not correctly upgrading to v1 in 1.20.5 and 1.20.6 (precisely from 24w11a to 24w20a)
1211
- Changed exclude tag from `exclude` to `ts.sa.exclude`
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
## by Tschipcraft
22
# Prepares an entity for hiding
33

4+
# Recover entity tags that may have been removed by other mods/data packs (Issue #26)
5+
execute as @s[scores={ts.sa.timer=-300..99}] run function spawnanimations:internal/animation/dig_up/recover_tags/animating
6+
execute as @s[scores={ts.sa.e.nbt.Sil=0},tag=!ts.sa.verify] run function spawnanimations:internal/animation/dig_up/recover_tags/hidden
7+
tag @s[scores={ts.sa.timer=100}] add ts.sa.verified
8+
49
# Exclude entities that have the glowing, levitation or invisibility potion effect, are riding another entity, or are burning
5-
execute as @s[predicate=!spawnanimations:exclude] run tag @s add ts.sa.verified
10+
execute as @s[tag=!ts.sa.verify,tag=!ts.sa.to_verify,predicate=!spawnanimations:exclude] run tag @s add ts.sa.verified
11+
612
# Exclude silent or no AI mobs
7-
execute as @s[tag=!ts.sa.verified,nbt={Silent:1b}] run tag @s add ts.sa.verified
8-
execute as @s[tag=!ts.sa.verified,nbt={NoAI:1b}] run tag @s add ts.sa.verified
13+
execute as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify,nbt={Silent:1b}] run tag @s add ts.sa.verified
14+
execute as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify,nbt={NoAI:1b}] run tag @s add ts.sa.verified
915

1016
# Hide the entity
11-
execute as @s[tag=!ts.sa.verified] run function spawnanimations:internal/entity/hide
17+
execute as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify] run function spawnanimations:internal/entity/hide
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
##by Tschipcraft
2+
# Recovers entity tags that were removed by other mods/data packs during the dig up animation
3+
4+
# We set every possible tag an entity in this state might have in hope that we can properly recover it
5+
tag @s add ts.sa.verify
6+
tag @s add ts.sa.protected
7+
8+
tag @s add ts.sa.hidden
9+
execute if score $hide_armor ts.sa.settings matches 1..2 run tag @s[type=#spawnanimations:can_wear_armor,predicate=spawnanimations:validate/save_format] add ts.sa.ehs.saved
10+
execute if score $hide_emissive ts.sa.settings matches 1..2 run tag @s[type=#spawnanimations:has_emissive_layer] add ts.sa.ehs.shrunk
11+
execute if score $hide_emissive ts.sa.settings matches 1..2 run tag @s add ts.sa.ehs.pehkui.shrunk
12+
execute if score $enderman_hack ts.sa.settings matches 1..2 run tag @s[type=minecraft:enderman] add ts.sa.ehs.pehkui.hitbox
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
##by Tschipcraft
2+
# Recovers entity tags that were removed by other mods/data packs when hidden
3+
4+
# We set every possible tag an entity in this state might have in hope that we can properly recover it
5+
tag @s add ts.sa.to_verify
6+
7+
tag @s add ts.sa.hidden
8+
execute if score $hide_armor ts.sa.settings matches 1..2 run tag @s[type=#spawnanimations:can_wear_armor,predicate=spawnanimations:validate/save_format] add ts.sa.ehs.saved
9+
execute if score $hide_emissive ts.sa.settings matches 1..2 run tag @s[type=#spawnanimations:has_emissive_layer] add ts.sa.ehs.shrunk
10+
execute if score $hide_emissive ts.sa.settings matches 1..2 run tag @s add ts.sa.ehs.pehkui.shrunk
11+
execute if score $enderman_hack ts.sa.settings matches 1..2 run tag @s[type=minecraft:enderman] add ts.sa.ehs.pehkui.hitbox

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ tag @s add ts.sa.verified
44
tag @s remove ts.sa.verify
55

66
# Reset entity info
7+
scoreboard players set @s ts.sa.timer 100
78
scoreboard players reset @s ts.sa.e.y
89
scoreboard players reset @s ts.sa.e.stage
910
scoreboard players reset @s ts.sa.e.speed

data/spawnanimations/function/internal/entity/ehs/conflict/resolve.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ data modify storage spawnanimations:temp equipment set value {}
77
data modify storage spawnanimations:temp equipment set from entity @s equipment
88

99
# Build entity data
10-
data modify storage spawnanimations:temp equipment_build set value {body:{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:2,TsSaRemove:1b}}}}],"minecraft:enchantments":{"minecraft:vanishing_curse":1},"minecraft:custom_data":{TsSaRemove:1b}}}}
10+
data modify storage spawnanimations:temp equipment_build set value {body:{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:2,TsSaRemove:1b}}}}],"minecraft:custom_data":{TsSaRemove:1b}}}}
1111
data modify storage spawnanimations:temp equipment_build.body merge from storage spawnanimations:temp equipment.body
1212

1313
# Save new Armor Items

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data modify storage spawnanimations:temp equipment set value {}
88
data modify storage spawnanimations:temp equipment set from entity @s equipment
99

1010
# Build entity data
11-
data modify storage spawnanimations:temp equipment_build set value {body:{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:2,TsSaRemove:1b}}}}],"minecraft:enchantments":{"minecraft:vanishing_curse":1},"minecraft:custom_data":{TsSaRemove:1b}}}}
11+
data modify storage spawnanimations:temp equipment_build set value {body:{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:2,TsSaRemove:1b}}}}],"minecraft:custom_data":{TsSaRemove:1b}}}}
1212

1313
# Copy Armor Items in correct order
1414
execute if data storage spawnanimations:temp equipment.feet.id run function spawnanimations:internal/entity/ehs/build_data_entry/armor_0

data/spawnanimations/function/reset.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ execute as @e[tag=ts.sa.to_hide] run function spawnanimations:internal/entity/eh
55
# Remove animation trigger
66
execute as @e[tag=ts.sa.to_verify] at @s run function spawnanimations:internal/animation/dig_up/verify_in_air
77
# Cancel animation
8-
execute as @e[tag=ts.sa.verify] store result entity @s Pos[1] double 0.01 run scoreboard players get @s ts.sa.e.y
8+
execute as @e[tag=ts.sa.verify,scores={ts.sa.e.y=-2147483648..2147483647}] store result entity @s Pos[1] double 0.01 run scoreboard players get @s ts.sa.e.y
99
execute as @e[tag=ts.sa.verify] at @s run function spawnanimations:internal/animation/dig_up/verify_in_air
1010

1111
# Reset checked items
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
## by Tschipcraft
22
# Prepares an entity for hiding
33

4+
# Recover entity tags that may have been removed by other mods/data packs (Issue #26)
5+
execute as @s[scores={ts.sa.timer=-300..99}] run function spawnanimations:internal/animation/dig_up/recover_tags/animating
6+
execute as @s[scores={ts.sa.e.nbt.Sil=0},tag=!ts.sa.verify] run function spawnanimations:internal/animation/dig_up/recover_tags/hidden
7+
tag @s[scores={ts.sa.timer=100}] add ts.sa.verified
8+
49
# Exclude entities that have the glowing, levitation or invisibility potion effect, are riding another entity, or are burning
5-
execute as @s[predicate=!spawnanimations:exclude] run tag @s add ts.sa.verified
10+
execute as @s[tag=!ts.sa.verify,tag=!ts.sa.to_verify,predicate=!spawnanimations:exclude] run tag @s add ts.sa.verified
11+
612
# Exclude silent or no AI mobs
7-
execute as @s[tag=!ts.sa.verified,nbt={Silent:1b}] run tag @s add ts.sa.verified
8-
execute as @s[tag=!ts.sa.verified,nbt={NoAI:1b}] run tag @s add ts.sa.verified
13+
execute as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify,nbt={Silent:1b}] run tag @s add ts.sa.verified
14+
execute as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify,nbt={NoAI:1b}] run tag @s add ts.sa.verified
915

1016
# Hide the entity
11-
execute as @s[tag=!ts.sa.verified] run function spawnanimations:internal/entity/hide
17+
execute as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify] run function spawnanimations:internal/entity/hide

0 commit comments

Comments
 (0)