mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-27 12:35:12 +01:00
fix hologram load error, classloader errors for missing hooks
This commit is contained in:
parent
f73e54c4e2
commit
5afe6799fe
@ -55,9 +55,12 @@ public final class PluginHook <T extends Class> {
|
||||
hooks.put(handler, this);
|
||||
// Does this class have a plugin constructor?
|
||||
try {
|
||||
pluginConstructor = type.getDeclaredConstructor(Plugin.class);
|
||||
pluginConstructor = handler.getDeclaredConstructor(Plugin.class);
|
||||
} catch (NoSuchMethodException | SecurityException ex) {
|
||||
// nope!
|
||||
} catch (Throwable t) {
|
||||
// (can also reach here if there is a class loader exception)
|
||||
hooks.remove(handler);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.songoda.core.hooks.holograms;
|
||||
|
||||
import com.songoda.core.hooks.Hook;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@ -13,9 +13,9 @@ public abstract class Holograms implements Hook {
|
||||
protected double yOffset = 0.5;
|
||||
protected double zOffset = 0.5;
|
||||
|
||||
protected final JavaPlugin plugin;
|
||||
protected final Plugin plugin;
|
||||
|
||||
public Holograms(JavaPlugin plugin) {
|
||||
public Holograms(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import com.sainttx.holograms.api.line.HologramLine;
|
||||
import com.sainttx.holograms.api.line.TextLine;
|
||||
import java.util.HashSet;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -16,7 +16,7 @@ public class HologramsHolograms extends Holograms {
|
||||
HologramPlugin hologramPlugin;
|
||||
HashSet<String> ourHolograms = new HashSet();
|
||||
|
||||
public HologramsHolograms(JavaPlugin plugin) {
|
||||
public HologramsHolograms(Plugin plugin) {
|
||||
super(plugin);
|
||||
hologramPlugin = (HologramPlugin) Bukkit.getPluginManager().getPlugin("Holograms");
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ package com.songoda.core.hooks.holograms;
|
||||
import com.gmail.filoghost.holographicdisplays.api.Hologram;
|
||||
import com.gmail.filoghost.holographicdisplays.api.HologramsAPI;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HolographicDisplaysHolograms extends Holograms {
|
||||
|
||||
public HolographicDisplaysHolograms(JavaPlugin plugin) {
|
||||
public HolographicDisplaysHolograms(Plugin plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user