Here’s the procedure if you need to update custom classes but lack the source code:
Unzip the module.
Decompile the class file to source code:
java -jar cfr-0.150.jar FlatTop/FlatTopPlayerRoster.class >FlatTop/FlatTopPlayerRoster.java
Sometimes cfr has trouble with anonymous classes. I’ve also had luck with procyon. (I needed it for
FlatTopPropertySheets.class, for which see below.)
procyon-decompiler FlatTop/FlatTopPropertySheet.class >FlatTop/FlatTopPropertySheet.java
- Edit the source code as needed. In this particular case the essential change was:
- this.retireButton.setIcon(new ImageIcon(GameModule.getGameModule().getDataArchive().getCachedImage(iconFileName)));
+ this.retireButton.setIcon(new ImageIcon(new OpMultiResolutionImage(Op.load(iconFileName))));
- Recompile the source code:
javac -classpath Vengine.jar -source 11 -target 11 FlatTop/FlatTopPlayerRoster.java
- Rezip the module.
After I replaced the method call which was removed, the Deprecation & Removal reporter found a deprecated method call, which I also replaced:
FlatTop.FlatTopPropertySheet => VASSAL.build.module.Map.componentCoordinates(java.awt.Point), 2021-08-05
This second replacement was a bit fraught; neither cfr nor procyon were able to decompile completely. In this instance, procyon figured out a case that cfr did not which I couldn’t see how to repair, while the bits that procyon didn’t get I did see how to repair, so I worked from what procyon produced instead.
I’ve sent you back the module. I have not tested it beyond that it loads. You’ll want to check that
FlatTopPropertySheet still behave as expected.