use of net.silentchaos512.lib.crafting.ingredient.ExclusionIngredient in project Silent-Gear by SilentChaos512.
the class MaterialsProvider method addWoods.
private void addWoods(Collection<MaterialBuilder> ret) {
// Wood
ExclusionIngredient planksIngredient = ExclusionIngredient.of(ItemTags.PLANKS, Items.ACACIA_PLANKS, Items.BIRCH_PLANKS, Items.DARK_OAK_PLANKS, Items.JUNGLE_PLANKS, Items.OAK_PLANKS, Items.SPRUCE_PLANKS, ModBlocks.NETHERWOOD_PLANKS, Items.CRIMSON_PLANKS, Items.WARPED_PLANKS);
ExclusionIngredient woodRodSubstitute = ExclusionIngredient.of(Tags.Items.RODS_WOODEN, CraftingItems.NETHERWOOD_STICK);
ret.add(new MaterialBuilder(Const.Materials.WOOD.getId(), 0, planksIngredient).categories(MaterialCategories.ORGANIC, MaterialCategories.WOOD).partSubstitute(PartType.ROD, woodRodSubstitute).stat(PartType.MAIN, ItemStats.DURABILITY, 59).stat(PartType.MAIN, ItemStats.ARMOR_DURABILITY, 8).stat(PartType.MAIN, ItemStats.REPAIR_VALUE, 0.25f).stat(PartType.MAIN, ItemStats.ENCHANTABILITY, 15).stat(PartType.MAIN, ItemStats.HARVEST_LEVEL, 0).stat(PartType.MAIN, ItemStats.HARVEST_SPEED, 2).stat(PartType.MAIN, ItemStats.MELEE_DAMAGE, 0).stat(PartType.MAIN, ItemStats.MAGIC_DAMAGE, 0).stat(PartType.MAIN, ItemStats.ATTACK_SPEED, 0.0f).stat(PartType.MAIN, ItemStats.ATTACK_SPEED, GearType.AXE, -0.2f).mainStatsArmor(1, 3, 2, 1, 0, // 7
2).stat(PartType.MAIN, ItemStats.RANGED_DAMAGE, 0).stat(PartType.MAIN, ItemStats.RANGED_SPEED, 0f).stat(PartType.MAIN, ItemStats.PROJECTILE_SPEED, 1f).stat(PartType.MAIN, ItemStats.PROJECTILE_ACCURACY, 0.9f).stat(PartType.MAIN, ItemStats.RARITY, 1).stat(PartType.MAIN, ItemStats.CHARGEABILITY, 0.6f).stat(PartType.ROD, ItemStats.ENCHANTABILITY, 0.1f, StatInstance.Operation.MUL2).stat(PartType.ROD, ItemStats.RARITY, 1).trait(PartType.MAIN, Const.Traits.FLAMMABLE, 1).trait(PartType.MAIN, Const.Traits.FLEXIBLE, 2).trait(PartType.MAIN, Const.Traits.JAGGED, 1).trait(PartType.ROD, Const.Traits.FLEXIBLE, 1).displayAll(PartTextureSet.LOW_CONTRAST, 0x896727).displayFragment(PartTextures.WOOD, 0X896727));
ret.add(wood("acacia", Items.ACACIA_PLANKS, 0xBA6337));
ret.add(wood("birch", Items.BIRCH_PLANKS, 0xD7C185));
ret.add(wood("dark_oak", Items.DARK_OAK_PLANKS, 0x4F3218));
ret.add(wood("jungle", Items.JUNGLE_PLANKS, 0xB88764));
ret.add(wood("oak", Items.OAK_PLANKS, 0xB8945F));
ret.add(wood("spruce", Items.SPRUCE_PLANKS, 0x82613A));
ret.add(wood("crimson", Items.CRIMSON_PLANKS, 0x7E3A56).trait(PartType.MAIN, Const.Traits.FLEXIBLE, 2).trait(PartType.MAIN, Const.Traits.JAGGED, 1).trait(PartType.ROD, Const.Traits.FLEXIBLE, 1));
ret.add(wood("warped", Items.WARPED_PLANKS, 0x398382).trait(PartType.MAIN, Const.Traits.FLEXIBLE, 2).trait(PartType.MAIN, Const.Traits.JAGGED, 1).trait(PartType.ROD, Const.Traits.FLEXIBLE, 1));
// Rough wood
ret.add(new MaterialBuilder(modId("wood/rough"), 0, Ingredient.EMPTY).categories(MaterialCategories.ORGANIC, MaterialCategories.WOOD).namePrefix(TextUtil.misc("crude")).partSubstitute(PartType.ROD, ModTags.Items.RODS_ROUGH).stat(PartType.ROD, ItemStats.DURABILITY, -0.25f, StatInstance.Operation.MUL1).stat(PartType.ROD, ItemStats.RARITY, -5, StatInstance.Operation.ADD).trait(PartType.ROD, Const.Traits.CRUDE, 3).display(PartType.ROD, PartTextureSet.LOW_CONTRAST, 0x6B4909).displayFragment(PartTextures.WOOD, 0x6B4909));
// Netherwood
ret.add(new MaterialBuilder(modId("netherwood"), 0, ModBlocks.NETHERWOOD_PLANKS).categories(MaterialCategories.ORGANIC, MaterialCategories.WOOD).partSubstitute(PartType.ROD, ModTags.Items.RODS_NETHERWOOD).stat(PartType.MAIN, ItemStats.DURABILITY, 72).stat(PartType.MAIN, ItemStats.ARMOR_DURABILITY, 12).stat(PartType.MAIN, ItemStats.REPAIR_VALUE, 0.1f).stat(PartType.MAIN, ItemStats.REPAIR_EFFICIENCY, 0.5f).stat(PartType.MAIN, ItemStats.ENCHANTABILITY, 13).stat(PartType.MAIN, ItemStats.HARVEST_LEVEL, 0).stat(PartType.MAIN, ItemStats.HARVEST_SPEED, 2).stat(PartType.MAIN, ItemStats.MELEE_DAMAGE, 0).stat(PartType.MAIN, ItemStats.MAGIC_DAMAGE, 0).stat(PartType.MAIN, ItemStats.ATTACK_SPEED, 0.2f).mainStatsArmor(1, 4, 2, 1, 0, // 8
6).stat(PartType.MAIN, ItemStats.RANGED_DAMAGE, 0).stat(PartType.MAIN, ItemStats.RANGED_SPEED, 0.0f).stat(PartType.MAIN, ItemStats.PROJECTILE_SPEED, 1f).stat(PartType.MAIN, ItemStats.PROJECTILE_ACCURACY, 0.8f).stat(PartType.MAIN, ItemStats.RARITY, 4).stat(PartType.MAIN, ItemStats.CHARGEABILITY, 0.7f).stat(PartType.ROD, ItemStats.DURABILITY, 70, StatInstance.Operation.MAX).stat(PartType.ROD, ItemStats.DURABILITY, -50, StatInstance.Operation.ADD).stat(PartType.ROD, ItemStats.HARVEST_SPEED, 1, StatInstance.Operation.ADD).stat(PartType.ROD, ItemStats.MELEE_DAMAGE, 0.5f, StatInstance.Operation.ADD).stat(PartType.ROD, ItemStats.RARITY, 3).trait(PartType.MAIN, Const.Traits.FLEXIBLE, 3).trait(PartType.MAIN, Const.Traits.JAGGED, 2).trait(PartType.ROD, Const.Traits.FLEXIBLE, 2).display(PartType.MAIN, PartTextureSet.LOW_CONTRAST, 0xD83200).display(PartType.ROD, PartTextureSet.LOW_CONTRAST, 0xD83200).displayFragment(PartTextures.WOOD, 0xD83200));
// Bamboo
ret.add(new MaterialBuilder(modId("bamboo"), 0, Items.BAMBOO).categories(MaterialCategories.ORGANIC).partSubstitute(PartType.ROD, Items.BAMBOO).stat(PartType.ROD, ItemStats.DURABILITY, 0.05f, StatInstance.Operation.MUL1).stat(PartType.ROD, ItemStats.RARITY, 4).display(PartType.ROD, PartTextureSet.LOW_CONTRAST, 0x9AC162));
}
use of net.silentchaos512.lib.crafting.ingredient.ExclusionIngredient in project Silent-Gear by SilentChaos512.
the class MaterialsProvider method addStringsAndFibers.
private void addStringsAndFibers(Collection<MaterialBuilder> ret) {
// Fine Silk
ret.add(new MaterialBuilder(modId("fine_silk"), 2, CraftingItems.FINE_SILK).categories(MaterialCategories.ORGANIC, MaterialCategories.FIBER).stat(PartType.BINDING, ItemStats.DURABILITY, 0.1f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.ARMOR_DURABILITY, 0.1f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.MAGIC_ARMOR, 2, StatInstance.Operation.ADD).stat(PartType.BINDING, ItemStats.RARITY, 10, StatInstance.Operation.ADD).trait(PartType.BINDING, Const.Traits.LUCKY, 1).stat(PartType.CORD, ItemStats.DURABILITY, 0.1f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RANGED_DAMAGE, 0.07f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RARITY, 10, StatInstance.Operation.ADD).trait(PartType.CORD, Const.Traits.FLEXIBLE, 2).display(PartType.BINDING, PartTextureSet.LOW_CONTRAST, 0xCCFFFF).displayBowstring(0xCCFFFF).displayFragment(PartTextures.CLOTH, 0xCCFFFF));
// Flax
ret.add(new MaterialBuilder(modId("flax"), 1, CraftingItems.FLAX_STRING).categories(MaterialCategories.ORGANIC, MaterialCategories.FIBER).stat(PartType.BINDING, ItemStats.DURABILITY, -0.05f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.DURABILITY, 10, StatInstance.Operation.ADD).stat(PartType.BINDING, ItemStats.ARMOR_DURABILITY, 0.05f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.HARVEST_SPEED, 0.05f, StatInstance.Operation.MUL1).trait(PartType.BINDING, Const.Traits.FLEXIBLE, 1).stat(PartType.CORD, ItemStats.DURABILITY, 0.05f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RANGED_DAMAGE, -0.1f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RANGED_SPEED, 0.2f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RARITY, 6, StatInstance.Operation.ADD).display(PartType.BINDING, PartTextureSet.LOW_CONTRAST, 0xB3804B).displayBowstring(0x845E37).displayFragment(PartTextures.CLOTH, 0x845E37));
// Fluffy String
ret.add(new MaterialBuilder(modId("fluffy_string"), 1, CraftingItems.FLUFFY_STRING).categories(MaterialCategories.ORGANIC, MaterialCategories.FIBER).stat(PartType.BINDING, ItemStats.DURABILITY, 0.05f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.DURABILITY, -10, StatInstance.Operation.ADD).stat(PartType.BINDING, ItemStats.ARMOR_DURABILITY, 0.05f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.HARVEST_SPEED, -0.05f, StatInstance.Operation.MUL1).trait(PartType.BINDING, Const.Traits.FLEXIBLE, 1).stat(PartType.CORD, ItemStats.DURABILITY, 0.05f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RANGED_DAMAGE, 0.05f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RANGED_SPEED, -0.05f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RARITY, 7, StatInstance.Operation.ADD).display(PartType.BINDING, PartTextureSet.LOW_CONTRAST, 0xFFFAE5).displayBowstring(0xFFFAE5).displayFragment(PartTextures.CLOTH, 0xFFFAE5));
// Sinew
ret.add(new MaterialBuilder(modId("sinew"), 1, CraftingItems.SINEW_FIBER).categories(MaterialCategories.ORGANIC, MaterialCategories.FIBER).stat(PartType.BINDING, ItemStats.DURABILITY, 0.05f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.REPAIR_EFFICIENCY, -0.05f, StatInstance.Operation.MUL1).trait(PartType.BINDING, Const.Traits.FLEXIBLE, 2).stat(PartType.CORD, ItemStats.DURABILITY, 0.2f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RANGED_DAMAGE, 0.2f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RARITY, 8, StatInstance.Operation.ADD).trait(PartType.CORD, Const.Traits.FLEXIBLE, 1).display(PartType.BINDING, PartTextureSet.LOW_CONTRAST, 0xD8995B).displayBowstring(0x7E6962).displayFragment(PartTextures.CLOTH, 0x7E6962));
// String
ExclusionIngredient stringIngredient = ExclusionIngredient.of(Tags.Items.STRING, CraftingItems.FLAX_STRING, CraftingItems.FLUFFY_STRING, CraftingItems.SINEW_FIBER);
ret.add(new MaterialBuilder(modId("string"), 1, stringIngredient).categories(MaterialCategories.ORGANIC, MaterialCategories.FIBER).stat(PartType.BINDING, ItemStats.DURABILITY, -0.05f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.ARMOR_DURABILITY, 0.05f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.REPAIR_EFFICIENCY, 0.05f, StatInstance.Operation.MUL1).trait(PartType.BINDING, Const.Traits.FLEXIBLE, 1).stat(PartType.CORD, ItemStats.RANGED_SPEED, 0.1f, StatInstance.Operation.MUL1).stat(PartType.CORD, ItemStats.RARITY, 4, StatInstance.Operation.ADD).display(PartType.BINDING, PartTextureSet.LOW_CONTRAST, Color.VALUE_WHITE).displayBowstring(Color.VALUE_WHITE).displayFragment(PartTextures.CLOTH, Color.VALUE_WHITE));
// Vines
ret.add(new MaterialBuilder(modId("vine"), 0, Items.VINE).categories(MaterialCategories.ORGANIC).stat(PartType.BINDING, ItemStats.DURABILITY, 0.03f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.ARMOR_DURABILITY, -0.03f, StatInstance.Operation.MUL1).stat(PartType.BINDING, ItemStats.REPAIR_EFFICIENCY, 0.03f, StatInstance.Operation.MUL1).display(PartType.BINDING, PartTextureSet.LOW_CONTRAST, 0x007F0E));
}
use of net.silentchaos512.lib.crafting.ingredient.ExclusionIngredient in project Silent-Gear by SilentChaos512.
the class MaterialsProvider method addClothLikes.
private void addClothLikes(Collection<MaterialBuilder> ret) {
// Phantom Membrane
ret.add(new MaterialBuilder(modId("phantom_membrane"), 2, Items.PHANTOM_MEMBRANE).categories(MaterialCategories.ORGANIC, MaterialCategories.CLOTH).mainStatsCommon(0, 12, 10, 35, 0.7f).stat(PartType.MAIN, ItemStats.ARMOR_DURABILITY, GearType.ELYTRA, 17).mainStatsArmor(1, 2, 2, 1, 0, // 6
8).trait(PartType.MAIN, Const.Traits.RENEW, 2, new MaterialRatioTraitCondition(0.5f)).stat(PartType.GRIP, ItemStats.REPAIR_EFFICIENCY, 0.15f, StatInstance.Operation.MUL1).stat(PartType.GRIP, ItemStats.HARVEST_SPEED, 0.1f, StatInstance.Operation.MUL1).stat(PartType.GRIP, ItemStats.ATTACK_SPEED, 0.2f, StatInstance.Operation.ADD).stat(PartType.GRIP, ItemStats.RARITY, 8, StatInstance.Operation.ADD).trait(PartType.GRIP, Const.Traits.ANCIENT, 2).stat(PartType.LINING, ItemStats.ARMOR_DURABILITY, 4, StatInstance.Operation.ADD).trait(PartType.LINING, Const.Traits.LIGHT, 2).displayAll(PartTextureSet.LOW_CONTRAST, 0xC3B9A1).displayFragment(PartTextures.CLOTH, 0xC3B9A1));
// Fine Silk Cloth
ret.add(new MaterialBuilder(modId("fine_silk_cloth"), 2, CraftingItems.FINE_SILK_CLOTH).categories(MaterialCategories.ORGANIC, MaterialCategories.CLOTH).mainStatsCommon(0, 14, 14, 40, 0.9f).stat(PartType.MAIN, ItemStats.ARMOR_DURABILITY, GearType.ELYTRA, 18).mainStatsArmor(1, 2, 2, 1, 0, // 6
14).trait(PartType.MAIN, Const.Traits.SNOW_WALKER, 1, new GearTypeTraitCondition(GearType.BOOTS)).stat(PartType.GRIP, ItemStats.REPAIR_EFFICIENCY, 0.1f, StatInstance.Operation.MUL1).stat(PartType.GRIP, ItemStats.HARVEST_SPEED, 0.15f, StatInstance.Operation.MUL1).stat(PartType.GRIP, ItemStats.RARITY, 10, StatInstance.Operation.ADD).trait(PartType.GRIP, Const.Traits.ACCELERATE, 1).stat(PartType.LINING, ItemStats.ARMOR_DURABILITY, 5, StatInstance.Operation.ADD).stat(PartType.LINING, ItemStats.MAGIC_ARMOR, 2, StatInstance.Operation.ADD).trait(PartType.LINING, Const.Traits.FLEXIBLE, 3).displayAll(PartTextureSet.LOW_CONTRAST, 0xC3B9A1).displayFragment(PartTextures.CLOTH, 0xC3B9A1));
// Leather
ret.add(new MaterialBuilder(modId("leather"), 0, Tags.Items.LEATHER).categories(MaterialCategories.ORGANIC, MaterialCategories.CLOTH).mainStatsCommon(0, 5, 15, 11, 0.8f).mainStatsArmor(1, 3, 2, 1, 0, // 7
8).trait(PartType.MAIN, Const.Traits.SNOW_WALKER, 1, new GearTypeTraitCondition(GearType.BOOTS)).stat(PartType.GRIP, ItemStats.DURABILITY, 0.05f, StatInstance.Operation.MUL1).stat(PartType.GRIP, ItemStats.REPAIR_EFFICIENCY, 0.1f, StatInstance.Operation.MUL1).stat(PartType.GRIP, ItemStats.HARVEST_SPEED, 0.15f, StatInstance.Operation.MUL1).stat(PartType.GRIP, ItemStats.ATTACK_SPEED, 0.15f, StatInstance.Operation.ADD).stat(PartType.GRIP, ItemStats.RARITY, 5, StatInstance.Operation.ADD).trait(PartType.GRIP, Const.Traits.FLEXIBLE, 3).stat(PartType.LINING, ItemStats.ARMOR_DURABILITY, 1f, StatInstance.Operation.ADD).trait(PartType.LINING, Const.Traits.FLEXIBLE, 2).displayAll(PartTextureSet.LOW_CONTRAST, 0x805133).displayFragment(PartTextures.CLOTH, 0x805133));
// Wool
ExclusionIngredient woolIngredient = ExclusionIngredient.of(ItemTags.WOOL, Items.BLACK_WOOL, Items.BLUE_WOOL, Items.BROWN_WOOL, Items.CYAN_WOOL, Items.GRAY_WOOL, Items.GREEN_WOOL, Items.LIGHT_BLUE_WOOL, Items.LIGHT_GRAY_WOOL, Items.LIME_WOOL, Items.MAGENTA_WOOL, Items.ORANGE_WOOL, Items.PINK_WOOL, Items.PURPLE_WOOL, Items.RED_WOOL, Items.WHITE_WOOL, Items.YELLOW_WOOL);
ret.add(new MaterialBuilder(Const.Materials.WOOL.getId(), 0, woolIngredient).categories(MaterialCategories.ORGANIC, MaterialCategories.CLOTH).mainStatsCommon(0, 4, 7, 7, 0.7f).mainStatsArmor(0.5f, 2f, 1.0f, 0.5f, 0, // 4
4).trait(PartType.MAIN, Const.Traits.SNOW_WALKER, 1, new GearTypeTraitCondition(GearType.BOOTS)).stat(PartType.GRIP, ItemStats.REPAIR_EFFICIENCY, 0.2f, StatInstance.Operation.MUL1).stat(PartType.GRIP, ItemStats.HARVEST_SPEED, 0.1f, StatInstance.Operation.MUL1).stat(PartType.GRIP, ItemStats.ATTACK_SPEED, 0.2f, StatInstance.Operation.ADD).stat(PartType.GRIP, ItemStats.RARITY, 4, StatInstance.Operation.ADD).trait(PartType.GRIP, Const.Traits.FLEXIBLE, 1).stat(PartType.LINING, ItemStats.KNOCKBACK_RESISTANCE, 0.1f, StatInstance.Operation.ADD).trait(PartType.LINING, Const.Traits.FLEXIBLE, 1).displayAll(PartTextureSet.LOW_CONTRAST, Color.VALUE_WHITE).displayFragment(PartTextures.CLOTH, Color.VALUE_WHITE));
ret.add(wool("black", Items.BLACK_WOOL, 0x141519));
ret.add(wool("blue", Items.BLUE_WOOL, 0x35399D));
ret.add(wool("brown", Items.BROWN_WOOL, 0x724728));
ret.add(wool("cyan", Items.CYAN_WOOL, 0x158991));
ret.add(wool("gray", Items.GRAY_WOOL, 0x3E4447));
ret.add(wool("green", Items.GREEN_WOOL, 0x546D1B));
ret.add(wool("light_blue", Items.LIGHT_BLUE_WOOL, 0x3AAFD9));
ret.add(wool("light_gray", Items.LIGHT_GRAY_WOOL, 0x8E8E86));
ret.add(wool("lime", Items.LIME_WOOL, 0x70B919));
ret.add(wool("magenta", Items.MAGENTA_WOOL, 0xBD44B3));
ret.add(wool("orange", Items.ORANGE_WOOL, 0xF07613));
ret.add(wool("pink", Items.PINK_WOOL, 0xED8DAC));
ret.add(wool("purple", Items.PURPLE_WOOL, 0x792AAC));
ret.add(wool("red", Items.RED_WOOL, 0xA12722));
ret.add(wool("white", Items.WHITE_WOOL, 0xE9ECEC));
ret.add(wool("yellow", Items.YELLOW_WOOL, 0xF8C627));
}
use of net.silentchaos512.lib.crafting.ingredient.ExclusionIngredient in project Silent-Gear by SilentChaos512.
the class CombineFragmentsRecipe method assemble.
@Override
public ItemStack assemble(CraftingContainer craftingInventory) {
StackList list = StackList.from(craftingInventory);
ItemStack stack = list.firstOfType(FragmentItem.class);
if (stack.isEmpty())
return ItemStack.EMPTY;
IMaterialInstance material = FragmentItem.getMaterial(stack);
if (material == null)
return ItemStack.EMPTY;
// Get the actual item the fragment came from (if present)
if (!material.getItem().isEmpty()) {
return material.getItem();
}
// Try to get an equivalent item from the material's ingredient
ItemStack[] matchingStacks = material.getIngredient().getItems();
if (matchingStacks.length < 1) {
if (material.getIngredient() instanceof ExclusionIngredient) {
// Get excluded ingredients if no others are available
ItemStack[] allMatches = ((ExclusionIngredient) material.getIngredient()).getMatchingStacksWithExclusions();
if (allMatches.length > 0) {
return allMatches[0];
}
}
return ItemStack.EMPTY;
}
return matchingStacks[0].copy();
}
Aggregations