Skip to content

Instantly share code, notes, and snippets.

@TheGlitch76
Created April 19, 2020 03:43
Show Gist options
  • Save TheGlitch76/644f40d6baddbfe6afc8003ab508196e to your computer and use it in GitHub Desktop.
Save TheGlitch76/644f40d6baddbfe6afc8003ab508196e to your computer and use it in GitHub Desktop.
examples
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();
}
}
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