Slay the Spire

Slay the Spire

ModTheSpire
K1: LION 2019 年 1 月 20 日 下午 6:18
Error Initializing a class
So I've been working on a mod for the past few days and everything worked as it should. Then when the next update hit, both for ModTheSpire and Slay the Spire, any new Custom Card Class I've created has ended in this exception:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.ExceptionInInitializerError
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:133)
Caused by: java.lang.ExceptionInInitializerError
at EnigmaMod.EnigmaBase.receiveEditCards(EnigmaBase.java:106)
at basemod.BaseMod.publishEditCards(BaseMod.java:2270)
at basemod.patches.com.megacrit.cardcrawl.helpers.CardLibrary.EditCardsPatch.Prefix(EditCardsPatch.java:11)
at com.megacrit.cardcrawl.helpers.CardLibrary.initialize(CardLibrary.java)
at com.megacrit.cardcrawl.core.CardCrawlGame.create(CardCrawlGame.java:271)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: java.lang.NullPointerException
at EnigmaMod.cards.Square_Root.<clinit>(Square_Root.java:19)
... 7 more

It used to have an error at AbstractCards/CustomCards class, but I somehow fixed that by re-typing the return new Card(); in the makeCopy() method. I can't seem to find anything different between the lines of code in the CustomCard classes that work and those that don't. I've pretty much exhausted all possible resources at my disposal, so any insight would be helpful.

Note: I can create new custom relics just fine.
< >
正在显示第 1 - 4 条,共 4 条留言
K1: LION 2019 年 1 月 20 日 下午 7:49 
I just now tried re-typing BaseMod.addCard(new CustomCardName()); and got the previous error I used to get.

03:43:11.327 INFO cards.AbstractCard> Card initialized incorrecty
Exception: java.lang.NullPointerException
03:43:11.329 ERROR core.CardCrawlGame> Exception caught
java.lang.NullPointerException: null
at com.badlogic.gdx.graphics.g2d.GlyphLayout.setText(GlyphLayout.java:69) ~[desktop-1.0.jar:?]
at com.badlogic.gdx.graphics.g2d.GlyphLayout.<init>(GlyphLayout.java:51) ~[desktop-1.0.jar:?]
at com.megacrit.cardcrawl.cards.AbstractCard.initializeTitle(AbstractCard.java:421) ~[?:?]
at com.megacrit.cardcrawl.cards.AbstractCard.<init>(AbstractCard.java:368) ~[?:?]
at com.megacrit.cardcrawl.cards.AbstractCard.<init>(AbstractCard.java:297) ~[?:?]
at basemod.abstracts.CustomCard.<init>(CustomCard.java:75) ~[BaseMod.jar:?]
at EnigmaMod.cards.Ingrain.<init>(Ingrain.java:24) ~[EnigmaMod.jar:?]
at EnigmaMod.EnigmaBase.receiveEditCards(EnigmaBase.java:106) ~[EnigmaMod.jar:?]
at basemod.BaseMod.publishEditCards(BaseMod.java:2270) ~[?:?]
at basemod.patches.com.megacrit.cardcrawl.helpers.CardLibrary.EditCardsPatch.Prefix(EditCardsPatch.java:11) ~[BaseMod.jar:?]
at com.megacrit.cardcrawl.helpers.CardLibrary.initialize(CardLibrary.java) ~[?:?]
at com.megacrit.cardcrawl.core.CardCrawlGame.create(CardCrawlGame.java:271) [?:?]
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149) [?:?]
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126) [desktop-1.0.jar:?]

If it's something to do with BaseMod itself tell me, because I don't know how to make sure my current version is up to date. I think it is, but I have no way to know for certain (unless there's something I'm missing).
K1: LION 2019 年 1 月 22 日 下午 9:49 
So, I figured it out finally, but it doesn't make much sense to me. Somehow the call

CardCrawlGame.languagePack.getCardStrings(ID)

was returning a null value. I fixed that by physically writing the card name in place of the variable I had been using. Everything else is working as intended.
Dom 2019 年 2 月 10 日 下午 2:40 
I am having the same issue and would love to figure out why it is happening so that we can use localization properly.
2091410747 2019 年 5 月 23 日 上午 6:51 
Is it a JDK issue??
Does this problem require a new version of the JDK?
< >
正在显示第 1 - 4 条,共 4 条留言
每页显示数: 1530 50