question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tag.contains() doesn't work with dynamic registry tags

See original GitHub issue

Here’s a simple test:

  1. Write the following code
Tag<Biome> biomeTag = TagFactory.BIOME.create(new Identifier("modid", "test"));
System.out.println(biomeTag.values().size()); //expected "1"

Biome biome1 = BuiltinRegistries.BIOME.get(BiomeKeys.BADLANDS); //in the tag
Biome biome2 = BuiltinRegistries.BIOME.get(BiomeKeys.JUNGLE); //not in the tag
System.out.println(biomeTag.contains(biome1)); //expected "true"
System.out.println(biomeTag.contains(biome2)); //expected "false"

System.out.println(biomeTag.values().get(0)); //expected "minecraft:badlands"
//see Biome's implementation of toString()
  1. Put the test.json tag file in the right place
{
  "replace": false,
  "values": [
    "minecraft:badlands"
  ]
}
  1. Read the output image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
Technici4ncommented, Aug 28, 2021

We need some protection mechanism against this. Perhaps we could throw an error if the wrong registry is used? Clearly this kind of issue will be frequent if we don’t do anything about it.

1reaction
LambdAuroracommented, Aug 28, 2021

To be honest, having to use the actual dynamic registry to get the references sounds the intended behavior to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom dynamic tag image doesn't work - WordPress.org
I have created a custom dynamic Tag of category image to show an image in the frontend. It doesn't seem to work. What...
Read more >
Dynamic tags overview (deprecated) - Help Center - WordFly
What is a dynamic tag? Dynamic tags allow you to personalize your email design with conditional statements. This is a valuable tool if...
Read more >
Click event doesn't work on dynamically generated elements
In jQuery, Click() event Direct binding which attaches the event handler to the element only if the particular element(Html code) exists on the...
Read more >
Google Ads dynamic remarketing - Tag Manager Help
You can also create triggers based on a custom event that register in Tag Manager via the Data Layer. Test and deploy. The...
Read more >
Dynamic Meters and Metrics with Micrometer | by Aviad Pines
This is a known issue, and Micrometer has open issues about it. Some solutions exist, like Hana Giat's Multi-Tagged Metrics, which I have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found