Adds some events that trigger when NPC actions start or end, and when sounds are played

This commit is contained in:
2024-07-28 17:12:26 +02:00
parent 81dda85405
commit 904adf46f0
20 changed files with 571 additions and 10 deletions

View File

@ -0,0 +1,40 @@
package net.knarcraft.blacksmith.event;
import net.citizensnpcs.api.npc.NPC;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.jetbrains.annotations.NotNull;
/**
* The base class for all blacksmith plugin events
*/
@SuppressWarnings("unused")
public abstract class AbstractBlacksmithPluginEvent extends Event implements BlacksmithPluginEvent {
protected final NPC npc;
protected final Player player;
/**
* Instantiates a new blacksmith plugin event
*
* @param npc <p>The NPC involved in the event</p>
* @param player <p>The player involved in the event</p>
*/
public AbstractBlacksmithPluginEvent(@NotNull NPC npc, @NotNull Player player) {
this.npc = npc;
this.player = player;
}
@Override
@NotNull
public NPC getNpc() {
return this.npc;
}
@Override
@NotNull
public Player getPlayer() {
return this.player;
}
}