Skip to content

Commit

Permalink
Add parseNbtString to ScriptResourceUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
zbx1425 committed Aug 15, 2023
1 parent 00cf1f8 commit 75e8ae7
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import cn.zbx1425.mtrsteamloco.mixin.ClientCacheAccessor;
import cn.zbx1425.mtrsteamloco.render.integration.MtrModelRegistryUtil;
import cn.zbx1425.sowcerext.util.ResourceUtil;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import mtr.client.ClientData;
import mtr.mappings.Utilities;
import net.minecraft.client.Minecraft;
Expand All @@ -13,6 +14,8 @@
#else
import net.minecraft.core.Registry;
#endif
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.TagParser;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.ResourceManager;

Expand Down Expand Up @@ -84,6 +87,10 @@ public static int getParticleTypeId(ResourceLocation identifier) {
#endif
}

public static CompoundTag parseNbtString(String text) throws CommandSyntaxException {
return TagParser.parseTag(text);
}

public static String getMTRVersion() {
String mtrModVersion;
try {
Expand Down

0 comments on commit 75e8ae7

Please sign in to comment.