Initial commit
This commit is contained in:
3
Plugins/Old/Autostart/.idea/.gitignore
generated
vendored
Normal file
3
Plugins/Old/Autostart/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
9
Plugins/Old/Autostart/.idea/artifacts/autostart.xml
generated
Normal file
9
Plugins/Old/Autostart/.idea/artifacts/autostart.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="autostart">
|
||||
<output-path>$USER_HOME$/Desktop</output-path>
|
||||
<root id="archive" name="autostart.jar">
|
||||
<element id="module-output" name="Autostart" />
|
||||
<element id="file-copy" path="$PROJECT_DIR$/plugin.yml" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
11
Plugins/Old/Autostart/.idea/libraries/spigot_1_15_2.xml
generated
Normal file
11
Plugins/Old/Autostart/.idea/libraries/spigot_1_15_2.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<component name="libraryTable">
|
||||
<library name="spigot-1.15.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../Spigot Versions/spigot-1.15.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../Spigot Versions/spigot-1.15.2.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
6
Plugins/Old/Autostart/.idea/misc.xml
generated
Normal file
6
Plugins/Old/Autostart/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
Plugins/Old/Autostart/.idea/modules.xml
generated
Normal file
8
Plugins/Old/Autostart/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Autostart.iml" filepath="$PROJECT_DIR$/Autostart.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
12
Plugins/Old/Autostart/Autostart.iml
Normal file
12
Plugins/Old/Autostart/Autostart.iml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Spigot Versions" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
Binary file not shown.
4
Plugins/Old/Autostart/plugin.yml
Normal file
4
Plugins/Old/Autostart/plugin.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
name: Autostart
|
||||
main: de.welovemcskript.autostart.Autostart
|
||||
version: 1.0.0
|
||||
api-version: 1.15
|
||||
@@ -0,0 +1,40 @@
|
||||
package de.welovemcskript.autostart;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class Autostart extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
if(Bukkit.getServer().getPluginManager().getPlugins() == null) {
|
||||
startServer();
|
||||
}
|
||||
}
|
||||
|
||||
public static void startServer() {
|
||||
Process p = null;
|
||||
try {
|
||||
p = Runtime.getRuntime().exec("cmd /c ../start.sh");
|
||||
InputStream is = p.getInputStream();
|
||||
|
||||
int i = 0;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
while ((i = is.read()) != -1) {
|
||||
sb.append((char)i);
|
||||
}
|
||||
System.out.println(sb.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user