Created
April 19, 2020 03:43
-
-
Save TheGlitch76/644f40d6baddbfe6afc8003ab508196e to your computer and use it in GitHub Desktop.
examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PatchworkModProvider implements ModProvider { | |
@Override | |
public void acceptCanidate(ProvidedModCanidateRepresentation representation) { | |
ModManifest manifest; | |
try { | |
manifest = Patchwork.parseManifest(representation.getPath()); | |
} catch (ManifestParseException ex) { | |
//if its a bad manifest, fail hard | |
// else: | |
representation.pass(); | |
} | |
representation.provide(manifest.getId); | |
} | |
@Override | |
public void processMod(ProvidedModRepresentation representation) { | |
representation.setPath(Patchwork.patch(representation.getPath())) | |
.finish(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SpongeModProvider implements ModProvider { | |
@Override | |
public void acceptCanidate(ProvidedModCanidateRepresentation representation) { | |
// annotation scanning | |
// for actual API usage see PatchworkModProvider; its basically the same here. | |
} | |
@Override | |
public void processMod(ProvidedModRepresentation representation) { | |
representation | |
.setModContainer(SpongeMagic.createMeAModContainer(representation.getId())) | |
.finish(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment