本文整理汇总了Java中org.bukkit.inventory.EntityEquipment.setItemInMainHand方法的典型用法代码示例。如果您正苦于以下问题:Java EntityEquipment.setItemInMainHand方法的具体用法?Java EntityEquipment.setItemInMainHand怎么用?Java EntityEquipment.setItemInMainHand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.inventory.EntityEquipment
的用法示例。
在下文中一共展示了EntityEquipment.setItemInMainHand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCommand
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
@Override
protected void onCommand(CommandSender sender, String[] args) {
Player player = (Player) sender;
EntityEquipment e = player.getEquipment();
ItemStack held = e.getItemInMainHand();
e.setItemInMainHand(e.getHelmet());
e.setHelmet(held);
sender.sendMessage(ChatColor.GOLD + "Enjoy your new hat.");
}
示例2: set
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void set(final EntityEquipment e, final @Nullable ItemStack item) {
if (Skript.isRunningMinecraft(1, 9))
e.setItemInMainHand(item);
else
e.setItemInHand(item); //Compatibility reasons
}
示例3: createRobot
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
private void createRobot(Skeleton s) {
EntityEquipment e = s.getEquipment();
e.setHelmet(new ItemStack(Material.DISPENSER, 1));
e.setChestplate(new ItemStack(Material.IRON_CHESTPLATE, 1));
e.setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS, 1));
e.setLeggings(new ItemStack(Material.IRON_BOOTS, 1));
e.setItemInMainHand(new ItemStack(Material.BOW, 1));
permaVanish(s);
}
示例4: restoreEquipment
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
void restoreEquipment(LivingEntity entity) {
EntityEquipment equipment = entity.getEquipment();
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
equipment.setItemInMainHand(this.lived.mainHand);
equipment.setItemInOffHand(this.lived.offHand);
} else {
equipment.setItemInHand(this.lived.mainHand);
}
equipment.setHelmet(this.lived.helmet);
equipment.setChestplate(this.lived.chestplate);
equipment.setLeggings(this.lived.leggings);
equipment.setBoots(this.lived.boots);
}
示例5: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static ShopNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")
|| !map.containsKey("message") || !map.containsKey("shop")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
ShopNPC npc = new ShopNPC(loc);
EntityType type = EntityType.valueOf((String) map.get("type"));
npc.name = (String) map.get("name");
npc.inventory = (ShopInventory) map.get("shop");
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.getEntity().setCustomName((String) map.get("name"));
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
npc.chat = (BioptionMessage) map.get("message");
//provide our npc's name, unless we don't have one!
if (npc.name != null && !npc.name.equals("")) {
FancyMessage label = new FancyMessage(npc.name);
npc.chat.setSourceLabel(label);
}
//update code 3
if (map.containsKey("badrequirementmessage"))
npc.altMessage = (Message) map.get("badrequirementmessage");
if (map.containsKey("requiredquests"))
npc.requirements = (List<String>) map.get("requiredquests");
return npc;
}
示例6: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
public static DummyNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
EntityType type = EntityType.valueOf((String) map.get("type"));
DummyNPC npc = new DummyNPC(loc);
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.setStartingLoc(loc);
npc.getEntity().setCustomName((String) map.get("name"));
npc.name = (String) map.get("name");
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
return npc;
}
示例7: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
public static SimpleBioptionNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")
|| !map.containsKey("message")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
SimpleBioptionNPC npc = new SimpleBioptionNPC(loc);
EntityType type = EntityType.valueOf((String) map.get("type"));
npc.name = (String) map.get("name");
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.getEntity().setCustomName((String) map.get("name"));
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
npc.chat = (BioptionMessage) map.get("message");
//provide our npc's name, unless we don't have one!
if (npc.name != null && !npc.name.equals("")) {
npc.chat.setSourceLabel(
new FancyMessage(npc.name));
}
return npc;
}
示例8: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
public static ServiceNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")
|| !map.containsKey("message") || !map.containsKey("services")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
ServiceNPC npc = new ServiceNPC(loc);
EntityType type = EntityType.valueOf((String) map.get("type"));
npc.name = (String) map.get("name");
npc.inventory = (ServiceInventory) map.get("services");
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.getEntity().setCustomName((String) map.get("name"));
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
npc.chat = (BioptionMessage) map.get("message");
//provide our npc's name, unless we don't have one!
if (npc.name != null && !npc.name.equals("")) {
FancyMessage label = new FancyMessage(npc.name);
npc.chat.setSourceLabel(label);
}
return npc;
}
示例9: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
public static SimpleQuestStartNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")
|| !map.containsKey("firstmessage") || !map.containsKey("duringmessage")
|| !map.containsKey("postmessage") || !map.containsKey("badrequirementmessage")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
EntityType type = EntityType.valueOf((String) map.get("type"));
SimpleQuestStartNPC npc = new SimpleQuestStartNPC(loc);
npc.isEnd = false;
npc.name = (String) map.get("name");
//load the chunk
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.getEntity().setCustomName((String) map.get("name"));
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
npc.chat = (BioptionMessage) map.get("firstmessage");
npc.duringMessage = (Message) map.get("duringmessage");
npc.afterMessage = (Message) map.get("postmessage");
npc.altMessage = (Message) map.get("badrequirementmessage");
//provide our npc's name, unless we don't have one!
if (npc.name != null && !npc.name.equals("")) {
FancyMessage label = new FancyMessage(npc.name);
npc.chat.setSourceLabel(label);
npc.duringMessage.setSourceLabel(label);
npc.afterMessage.setSourceLabel(label);
npc.altMessage.setSourceLabel(label);
}
return npc;
}
示例10: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
public static LevelupNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")
|| !map.containsKey("message") || !map.containsKey("famerate")
|| !map.containsKey("famebase")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
LevelupNPC npc = new LevelupNPC(loc);
EntityType type = EntityType.valueOf((String) map.get("type"));
npc.name = (String) map.get("name");
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.getEntity().setCustomName((String) map.get("name"));
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
npc.chat = (BioptionMessage) map.get("message");
//provide our npc's name, unless we don't have one!
if (npc.name != null && !npc.name.equals("")) {
npc.chat.setSourceLabel(
new FancyMessage(npc.name));
}
npc.fameBase = (int) map.get("famebase");
npc.fameRate = (double) map.get("famerate");
npc.hpBase = npc.mpBase = 0;
npc.hpRate = npc.mpRate = 0.0;
if (map.containsKey("hpbase")) {
npc.hpBase = (int) map.get("hpbase");
}
if (map.containsKey("hprate")) {
npc.hpRate = (double) map.get("hprate");
}
if (map.containsKey("mpbase")) {
npc.mpBase = (int) map.get("mpbase");
}
if (map.containsKey("mprate")) {
npc.mpRate = (double) map.get("mprate");
}
return npc;
}
示例11: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
public static InnNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")
|| !map.containsKey("message") || !map.containsKey("cost")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
InnNPC npc = new InnNPC(loc);
EntityType type = EntityType.valueOf((String) map.get("type"));
npc.name = (String) map.get("name");
npc.cost = (int) map.get("cost");
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.getEntity().setCustomName((String) map.get("name"));
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
npc.chat = (BioptionMessage) map.get("message");
//provide our npc's name, unless we don't have one!
if (npc.name != null && !npc.name.equals("")) {
FancyMessage label = new FancyMessage(npc.name);
npc.chat.setSourceLabel(label);
}
return npc;
}
示例12: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
public static BankNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")
|| !map.containsKey("message") || !map.containsKey("bank-id")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
BankNPC npc = new BankNPC(loc);
EntityType type = EntityType.valueOf((String) map.get("type"));
npc.name = (String) map.get("name");
npc.bankID = (String) map.get("bank-id");
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.getEntity().setCustomName((String) map.get("name"));
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
npc.chat = (BioptionMessage) map.get("message");
//provide our npc's name, unless we don't have one!
if (npc.name != null && !npc.name.equals("")) {
FancyMessage label = new FancyMessage(npc.name);
npc.chat.setSourceLabel(label);
}
return npc;
}
示例13: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
public static ForgeNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")
|| !map.containsKey("message") || !map.containsKey("cost")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
ForgeNPC npc = new ForgeNPC(loc);
EntityType type = EntityType.valueOf((String) map.get("type"));
npc.name = (String) map.get("name");
npc.cost = (int) map.get("cost");
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.getEntity().setCustomName((String) map.get("name"));
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
npc.chat = (BioptionMessage) map.get("message");
//provide our npc's name, unless we don't have one!
if (npc.name != null && !npc.name.equals("")) {
FancyMessage label = new FancyMessage(npc.name);
npc.chat.setSourceLabel(label);
}
return npc;
}
示例14: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
public static MuteNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
EntityType type = EntityType.valueOf((String) map.get("type"));
MuteNPC npc = new MuteNPC(loc);
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.setStartingLoc(loc);
npc.getEntity().setCustomName((String) map.get("name"));
npc.name = (String) map.get("name");
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
return npc;
}
示例15: valueOf
import org.bukkit.inventory.EntityEquipment; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static TeleportNPC valueOf(Map<String, Object> map) {
if (map == null || !map.containsKey("name") || !map.containsKey("type")
|| !map.containsKey("location") || !map.containsKey("equipment")
|| !map.containsKey("message") || !map.containsKey("cost")
|| !map.containsKey("destination") || !map.containsKey("requiredquests")
|| !map.containsKey("badrequirementmessage")) {
QuestManagerPlugin.logger.warning("Invalid NPC info! "
+ (map.containsKey("name") ? ": " + map.get("name") : ""));
return null;
}
EquipmentConfiguration econ = new EquipmentConfiguration();
try {
YamlConfiguration tmp = new YamlConfiguration();
tmp.createSection("key", (Map<?, ?>) map.get("equipment"));
econ.load(tmp.getConfigurationSection("key"));
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LocationState ls = (LocationState) map.get("location");
Location loc = ls.getLocation();
EntityType type = EntityType.valueOf((String) map.get("type"));
TeleportNPC npc = new TeleportNPC(loc);
npc.name = (String) map.get("name");
npc.cost = (int) map.get("cost");
npc.destination = ((LocationState) map.get("destination")).getLocation();
loc.getChunk();
npc.setEntity(loc.getWorld().spawnEntity(loc, type));
npc.getEntity().setCustomName((String) map.get("name"));
if (npc.getEntity() instanceof LivingEntity) {
EntityEquipment equipment = ((LivingEntity) npc.getEntity()).getEquipment();
equipment.setHelmet(econ.getHead());
equipment.setChestplate(econ.getChest());
equipment.setLeggings(econ.getLegs());
equipment.setBoots(econ.getBoots());
equipment.setItemInMainHand(econ.getHeldMain());
equipment.setItemInOffHand(econ.getHeldOff());
}
npc.chat = (BioptionMessage) map.get("message");
npc.altMessage = (Message) map.get("badrequirementmessage");
npc.requirements = (List<String>) map.get("requiredquests");
//provide our npc's name, unless we don't have one!
if (npc.name != null && !npc.name.equals("")) {
FancyMessage label = new FancyMessage(npc.name);
npc.chat.setSourceLabel(label);
npc.altMessage.setSourceLabel(label);
}
return npc;
}