PendingLoadJavaPlugin.java
package com.hypixel.hytale.server.core.plugin.pending;
import com.hypixel.hytale.common.plugin.PluginManifest;
import com.hypixel.hytale.logger.HytaleLogger;
import com.hypixel.hytale.server.core.plugin.JavaPlugin;
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
import com.hypixel.hytale.server.core.plugin.PluginClassLoader;
import com.hypixel.hytale.server.core.plugin.PluginManager;
import java.lang.reflect.Constructor;
import java.nio.file.Path;
import java.util.logging.Level;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class PendingLoadJavaPlugin extends PendingLoadPlugin {
private static final HytaleLogger LOGGER = HytaleLogger.forEnclosingClass();
@Nonnull
private final PluginClassLoader urlClassLoader;
public PendingLoadJavaPlugin(@Nullable Path path, @Nonnull PluginManifest manifest, @Nonnull PluginClassLoader urlClassLoader) {
super(path, manifest);
this.urlClassLoader = urlClassLoader;
}
@Nonnull
PendingLoadPlugin {
(.getPath(), manifest, .urlClassLoader);
}
{
.urlClassLoader.isInServerClassPath();
}
JavaPlugin {
{
.getManifest();
Class<?> mainClass = .urlClassLoader.loadLocalClass(manifest.getMain());
(JavaPlugin.class.isAssignableFrom(mainClass)) {
Constructor<?> constructor = mainClass.getConstructor(JavaPluginInit.class);
PluginManager.MODS_PATH;
manifest.getGroup();
var10000.resolve(var10001 + + manifest.getName());
(manifest, dataDirectory, .getPath(), .urlClassLoader);
(JavaPlugin)constructor.newInstance(init);
}
(manifest.getMain() + );
} (ClassNotFoundException e) {
((HytaleLogger.Api)LOGGER.at(Level.SEVERE).withCause(e)).log(, .getPath());
} (NoSuchMethodException e) {
((HytaleLogger.Api)LOGGER.at(Level.SEVERE).withCause(e)).log(, .getPath());
} (Throwable e) {
((HytaleLogger.Api)LOGGER.at(Level.SEVERE).withCause(e)).log(, .getPath());
}
;
}
String {
+ .toString() + ;
}
}