ModTweaker

ModTweaker

88M Downloads

Lexicon.setEntryKnowledgeType is called out of order

lucidobservor opened this issue ยท 1 comments

commented

Issue Description:

When you make a call to Lexicon.addEntry, followed by a call to Lexicon.setEntryKnowledgeType, the call to setEntryKnowledgeType is always called first. This call then fails, because at the point of execution, addEntry has not yet been called.

As a suggested fix, Lexicon.setEntryKnowledgeType should add to the LATE_ADDITIONS list instead of the LATE_REMOVALS list.

What happens:

The call to Lexicon.setEntryKnowledgeType fails with the message "Cannot find lexicon entry ${entryName}". Later in the script, the entry ${entryName} is added without issue, but it has the default knowledge type.

What you expected to happen:

The call to addEntry should be executed first, followed by setEntryKnowledgeType, which should succeed.

Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):

https://gist.github.com/lucidobservor/8cd23b32a6036101a5afe34e0c78ac26

Minetweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):

https://hastebin.com/axakodiney.md

Relevant lines are 107-110 and 151-154, showing the scripts which are executed out of order.


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12.2
  • Forge: 14.23.4.2709
  • Crafttweaker: 4.1.9
  • ModTweaker: 4.0.12
  • MTLib: 3.0.5

Your most recent log file where the issue was present:

https://hastebin.com/epadekomux.md (see line 1150-1151)

commented

~~As said on discord, this is not an issue that will be fixed.

If you look at the code you can realize it can actually never be fixed, and I'm fairly sure I already removed the code. ~~

Sorry, I should be replying to these at 5am... Got confused between this and something that was removed before.