Jump to content

Valtiel

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by Valtiel

  1. I speak Spanish and I used a translator to answer you, this is just the armor modeling needs to be implemented in the armor class. look in my profile I have already solved that in 1.15.2 but it also works in 1.16.x
  2. forge would take effect in "textures / hud / capsule_bar.png" but if you draw directly on the screen then we talk about different things
  3. For your understanding, forge automatically adapts higher resolutions without the need to modify its code as long as the size is equivalent, so an item with a 16x16 texture can be changed to one of 32x32 or 64x64 without modifying the code
  4. So what dimensions of texture do you want to use? If your item or gui uses a 64x64 resolution but you want to use a 100x96 resolution, I recommend that you double the original resolution in this case 128x128.
  5. I do not know the gui but I do know textures in great resolution, I recommend that you identify the real value of your image, is it 64 x 32? or customized. it is obvious that the image you want to use is longer than the one that appears in the game you can use it without modifying the code
  6. after checking your code I got confused, I think it should look like this: torso = new ModelRenderer(this, 16, 32); /////////////(parameters of setTexture) torso.func_228300_a_(-4.0F, -7.0F, -4.0F, 7.0F, 4.0F, 8.0F, 0.0F); torso.setRotationPoint(0F, 0F, 0F);
  7. also add the parameters of setTextureOffset as you use it you are adding the same texture to all parts
  8. It is obfuscated, I think that is how it is used .func_228300_a_ for example: leftshoe.func_228300_a_(-2.5F, 9.1F, -2.5F, 5, 3, 5); yourfield.func_228300_a_(position, dimensions); I don't speak English, I hope to be of help
  9. First let me clarify that I use the google translator I speak Spanish so my writing may have errors this class adds the 3d model to armoritem i use it because my mod adds various armor package com.valtiel.vgirlarmor.item.armor; import com.valtiel.vgirlarmor.proxy.ClientProxy; import net.minecraft.client.renderer.entity.model.BipedModel; import net.minecraft.entity.LivingEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.IArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; public class Girl_Armor extends ArmorItem { public final EquipmentSlotType type; public Girl_Armor(IArmorMaterial mat, EquipmentSlotType type, Properties props) { super(mat, type, props); this.type = type; } @SuppressWarnings({ "rawtypes", "unchecked" }) @Override @OnlyIn(Dist.CLIENT) public BipedModel getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, BipedModel original) { BipedModel armorModel = ClientProxy.armorModels.get(this); if (armorModel != null) { armorModel.bipedHead.showModel = armorSlot == EquipmentSlotType.HEAD; armorModel.bipedHeadwear.showModel = false; armorModel.bipedBody.showModel = armorSlot == EquipmentSlotType.CHEST || armorSlot == EquipmentSlotType.LEGS; armorModel.bipedRightArm.showModel = armorSlot == EquipmentSlotType.CHEST; armorModel.bipedLeftArm.showModel = armorSlot == EquipmentSlotType.CHEST; armorModel.bipedRightLeg.showModel = armorSlot == EquipmentSlotType.LEGS || armorSlot == EquipmentSlotType.FEET; armorModel.bipedLeftLeg.showModel = armorSlot == EquipmentSlotType.LEGS || armorSlot == EquipmentSlotType.FEET; } return armorModel; } } this is my armor class, when extending "girl armor" the 3d model is automatically added, if you only want to make an armor add the "girl armor" code and extend armoritem ckage com.valtiel.vgirlarmor.item.armor; import javax.annotation.Nonnull; import com.valtiel.vgirlarmor.Girl_Armor_Mod; import com.valtiel.vgirlarmor.item.ItemModHats; import com.valtiel.vgirlarmor.item.ItemModShoes; import com.valtiel.vgirlarmor.item.ItemModSkirts; import com.valtiel.vgirlarmor.item.ItemModTops; import net.minecraft.entity.Entity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.IArmorMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvents; import net.minecraftforge.registries.ForgeRegistries; public class Diamond_Girl_Armor extends Girl_Armor { public static final IArmorMaterial DIAMOND_A = new IArmorMaterial() { private final int[] damageReduction = {4, 6, 8, 4}; @Override public int getDurability(EquipmentSlotType slotIn) { return 550; } @Override public int getDamageReductionAmount(EquipmentSlotType slotIn) { return damageReduction[slotIn.getIndex()]; } @Override public int getEnchantability() { return 40; } @Override public SoundEvent getSoundEvent() { return SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND; } @Override public Ingredient getRepairMaterial() { Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation("minecraft", "diamond")); return Ingredient.fromItems(item); } @Override public String getName() { return "diamond_girl"; } @Override public float getToughness() { return 3; } }; public final EquipmentSlotType type; public Diamond_Girl_Armor(EquipmentSlotType type, IArmorMaterial mat, Properties props) { super(mat, type, props); this.type = type; } @Nonnull @Override public final String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type){ if(stack.getItem() == ItemModSkirts.Diamond_Skirt) { return Girl_Armor_Mod.modId + ":" + "/textures/models/armor/diamond_girl_armor_layer_2.png" ; } else if(stack.getItem() == ItemModHats.Diamond_Hat || stack.getItem() == ItemModTops.Diamond_Top || stack.getItem() == ItemModShoes.Diamond_Shoes) { return Girl_Armor_Mod.modId + ":" + "/textures/models/armor/diamond_girl_armor_layer_1.png" ; } return null; } } my model class, just an example package com.valtiel.vgirlarmor.models; import net.minecraft.client.renderer.entity.model.BipedModel; import net.minecraft.client.renderer.model.ModelRenderer; public class Girl_Armor_Model extends BipedModel { //fields ModelRenderer torso2; public Girl_Armor_Model(float expand) { super(expand, 0, 128, 64); ////torso2 torso2 = new ModelRenderer(this, 16, 32); torso2.func_228301_a_(-4F, 0F, -2F, 8, 12, 4, expand/(15.0F)); torso2.setRotationPoint(0F, 0F, 0F); torso2.setTextureSize(128, 64); torso2.mirror = true; setRotation(torso2, 0F, 0F, 0F); this.bipedBody.addChild(torso2); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } } itemMod package com.valtiel.vgirlarmor.item; import com.valtiel.vgirlarmor.Girl_Armor_Mod; import com.valtiel.vgirlarmor.item.armor.Diamond_Girl_Armor; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.Item; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.IForgeRegistry; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class ItemModHats { public static final Item Diamond_Hat = new Diamond_Girl_Armor(EquipmentSlotType.HEAD, Diamond_Girl_Armor.DIAMOND_A, unstackable()).setRegistryName(Girl_Armor_Mod.modId, "diamond_hat"); @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> evt) { IForgeRegistry<Item> registry = evt.getRegistry(); registry.register(Diamond_Hat); } public static Item.Properties defaultBuilder() { return new Item.Properties().group(Girl_Armor_Mod.Girl_Armor_Hats); } private static Item.Properties unstackable() { return defaultBuilder().maxStackSize(1); } } finally client proxy, this registers the 3d model in the mod package com.valtiel.vgirlarmor.proxy; import java.util.HashMap; import java.util.Map; import com.valtiel.vgirlarmor.item.ItemModHats; import com.valtiel.vgirlarmor.models.Girl_Armor_Model; import net.minecraft.client.renderer.entity.model.BipedModel; import net.minecraft.item.Item; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod.EventBusSubscriber(Dist.CLIENT) public class ClientProxy implements IProxy { @SuppressWarnings("rawtypes") public static final Map<Item, BipedModel> armorModels = new HashMap<Item, BipedModel>(); public void registerHandlers() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); Girl_Armor_Model girlarmor = new Girl_Armor_Model(1.0F); Girl_Armor_Model girlskirt = new Girl_Armor_Model(0.5F); armorModels.put(ItemModHats.Diamond_Hat, girlarmor); armorModels.put(ItemModTops.Diamond_Top, girlarmor); armorModels.put(ItemModSkirts.Diamond_Skirt, girlskirt); armorModels.put(ItemModShoes.Diamond_Shoes, girlarmor); } private void clientSetup(FMLClientSetupEvent event) { } } with this code eliminate the problem of lag in second and third person
  10. First define what version of minecraft you use, in 1.14.4 I already found the solution, click on my user to see the link, with that code I had lag problems if you have the same problem let me know
  11. I think you mean this @Override @OnlyIn(Dist.CLIENT) public BipedModel getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, BipedModel original) { return new Girl_Armor_Model(1.0f); } I'm sorry to tell you that this code used to cause lag in the second and third person
  12. it works. I leave this code in case someone needs it @SuppressWarnings("unchecked") @Nullable @Override public <A extends BipedModel<?>> A getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, A _default) { GirlArmorModel girl_armor = new GirlArmorModel(1F); girl_armor.field_78116_c.showModel = armorSlot == EquipmentSlotType.HEAD; girl_armor.bipedHeadwear.showModel = armorSlot == EquipmentSlotType.HEAD; girl_armor.field_78115_e.showModel = (armorSlot == EquipmentSlotType.CHEST) || (armorSlot == EquipmentSlotType.CHEST); girl_armor.bipedRightArm.showModel = armorSlot == EquipmentSlotType.CHEST; girl_armor.bipedLeftArm.showModel = armorSlot == EquipmentSlotType.CHEST; girl_armor.bipedRightLeg.showModel = (armorSlot == EquipmentSlotType.LEGS) || (armorSlot == EquipmentSlotType.FEET); girl_armor.bipedLeftLeg.showModel = (armorSlot == EquipmentSlotType.LEGS) || (armorSlot == EquipmentSlotType.FEET); girl_armor.isChild = _default.isChild; girl_armor.isSneak = _default.isSneak; girl_armor.isSitting = _default.isSitting; girl_armor.rightArmPose = _default.rightArmPose; girl_armor.leftArmPose = _default.leftArmPose; return (A) girl_armor; } } changes ModelBiped BipedModel<LivingEntity> ModelRenderer RendererModel bipedBody field_78115_e bipedHead field_78116_c
  13. my model armor is not rendered, I think the biggest change is armor class: 1.7.10 to 1.13.2 public ModelBiped getArmorModel (EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped defaultModel) { ModelBiped armorModel = ClientProxy.armorModels.get(this); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1.14 modelbiped change by "BipedModel <LivingEntity>" EntityLivingBase change by LivingEntity public BipedModel<LivingEntity> getArmorModel (LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, BipedModel defaultModel) { BipedModel<LivingEntity> armorModel = ClientProxy.armorModels.get(this);
  14. I would like to know what changes have been made in the rendering of custom armor model. I know that "modelbiped" change by BipedModel <LivingEntity> Up to 1.13.2 I have used the classic method
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.