Advertisement
Lisenochek

Untitled

Jan 12th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. package ru.lisenochek.ftnpc;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.Location;
  5. import org.bukkit.entity.Entity;
  6. import org.bukkit.entity.Villager;
  7.  
  8. public class CustomVillager {
  9.  
  10. private Location loc;
  11. private String name;
  12. private String cmd;
  13.  
  14. public CustomVillager(Location loc, String name, String cmd) {
  15. this.loc = loc;
  16. this.name = name;
  17. this.cmd = cmd;
  18. }
  19.  
  20. public String getCommand() {
  21. return this.cmd;
  22. }
  23.  
  24. public Location getLocation() {
  25. return loc;
  26. }
  27.  
  28. public void setCommand(String cmd) {
  29. this.cmd = cmd;
  30. }
  31.  
  32. public String getName() {
  33. return name;
  34. }
  35.  
  36. public Entity getBukkitEntity() {
  37. return ChunkEntityListener.getEntityByLocation(loc);
  38. }
  39.  
  40. public Villager getVillager() {
  41. return (Villager) getBukkitEntity();
  42. }
  43.  
  44. public String getNameWithoutColors() {
  45. return ChatColor.stripColor(getName());
  46. }
  47.  
  48. public void setName(String name) {
  49. this.name = C.c(name);
  50. getBukkitEntity().setCustomName(this.name);
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement