mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Fixes #2145
This commit is contained in:
parent
bf8b4db7bf
commit
ac4cfd3d68
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -44,8 +44,17 @@ public class ThirdPartyPluginService {
|
||||
|
||||
public void start() {
|
||||
if (isPluginInstalled("PlaceholderAPI")) {
|
||||
try {
|
||||
PlaceholderAPIHook hook = new PlaceholderAPIHook(plugin);
|
||||
hook.register();
|
||||
isPlaceholderAPIInstalled = true;
|
||||
new PlaceholderAPIHook().register();
|
||||
}
|
||||
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")) {
|
||||
|
Loading…
Reference in New Issue
Block a user