fonnymunkey / RLMixins

Many tweaks, patches, and additions for the modpack RLCraft.
MIT License
5 stars 7 forks source link

Fix Waystones' NameGenerator mixin #15

Closed Meldexun closed 4 months ago

Meldexun commented 4 months ago

The NameGenerator mixin calls rlmixins$usedNamesMap.getInt(name) to get how often a name has been used, then appends that number to the name and then calls this.rlmixins$usedNamesMap.put(name, count+1) to update how often the name has been used. The problem is that it uses the "base" name without any number appended when calling getInt but then uses the name with the number appended when calling put. This results in the getName method always returning the base name with one appended when the base name has been used one or more times.

This PR fixes this issue and also fixes the result of the GenerateWaystoneNameEvent being ignored.

fonnymunkey commented 4 months ago

I had previously populated the map before appending the number, moved it for testing, and forgot to move it back, woops.

The problem with the event result being used as it is, means if any mod changes the name it will likely have the number afterwards, nullifying the point of the mixin, but I guess I could only find RLTweaker and Xaeros using the event so it shouldn't be too big of an issue.