Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ru.lisenochek.ftnpc;
- import org.bukkit.ChatColor;
- import org.bukkit.Location;
- import org.bukkit.entity.Entity;
- import org.bukkit.entity.Villager;
- public class CustomVillager {
- private Location loc;
- private String name;
- private String cmd;
- public CustomVillager(Location loc, String name, String cmd) {
- this.loc = loc;
- this.name = name;
- this.cmd = cmd;
- }
- public String getCommand() {
- return this.cmd;
- }
- public Location getLocation() {
- return loc;
- }
- public void setCommand(String cmd) {
- this.cmd = cmd;
- }
- public String getName() {
- return name;
- }
- public Entity getBukkitEntity() {
- return ChunkEntityListener.getEntityByLocation(loc);
- }
- public Villager getVillager() {
- return (Villager) getBukkitEntity();
- }
- public String getNameWithoutColors() {
- return ChatColor.stripColor(getName());
- }
- public void setName(String name) {
- this.name = C.c(name);
- getBukkitEntity().setCustomName(this.name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement