EntityCulling icon indicating copy to clipboard operation
EntityCulling copied to clipboard

Beacon not properly whitelisted because config requires localized name [1.12.2]

Open jchung01 opened this issue 2 years ago • 3 comments

With just this mod, the beacon's beam will be culled because the expected format in the config's whitelist is wrong. According to the line here, the block entity whitelist in the config uses the localized name of the tile entity. Perhaps you meant to use Block#getTranslationKey(), which gives you the "unlocalized" name with tile. prepended to it? This would allow the default tile.beacon to properly be whitelisted. I believe another option would be to get the tile entity name from its registry, which would instead align the format with the modern versions of this mod, using modid:tile_entity_name.

jchung01 avatar Mar 18 '24 04:03 jchung01

I'll be honest, this code is really old and not too much tested(just that it basically works), and the 1.8/1.12 version(same source code more or less) have a few oddities, having to use the translationkey being one of them. At least in 1.8 I wasn't able to find anything that looked like the normal minecraft:beacon syntax, so I just assumed that 1.8/1.12 don't use namespace keys yet. Getting keys from a registry sounds a bit expensive, might need to build a cache on the fly. Will check whats going on with beacons later.

tr7zw avatar Mar 18 '24 15:03 tr7zw

To clarify, in its current state, the beacon will get correctly whitelisted if in the config it is Beacon instead of tile.beacon. Using the beacon as an example, here's what I believe are the correct ways to get the names for the following formats (entry being the tile entity):

  • Beacon = entry.getBlockType().getLocalizedName(): This is the current behavior, whitelists by localized name
  • tile.beacon = entry.getBlockType().getTranslationKey(): Whitelists by unlocalized name
  • minecraft:beacon = entry.getBlockType().getRegistryName().toString(): IForgeRegistryEntry.Impl#getRegistryName() is a Forge method, whitelists by the modid:block_name format. I don't believe this is expensive, as it is just getting the resource location from the Block's superclass Impl's instance variable delegate.

jchung01 avatar Mar 18 '24 19:03 jchung01

I'm having a similar problem, in minecraft 1.12.2 the mod skips the rendering of Tinker's Construct 2's smeltery and tinker tanks, which are tile entities that will render stored fluids, and I have no idea how to add them to the whitelist. : (

Akiba275 avatar Aug 22 '24 05:08 Akiba275