Jump to content

zero8034

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by zero8034

  1. i also finally managed to get it working heres my finished colorHandler that works currently for 1.18.2 and from what i can tell should work post version 1.12 //code start package com.zer0_the_wolf.layeredarmor.item.custom; import com.zer0_the_wolf.layeredarmor.item.LayeredArmoritems; import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.color.item.ItemColors; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.DyeableArmorItem; import net.minecraft.world.item.DyeableLeatherItem; import net.minecraft.world.item.ItemStack; import net.minecraftforge.client.event.ColorHandlerEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; public class ColorHandlers { @SubscribeEvent public static void registerItemColors(ColorHandlerEvent.Item event) { event.getItemColors().register(ColorHandlers::getColor, LayeredArmoritems.LEATHERCHAINHELMET.get(), LayeredArmoritems.LEATHERCHAINCHESTPLATE.get(), LayeredArmoritems.LEATHERCHAINLEGGINGS.get(), LayeredArmoritems.LEATHERCHAINBOOTS.get()); } private static int getColor(ItemStack pStack, int tintIndex) { CompoundTag compoundtag = pStack.getTagElement("display"); if (tintIndex == 0) { return compoundtag != null && compoundtag.contains("color", 99) ? compoundtag.getInt("color") : 10511680; } return 0xFFFFFF; } } //end code do note that you have to add a listener should be same place you added a listener for the event bus. mine looks like. eventBus.addListener(ColorHandlers::registerItemColors);
  2. iv done as best i can and gotten to the same stackoverflow error
  3. I'm trying to essentially do the same thing as you have but in 1.18.2 i dont see any of the comments to help with this could ya help me to do what ya did?
  4. as in the title I'm working on a mod for 1.18.2 and am almost done iv got all my items, textures, models, and recipes made except for the de-crafting recipes. let me give some context, I'm remaking my layered armor mod where you can take armor and layer them in sorts like how real armor is done. Leather being the base, chainmail being the middle layer, and the rest of the materials are available as a sort of plate to put on the outside cover. iv got the first stage of decrafting done via the craftRemainder() property. but there is a problem with this method when expanded to the rest of the items. N= netherite, C= chainmail, L= Leather LCN => LC , N works just fine with LC being the craft remainder of LCN and N being the result of the crafting recipe. if I set L as the craft remainder of LC then when constructing LCN via LC+N I get the expected result of LCN but with L left over in the crafting table that being a problematic extra. i had L set as the crafting remainder of LC because that is expected for LC => L , C spitting out C and leaving L behind. I'm not sure if there is a sort of trick I could do where for certain recipes the property craftRemainder() is set to null for LC specifically when doing certain recipes or if you can specify a recipe to leave an item behind rather than the item from the inside of a recipe leaving one behind? I'v tried to get .setContainerItem() to work but it hasn't worked either, effectively the same result.
×
×
  • Create New...

Important Information

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