1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2020-07-29 21:57:08 +02:00
parent bf8b4db7bf
commit ac4cfd3d68
3 changed files with 24 additions and 6 deletions

View File

@ -56,6 +56,7 @@
* Fixed Wither Assembler requiring more items than it actually consumes
* Fixed Metrics not updating automatically
* Fixed #2143
* Fixed #2145
## Release Candidate 14 (12 Jul 2020)

View File

@ -14,9 +14,12 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion;
class PlaceholderAPIHook extends PlaceholderExpansion {
@Override
public String getAuthor() {
return SlimefunPlugin.instance().getDescription().getAuthors().toString();
private final String version;
private final String author;
public PlaceholderAPIHook(SlimefunPlugin plugin) {
this.version = plugin.getDescription().getVersion();
this.author = plugin.getDescription().getAuthors().toString();
}
@Override
@ -26,7 +29,12 @@ class PlaceholderAPIHook extends PlaceholderExpansion {
@Override
public String getVersion() {
return SlimefunPlugin.instance().getDescription().getVersion();
return version;
}
@Override
public String getAuthor() {
return author;
}
@Override

View File

@ -44,8 +44,17 @@ public class ThirdPartyPluginService {
public void start() {
if (isPluginInstalled("PlaceholderAPI")) {
isPlaceholderAPIInstalled = true;
new PlaceholderAPIHook().register();
try {
PlaceholderAPIHook hook = new PlaceholderAPIHook(plugin);
hook.register();
isPlaceholderAPIInstalled = true;
}
catch (Exception | LinkageError x) {
String version = plugin.getServer().getPluginManager().getPlugin("PlaceholderAPI").getDescription().getVersion();
Slimefun.getLogger().log(Level.WARNING, "Maybe consider updating PlaceholderAPI or Slimefun?");
Slimefun.getLogger().log(Level.WARNING, x, () -> "Failed to hook into PlaceholderAPI v" + version);
}
}
if (isPluginInstalled("EmeraldEnchants")) {