Merge pull request #406 from Lucaskyy/fix-plugin-writer-2
Fix plugin writer with compiled java plugins
This commit is contained in:
commit
f1350ed14a
2 changed files with 3 additions and 2 deletions
|
@ -12,6 +12,7 @@ import javax.swing.JMenu;
|
||||||
import javax.swing.JMenuBar;
|
import javax.swing.JMenuBar;
|
||||||
import javax.swing.JMenuItem;
|
import javax.swing.JMenuItem;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import com.google.common.io.Files;
|
||||||
import me.konloch.kontainer.io.DiskReader;
|
import me.konloch.kontainer.io.DiskReader;
|
||||||
import me.konloch.kontainer.io.DiskWriter;
|
import me.konloch.kontainer.io.DiskWriter;
|
||||||
import org.apache.commons.compress.utils.FileNameUtils;
|
import org.apache.commons.compress.utils.FileNameUtils;
|
||||||
|
@ -188,7 +189,7 @@ public class PluginWriter extends JFrame
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//write to temporary file location
|
//write to temporary file location
|
||||||
DiskWriter.replaceFile(tempFile.getAbsolutePath(), area.getText(), false);
|
Files.copy(savePath, tempFile);
|
||||||
//run plugin from that location
|
//run plugin from that location
|
||||||
PluginManager.runPlugin(tempFile);
|
PluginManager.runPlugin(tempFile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class CompiledJavaPluginLaunchStrategy implements PluginLaunchStrategy {
|
||||||
LoadedNodeData pdata = null;
|
LoadedNodeData pdata = null;
|
||||||
for (LoadedNodeData d : set) {
|
for (LoadedNodeData d : set) {
|
||||||
ClassNode cn = d.node;
|
ClassNode cn = d.node;
|
||||||
if (cn.superName.equals(PLUGIN_CLASS_NAME)) {
|
if (Objects.equals(cn.superName, PLUGIN_CLASS_NAME)) {
|
||||||
if (pdata == null) {
|
if (pdata == null) {
|
||||||
pdata = d;
|
pdata = d;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue