COSTAR
COSTAR is a simple mod for 1.9.0-1.12.0 that fixes the blockentity names in the pie chart when using Fabric. In those versions, Mojang made a questionable design decision to use reflection to set the names of the entries in the profiler in the pie-ray directory (root.tick.level.entities.blockEntities). Specifically, they use Class#getSimpleName to get the name of class of the blockentity, which is normally an obfuscated 2-3 letter sequence, ex. avs. However, to allow mods to work across minor versions Fabric Loader renames all obfuscated symbols to stable names, changing class names to the form of “class_[1-5 numbers]”, and because of the game using reflection, these new names show up in the profiler. This matters because colors of entries in the profiler are set via a hash of their name, and the color changes from Fabric’s class renaming make it easier to differentiate furnaces (which mean blacksmiths) (see image 2). COSTAR reverses the mapping process to replace the intermediary names with the original obfuscated names in the profiler, masking the fact that the blockentity classes were renamed at all and matching vanilla behavior. This issue was fixed in vanilla in 1.12.1-pre1 as MC-117087 because using reflection to get the names, besides being a bad design decision in terms of usability, could also cause a large performance hit.
Images
Vanilla / Fabric with COSTAR
Fabric without COSTAR
Name
The name is taken from the COSTAR instrument on the Hubble Space Telescope. It stands for “Corrective Optics Space Telescope Axial Replacement,” and it was added to the telescope to fix a mirror manufacturing issue which was causing optical aberration[1]. Therefore, the name is related to an fixing an issue with reflection (just in code instead of a literal mirror). It also follows in the tradition of the space-themed bug fix mod names of Voyager, Voyager II, and New Horizons.
Development
This mod was made by @tildejustin.
Source code: https://github.com/tildejustin/costar
Modrinth: https://modrinth.com/mod/costar
Changelog
v1.0.2 fixed a synchronization issue where placing a block entity that had not been profiled before would throw a ConcurrentModificationException because HashMap#computeIfAbsent was being called on the server and client at the same time and is not thread-safe.
v1.0.1 fixed an issue with an incorrect unspecified profiler section size due to Class#getName being slower than Class#getSimpleName by caching the correct name the first time it was calculated and burning a call to Class#getSimpleName and then pulling from the cache every time afterwards.

