Skip to content

Commit e3b8b71

Browse files
committed
Cast USS sycnhronously
1 parent ba23458 commit e3b8b71

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎plugin/src/main/java/fr/jamailun/ultimatespellsystem/extension/mythicMobs/MythicMobSkill.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ public class MythicMobSkill extends SkillMechanic implements INoTargetSkill {
2626
public MythicMobSkill(SkillExecutor manager, File file, String line, MythicLineConfig mlc) {
2727
super(manager, file, line, mlc);
2828
spellId = mlc.getString("spell", "s");
29+
UssLogger.logDebug("MythicMobSkill: Loaded skill with spell id " + spellId);
2930
}
3031

3132
@Override
3233
public SkillResult cast(SkillMetadata skillMetadata) {
34+
UssLogger.logDebug("MythicMobSkill: Casting skill with spell id " + spellId);
3335
var spell = UltimateSpellSystem.getSpellsManager().getSpell(spellId);
3436
if(spell == null) {
3537
UssLogger.logWarning("MythicMobSkill: Spell with id " + spellId + " not found.");
@@ -48,7 +50,10 @@ public SkillResult cast(SkillMetadata skillMetadata) {
4850
return SkillResult.ERROR;
4951
}
5052

51-
spell.castNotCancellable(livingCaster);
53+
UltimateSpellSystem.getScheduler().run(() -> {
54+
// Run on next scheduler tick
55+
spell.castNotCancellable(livingCaster);
56+
});
5257
return SkillResult.SUCCESS;
5358
}
5459
}

0 commit comments

Comments
 (0)