replace_regex crashes game when attempting to use non-existent capture group
LyraelRayne opened this issue ยท 1 comments
Issue type:
- ๐ Bug
Short description:
replace_regex crashes game when attempting to use non-existent capture group
Steps to reproduce the problem:
In the logic programmer:
- Create string "." ("matcher")
- Create string "$1," ("replacer")
- Create string "xxoxxoooo" ("text")
- replace_regex(matcher, replacer, text)
- Put the cards in display panels
- Crash when the last card is placed
[09Dec2023 17:54:38.078] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception
java.lang.IndexOutOfBoundsException: n > number of groups: 1
See log for full stack trace.
Also note that when I reloaded my world, the display panels were still displaying the strings, but the cards were not in the display panels! I could no longer change the value of these display panels and had to break them.
Expected behaviour:
An error message in-game explaining why the regex match failed
Versions:
- This mod: 1.20.3
- Minecraft: 1.20.1
- Forge: 4.2.16