Search in sources :

Example 1 with CureEffectsSpillingEffect

use of slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.CureEffectsSpillingEffect in project TinkersConstruct by SlimeKnights.

the class ModifierRecipeProvider method addSpillingRecipes.

private void addSpillingRecipes(Consumer<FinishedRecipe> consumer) {
    String folder = "tools/spilling/";
    // vanilla
    SpillingRecipeBuilder.forFluid(Fluids.WATER, FluidAttributes.BUCKET_VOLUME / 20).addEffect(new DamageSpillingEffect(LivingEntityPredicate.WATER_SENSITIVE, DamageType.PIERCING, 2f)).addEffect(ExtinguishSpillingEffect.INSTANCE).save(consumer, modResource(folder + "water"));
    SpillingRecipeBuilder.forFluid(Fluids.LAVA, FluidAttributes.BUCKET_VOLUME / 20).addEffect(new DamageSpillingEffect(LivingEntityPredicate.NOT_FIRE_IMMUNE, DamageType.FIRE, 2f)).addEffect(new SetFireSpillingEffect(10)).save(consumer, modResource(folder + "lava"));
    SpillingRecipeBuilder.forFluid(Tags.Fluids.MILK, FluidAttributes.BUCKET_VOLUME / 10).addEffect(new CureEffectsSpillingEffect(new ItemStack(Items.MILK_BUCKET))).addEffect(StrongBonesModifier.SPILLING_EFFECT).save(consumer, modResource(folder + "milk"));
    // blaze - more damage, less fire
    SpillingRecipeBuilder.forFluid(TinkerFluids.blazingBlood.getLocalTag(), FluidAttributes.BUCKET_VOLUME / 20).addEffect(new DamageSpillingEffect(LivingEntityPredicate.NOT_FIRE_IMMUNE, DamageType.FIRE, 3f)).addEffect(new SetFireSpillingEffect(5)).save(consumer, prefix(TinkerFluids.blazingBlood, folder));
    // slime
    int slimeballPiece = FluidValues.SLIMEBALL / 5;
    // earth - lucky
    SpillingRecipeBuilder.forFluid(TinkerFluids.earthSlime.getForgeTag(), slimeballPiece).addEffect(new EffectSpillingEffect(MobEffects.LUCK, 15, 1)).addEffect(new EffectSpillingEffect(MobEffects.MOVEMENT_SLOWDOWN, 15, 1)).save(consumer, prefix(TinkerFluids.earthSlime, folder));
    // sky - jump boost
    SpillingRecipeBuilder.forFluid(TinkerFluids.skySlime.getLocalTag(), slimeballPiece).addEffect(new EffectSpillingEffect(MobEffects.JUMP, 20, 1)).addEffect(new EffectSpillingEffect(MobEffects.MOVEMENT_SLOWDOWN, 15, 1)).save(consumer, prefix(TinkerFluids.skySlime, folder));
    // ender - levitation
    SpillingRecipeBuilder.forFluid(TinkerFluids.enderSlime.getLocalTag(), slimeballPiece).addEffect(new EffectSpillingEffect(MobEffects.LEVITATION, 5, 1)).addEffect(new EffectSpillingEffect(MobEffects.MOVEMENT_SLOWDOWN, 15, 1)).save(consumer, prefix(TinkerFluids.enderSlime, folder));
    // slimelike
    // blood - food
    SpillingRecipeBuilder.forFluid(TinkerFluids.blood.getLocalTag(), slimeballPiece).addEffect(new RestoreHungerSpillingEffect(1, 0.2f)).addEffect(new EffectSpillingEffect(MobEffects.DIG_SLOWDOWN, 10, 1)).save(consumer, prefix(TinkerFluids.blood, folder));
    // venom - poison
    SpillingRecipeBuilder.forFluid(TinkerFluids.venom.getLocalTag(), slimeballPiece).addEffect(new EffectSpillingEffect(MobEffects.POISON, 25, 1)).save(consumer, prefix(TinkerFluids.venom, folder));
    // magma - fire resistance
    SpillingRecipeBuilder.forFluid(TinkerFluids.magma.getForgeTag(), slimeballPiece).addEffect(new EffectSpillingEffect(MobEffects.FIRE_RESISTANCE, 25, 1)).save(consumer, prefix(TinkerFluids.magma, folder));
    // soul - slowness and blindness
    SpillingRecipeBuilder.forFluid(TinkerFluids.liquidSoul.getLocalTag(), slimeballPiece).addEffect(new EffectSpillingEffect(MobEffects.MOVEMENT_SLOWDOWN, 25, 2)).addEffect(new EffectSpillingEffect(MobEffects.BLINDNESS, 5, 1)).save(consumer, prefix(TinkerFluids.liquidSoul, folder));
    // ender - teleporting
    SpillingRecipeBuilder.forFluid(TinkerFluids.moltenEnder.getForgeTag(), FluidAttributes.BUCKET_VOLUME / 20).addEffect(new DamageSpillingEffect(DamageType.MAGIC, 1f)).addEffect(TeleportSpillingEffect.INSTANCE).save(consumer, prefix(TinkerFluids.moltenEnder, folder));
    // multi-recipes
    SpillingRecipeBuilder.forFluid(TinkerTags.Fluids.GLASS_SPILLING, FluidAttributes.BUCKET_VOLUME / 10).addEffect(new DamageSpillingEffect(LivingEntityPredicate.NOT_FIRE_IMMUNE, DamageType.FIRE, 1f)).addEffect(new SetFireSpillingEffect(3)).save(consumer, modResource(folder + "glass"));
    SpillingRecipeBuilder.forFluid(TinkerTags.Fluids.CLAY_SPILLING, FluidAttributes.BUCKET_VOLUME / 20).addEffect(new DamageSpillingEffect(LivingEntityPredicate.NOT_FIRE_IMMUNE, DamageType.FIRE, 1.5f)).addEffect(new SetFireSpillingEffect(3)).save(consumer, modResource(folder + "clay"));
    SpillingRecipeBuilder.forFluid(TinkerTags.Fluids.CHEAP_METAL_SPILLING, FluidValues.NUGGET).addEffect(new DamageSpillingEffect(LivingEntityPredicate.NOT_FIRE_IMMUNE, DamageType.FIRE, 1.5f)).addEffect(new SetFireSpillingEffect(7)).save(consumer, modResource(folder + "metal_cheap"));
    SpillingRecipeBuilder.forFluid(TinkerTags.Fluids.AVERAGE_METAL_SPILLING, FluidValues.NUGGET).addEffect(new DamageSpillingEffect(LivingEntityPredicate.NOT_FIRE_IMMUNE, DamageType.FIRE, 2f)).addEffect(new SetFireSpillingEffect(7)).save(consumer, modResource(folder + "metal_average"));
    SpillingRecipeBuilder.forFluid(TinkerTags.Fluids.EXPENSIVE_METAL_SPILLING, FluidValues.NUGGET).addEffect(new DamageSpillingEffect(LivingEntityPredicate.NOT_FIRE_IMMUNE, DamageType.FIRE, 2.5f)).addEffect(new SetFireSpillingEffect(7)).save(consumer, modResource(folder + "metal_expensive"));
    // gold applies magic
    SpillingRecipeBuilder.forFluid(TinkerFluids.moltenGold.getForgeTag(), FluidValues.NUGGET).addEffect(new DamageSpillingEffect(DamageType.MAGIC, 2f)).addEffect(new SetFireSpillingEffect(3)).save(consumer, prefix(TinkerFluids.moltenGold, folder));
    // pig iron fills you up magic
    SpillingRecipeBuilder.forFluid(TinkerFluids.moltenPigIron.getLocalTag(), FluidValues.NUGGET).addEffect(new RestoreHungerSpillingEffect(2, 0.3f)).addEffect(new SetFireSpillingEffect(2)).save(consumer, prefix(TinkerFluids.moltenPigIron, folder));
    // uranium also does poison
    SpillingRecipeBuilder.forFluid(TinkerFluids.moltenUranium.getLocalTag(), FluidValues.NUGGET).addEffect(new DamageSpillingEffect(LivingEntityPredicate.NOT_FIRE_IMMUNE, DamageType.FIRE, 1.5f)).addEffect(new EffectSpillingEffect(MobEffects.POISON, 10, 1)).addEffect(new SetFireSpillingEffect(3)).save(consumer, prefix(TinkerFluids.moltenUranium, folder));
    // potion fluid compat
    ResourceLocation potionTag = new ResourceLocation("forge", "potion");
    // standard potion is 250 mb, but we want a smaller number. For the effects, we really want to divide into 4 pieces
    SpillingRecipeBuilder.forFluid(FluidIngredient.of(FluidTags.createOptional(potionTag), FluidAttributes.BUCKET_VOLUME / 8)).addEffect(new PotionFluidEffect(0.5f, TagPredicate.ANY)).save(withCondition(consumer, new NotCondition(new FluidTagEmptyCondition(potionTag))), modResource(folder + "potion_fluid"));
    // create has three types of bottles stored on their fluid, react to it to boost
    Function<String, TagPredicate> createBottle = value -> {
        CompoundTag compound = new CompoundTag();
        compound.putString("Bottle", value);
        return new TagPredicate(compound);
    };
    String create = "create";
    SpillingRecipeBuilder.forFluid(FluidNameIngredient.of(new ResourceLocation(create, "potion"), FluidAttributes.BUCKET_VOLUME / 8)).addEffect(new PotionFluidEffect(0.25f, createBottle.apply("REGULAR"))).addEffect(new PotionFluidEffect(0.5f, createBottle.apply("SPLASH"))).addEffect(new PotionFluidEffect(1f, createBottle.apply("LINGERING"))).save(withCondition(consumer, modLoaded(create)), modResource(folder + "create_potion_fluid"));
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) Tags(net.minecraftforge.common.Tags) Arrays(java.util.Arrays) Items(net.minecraft.world.item.Items) FluidNameIngredient(slimeknights.mantle.recipe.data.FluidNameIngredient) LivingEntityPredicate(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.DamageSpillingEffect.LivingEntityPredicate) Item(net.minecraft.world.item.Item) ItemNameIngredient(slimeknights.mantle.recipe.data.ItemNameIngredient) TinkerHeadType(slimeknights.tconstruct.world.TinkerHeadType) MaterialIds(slimeknights.tconstruct.tools.data.material.MaterialIds) TinkerWorld(slimeknights.tconstruct.world.TinkerWorld) FluidAttributes(net.minecraftforge.fluids.FluidAttributes) SlotType(slimeknights.tconstruct.library.tools.SlotType) SpillingRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.spilling.SpillingRecipeBuilder) ArmorSlotType(slimeknights.tconstruct.tools.item.ArmorSlotType) TinkerGadgets(slimeknights.tconstruct.gadgets.TinkerGadgets) SwappableModifierRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.adding.SwappableModifierRecipeBuilder) OverslimeModifierRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.adding.OverslimeModifierRecipeBuilder) SizedIngredient(slimeknights.mantle.recipe.ingredient.SizedIngredient) CureEffectsSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.CureEffectsSpillingEffect) ItemCastingRecipeBuilder(slimeknights.tconstruct.library.recipe.casting.ItemCastingRecipeBuilder) TeleportSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.TeleportSpillingEffect) ItemTags(net.minecraft.tags.ItemTags) SlimeType(slimeknights.tconstruct.shared.block.SlimeType) ModifierRemovalRecipe(slimeknights.tconstruct.tools.recipe.ModifierRemovalRecipe) ItemNameOutput(slimeknights.mantle.recipe.data.ItemNameOutput) TinkerTags(slimeknights.tconstruct.common.TinkerTags) ModifierMatch(slimeknights.tconstruct.library.recipe.modifiers.ModifierMatch) TinkerTools(slimeknights.tconstruct.tools.TinkerTools) Blocks(net.minecraft.world.level.block.Blocks) ConfigEnabledCondition(slimeknights.tconstruct.common.json.ConfigEnabledCondition) MaterialIngredient(slimeknights.tconstruct.library.recipe.ingredient.MaterialIngredient) StrongBonesModifier(slimeknights.tconstruct.tools.modifiers.traits.skull.StrongBonesModifier) CompoundTag(net.minecraft.nbt.CompoundTag) ModifierRepairRecipeBuilder(slimeknights.tconstruct.library.recipe.tinkerstation.repairing.ModifierRepairRecipeBuilder) FluidValues(slimeknights.tconstruct.library.recipe.FluidValues) Modifier(slimeknights.tconstruct.library.modifiers.Modifier) ItemStack(net.minecraft.world.item.ItemStack) ModifierRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.adding.ModifierRecipeBuilder) SpecialRecipeBuilder(net.minecraft.data.recipes.SpecialRecipeBuilder) IngredientIntersection(slimeknights.mantle.recipe.ingredient.IngredientIntersection) ShapedRecipeBuilder(net.minecraft.data.recipes.ShapedRecipeBuilder) EntityType(net.minecraft.world.entity.EntityType) RandomItem(slimeknights.tconstruct.library.recipe.RandomItem) SetFireSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.SetFireSpillingEffect) TinkerModifiers(slimeknights.tconstruct.tools.TinkerModifiers) MobEffects(net.minecraft.world.effect.MobEffects) DamageType(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.DamageSpillingEffect.DamageType) Function(java.util.function.Function) Ingredient(net.minecraft.world.item.crafting.Ingredient) CompoundIngredient(slimeknights.mantle.recipe.data.CompoundIngredient) FluidIngredient(slimeknights.mantle.recipe.ingredient.FluidIngredient) EffectSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.EffectSpillingEffect) ItemLike(net.minecraft.world.level.ItemLike) ShapelessRecipeBuilder(net.minecraft.data.recipes.ShapelessRecipeBuilder) TinkerToolParts(slimeknights.tconstruct.tools.TinkerToolParts) FluidTagEmptyCondition(slimeknights.mantle.recipe.helper.FluidTagEmptyCondition) PotionFluidEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.PotionFluidEffect) ConditionalRecipe(net.minecraftforge.common.crafting.ConditionalRecipe) Fluids(net.minecraft.world.level.material.Fluids) TinkerMaterials(slimeknights.tconstruct.shared.TinkerMaterials) DataGenerator(net.minecraft.data.DataGenerator) TinkerCommons(slimeknights.tconstruct.shared.TinkerCommons) IngredientDifference(slimeknights.mantle.recipe.ingredient.IngredientDifference) ArmorDyeingRecipe(slimeknights.tconstruct.tools.recipe.ArmorDyeingRecipe) TinkerFluids(slimeknights.tconstruct.fluids.TinkerFluids) FluidTags(net.minecraft.tags.FluidTags) IncrementalModifierRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.adding.IncrementalModifierRecipeBuilder) Tag(net.minecraft.tags.Tag) MaterialVariantId(slimeknights.tconstruct.library.materials.definition.MaterialVariantId) TagPredicate(slimeknights.tconstruct.library.recipe.TagPredicate) FinishedRecipe(net.minecraft.data.recipes.FinishedRecipe) EntityIngredient(slimeknights.mantle.recipe.ingredient.EntityIngredient) DamageSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.DamageSpillingEffect) TConstruct(slimeknights.tconstruct.TConstruct) ExtinguishSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.ExtinguishSpillingEffect) Consumer(java.util.function.Consumer) TinkerSmeltery(slimeknights.tconstruct.smeltery.TinkerSmeltery) SeveringRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.severing.SeveringRecipeBuilder) RestoreHungerSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.RestoreHungerSpillingEffect) BaseRecipeProvider(slimeknights.tconstruct.common.data.BaseRecipeProvider) MaterialId(slimeknights.tconstruct.library.materials.definition.MaterialId) FluidObject(slimeknights.mantle.registration.object.FluidObject) NotCondition(net.minecraftforge.common.crafting.conditions.NotCondition) TrueCondition(net.minecraftforge.common.crafting.conditions.TrueCondition) FrameType(slimeknights.tconstruct.gadgets.entity.FrameType) ItemOutput(slimeknights.mantle.recipe.helper.ItemOutput) DamageSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.DamageSpillingEffect) NotCondition(net.minecraftforge.common.crafting.conditions.NotCondition) CureEffectsSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.CureEffectsSpillingEffect) FluidTagEmptyCondition(slimeknights.mantle.recipe.helper.FluidTagEmptyCondition) TagPredicate(slimeknights.tconstruct.library.recipe.TagPredicate) EffectSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.EffectSpillingEffect) SetFireSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.SetFireSpillingEffect) PotionFluidEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.PotionFluidEffect) RestoreHungerSpillingEffect(slimeknights.tconstruct.library.recipe.modifiers.spilling.effects.RestoreHungerSpillingEffect) ResourceLocation(net.minecraft.resources.ResourceLocation) ItemStack(net.minecraft.world.item.ItemStack) CompoundTag(net.minecraft.nbt.CompoundTag)

Aggregations

Arrays (java.util.Arrays)1 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1 DataGenerator (net.minecraft.data.DataGenerator)1 FinishedRecipe (net.minecraft.data.recipes.FinishedRecipe)1 ShapedRecipeBuilder (net.minecraft.data.recipes.ShapedRecipeBuilder)1 ShapelessRecipeBuilder (net.minecraft.data.recipes.ShapelessRecipeBuilder)1 SpecialRecipeBuilder (net.minecraft.data.recipes.SpecialRecipeBuilder)1 CompoundTag (net.minecraft.nbt.CompoundTag)1 ResourceLocation (net.minecraft.resources.ResourceLocation)1 FluidTags (net.minecraft.tags.FluidTags)1 ItemTags (net.minecraft.tags.ItemTags)1 Tag (net.minecraft.tags.Tag)1 MobEffects (net.minecraft.world.effect.MobEffects)1 EntityType (net.minecraft.world.entity.EntityType)1 Item (net.minecraft.world.item.Item)1 ItemStack (net.minecraft.world.item.ItemStack)1 Items (net.minecraft.world.item.Items)1 Ingredient (net.minecraft.world.item.crafting.Ingredient)1 ItemLike (net.minecraft.world.level.ItemLike)1