Skip to content

Commit

Permalink
Change to detect new #c:tools/shields tag
Browse files Browse the repository at this point in the history
Tags were unified in 1.20.5 between mod loaders and now contain folders.
See PR: FabricMC/fabric#3310
Shield tag is now: #c:tools/shields
  • Loading branch information
MightyKnight committed Apr 24, 2024
1 parent 88d9260 commit 6903bad
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ private void hideShield(LivingEntity entity, ItemStack stack, ModelTransformatio
return;
}

// Block items in the tag "c:tools/shields" (>1.20.5)
if(Versioned.REGISTRY.stackHasTag(stack, new Identifier("c", "tools/shields"))) {
callback.cancel();
return;
}

// Block items in the item tag "c:shields"
// [LEGACY] This tag was changed to "c:tools/shields" in 1.20.5
if(Versioned.REGISTRY.stackHasTag(stack, new Identifier("c", "shields"))) {
callback.cancel();
return;
Expand All @@ -81,7 +88,7 @@ private void hideShield(LivingEntity entity, ItemStack stack, ModelTransformatio
for(String tagKey : ShieldDisruptor.getMain().getConfig().hiddenItems) {

// Validate tag to prevent crashes
if (!tagKey.matches("#[a-z0-9_.-]+:[a-z0-9_.-]+")) {
if (!tagKey.matches("#[a-z0-9_.-]+:[a-z0-9_.-/]+")) {
continue;
}

Expand Down

0 comments on commit 6903bad

Please sign in to comment.