Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey so I'd like to make two armor classes "ItemArmorMyCustomArmor" and "ItemArmorMyCustomArmorWithOverlay"

 

I found a tutorial on how to make the first armor class (so this means I know I need to look in "myModId:textures/model/armor/" for the layer_1 and 2.png) however it did not explain how to add overlays (I know how to do this for normal items) and looking in the ItemArmor class seems like only CLOTH or leather armor types get the overlays. How ever I do not want vanilla overlays or use CLOTH for all my armor types, I want to make suits of armor that can be customized by the owner (dying leather armor, only now can dye trim and armor base)

 

here is my attempt at the normal armor:

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ee.rot.Rot;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;

public class ItemArmorCustom extends ItemArmor
{

private String texturePath = Rot.MODID+":textures/model/armor/";

public ItemArmorCustom(ItemArmor.ArmorMaterial mat, int wornSlot, String type)
{
	super(mat, 0, wornSlot);
	this.setMaxStackSize(1);
	this.setTextureName(type, wornSlot);
}

private void setTextureName(String type, int armorPart)
{
	switch(armorType)
	{
		case 0:
		case 1:
		case 3:
			this.texturePath += type + "_layer_1.png";
			break;
		case 2:
			this.texturePath += type + "_layer_2.png";
			break;
	}
}

@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ir)
{
	this.itemIcon = ir.registerIcon(Rot.MODID+":"+this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf('.')+1));
	super.registerIcons(ir);
}

@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot,
		String type)
{
	return texturePath;
}
}

 

If something is wrong or should be done differently being corrected and educated would be much appreciated the tutorial I watched was for 1.6.4 which shouldn't make a difference other then wondering why he made a separate method to set the texture location. 

  • Author

ok did some more digging and I found that renderBiped and renderPlayer are what call "getArmorTexture" from Item (which is used mainly in ItemArmor that extends Item)

 

So I guess I need to know how to make a custom renderer for players wearing my armor so I can use more render passes to do my overlays?

  • 2 weeks later...
  • Author

Well with some searching I think a few others have asked this question and no response to each one, guess this is impossible or no one knows how?

 

How do I make a suggestion for the forge guys to add something like this in? And if it is How do I go about this path of armor with overlays.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.