Skip to content

Commit

Permalink
Merge pull request #406 from Lucaskyy/fix-plugin-writer-2
Browse files Browse the repository at this point in the history
Fix plugin writer with compiled java plugins
  • Loading branch information
Konloch authored Mar 23, 2022
2 parents 820d867 + 6e7db39 commit f1350ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import com.google.common.io.Files;
import me.konloch.kontainer.io.DiskReader;
import me.konloch.kontainer.io.DiskWriter;
import org.apache.commons.compress.utils.FileNameUtils;
Expand Down Expand Up @@ -188,7 +189,7 @@ public void runPlugin()
try
{
//write to temporary file location
DiskWriter.replaceFile(tempFile.getAbsolutePath(), area.getText(), false);
Files.copy(savePath, tempFile);
//run plugin from that location
PluginManager.runPlugin(tempFile);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Plugin run(File file) throws Throwable {
LoadedNodeData pdata = null;
for (LoadedNodeData d : set) {
ClassNode cn = d.node;
if (cn.superName.equals(PLUGIN_CLASS_NAME)) {
if (Objects.equals(cn.superName, PLUGIN_CLASS_NAME)) {
if (pdata == null) {
pdata = d;
} else {
Expand Down

0 comments on commit f1350ed

Please sign in to comment.