Jump to content

Recommended Posts

Posted (edited)

Title explains it all, I think.

I'm attempting to make an armor set that extends from DyeableArmorItem instead of ArmorItem and for some reason the armor model's color is not changing in-game. While the dye crafting recipes work, the resulting "tint colors" are not showing up on my character or on the inventory icon (except for the "Dyed" tag).

Any assistance?

Edited by CatzRule81
Solved.
  • CatzRule81 changed the title to [1.18.2] Custom armor set extending DyeableArmorItem is dye-able, but not displaying
  • 2 weeks later...
  • 2 weeks later...
Posted (edited)
  On 5/15/2024 at 7:12 PM, Toasterkid said:

Your files are named like this?

  • armormaterial_layer_1.png
  • armormaterial_layer_1_overlay.png
  • armormaterial_layer_2.png
  • armormaterial_layer_2_overlay.png
Expand  

Sorry for the delayed response. Yes, my armor textures are named as such, although the overlay PNGs are just fully transparent images because I wanted the entire armor to be dyed. Not just only certain areas like how leather armor has it.

leather armor overlays are the sole reason I'm trying to do this lol.

EDIT: Only the items have overlay textures, unsure what to do with the armor textures because I can't access Vanilla's own PNG files. For some reason...

Edited by CatzRule81
Posted

Update on the above: Just tried creating blank (fully transparent) armor overlay layers named similarly to what Toasterkid specified, no changes. I wish this was as simple as just editing *.json  data files in the same way I could put layering on the "item in hand" models but apparently Minecraft is not gonna be easy about this one.

Using CTRL+F to search the vanilla DyeableLeatherItem and DyeableArmorItem for words such as "layer", "overlay", and "color" doesn't help much either. Might be something with the Forge getArmorTexture() method but I'm not sure how to do layering with those, since all that method is meant to return is a single String value.

  • 2 months later...
  • 1 month later...
Posted

Figured out how to do armor layering thanks to another post for 1.8.9 that still worked for 1.18.2, so credits to them. However, now I have the opposite problem; the armor textures are displaying colors correctly but the items are no longer doing so. I've already edited the JSON texture layering files like so:

{
  "parent": "item/generated",
  "textures": {
    "layer0": "cai:items/wool_leggings",
    "layer1": "cai:items/blank"
  }
}

