forked from BLOCKFANTASY/LOOHP-Limbo
Compare commits
3 Commits
dependabot
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
94ad6d8460 | |
|
|
b19bba7140 | |
|
|
a0382bd64c |
|
|
@ -1,6 +1,6 @@
|
||||||
# Limbo
|
# Limbo
|
||||||
[](http://ci.loohpjames.com/job/Limbo/)
|
[](http://ci.loohpjames.com/job/Limbo/)
|
||||||
## Standalone Limbo Minecraft Server (Currently 1.21.7)
|
## Standalone Limbo Minecraft Server (Currently 1.21.8)
|
||||||
|
|
||||||
https://www.spigotmc.org/resources/82468/
|
https://www.spigotmc.org/resources/82468/
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ IP: mc.loohpjames.com
|
||||||
```
|
```
|
||||||

|

|
||||||
***
|
***
|
||||||
### Downloads (1.17.1-1.21.7)
|
### Downloads (1.17.1-1.21.8)
|
||||||
- [Jenkins](http://ci.loohpjames.com/job/Limbo/)
|
- [Jenkins](http://ci.loohpjames.com/job/Limbo/)
|
||||||
***
|
***
|
||||||
### Offical Plugins
|
### Offical Plugins
|
||||||
|
|
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -136,7 +136,7 @@
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>${project.artifactId}-${project.version}-1.21.7</finalName>
|
<finalName>${project.artifactId}-${project.version}-1.21.8</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ public final class Limbo {
|
||||||
|
|
||||||
//===========================
|
//===========================
|
||||||
|
|
||||||
public final String SERVER_IMPLEMENTATION_VERSION = "1.21.7";
|
public final String SERVER_IMPLEMENTATION_VERSION = "1.21.8";
|
||||||
public final int SERVER_IMPLEMENTATION_PROTOCOL = 772;
|
public final int SERVER_IMPLEMENTATION_PROTOCOL = 772;
|
||||||
public final String LIMBO_IMPLEMENTATION_VERSION;
|
public final String LIMBO_IMPLEMENTATION_VERSION;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,18 +55,35 @@ public class PluginManager {
|
||||||
protected void loadPlugins() {
|
protected void loadPlugins() {
|
||||||
for (File file : pluginFolder.listFiles()) {
|
for (File file : pluginFolder.listFiles()) {
|
||||||
if (file.isFile() && file.getName().endsWith(".jar")) {
|
if (file.isFile() && file.getName().endsWith(".jar")) {
|
||||||
boolean found = false;
|
|
||||||
try (ZipInputStream zip = new ZipInputStream(new FileInputStream(file))) {
|
try (ZipInputStream zip = new ZipInputStream(new FileInputStream(file))) {
|
||||||
|
ZipEntry limboYmlEntry = null;
|
||||||
|
ZipEntry pluginYmlEntry = null;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
ZipEntry entry = zip.getNextEntry();
|
ZipEntry entry = zip.getNextEntry();
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String name = entry.getName();
|
String name = entry.getName();
|
||||||
if (name.endsWith("plugin.yml") || name.endsWith("limbo.yml")) {
|
if (name.endsWith("limbo.yml")) {
|
||||||
found = true;
|
limboYmlEntry = entry;
|
||||||
|
} else if (name.endsWith("plugin.yml")) {
|
||||||
|
pluginYmlEntry = entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FileConfiguration pluginYaml = new FileConfiguration(zip);
|
ZipEntry chosenEntry = limboYmlEntry != null ? limboYmlEntry : pluginYmlEntry;
|
||||||
|
|
||||||
|
if (chosenEntry != null) {
|
||||||
|
try (ZipInputStream processZip = new ZipInputStream(new FileInputStream(file))) {
|
||||||
|
while (true) {
|
||||||
|
ZipEntry currentEntry = processZip.getNextEntry();
|
||||||
|
if (currentEntry == null) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentEntry.getName().equals(chosenEntry.getName())) {
|
||||||
|
FileConfiguration pluginYaml = new FileConfiguration(processZip);
|
||||||
String main = pluginYaml.get("main", String.class);
|
String main = pluginYaml.get("main", String.class);
|
||||||
String pluginName = pluginYaml.get("name", String.class);
|
String pluginName = pluginYaml.get("name", String.class);
|
||||||
|
|
||||||
|
|
@ -74,6 +91,7 @@ public class PluginManager {
|
||||||
System.err.println("Ambiguous plugin name in " + file.getName() + " with the plugin \"" + plugins.get(pluginName).getClass().getName() + "\"");
|
System.err.println("Ambiguous plugin name in " + file.getName() + " with the plugin \"" + plugins.get(pluginName).getClass().getName() + "\"");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
URLClassLoader child = new URLClassLoader(new URL[]{file.toURI().toURL()}, Limbo.getInstance().getClass().getClassLoader());
|
URLClassLoader child = new URLClassLoader(new URL[]{file.toURI().toURL()}, Limbo.getInstance().getClass().getClassLoader());
|
||||||
Class<?> clazz = Class.forName(main, true, child);
|
Class<?> clazz = Class.forName(main, true, child);
|
||||||
LimboPlugin plugin = (LimboPlugin) clazz.getDeclaredConstructor().newInstance();
|
LimboPlugin plugin = (LimboPlugin) clazz.getDeclaredConstructor().newInstance();
|
||||||
|
|
@ -84,13 +102,14 @@ public class PluginManager {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.err.println("Jar file " + file.getName() + " has no plugin.yml or limbo.yml!");
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("Unable to load plugin \"" + file.getName() + "\"");
|
System.err.println("Unable to load plugin \"" + file.getName() + "\"");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (!found) {
|
|
||||||
System.err.println("Jar file " + file.getName() + " has no plugin.yml!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue