Changes

26 bytes removed ,  12:25, 18 December 2021
m
→‎Using Tags In Code: use tip template instead of custom colored box template
Line 21: Line 21:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
{{Colored box|title=tip|content=The <code><nowiki>TagCollection</nowiki></code> returned by <code><nowiki>#getAllTags</nowiki></code> (and the <code><nowiki>Tag</nowiki></code>s within it) may expire if a reload happens, so you should always query the collection anew every time you need it. The static <code><nowiki>Tag$Named</nowiki></code> fields in <code><nowiki>BlockTags</nowiki></code> and <code><nowiki>ItemTags</nowiki></code> avoid this by introducing a wrapper that handles this expiring. Alternatively, a resource reload listener can be used to refresh any cached tags.}}
+
{{Tip|The <code><nowiki>TagCollection</nowiki></code> returned by <code><nowiki>#getAllTags</nowiki></code> (and the <code><nowiki>Tag</nowiki></code>s within it) may expire if a reload happens, so you should always query the collection anew every time you need it. The static <code><nowiki>Tag$Named</nowiki></code> fields in <code><nowiki>BlockTags</nowiki></code> and <code><nowiki>ItemTags</nowiki></code> avoid this by introducing a wrapper that handles this expiring. Alternatively, a resource reload listener can be used to refresh any cached tags.}}
    
== Conventions ==
 
== Conventions ==
297

edits