Merge pull request #48 from xPlumpOrange/master
Fixed Bukkit Config Loading and ProtocolLib Implementation
This commit is contained in:
3 files changed
+8
-7
No files matched your search
@@ -54,7 +54,7 @@ public class BukkitConfig extends ConfigProvider {
|
||||
// Just ignore since it either does not exist, or we can overwrite
|
||||
}
|
||||
|
||||
try (InputStream in = BukkitConfig.class.getResourceAsStream("config.yml")) {
|
||||
try (InputStream in = plugin.getResource("config.yml")) { // Have to use Bukkit's resource streaming or the resource wont be found
|
||||
Files.copy(in, configFile.toPath());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -31,8 +31,14 @@ public class TCPShieldBukkit extends JavaPlugin implements TCPShieldPlugin {
|
||||
|
||||
if (BukkitImplProvider.hasPaperEvent())
|
||||
bukkitImpl = new BukkitPaper(this);
|
||||
else
|
||||
else {
|
||||
if (getServer().getPluginManager().getPlugin("ProtocolLib") == null) {
|
||||
getLogger().severe("TCPShield not loading because ProtocolLib is not installed. Either use Paper to enable native compatibility or install ProtocolLib.");
|
||||
return;
|
||||
}
|
||||
|
||||
bukkitImpl = new BukkitProtocolLib(this);
|
||||
}
|
||||
|
||||
bukkitImpl.load();
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -16,11 +16,6 @@ public class BukkitProtocolLib extends BukkitImplProvider {
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
if (getPlugin().getServer().getPluginManager().getPlugin("ProtocolLib") == null) {
|
||||
getPlugin().getLogger().severe("TCPShield not loading because ProtocolLib is not installed. Either use Paper to enable native compatibility or install ProtocolLib.");
|
||||
return;
|
||||
}
|
||||
|
||||
ProtocolLibHandshakeHandler packetHandler = new ProtocolLibHandshakeHandler(this);
|
||||
com.comphenix.protocol.ProtocolLibrary.getProtocolManager().addPacketListener(packetHandler);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user