-
3d Rendering Armor
//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
-
BreadBear joined the community
-
3d Rendering Armor
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
IPS spam blocked by CleanTalk.