(also "CAI" stands for "Catz's Adventure Items" if you wanted to know that, it's a private mod)

So far I've already used the following in my code:

  • Extending DyeableArmorItem
  • Implementing DyeableLeatherItem
  • Overridden getColor() and getArmorTexture() to allow armor layering to work (see above linked post)

Anyone know what's up with that? Am I layering the textures incorrectly? Is there some item color class implementation I'm missing?

Posted
  On 9/8/2024 at 1:25 AM, Shipwrecker said:

Maybe there's something happening in the 'leather armor + dye' recipe itself that would be updating the held item texture?

Expand  

I am not using hardcoded recipes, I'm using Vanilla's already existing code for leather armor dying. (via extending and implementing DyeableArmorItem / DyeableLeatherItem respectively)

I have actually figured out that it's something to do with registering item colors to the ItemColors instance, but I'm trying to figure out where exactly in my mod's code I would be placing a call to the required event handler. Unfortunately the tutorial is criminally undescriptive. The most I've found is that it has to be done during client initialization.

I'm currently trying to do the necessary setup via hijacking the item registry since trying to modify the item classes directly (via using SubscribeEvent in the item's constructor didn't work. Class so far:

// mrrp mrow - mcmod item painter v1.0 - catzrule ch
package catzadvitems.init;

import net.minecraft.client.color.item.ItemColors;
import net.minecraft.world.item.Item;

import net.minecraftforge.registries.ObjectHolder;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.client.event.ColorHandlerEvent;

import catzadvitems.item.DyeableWoolArmorItem;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class Painter {
	@ObjectHolder("cai:dyeable_wool_chestplate")
	public static final Item W_CHEST = null;
	@ObjectHolder("cai:dyeable_wool_leggings")
	public static final Item W_LEGS = null;
	@ObjectHolder("cai:dyeable_wool_boots")
	public static final Item W_SOCKS = null;
	
	public Painter() {
      // left blank, idk if forge throws a fit if constructors are missing, not taking the chance of it happening.
	}

	@SubscribeEvent
	public static void init(FMLClientSetupEvent event) {
		new Painter();
	}

	@Mod.EventBusSubscriber
	private static class ForgeBusEvents {
	
		@SubscribeEvent
		public static void registerItemColors(ColorHandlerEvent.Item event) {
			ItemColors col = event.getItemColors();
			
			col.register(DyeableUnderArmorItem::getItemDyedColor, W_CHEST, W_LEGS, W_SOCKS);

			//placeholder for other dye-able items here later..
			
		}
	}
}

(for those wondering, i couldn't think of a creative wool helmet name)

Posted
  On 9/8/2024 at 2:12 PM, scientistknight1 said:

What about naming it a "wool cap" or "wool hat"?

Expand  

"Leather Cap" is already taken and "Wool Hat" sounds a bit over generic, but I might look into a "Wool Beanie" after I figure out how to fix the issue of item colors not working.

That being said, still looking for solutions.

Posted

I found how to do this from a similar issue for MC 1.16. Basically, instead of trying to hijack the registry using ObjectHolder, you can just get the items from the registry directly.

So DON'T do this:

@ObjectHolder("modid:your_item_id")
public static final Item ITEM_OBJECT_HOLDER = null;

// [...]

event.getItemColors().register(itemClass::someMethodToGetItemColor, ITEM_OBJECT_HOLDER)

Do this instead:

event.getItemColors().register(itemClass::someMethodToGetItemColor, ModItemsClass.YOUR_ITEM_REGISTRY_NAME.get())

 

  • CatzRule81 changed the title to [SOLVED] [1.18.2] Custom armor set extending DyeableArmorItem is dye-able, but not displaying

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • my game keeps crashing right before launching the game before full screen and keeps poping up this error message "error code 1 " The game crashed: rendering overlay Error: java.lang.IllegalAccessError: failed to access class com.mojang.blaze3d.platform.GlStateManager$TextureState from class net.coderbot.iris.gl.IrisRenderSystem$DSAARB (com.mojang.blaze3d.platform.GlStateManager$TextureState is in module minecraft@1.18.2 of loader 'TRANSFORMER' @d919544; net.coderbot.iris.gl.IrisRenderSystem$DSAARB is in module oculus@1.6.4 of loader 'TRANSFORMER' @d919544)
    • removing oculus or any of ETF or EMF or even embeddium doesn't change anything it just crashes again with error -1  https://gist.github.com/Tikalian-coconut/d49e8fb83bf57d5e04eb042522046786 this time i removed all 4 at same time and that gave it something is wrong with the game seriously..
    • crash report -> https://gist.github.com/Tikalian-coconut/18c41f97bdacef54725e5141f57697d7 from what i see it seems like Entity Texture Features doesn't like Oculus doing something or invert.. not sure it's why everything is all black textured but that causes a -1 error
    • well that's bad, cuz there's no crash report at all (the last crash report is from previous replies) it's probably another issue that doesn't fit in this bug report, the game works fine except that everything is black, no texture except the sky and skin, everything else is just black i've tried reloading the textures in game, see for drivers updates but it did nothing, seems like an issue with Embeddium or Oculus i think, but i know nothing compared to you i can still send the latest debug and latest.log files.. edit: it seems that when i re-add rechiseled (1.1.6-1.20.1) it crashes as error 1 (i can't remove it off from the modpack cuz that'll break all my builds on some maps) lemme start the game and get it to crash to get a crash report done)
    • If you've fallen victim to a crypto scam, you're not alone and thankfully, you're not without options. I highly recommend iBolt Cyber Hacker Company for anyone seeking professional and effective assistance in recovering scammed cryptocurrency. After extensive research and hearing from multiple satisfied clients, it's clear that iBolt stands out in a crowded and often unreliable market. Their team of experienced cyber experts and blockchain analysts uses advanced tracking techniques to follow stolen funds across the blockchain and engage with crypto exchanges when possible. They’re not just tech-savvy—they’re strategic and persistent. WHY CHOOSE iBOLT CYBER HACKER COMPANY? (1) Proven success in crypto asset recovery (2) Fast, professional, and discreet service (3) Skilled in blockchain forensics and cyber investigation (4) Committed to fighting online fraud and supporting victims Don’t give up. I strongly recommend reaching out to iBolt Cyber Hacker Company. ENQUIRIES: info @ iboltcyberhack . org/ www . iboltcyberhack. org/ +39. 351. 105. 3619.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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