Paste #111075: Unnamed Java Paste

Date: 2023/06/13 11:14:25 UTC-07:00
Type: Java

View Raw Paste Download This Paste
Copy Link


package fr.lightmute;

import net.citizensnpcs.api.event.NPCRightClickEvent;
import net.citizensnpcs.api.npc.NPC;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class Events implements Listener {
  @EventHandler
  public void npcrightclick(NPCRightClickEvent e) {
    Player player = e.getClicker();
    NPC npc = e.getNPC();
    ConfigTaxi config = new ConfigTaxi("config.yml", StelyTaxi.instance);
    if (config.isNull("NPC.Name")) {
      config.set("NPC.Name", "Taxi");
      config.saveConfig();
    } 
    if (npc.getName().equals(config.getString("NPC.Name").replace("&", "))) {
      Inventaire inv = new Inventaire();
      player.openInventory(inv.openinventaire());
    } 
  }
}

Highlighting for 'Other' types handled by Highlight.JS, which was released under the BSD 3-Clause License.