Skip to content

Commit

Permalink
Fixed logic and use minecraft constant
Browse files Browse the repository at this point in the history
  • Loading branch information
TelepathicGrunt committed Sep 13, 2023
1 parent fba9b14 commit b794e98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.List;

import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -56,7 +57,7 @@ private static void setupUntranslatedItemTagWarning() {
List<TagKey<Item>> untranslatedItemTags = new ObjectArrayList<>();
itemRegistry.streamTags().forEach(itemTagKey -> {
// We do not translate vanilla's tags at this moment.
if (itemTagKey.id().getNamespace().equals("minecraft")) {
if (itemTagKey.id().getNamespace().equals(Identifier.DEFAULT_NAMESPACE)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static String getTagTranslationKey(TagKey<?> tagKey) {
Identifier registryIdentifier = tagKey.registry().getValue();
Identifier tagIdentifier = tagKey.id();

if (registryIdentifier.getNamespace().equals("minecraft")) {
if (!registryIdentifier.getNamespace().equals(Identifier.DEFAULT_NAMESPACE)) {
stringBuilder.append(registryIdentifier.getNamespace())
.append(".");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.List;

import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -54,7 +55,7 @@ private static void setupLegacyTagWarning() {

// We only care about vanilla registries
dynamicRegistries.streamAllRegistries().forEach(registryEntry -> {
if (registryEntry.key().getValue().getNamespace().equals("minecraft")) {
if (registryEntry.key().getValue().getNamespace().equals(Identifier.DEFAULT_NAMESPACE)) {
registryEntry.value().streamTags().forEach(tagKey -> {
// Grab tags under 'c' namespace
if (tagKey.id().getNamespace().equals("c")) {
Expand Down

0 comments on commit b794e98

Please sign in to comment.