Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jchung01 opened this issue Mar 18, 2024 · 3 comments
Labels
legacy Anything older than 1.16

Comments

@jchung01
Copy link

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.

@tr7zw
Copy link
Owner

tr7zw commented Mar 18, 2024

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.

@jchung01
Copy link
Author

jchung01 commented Mar 18, 2024

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.

@tr7zw tr7zw added the legacy Anything older than 1.16 label Jun 13, 2024
@Akiba275
Copy link

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. : (

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy Anything older than 1.16
Projects
None yet
Development

No branches or pull requests

3 participants