Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ on:
required: false
default: false
type: boolean
separate_forge:
description: 'If false, separate Modrinth Forge mod version will not be uploaded'
required: false
default: true
type: boolean

jobs:
deploy:
Expand Down Expand Up @@ -257,7 +262,7 @@ jobs:
- 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
id: upload_forge_modrinth_mod
uses: Kir-Antipov/mc-publish@v3.3
if: steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == 'false'
if: steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == 'false' && github.event.inputs.separate_forge == 'true'
with:
modrinth-id: zrzYrlm0
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- **Added support for Minecraft 1.21.11** 🐎
- Updated to work with the new gamerule names
- Removed broken hide feedback code for 1.21+
- **Added support for Minecraft 26.1** 🐤
- Migrated `#bamboo_plantable_on` references to `#supports_vegetation`
- Added router to handle [unobfuscated code](https://www.minecraft.net/en-us/article/removing-obfuscation-in-java-edition)
- Bumped pack format and protocol version
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Sand
execute if block ~ ~ ~ #minecraft:sand run particle block{block_state:"minecraft:sand"} ~ ~1 ~ 1.5 0 1.5 1 30 normal
# Dirt
execute if block ~ ~ ~ #minecraft:bamboo_plantable_on unless block ~ ~ ~ #minecraft:sand run particle block{block_state:"minecraft:dirt"} ~ ~1 ~ 1.5 0 1.5 1 30 normal
execute if block ~ ~ ~ #spawnanimations:dirt unless block ~ ~ ~ #minecraft:sand run particle block{block_state:"minecraft:dirt"} ~ ~1 ~ 1.5 0 1.5 1 30 normal
# Wood
execute if block ~ ~ ~ #minecraft:planks run particle block{block_state:"minecraft:oak_planks"} ~ ~1 ~ 1.5 0 1.5 1 30 normal
execute if block ~ ~ ~ #minecraft:logs run particle block{block_state:"minecraft:oak_log"} ~ ~1 ~ 1.5 0 1.5 1 30 normal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ execute if block ~ ~ ~ #minecraft:sand unless block ~ ~ ~ minecraft:red_sand run
execute if block ~ ~ ~ minecraft:red_sand run particle block{block_state:"minecraft:red_sand"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~ ~ minecraft:sandstone run particle block{block_state:"minecraft:sandstone"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
# Dirt
execute if block ~ ~ ~ #minecraft:bamboo_plantable_on unless block ~ ~ ~ #minecraft:sand unless block ~ ~0.2 ~ minecraft:gravel run particle block{block_state:"minecraft:dirt"} ~ ~ ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~ ~ #spawnanimations:dirt unless block ~ ~ ~ #minecraft:sand unless block ~ ~0.2 ~ minecraft:gravel run particle block{block_state:"minecraft:dirt"} ~ ~ ~ 0.1 0 0.1 1 9 normal
# Wood
execute if block ~ ~ ~ #minecraft:planks run particle block{block_state:"minecraft:oak_planks"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~ ~ #minecraft:logs run particle block{block_state:"minecraft:oak_log"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
execute if block ~ ~ ~ #minecraft:sand run playsound minecraft:block.sand.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ sandstone run playsound minecraft:block.stone.break hostile @a ~ ~ ~ 0.85 0.6
# Dirt
execute if block ~ ~ ~ #minecraft:bamboo_plantable_on unless block ~ ~ ~ #minecraft:sand unless block ~ ~0.2 ~ minecraft:snow run playsound minecraft:block.gravel.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ #spawnanimations:dirt unless block ~ ~ ~ #minecraft:sand unless block ~ ~0.2 ~ minecraft:snow run playsound minecraft:block.gravel.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ minecraft:gravel unless block ~ ~ ~ #spawnanimations:dirt unless block ~ ~0.2 ~ minecraft:snow run playsound minecraft:block.gravel.break hostile @a ~ ~ ~ 0.85 0.6
# Wood
execute if block ~ ~ ~ #minecraft:planks run playsound minecraft:block.wood.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ #minecraft:logs run playsound minecraft:block.wood.break hostile @a ~ ~ ~ 0.85 0.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
execute if block ~ ~ ~ #minecraft:sand run playsound minecraft:block.sand.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ sandstone run playsound minecraft:block.stone.break hostile @a ~ ~ ~ 0.85 0.9
# Dirt
execute if block ~ ~ ~ #minecraft:bamboo_plantable_on unless block ~ ~ ~ #minecraft:sand run playsound minecraft:block.gravel.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ #spawnanimations:dirt unless block ~ ~ ~ #minecraft:sand run playsound minecraft:block.gravel.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ minecraft:gravel unless block ~ ~ ~ #spawnanimations:dirt run playsound minecraft:block.gravel.break hostile @a ~ ~ ~ 0.85 0.9
# Wood
execute if block ~ ~ ~ #minecraft:planks run playsound minecraft:block.wood.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ #minecraft:logs run playsound minecraft:block.wood.break hostile @a ~ ~ ~ 0.85 0.9
Expand All @@ -28,8 +29,8 @@ execute if block ~ ~ ~ minecraft:end_stone run playsound minecraft:block.stone.b

# Nether
execute if block ~ ~ ~ #minecraft:base_stone_nether run playsound minecraft:block.netherrack.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ minecraft:nether_bricks run playsound minecraft:block.nether_bricks.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ #minecraft:nylium run playsound minecraft:block.wart_block.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ minecraft:nether_bricks run playsound minecraft:block.nether_bricks.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ #minecraft:soul_fire_base_blocks run playsound minecraft:block.soul_sand.break hostile @a ~ ~ ~ 0.85 0.9

execute if block ~ ~ ~ minecraft:lava run playsound minecraft:block.lava.pop hostile @a ~ ~ ~ 0.85 0.9
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##by Tschipcraft

execute store result score $version ts.sa.settings run data get entity @r DataVersion
execute unless score $global tvc_ignore matches 1 if score $version ts.sa.settings matches 4700.. run tellraw @a [{"text":"[Spawn Animations] ","color":"gray"},{"text":"?","bold":true,"color":"gold"},{"text":" Future unknown Minecraft version above 1.21.11 detected! This data pack/mod may not work correctly anymore! Please make sure to check for updates in the menu! (","color":"gold"},{"text":"/trigger tschipcraft.menu","underlined":true,"color":"gold","click_event":{"action":"run_command","command":"trigger tschipcraft.menu"},"hover_event":{"action":"show_text","value":"Click here","text":"Click here"}},{"text":")","color":"gold"}]
execute unless score $global tvc_ignore matches 1 if score $version ts.sa.settings matches 4800.. run tellraw @a [{"text":"[Spawn Animations] ","color":"gray"},{"text":"?","bold":true,"color":"gold"},{"text":" Future unknown Minecraft version above 26.1 detected! This data pack/mod may not work correctly anymore! Please make sure to check for updates in the menu! (","color":"gold"},{"text":"/trigger tschipcraft.menu","underlined":true,"color":"gold","click_event":{"action":"run_command","command":"trigger tschipcraft.menu"},"hover_event":{"action":"show_text","value":"Click here","text":"Click here"}},{"text":")","color":"gold"}]
# Note: 1.17x-1.20x uses the old folder names (function -> functions)

# Announce escape sequence handling changes
Expand Down
7 changes: 7 additions & 0 deletions data/spawnanimations/tags/block/dirt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
{"id": "#minecraft:bamboo_plantable_on", "required": false},
{"id": "#minecraft:supports_vegetation", "required": false}
]
}
2 changes: 1 addition & 1 deletion data/spawnanimations/tags/block/supported.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"values": [
"#minecraft:sand",
"minecraft:sandstone",
"#minecraft:bamboo_plantable_on",
"#spawnanimations:dirt",
"#minecraft:planks",
"#minecraft:logs",
"#minecraft:leaves",
Expand Down
1 change: 0 additions & 1 deletion fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
},
"depends": {
"minecraft": "${mc_version_range_fabric}",
"fabric": ">=0.34.0",
"java": ">=8"
},
"recommends": {
Expand Down
Binary file modified net/tschipcraft/spawnanimations/fabric/Init.class
Binary file not shown.
Binary file modified net/tschipcraft/spawnanimations/fabric/sendConfig.class
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"id": "spawnanimations",
"pack": {
"pack_format": 15,
"supported_formats": [7, 94],
"supported_formats": [7, 101],
"min_format": 7,
"max_format": 94,
"max_format": 101,
"description": "Tschipcraft's Spawn Animations\n└ v${version} ● mc${mc_human_version_range}"
},
"overlays": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ public void onInitialize() {
if (FabricLoader.getInstance().isModLoaded("midnightlib")) {
// Use MidnightLib features
LOGGER.info("[Spawn Animations] Sending global config to world ...");
sendConfig.sendConfig(server);
try {
// Check for obfuscated class name to determine if we're running a pre 26.1 version
Class.forName("net.minecraft.class_2168");
sendConfigObf.sendConfig(server);
} catch (ClassNotFoundException e) {
sendConfig.sendConfig(server);
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package net.tschipcraft.spawnanimations.fabric;

import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;

public class sendConfig {

Expand Down Expand Up @@ -39,6 +39,7 @@ public static void sendConfig(MinecraftServer server) {
} else {
sendCommand("execute if score $play_sounds ts.sa.settings matches -1 run scoreboard players set $play_sounds ts.sa.settings 0", server);
sendCommand("execute if score $play_sounds ts.sa.settings matches 2 run scoreboard players set $play_sounds ts.sa.settings 1", server);
}

if (Config.hide_worn_armor_and_tools == Config.bool.YES) {
sendCommand("scoreboard players set $hide_armor ts.sa.settings 2", server);
Expand Down Expand Up @@ -75,9 +76,9 @@ public static void sendConfig(MinecraftServer server) {
}

public static void sendCommand(String command, MinecraftServer server) {
ServerCommandSource commandSource = server.getCommandSource();
CommandSourceStack commandSource = server.createCommandSourceStack();
try {
server.getCommandManager().getDispatcher().execute(command, commandSource);
server.getCommands().getDispatcher().execute(command, commandSource);
} catch (CommandSyntaxException ignored) {
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package net.tschipcraft.spawnanimations.fabric;

import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;

public class sendConfigObf {

public static void sendConfig(MinecraftServer server) {
sendCommand("scoreboard objectives add ts.sa.settings dummy", server);

if (Config.activation_distance == 0) {
sendCommand("execute unless score $activation_dist ts.sa.settings matches 1..100 run scoreboard players set $activation_dist ts.sa.settings 20", server);
sendCommand("execute if score #lock_distance ts.sa.settings matches 1 run scoreboard players set #lock_distance ts.sa.settings 0", server);
} else {
sendCommand("scoreboard players set $activation_dist ts.sa.settings " + Config.activation_distance, server);
sendCommand("scoreboard players set #lock_distance ts.sa.settings 1", server);
}
if (Config.activation_mode == Config.mode.CLASSIC) {
sendCommand("scoreboard players set $activation_mode ts.sa.settings 2", server);
} else if (Config.activation_mode == Config.mode.VANILLA) {
sendCommand("scoreboard players set $activation_mode ts.sa.settings -1", server);
} else {
sendCommand("execute if score $activation_mode ts.sa.settings matches -1 run scoreboard players set $activation_mode ts.sa.settings 0", server);
sendCommand("execute if score $activation_mode ts.sa.settings matches 2 run scoreboard players set $activation_mode ts.sa.settings 1", server);
}
if (Config.enable_poof_animation == Config.bool.YES) {
sendCommand("scoreboard players set $enable_poof_anim ts.sa.settings 2", server);
} else if (Config.enable_poof_animation == Config.bool.NO) {
sendCommand("scoreboard players set $enable_poof_anim ts.sa.settings -1", server);
} else {
sendCommand("execute if score $enable_poof_anim ts.sa.settings matches -1 run scoreboard players set $enable_poof_anim ts.sa.settings 0", server);
sendCommand("execute if score $enable_poof_anim ts.sa.settings matches 2 run scoreboard players set $enable_poof_anim ts.sa.settings 1", server);
}
if (Config.play_animation_sounds == Config.bool.YES) {
sendCommand("scoreboard players set $play_sounds ts.sa.settings 2", server);
} else if (Config.play_animation_sounds == Config.bool.NO) {
sendCommand("scoreboard players set $play_sounds ts.sa.settings -1", server);
} else {
sendCommand("execute if score $play_sounds ts.sa.settings matches -1 run scoreboard players set $play_sounds ts.sa.settings 0", server);
sendCommand("execute if score $play_sounds ts.sa.settings matches 2 run scoreboard players set $play_sounds ts.sa.settings 1", server);
}

if (Config.hide_worn_armor_and_tools == Config.bool.YES) {
sendCommand("scoreboard players set $hide_armor ts.sa.settings 2", server);
} else if (Config.hide_worn_armor_and_tools == Config.bool.NO) {
sendCommand("scoreboard players set $hide_armor ts.sa.settings -1", server);
} else {
sendCommand("execute if score $hide_armor ts.sa.settings matches -1 run scoreboard players set $hide_armor ts.sa.settings 0", server);
sendCommand("execute if score $hide_armor ts.sa.settings matches 2 run scoreboard players set $hide_armor ts.sa.settings 1", server);
}
if (Config.hide_emissive_mob_layers == Config.bool.YES) {
sendCommand("scoreboard players set $hide_emissive ts.sa.settings 2", server);
} else if (Config.hide_emissive_mob_layers == Config.bool.NO) {
sendCommand("scoreboard players set $hide_emissive ts.sa.settings -1", server);
} else {
sendCommand("execute if score $hide_emissive ts.sa.settings matches -1 run scoreboard players set $hide_emissive ts.sa.settings 0", server);
sendCommand("execute if score $hide_emissive ts.sa.settings matches 2 run scoreboard players set $hide_emissive ts.sa.settings 1", server);
}
if (Config.reduce_enderman_particles == Config.bool.YES) {
sendCommand("scoreboard players set $enderman_hack ts.sa.settings 2", server);
} else if (Config.reduce_enderman_particles == Config.bool.NO) {
sendCommand("scoreboard players set $enderman_hack ts.sa.settings -1", server);
} else {
sendCommand("execute if score $enderman_hack ts.sa.settings matches -1 run scoreboard players set $enderman_hack ts.sa.settings 0", server);
sendCommand("execute if score $enderman_hack ts.sa.settings matches 2 run scoreboard players set $enderman_hack ts.sa.settings 1", server);
}
if (Config.play_animation_on_unsupported_blocks == Config.bool.YES) {
sendCommand("scoreboard players set $play_unsupport ts.sa.settings 2", server);
} else if (Config.play_animation_on_unsupported_blocks == Config.bool.NO) {
sendCommand("scoreboard players set $play_unsupport ts.sa.settings -1", server);
} else {
sendCommand("execute if score $play_unsupport ts.sa.settings matches -1 run scoreboard players set $play_unsupport ts.sa.settings 0", server);
sendCommand("execute if score $play_unsupport ts.sa.settings matches 2 run scoreboard players set $play_unsupport ts.sa.settings 1", server);
}
}

public static void sendCommand(String command, MinecraftServer server) {
ServerCommandSource commandSource = server.getCommandSource();
try {
server.getCommandManager().getDispatcher().execute(command, commandSource);
} catch (CommandSyntaxException ignored) {
}
}

}
Loading