Integrated Dynamics

Integrated Dynamics

63M Downloads

replace_regex crashes game when attempting to use non-existent capture group

LyraelRayne opened this issue ยท 1 comments

commented

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:

  1. Create string "." ("matcher")
  2. Create string "$1," ("replacer")
  3. Create string "xxoxxoooo" ("text")
  4. replace_regex(matcher, replacer, text)
  5. Put the cards in display panels
  6. 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

Log file:

https://pastebin.com/LLS2NT2h

commented

Thanks for reporting!