mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Fixes #1264
This commit is contained in:
parent
95e5da325b
commit
015159dfe8
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user