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
2 changes: 1 addition & 1 deletion .spyglassrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"env": {
"gameVersion": "1.21.11"
"gameVersion": "26.1"
}
}
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 rain detection to use our own `#is_dry` biome tag combo instead of the now removed `#snow_golem_melts` tag
- Removed broken hide feedback code for 1.21+
- **Added support for Minecraft 26.1.x** 🐤
- Updated night detection to use the new `minecraft:overworld` world clock
- Added router to handle [unobfuscated code](https://www.minecraft.net/en-us/article/removing-obfuscation-in-java-edition)
- Bumped pack format and protocol version
2 changes: 1 addition & 1 deletion data/more_mobs/function/version_checker.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

scoreboard objectives add ts.mm.version dummy
execute store result score $global ts.mm.version run data get entity @r DataVersion
execute unless score $global tvc_ignore matches 1 if score $global ts.mm.version matches 4700.. run tellraw @a [{"text":"[More Mobs] ","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 $global ts.mm.version matches 4800.. run tellraw @a [{"text":"[More Mobs] ","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.14x-1.20x uses the old folder names (function -> functions)

# Announce version limitations
Expand Down
1 change: 1 addition & 0 deletions data/more_mobs/predicate/full_moon.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"//comment": "This predicate is currently not used by the data pack, but may come in handy if I decide to do something with it",
"condition": "minecraft:time_check",
"clock": "minecraft:overworld",
"value": {
"min": 14000,
"max": 22000
Expand Down
1 change: 1 addition & 0 deletions data/more_mobs/predicate/is_night.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"condition": "minecraft:time_check",
"clock": "minecraft:overworld",
"value": {
"min": 12542,
"max": 23460
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.2.7",
"java": ">=8"
},
"recommends": {
Expand Down
Binary file modified net/tschipcraft/moremobs/fabric/Init.class
Binary file not shown.
Binary file modified net/tschipcraft/moremobs/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": "moremobs",
"pack": {
"pack_format": 15,
"supported_formats": [4,94],
"supported_formats": [4,101],
"min_format": 4,
"max_format": 94,
"max_format": 101,
"description": "Tschipcraft's More Mobs \n└ v${version} ● mc${mc_human_version_range}"
},
"overlays": {
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/net/tschipcraft/moremobs/fabric/Init.java
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("[More Mobs] 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
6 changes: 3 additions & 3 deletions src/main/java/net/tschipcraft/moremobs/fabric/sendConfig.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package net.tschipcraft.moremobs.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 @@ -64,9 +64,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
74 changes: 74 additions & 0 deletions src/main/java/net/tschipcraft/moremobs/fabric/sendConfigObf.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package net.tschipcraft.moremobs.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.mm.settings dummy", server);
if (Config.enable_heads == Config.bool.YES) {
sendCommand("scoreboard players set $enable_heads ts.mm.settings 2", server);
} else if (Config.enable_heads == Config.bool.NO) {
sendCommand("scoreboard players set $enable_heads ts.mm.settings -1", server);
} else {
sendCommand("execute if score $enable_heads ts.mm.settings matches -1 run scoreboard players set $enable_heads ts.mm.settings 0", server);
sendCommand("execute if score $enable_heads ts.mm.settings matches 2 run scoreboard players set $enable_heads ts.mm.settings 1", server);
}

if (Config.enable_head_drops == Config.bool.YES) {
sendCommand("scoreboard players set $head_drops ts.mm.settings 2", server);
} else if (Config.enable_head_drops == Config.bool.NO) {
sendCommand("scoreboard players set $head_drops ts.mm.settings -1", server);
} else {
sendCommand("execute if score $head_drops ts.mm.settings matches -1 run scoreboard players set $head_drops ts.mm.settings 0", server);
sendCommand("execute if score $head_drops ts.mm.settings matches 2 run scoreboard players set $head_drops ts.mm.settings 1", server);
}

if (Config.enable_additional_loot == Config.bool.YES) {
sendCommand("scoreboard players set $loot ts.mm.settings 2", server);
} else if (Config.enable_additional_loot == Config.bool.NO) {
sendCommand("scoreboard players set $loot ts.mm.settings -1", server);
} else {
sendCommand("execute if score $loot ts.mm.settings matches -1 run scoreboard players set $loot ts.mm.settings 0", server);
sendCommand("execute if score $loot ts.mm.settings matches 2 run scoreboard players set $loot ts.mm.settings 1", server);
}

if (Config.enable_additional_valuable_loot == Config.bool.YES) {
sendCommand("scoreboard players set $val_loot ts.mm.settings 2", server);
} else if (Config.enable_additional_valuable_loot == Config.bool.NO) {
sendCommand("scoreboard players set $val_loot ts.mm.settings -1", server);
} else {
sendCommand("execute if score $val_loot ts.mm.settings matches -1 run scoreboard players set $val_loot ts.mm.settings 0", server);
sendCommand("execute if score $val_loot ts.mm.settings matches 2 run scoreboard players set $val_loot ts.mm.settings 1", server);
}

if (Config.enable_upside_down_spiders == Config.bool.YES) {
sendCommand("scoreboard players set $upsided_s ts.mm.settings 2", server);
} else if (Config.enable_upside_down_spiders == Config.bool.NO) {
sendCommand("scoreboard players set $upsided_s ts.mm.settings -1", server);
} else {
sendCommand("execute if score $upsided_s ts.mm.settings matches -1 run scoreboard players set $upsided_s ts.mm.settings 0", server);
sendCommand("execute if score $upsided_s ts.mm.settings matches 2 run scoreboard players set $upsided_s ts.mm.settings 1", server);
}

if (Config.enable_let_undead_mobs_burn_in_daylight == Config.bool.YES) {
sendCommand("scoreboard players set $mobs_burn ts.mm.settings 2", server);
} else if (Config.enable_let_undead_mobs_burn_in_daylight == Config.bool.NO) {
sendCommand("scoreboard players set $mobs_burn ts.mm.settings -1", server);
} else {
sendCommand("execute if score $mobs_burn ts.mm.settings matches -1 run scoreboard players set $mobs_burn ts.mm.settings 0", server);
sendCommand("execute if score $mobs_burn ts.mm.settings matches 2 run scoreboard players set $mobs_burn ts.mm.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) {
}
}

}