Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update draftable edition sections #6631

Merged
merged 40 commits into from
Nov 29, 2024
Merged

Conversation

Ayora29
Copy link
Contributor

@Ayora29 Ayora29 commented Nov 25, 2024

  • FileSection.java : Use a LinkedHashMap to parse edition section, preserving section order and improve performance.
  • CardEdition.java : Increment art index when multiple cards with the same name are in the same sheet. Add new section names, remove irrelevant ones.
  • Edition txt files of draftable sets : update "sections" and "Booster=" parts to better reflect reallity (cf scryfall and mtg.fandom.com) and reduce amount of unecessary additionnal sections/sheets.
  • printsheets.txt : remove unecessary or dead sections
  • No card addition, no card remove, no cards in different order compared to before (exept some basic lands)
  • I have tested drafts for all editions that I have modified

@Agetian
Copy link
Contributor

Agetian commented Nov 26, 2024

Is this branch now ready? Can someone please test and confirm/approve? Leaving it open for a long time may result in a similar effect as before (the need to merge + some difficult to track issues)

@paulsnoops
Copy link
Contributor

I didn't think those changes to MH3 edition were causing the crash so I've just tested again and it's still crashing for me:

main > java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
at java.base/java.util.Objects.checkIndex(Objects.java:365)
at java.base/java.util.ArrayList.get(ArrayList.java:428)
at forge.util.FileSection.parseSections(FileSection.java:109)
at forge.game.GameFormat$Reader.read(GameFormat.java:375)
at forge.game.GameFormat$Reader.read(GameFormat.java:345)
at forge.util.storage.StorageReaderRecursiveFolderWithUserFolder.readAll(StorageReaderRecursiveFolderWithUserFolder.java:105)
at forge.util.storage.StorageBase.(StorageBase.java:44)
at forge.game.GameFormat$Collection.(GameFormat.java:465)
at forge.model.FModel.initialize(FModel.java:208)
at forge.Singletons.initializeOnce(Singletons.java:56)
at forge.view.Main.main(Main.java:64)

@Agetian
Copy link
Contributor

Agetian commented Nov 26, 2024

Hmm, probably worth checking out in the debugger which file it's unhappy about in particular... I'm only going to be able to do this on the weekend, so hopefully someone is faster, hehe :)

@Ayora29
Copy link
Contributor Author

Ayora29 commented Nov 26, 2024

@paulsnoops @Agetian Ok, you should have a blank file that I don't have and it is causing the Index out of bounds Execption.
May be a custom set file or something like that?
I have added a check for empty text in the parseSections method.
The error should be gone now hopefully.

@paulsnoops
Copy link
Contributor

@paulsnoops @Agetian Ok, you should have a blank file that I don't have and it is causing the Index out of bounds Execption. May be a custom set file or something like that? I have added a check for empty text in the parseSections method. The error should be gone now hopefully.

It loads fine now, thanks for supporting custom editions

@Agetian
Copy link
Contributor

Agetian commented Nov 29, 2024

Looks like this MR might be ready for merge, waiting for the greenlight in case there are no more concerns.

@Agetian Agetian merged commit 115276f into Card-Forge:master Nov 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants