Jump to content

CatzRule81

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by CatzRule81

  1. 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())
  2. "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.
  3. 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)
  4. Yep it works but now I've got other problems. Life of a modder, I suppose.
  5. 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?
  6. Ayo, finally found this thread and I'm glad I did. Hopefully it works in 1.18.x. Thanks.
  7. Decided to come back to this and still haven't been able to figure anything out that works. So uhhhh...overdue bump
  8. 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.
  9. 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...
  10. Just use AttributeFix for the first one. It's literally a must have for any mod that wants to raise armor points above 30, or have health values above 2000, or basically anything else out of reach of Vanilla attribute limits. I don't know how you haven't heard of this because it's so widely used. Here's a link https://www.curseforge.com/minecraft/mc-mods/attributefix As for the other two, I'm not sure myself how to add attributes as I've never had to delve into this field of modding, and I'm decently sure you can just use a resource pack to remove the particle damage indicator. Not gonna tell you how to make a resource pack though, that is something you should figure out on your own.
  11. Felt like I should mention that the item textures (the "in hand" model) is being layered just like leather armor already.
  12. 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?
×
×
  • Create New...

Important Information

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