use of net.minecraft.world.entity.npc.VillagerType in project MyPet by xXKeyleXx.
the class EntityMyVillager method updateVisuals.
@Override
public void updateVisuals() {
this.getEntityData().set(AGE_WATCHER, getMyPet().isBaby());
String professionKey = MyVillager.Profession.values()[getMyPet().getProfession()].getKey();
VillagerProfession profession = Registry.VILLAGER_PROFESSION.get(new ResourceLocation(professionKey));
// TODO
VillagerType type = Registry.VILLAGER_TYPE.get(new ResourceLocation(getMyPet().getType().getKey()));
this.getEntityData().set(PROFESSION_WATCHER, new VillagerData(type, profession, getMyPet().getVillagerLevel()));
}
use of net.minecraft.world.entity.npc.VillagerType in project MyPet by xXKeyleXx.
the class EntityMyVillager method updateVisuals.
@Override
public void updateVisuals() {
this.getEntityData().set(AGE_WATCHER, getMyPet().isBaby());
String professionKey = MyVillager.Profession.values()[getMyPet().getProfession()].getKey();
VillagerProfession profession = Registry.VILLAGER_PROFESSION.get(new ResourceLocation(professionKey));
// TODO
VillagerType type = Registry.VILLAGER_TYPE.get(new ResourceLocation(getMyPet().getType().getKey()));
this.getEntityData().set(PROFESSION_WATCHER, new VillagerData(type, profession, getMyPet().getVillagerLevel()));
}
use of net.minecraft.world.entity.npc.VillagerType in project MyPet by xXKeyleXx.
the class EntityMyZombieVillager method updateVisuals.
@Override
public void updateVisuals() {
getEntityData().set(BABY_WATCHER, getMyPet().isBaby());
String professionKey = MyVillager.Profession.values()[getMyPet().getProfession()].getKey();
VillagerProfession profession = Registry.VILLAGER_PROFESSION.get(new ResourceLocation(professionKey));
// TODO
VillagerType type = Registry.VILLAGER_TYPE.get(new ResourceLocation(getMyPet().getType().getKey()));
getEntityData().set(PROFESSION_WATCHER, new VillagerData(type, profession, getMyPet().getTradingLevel()));
Bukkit.getScheduler().runTaskLater(MyPetApi.getPlugin(), () -> {
if (getMyPet().getStatus() == MyPet.PetState.Here) {
for (EquipmentSlot slot : EquipmentSlot.values()) {
setPetEquipment(slot, CraftItemStack.asNMSCopy(getMyPet().getEquipment(slot)));
}
}
}, 5L);
}
use of net.minecraft.world.entity.npc.VillagerType in project MyPet by xXKeyleXx.
the class EntityMyZombieVillager method updateVisuals.
@Override
public void updateVisuals() {
getEntityData().set(BABY_WATCHER, getMyPet().isBaby());
String professionKey = MyVillager.Profession.values()[getMyPet().getProfession()].getKey();
VillagerProfession profession = Registry.VILLAGER_PROFESSION.get(new ResourceLocation(professionKey));
// TODO
VillagerType type = Registry.VILLAGER_TYPE.get(new ResourceLocation(getMyPet().getType().getKey()));
getEntityData().set(PROFESSION_WATCHER, new VillagerData(type, profession, getMyPet().getTradingLevel()));
Bukkit.getScheduler().runTaskLater(MyPetApi.getPlugin(), () -> {
if (getMyPet().getStatus() == MyPet.PetState.Here) {
for (EquipmentSlot slot : EquipmentSlot.values()) {
setPetEquipment(slot, CraftItemStack.asNMSCopy(getMyPet().getEquipment(slot)));
}
}
}, 5L);
}
Aggregations