Skip to content

Commit 214505b

Browse files
committed
chore: Update dependencies / add more Javadoc
1 parent a161d72 commit 214505b

File tree

5 files changed

+60
-3
lines changed

5 files changed

+60
-3
lines changed

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[versions]
2-
asm = '9.9'
2+
asm = '9.9.1'
33
commons-lang3 = '3.20.0'
44
diffpatch = 'cde1224'
55
fernflower = '1.0.0'
6-
flatlaf = '3.6.2'
6+
flatlaf = '3.7'
77
jansi = '2.4.2'
8-
json = '20250517'
8+
json = '20251224'
99
mapping-io = '0.8.0'
1010
rdi = '1.1'
1111
shadow-plugin = '8.3.1'

src/main/java/org/mcphackers/mcp/plugin/PluginClassLoader.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,23 @@
44
import java.net.URLClassLoader;
55

66
public class PluginClassLoader extends URLClassLoader {
7+
/**
8+
* @param parent Parent class loader for the plugin class loader
9+
*/
710
public PluginClassLoader(ClassLoader parent) {
811
super(new URL[] {}, parent);
912
}
1013

14+
/**
15+
* Appends the specified URL to the list of URLs to search for
16+
* classes and resources.
17+
* <p>
18+
* If the URL specified is {@code null} or is already in the
19+
* list of URLs, or if this loader is closed, then invoking this
20+
* method has no effect.
21+
*
22+
* @param url the URL to be added to the search path of URLs
23+
*/
1124
public void addURL(URL url) {
1225
super.addURL(url);
1326
}

src/main/java/org/mcphackers/mcp/plugin/PluginManager.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,29 @@
1515
import org.mcphackers.mcp.tools.FileUtil;
1616

1717
public class PluginManager {
18+
/* The list of loaded plugins */
1819
private final Map<String, MCPPlugin> loadedPlugins = new HashMap<>();
1920

21+
/**
22+
* @return A list containing loaded plugins
23+
*/
2024
public Map<String, MCPPlugin> getLoadedPlugins() {
2125
return this.loadedPlugins;
2226
}
2327

28+
/**
29+
* Discovers plugins in .jar/.zip/.class file format.
30+
* <p>
31+
* Plugins in .class file format must be on the classpath.
32+
* .jar/.zip plugins may be placed into the "plugins" folder
33+
* of the MCP instance.
34+
* <p>
35+
* Plugins are loaded via {@link PluginClassLoader} with a {@link ServiceLoader}.
36+
*
37+
* @see PluginClassLoader
38+
* @see MCPPlugin
39+
* @param mcp MCP instance
40+
*/
2441
public void discoverPlugins(MCP mcp) {
2542
ClassLoader classLoader = mcp.getClass().getClassLoader();
2643
try (PluginClassLoader pluginClassLoader = new PluginClassLoader(classLoader)) {

src/main/java/org/mcphackers/mcp/tasks/mode/TaskModeBuilder.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,54 @@ public class TaskModeBuilder {
1111
private TaskParameter[] params = new TaskParameter[]{};
1212
private Requirement requirement;
1313

14+
/**
15+
* @param name Task name to be set.
16+
* @return Current {@link TaskModeBuilder} instance
17+
*/
1418
public TaskModeBuilder setName(String name) {
1519
this.name = name;
1620
return this;
1721
}
1822

23+
/**
24+
* @param enabled Determines if progress bars are enabled or disabled.
25+
* @return Current {@link TaskModeBuilder} instance
26+
*/
1927
public TaskModeBuilder setProgressBars(boolean enabled) {
2028
this.usesProgressBars = enabled;
2129
return this;
2230
}
2331

32+
/**
33+
* @param taskClass Task class to be ran
34+
* @return Current {@link TaskModeBuilder} instance
35+
*/
2436
public TaskModeBuilder setTaskClass(Class<? extends Task> taskClass) {
2537
this.taskClass = taskClass;
2638
return this;
2739
}
2840

41+
/**
42+
* @param params Task parameters to be used
43+
* @return Current {@link TaskModeBuilder} instance
44+
*/
2945
public TaskModeBuilder setParameters(TaskParameter[] params) {
3046
this.params = params;
3147
return this;
3248
}
3349

50+
/**
51+
* @param condition Task requirement for task to become executable
52+
* @return Current {@link TaskModeBuilder} instance
53+
*/
3454
public TaskModeBuilder addRequirement(Requirement condition) {
3555
this.requirement = condition;
3656
return this;
3757
}
3858

59+
/**
60+
* @return Creates a {@link TaskMode} instance from {@link TaskModeBuilder}
61+
*/
3962
public TaskMode build() {
4063
return new TaskMode(this.name, this.taskClass, this.params, this.usesProgressBars, this.requirement);
4164
}

src/main/java/org/mcphackers/mcp/tasks/mode/TaskParameterMap.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ public class TaskParameterMap {
99
*/
1010
static final Map<String, TaskParameter> nameToParamMap = new HashMap<>();
1111

12+
/**
13+
* @param param Parameter name to be read from the cache
14+
* @return {@link TaskParameter} instance read from cache
15+
*/
1216
public static TaskParameter get(String param) {
1317
return nameToParamMap.get(param);
1418
}

0 commit comments

Comments
 (0)