Jump to content

3d Rendering Armor


BreadBear

Recommended Posts

does anyone know how i can add a 3d render for my armor i followed a tutorial from technovision for 1.15.2 but it only shows how to add basic vanilla style armor but i have 3d model for custom armor and im not sure about how to make it 3d from the point i have gotten to if anyone could help me i would greatly appreciate it.

Heres the link to the tutorial to reference what i have done so far i have completed everything else and everything else aside from the armor on the body render is fine.

https://www.youtube.com/watch?v=kJrlfzjrHqE&list=PLDhiRTZ_vnoWsCqtoG1X1MbGY5xATTadb&index=8

Link to comment
Share on other sites

  • 2 weeks later...
On 8/13/2021 at 5:07 PM, diesieben07 said:

Show your code.

//Main Class
import com.breadbear.petalsprettyhats.util.RegistryHandler;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;


@Mod("pph")
public class PrettyHats
{
    private static final Logger LOGGER = LogManager.getLogger();
    public static final String MOD_ID = "pph";

    public PrettyHats() {
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);

        RegistryHandler.init();

        MinecraftForge.EVENT_BUS.register(this);
    }

    private void setup(final FMLCommonSetupEvent event) { }

    private void doClientStuff(final FMLClientSetupEvent event) { }

    public static final ItemGroup TAB = new ItemGroup("Petals_Petally_Hats") {

        @Override
        public ItemStack createIcon() {
            return new ItemStack(RegistryHandler.RED_TULIP_HAT.get());
        }

    };

}
//ArmorMaterialClass
import com.breadbear.petalsprettyhats.PrettyHats;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.IArmorMaterial;
import net.minecraft.item.Items;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.SoundEvents;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import java.util.function.Supplier;

public enum RPHModArmorMaterial implements IArmorMaterial {

    RED_TULIP(PrettyHats.MOD_ID + "red_tulip", 0, new int[] { 0,0,0,0 }, 18,
            SoundEvents.BLOCK_GRASS_PLACE, 0.0f, () -> { return Ingredient.fromItems(Items.RED_TULIP.getItem()); });


    private static final int[] MAX_DAMAGE_ARRAY = new int[] {0, 0, 0, 0 };
    private final String name;
    private final int maxDamageFactor;
    private final int[] damageReductionAmountArray;
    private final int enchantability;
    private final SoundEvent soundEvent;
    private final float toughness;
    private final Supplier<Ingredient> repairMaterial;

    RPHModArmorMaterial(String name, int maxDamageFactor, int[] damageReductionAmountArray, int enchantability,
                        SoundEvent soundEvent, float toughness, Supplier<Ingredient> repairMaterial) {
        this.name = name;
        this.maxDamageFactor = maxDamageFactor;
        this.damageReductionAmountArray = damageReductionAmountArray;
        this.enchantability = enchantability;
        this.soundEvent = soundEvent;
        this.toughness = toughness;
        this.repairMaterial = repairMaterial;

    }


    @Override
    public int getDurability(EquipmentSlotType slotIn) {
        return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor;
    }

    @Override
    public int getDamageReductionAmount(EquipmentSlotType slotIn) {
        return this.damageReductionAmountArray[slotIn.getIndex()];
    }

    @Override
    public int getEnchantability() {
        return this.enchantability;
    }

    @Override
    public SoundEvent getSoundEvent() {
        return this.soundEvent;
    }

    @Override
    public Ingredient getRepairMaterial() {
        return this.repairMaterial.get();
    }


    @OnlyIn(Dist.CLIENT)
    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public float getToughness() {
        return this.toughness;
    }
}
//RegistryHandler
import com.breadbear.petalsprettyhats.PrettyHats;
import com.breadbear.petalsprettyhats.armour.OPHModArmorMaterial;
import com.breadbear.petalsprettyhats.armour.PPHModArmorMaterial;
import com.breadbear.petalsprettyhats.armour.RPHModArmorMaterial;
import com.breadbear.petalsprettyhats.armour.WPHModArmorMaterial;
import com.breadbear.petalsprettyhats.items.ItemBase;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.Item;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

public class RegistryHandler {

    public static final DeferredRegister<Item> ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, PrettyHats.MOD_ID);

    public static void init() {
        ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
    }


    // Items
    public static final RegistryObject<Item> RED_TULIP_HAT = ITEMS.register("red_tulip_hat", ItemBase::new);

    // Armour
    public static final RegistryObject<ArmorItem> RED_TULIP_POT_HAT = ITEMS.register("red_tulip_pot_hat", () ->
            new ArmorItem(RPHModArmorMaterial.RED_TULIP, EquipmentSlotType.HEAD, new Item.Properties().group(PrettyHats.TAB)));

    public static final RegistryObject<ArmorItem> WHITE_TULIP_POT_HAT = ITEMS.register("white_tulip_pot_hat", () ->
            new ArmorItem(WPHModArmorMaterial.WHITE_TULIP, EquipmentSlotType.HEAD, new Item.Properties().group(PrettyHats.TAB)));

    public static final RegistryObject<ArmorItem> ORANGE_TULIP_POT_HAT = ITEMS.register("orange_tulip_pot_hat", () ->
            new ArmorItem(OPHModArmorMaterial.ORANGE_TULIP, EquipmentSlotType.HEAD, new Item.Properties().group(PrettyHats.TAB)));

    public static final RegistryObject<ArmorItem> PINK_TULIP_POT_HAT = ITEMS.register("pink_tulip_pot_hat", () ->
            new ArmorItem(PPHModArmorMaterial.PINK_TULIP, EquipmentSlotType.HEAD, new Item.Properties().group(PrettyHats.TAB)));
}

sorry if this isnt  up to scratch this is my first time asking for support here sorry for the big delay also

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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