SavageLabs / SkyblockX

The Performance-Oriented Skyblock Core. MC 1.8.X-1.15.X.
https://skyblockx.com
Other
3 stars 0 forks source link

Fix custom struct saving bug #20

Closed unsky559 closed 4 years ago

unsky559 commented 4 years ago

Caused by: java.lang.IllegalArgumentException: No enum constant io.illyria.skyblockx.shade.baseplugin.XMaterial.Optional[Air] this string is the way to understand the problem. SBFReader can not read the string Optional[Air], it need to actualy be AIR. So to slove this I create another class that use SBFReader and SBFWriter to translate all wrong syntax to right, and it actually help. @ProSavage, You need to add some checks in SkyblockX/src/main/kotlin/io/illyria/skyblockx/sedit/SkyblockEdit.kt before line 77. Because XMaterial.matchXMaterial(block.type.name).toString() - command is returning Optional[Air], so I just use this regex to check (Optional|optional)\[(\w+\s\w+|\w+)], and after that make some string transform:

19 #18