Adds some events that trigger when NPC actions start or end, and when sounds are played
This commit is contained in:
@@ -3,6 +3,8 @@ package net.knarcraft.blacksmith.trait;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.knarcraft.blacksmith.BlacksmithPlugin;
|
||||
import net.knarcraft.blacksmith.config.blacksmith.BlacksmithNPCSettings;
|
||||
import net.knarcraft.blacksmith.event.BlacksmithReforgeFailEvent;
|
||||
import net.knarcraft.blacksmith.event.BlacksmithReforgeSucceedEvent;
|
||||
import net.knarcraft.blacksmith.manager.EconomyManager;
|
||||
import net.knarcraft.blacksmith.util.InputParsingHelper;
|
||||
import net.knarcraft.blacksmith.util.ItemHelper;
|
||||
@@ -135,9 +137,11 @@ public class ReforgeSession extends Session implements Runnable {
|
||||
private boolean reforgeItem() {
|
||||
if (random.nextInt(100) < this.config.getFailChance()) {
|
||||
failReforge();
|
||||
BlacksmithPlugin.getInstance().callEvent(new BlacksmithReforgeFailEvent(this.npc, this.player));
|
||||
return false;
|
||||
} else {
|
||||
succeedReforge();
|
||||
BlacksmithPlugin.getInstance().callEvent(new BlacksmithReforgeSucceedEvent(this.npc, this.player));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user