Java Code Examples for net.minecraft.village.VillagerData#getProfession()
The following examples show how to use
net.minecraft.village.VillagerData#getProfession() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FarmerVillagerTask_wartFarmMixin.java From carpet-extra with GNU Lesser General Public License v3.0 | 5 votes |
@Redirect(method = "shouldRun", at = @At( value = "INVOKE", target = "Lnet/minecraft/village/VillagerData;getProfession()Lnet/minecraft/village/VillagerProfession;" )) private VillagerProfession disguiseAsFarmer(VillagerData villagerData) { isFarmingCleric = false; VillagerProfession profession = villagerData.getProfession(); if (CarpetExtraSettings.clericsFarmWarts && profession == VillagerProfession.CLERIC) { isFarmingCleric = true; return VillagerProfession.FARMER; } return profession; }
Example 2
Source File: NpcClothingFeature.java From MineLittlePony with MIT License | 5 votes |
@Override public void render(MatrixStack matrixStack, VertexConsumerProvider provider, int i, T entity, float f, float g, float h, float j, float k, float l) { if (!entity.isInvisible()) { VillagerData data = entity.getVillagerData(); VillagerType type = data.getType(); VillagerProfession profession = data.getProfession(); HatType typeHatLayer = getHatType(typeHatCache, "type", Registry.VILLAGER_TYPE, type); HatType profHatLayer = getHatType(profHatCache, "profession", Registry.VILLAGER_PROFESSION, profession); M entityModel = getContextModel(); entityModel.setHatVisible( profHatLayer == VillagerResourceMetadata.HatType.NONE || (profHatLayer == VillagerResourceMetadata.HatType.PARTIAL && typeHatLayer != VillagerResourceMetadata.HatType.FULL) ); Identifier typeSkin = findTexture("type", Registry.VILLAGER_TYPE.getId(type)); getContext().getInternalRenderer().updateMetadata(typeSkin); renderModel(entityModel, typeSkin, matrixStack, provider, i, entity, 1, 1, 1); entityModel.setHatVisible(true); if (profession != VillagerProfession.NONE && !entity.isBaby()) { Identifier professionSkin = findTexture("profession", Registry.VILLAGER_PROFESSION.getId(profession)); getContext().getInternalRenderer().updateMetadata(professionSkin); renderModel(entityModel, professionSkin, matrixStack, provider, i, entity, 1, 1, 1); if (profession != VillagerProfession.NITWIT) { Identifier levelSkin = findTexture("profession_level", LEVEL_TO_ID.get(MathHelper.clamp(data.getLevel(), 1, LEVEL_TO_ID.size()))); renderModel(entityModel, levelSkin, matrixStack, provider, i, entity, 1, 1, 1); } } } }