All Downloads are FREE. Search and download functionalities are using the official Maven repository.

studio.magemonkey.divinity.modules.list.sell.SellTrait Maven / Gradle / Ivy

The newest version!
package studio.magemonkey.divinity.modules.list.sell;

import studio.magemonkey.divinity.api.DivinityAPI;
import net.citizensnpcs.api.event.NPCRightClickEvent;
import net.citizensnpcs.api.trait.Trait;
import net.citizensnpcs.api.trait.TraitName;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;

@TraitName("sell")
public class SellTrait extends Trait {

    public SellTrait() {
        super("sell");
    }

    @EventHandler
    public void click(NPCRightClickEvent e) {
        if (e.getNPC() == this.getNPC()) {
            Player      player      = e.getClicker();
            SellManager sellManager = DivinityAPI.getModuleManager().getSellManager();
            if (sellManager == null) return;

            sellManager.openSellGUI(player, false);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy