1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00
This commit is contained in:
TheBusyBiscuit 2019-11-28 19:35:28 +01:00
parent 95e5da325b
commit 015159dfe8

View File

@ -235,9 +235,6 @@ public class Research {
PlayerProfile.get(p, profile -> {
if (!profile.hasUnlocked(this)) {
ResearchUnlockEvent event = new ResearchUnlockEvent(p, this);
Bukkit.getPluginManager().callEvent(event);
Runnable runnable = () -> {
profile.setResearched(this, true);
SlimefunPlugin.getLocal().sendMessage(p, "messages.unlocked", true, msg -> msg.replace("%research%", getName()));
@ -247,6 +244,10 @@ public class Research {
}
};
Slimefun.runSync(() -> {
ResearchUnlockEvent event = new ResearchUnlockEvent(p, this);
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
if (instant) {
runnable.run();
@ -270,6 +271,7 @@ public class Research {
}, (research_progress.length + 1) * 20L);
}
}
});
}
});
}