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

Allow customization of libraries by server operators #808

Merged
merged 7 commits into from Jan 17, 2018

Conversation

@smartboyathome
Copy link
Contributor

@smartboyathome smartboyathome commented Jan 8, 2018

This allows server operators to manually specify libraries that their plugins need to run. Phase one of #451.

@@ -0,0 +1,134 @@
package net.glowstone.util;
Copy link
Member

@mastercoms mastercoms Jan 9, 2018

Perhaps move these into a new package?

@mastercoms mastercoms changed the title Allow customization of libraries by server operators. Allow customization of libraries by server operators Jan 9, 2018
@aramperes aramperes mentioned this pull request Jan 9, 2018
import net.glowstone.util.Library;
import net.glowstone.util.LibraryManager;
import net.glowstone.library.Library;
import net.glowstone.library.LibraryManager;
Copy link
Member

@mastercoms mastercoms Jan 9, 2018

Sorry that I wasn't clear, I meant net.glowstone.util.library, but I'm fine with this too. It's really up to you with which you feel is better.

@@ -11,7 +11,7 @@ public static void agentmain(String agentArgs, Instrumentation instrumentation)
inst = instrumentation;
}

static void addJarFile(JarFile file) {
public static void addJarFile(JarFile file) {
Copy link
Member

@aramperes aramperes Jan 10, 2018

Needs documentation

@@ -134,6 +138,24 @@ public boolean getBoolean(Key key) {
return bool;
}

/**
* Retrieves a section as a list of maps.
* @param key the key to look up
Copy link
Member

@aramperes aramperes Jan 10, 2018

Blank line before description and params

private static final String VERSION_KEY = "version";

@SuppressWarnings("unchecked")
public static Library fromConfigMap(Map<?, ?> configMap) {
Copy link
Member

@aramperes aramperes Jan 10, 2018

Needs documentation

this.checksumValue = checksumValue;
}

public String getGroupId() {
Copy link
Member

@aramperes aramperes Jan 10, 2018

Lombokify these getters

return checksumValue;
}

public Map<?, ?> toConfigMap() {
Copy link
Member

@aramperes aramperes Jan 10, 2018

Needs documentation

static void addJarFile(JarFile file) {
/**
* Adds a JAR file to the system class loader.
* @param file The JAR file to add to the class loader.
Copy link
Member

@aramperes aramperes Jan 13, 2018

Line between the description and params

@@ -227,15 +221,16 @@ String getLibrary() {
* the checksum will be automatically validated.
*
* @param file the file.
* @param checksum the reference checksum to validate the file's digest with.
* @param algorithm the {@link HashAlgorithm} used to compute the file's digest.
* @param library the library containing the algorithm and the checksum.
Copy link
Member

@aramperes aramperes Jan 13, 2018

the {@link Library} containing [...]

* See {@link LibraryDownloader#checksum(File, String, HashAlgorithm)}
* @param algorithm the algorithm used to validate the checksum.
* See {@link LibraryDownloader#checksum(File, String, HashAlgorithm)}
* @param library an object representing a library
Copy link
Member

@aramperes aramperes Jan 13, 2018

a {@link Library} instance representing a library

@aramperes aramperes requested a review from mastercoms Jan 16, 2018
@mastercoms mastercoms merged commit 1fcb93a into GlowstoneMC:dev Jan 17, 2018
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants