Skip to content

Commit

Permalink
Merge branch 'mc1.20.1/dev' into mc1.20.1/feat/acid-digests-things
Browse files Browse the repository at this point in the history
  • Loading branch information
Elenterius authored Oct 11, 2024
2 parents 6f01210 + 9b54ec0 commit cbee4b5
Show file tree
Hide file tree
Showing 30 changed files with 292 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private void addItemTranslations() {
addItem(ModItems.BLOOMBERRY, "Bloomberry", "An exotic delicacy which has a bioluminescent sheen and grants random potion effects when eaten.");

addItem(ModItems.REGENERATIVE_FLUID, "Regenerative Fluid", "A fluid with regenerative properties, used to concoct healing additives.");
addItem(ModItems.WITHERING_OOZE, "Withering Ooze", "A corrosive extract. It likely has uses in bio-alchemy.");
addItem(ModItems.WITHERING_OOZE, "Withering Ooze", "A black to steel gray liquid extracted from decaying material of wither origin.");
addItem(ModItems.HORMONE_SECRETION, "Hormone Secretion", "A fluid extract very rich in various hormones. A potent material for making drugs.");
addItem(ModItems.TOXIN_EXTRACT, "Toxin Extract", "A fluid so toxic you probably shouldn't touch it. Good for making a plethora of dubious substances.");
addItem(ModItems.VOLATILE_FLUID, "Volatile Fluid", "A very combustible extract, however it needs further processing to be truly dangerous.");
Expand Down Expand Up @@ -531,11 +531,11 @@ private void addItemTranslations() {
addItem(ModItems.UNSTABLE_COMPOUND, "Unstable Compound", "Very unstable and reactive substance. Seems like it will combust if it comes in contact with just about anything else.\nThe explosion is highly incendiary and has been known to liquefy magma blocks.");
addItem(ModItems.EXOTIC_COMPOUND, "Exotic Compound", "Substance of a questionable nature, comprised of exotic material and other trace elements.");
addItem(ModItems.GENETIC_COMPOUND, "Genetic Compound", "Cocktail of various hormones, nutrients and organic elements. It seems useful for producing potent stimulants.");
addItem(ModItems.CORROSIVE_ADDITIVE, "Corrosive Additive", "A highly corrosive fluid that seems useful for alchemically burning away organic material, or weakening the bonds of complex substances.");
addItem(ModItems.HEALING_ADDITIVE, "Healing Additive", "An highly concentrated substance that is used to imbue its properties to other compounds.");
addItem(ModItems.DECAYING_ADDITIVE, "Decaying Additive", "A viscous liquid that destabilizes life energy and accelerates the decay of organic material, weakening it at the molecular level.");
addItem(ModItems.HEALING_ADDITIVE, "Healing Additive", "A concentrated syrup of life energy that enhances other substances with vitality.");

addSerumItem(ModItems.AGEING_SERUM, "Aging Serum", "Forces the maturation of young Mobs into Adults. Some rare Mobs may even turn into Elders.");
addSerumItem(ModItems.REJUVENATION_SERUM, "Rejuvenation Serum", "Reverses the maturation of Mobs, in most cases turning them into children.");
addSerumItem(ModItems.REJUVENATION_SERUM, "Rejuvenation Serum", "Promotes cellular regeneration, reversing the maturation of Mobs and in most cases turning them into children.");
addSerumItem(ModItems.ENLARGEMENT_SERUM, "Enlargement Serum", "Induces growth in Slimes, Magma Cubes and Flesh Blobs.\n\n(If Pehkui is installed you can enlarge yourself and all Mobs)");
addSerumItem(ModItems.SHRINKING_SERUM, "Shrinking Serum", "Shrinks Slimes, Magma Cubes and Flesh Blobs.\n\n(If Pehkui is installed you can shrink yourself and all Mobs)");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ private void addItemTranslations() {
addItem(ModItems.UNSTABLE_COMPOUND, "Cannoneer's Compound", "Mighty unstable substance. Seems it'd explode if it be touchin' just about anythin' else.");
addItem(ModItems.EXOTIC_COMPOUND, "Wicthes' Compound", "It be o' questionable nature, made o' magic essence and other bits n' bobs.");
addItem(ModItems.GENETIC_COMPOUND, "Hereditary Compound", "Mixer o' various humors, nutrients and other livin' bits. It be used fer producin' potent drugs.");
addItem(ModItems.CORROSIVE_ADDITIVE, "Burnin' Additive", "A fluid that be quickly corrodin' even ta' thickest o' cannon barrels. It be useful for burnin' away livin' material, or weakenin' the hulls of yer rivals' ships.");
addItem(ModItems.DECAYING_ADDITIVE, "Burnin' Additive", "A fluid that be quickly corrodin' even ta' thickest o' cannon barrels. It be useful for burnin' away livin' material, or weakenin' the hulls of yer rivals' ships.");
addItem(ModItems.HEALING_ADDITIVE, "Healin' Additive", "A mightily concentrated brew that be used to imbue its healin' powers ta other brews.");

addSerumItem(ModItems.AGEING_SERUM, "Agin' Serum", "Forces the agin' of young Mobs inta Adults. Some rare Mobs may even turn inta Elders.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected void registerModels() {
serumItem(ModItems.GENETIC_COMPOUND);
serumItem(ModItems.EXOTIC_COMPOUND);
serumItem(ModItems.HEALING_ADDITIVE);
serumItem(ModItems.CORROSIVE_ADDITIVE);
serumItem(ModItems.DECAYING_ADDITIVE);

emissiveItem(ModItems.PRIMORDIAL_CORE);
fleshPlunderer(ModItems.DESPOIL_SICKLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ protected void buildRecipes(Consumer<FinishedRecipe> consumer) {
private void buildCompoundRecipes(Consumer<FinishedRecipe> consumer) {
BioLabRecipeBuilder.create(ModItems.ORGANIC_COMPOUND.get())
.addIngredient(ModItems.BILE.get())
.addIngredient(ModItems.NUTRIENT_PASTE.get())
.addIngredient(ModItems.BILE.get())
.addIngredient(ModItems.ORGANIC_MATTER.get())
.addIngredient(ModItems.NUTRIENTS.get())
.setCraftingTime(2 * 20)
.unlockedBy(ModItems.BILE.get()).save(consumer);

Expand Down Expand Up @@ -55,14 +57,14 @@ private void buildCompoundRecipes(Consumer<FinishedRecipe> consumer) {
private void buildAdditiveRecipes(Consumer<FinishedRecipe> consumer) {
BioLabRecipeBuilder.create(ModItems.HEALING_ADDITIVE.get())
.addIngredient(ModItems.REGENERATIVE_FLUID.get())
.addIngredient(ModItems.BILE.get())
.addIngredient(ModItems.REGENERATIVE_FLUID.get())
.setReactant(ModItems.ORGANIC_COMPOUND.get())
.setCraftingTime(2 * 20)
.unlockedBy(ModItems.ORGANIC_COMPOUND.get()).save(consumer);

BioLabRecipeBuilder.create(ModItems.CORROSIVE_ADDITIVE.get())
BioLabRecipeBuilder.create(ModItems.DECAYING_ADDITIVE.get())
.addIngredient(ModItems.WITHERING_OOZE.get())
.addIngredient(ModItems.WITHERING_OOZE.get())
.addIngredient(ModItems.BILE.get())
.setReactant(ModItems.ORGANIC_COMPOUND.get())
.setCraftingTime(2 * 20)
.unlockedBy(ModItems.ORGANIC_COMPOUND.get()).save(consumer);
Expand All @@ -85,7 +87,7 @@ private void buildSerumRecipes(Consumer<FinishedRecipe> consumer) {
.unlockedBy(ModItems.EXOTIC_COMPOUND.get()).save(consumer);

BioLabRecipeBuilder.create(ModItems.CLEANSING_SERUM.get())
.addIngredient(ModItems.CORROSIVE_ADDITIVE.get())
.addIngredient(ModItems.DECAYING_ADDITIVE.get())
.addIngredient(ModItems.HEALING_ADDITIVE.get())
.setReactant(ModItems.EXOTIC_COMPOUND.get())
.setCraftingTime(8 * 20)
Expand All @@ -110,16 +112,15 @@ private void buildSerumRecipes(Consumer<FinishedRecipe> consumer) {
BioLabRecipeBuilder.create(ModItems.REJUVENATION_SERUM.get())
.addIngredient(ModItems.HEALING_ADDITIVE.get())
.addIngredient(ModItems.NUTRIENT_PASTE.get())
.addIngredient(ModItems.CORROSIVE_ADDITIVE.get())
.addIngredient(ModItems.DECAYING_ADDITIVE.get())
.setReactant(ModItems.GENETIC_COMPOUND.get())
.setCraftingTime(8 * 20)
.unlockedBy(ModItems.GENETIC_COMPOUND.get()).save(consumer);

BioLabRecipeBuilder.create(ModItems.AGEING_SERUM.get())
.addIngredient(ModItems.NUTRIENT_PASTE.get())
.addIngredient(ModItems.NUTRIENT_PASTE.get())
.addIngredient(ModItems.MINERAL_FRAGMENT.get())
.addIngredient(ModItems.CORROSIVE_ADDITIVE.get())
.addIngredient(ModItems.DECAYING_ADDITIVE.get())
.setReactant(ModItems.GENETIC_COMPOUND.get())
.setCraftingTime(6 * 20)
.unlockedBy(ModItems.GENETIC_COMPOUND.get()).save(consumer);
Expand All @@ -136,8 +137,8 @@ private void buildSerumRecipes(Consumer<FinishedRecipe> consumer) {
BioLabRecipeBuilder.create(ModItems.SHRINKING_SERUM.get())
.addIngredient(ModItems.EXOTIC_DUST.get())
.addIngredient(ModItems.HEALING_ADDITIVE.get())
.addIngredient(ModItems.CORROSIVE_ADDITIVE.get())
.addIngredient(ModItems.CORROSIVE_ADDITIVE.get())
.addIngredient(ModItems.DECAYING_ADDITIVE.get())
.addIngredient(ModItems.DECAYING_ADDITIVE.get())
.setReactant(ModItems.GENETIC_COMPOUND.get())
.setCraftingTime(8 * 20)
.unlockedBy(ModItems.GENETIC_COMPOUND.get()).save(consumer);
Expand Down
4 changes: 2 additions & 2 deletions src/generated/resources/assets/biomancy/lang/en_pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
"item.biomancy.exotic_compound.tooltip": "It be o' questionable nature, made o' magic essence and other bits n' bobs.",
"item.biomancy.genetic_compound": "Hereditary Compound",
"item.biomancy.genetic_compound.tooltip": "Mixer o' various humors, nutrients and other livin' bits. It be used fer producin' potent drugs.",
"item.biomancy.corrosive_additive": "Burnin' Additive",
"item.biomancy.corrosive_additive.tooltip": "A fluid that be quickly corrodin' even ta' thickest o' cannon barrels. It be useful for burnin' away livin' material, or weakenin' the hulls of yer rivals' ships.",
"item.biomancy.decaying_additive": "Burnin' Additive",
"item.biomancy.decaying_additive.tooltip": "A fluid that be quickly corrodin' even ta' thickest o' cannon barrels. It be useful for burnin' away livin' material, or weakenin' the hulls of yer rivals' ships.",
"item.biomancy.healing_additive": "Healin' Additive",
"item.biomancy.healing_additive.tooltip": "A mightily concentrated brew that be used to imbue its healin' powers ta other brews.",
"serum.biomancy.ageing_serum": "Agin' Serum",
Expand Down
10 changes: 5 additions & 5 deletions src/generated/resources/assets/biomancy/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"item.biomancy.regenerative_fluid": "Regenerative Fluid",
"item.biomancy.regenerative_fluid.tooltip": "A fluid with regenerative properties, used to concoct healing additives.",
"item.biomancy.withering_ooze": "Withering Ooze",
"item.biomancy.withering_ooze.tooltip": "A corrosive extract. It likely has uses in bio-alchemy.",
"item.biomancy.withering_ooze.tooltip": "A black to steel gray liquid extracted from decaying material of wither origin.",
"item.biomancy.hormone_secretion": "Hormone Secretion",
"item.biomancy.hormone_secretion.tooltip": "A fluid extract very rich in various hormones. A potent material for making drugs.",
"item.biomancy.toxin_extract": "Toxin Extract",
Expand Down Expand Up @@ -103,16 +103,16 @@
"item.biomancy.exotic_compound.tooltip": "Substance of a questionable nature, comprised of exotic material and other trace elements.",
"item.biomancy.genetic_compound": "Genetic Compound",
"item.biomancy.genetic_compound.tooltip": "Cocktail of various hormones, nutrients and organic elements. It seems useful for producing potent stimulants.",
"item.biomancy.corrosive_additive": "Corrosive Additive",
"item.biomancy.corrosive_additive.tooltip": "A highly corrosive fluid that seems useful for alchemically burning away organic material, or weakening the bonds of complex substances.",
"item.biomancy.decaying_additive": "Decaying Additive",
"item.biomancy.decaying_additive.tooltip": "A viscous liquid that destabilizes life energy and accelerates the decay of organic material, weakening it at the molecular level.",
"item.biomancy.healing_additive": "Healing Additive",
"item.biomancy.healing_additive.tooltip": "An highly concentrated substance that is used to imbue its properties to other compounds.",
"item.biomancy.healing_additive.tooltip": "A concentrated syrup of life energy that enhances other substances with vitality.",
"serum.biomancy.ageing_serum": "Aging Serum",
"item.biomancy.ageing_serum": "Aging Serum",
"serum.biomancy.ageing_serum.tooltip": "Forces the maturation of young Mobs into Adults. Some rare Mobs may even turn into Elders.",
"serum.biomancy.rejuvenation_serum": "Rejuvenation Serum",
"item.biomancy.rejuvenation_serum": "Rejuvenation Serum",
"serum.biomancy.rejuvenation_serum.tooltip": "Reverses the maturation of Mobs, in most cases turning them into children.",
"serum.biomancy.rejuvenation_serum.tooltip": "Promotes cellular regeneration, reversing the maturation of Mobs and in most cases turning them into children.",
"serum.biomancy.enlargement_serum": "Enlargement Serum",
"item.biomancy.enlargement_serum": "Enlargement Serum",
"serum.biomancy.enlargement_serum.tooltip": "Induces growth in Slimes, Magma Cubes and Flesh Blobs.\n\n(If Pehkui is installed you can enlarge yourself and all Mobs)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "biomancy:item/serum/corrosive_additive"
"layer0": "biomancy:item/serum/decaying_additive"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"has_the_recipe": {
"conditions": {
"recipe": "biomancy:bio_brewing/corrosive_additive_from_bio_brewing"
"recipe": "biomancy:bio_brewing/decaying_additive_from_bio_brewing"
},
"trigger": "minecraft:recipe_unlocked"
}
Expand All @@ -28,7 +28,7 @@
],
"rewards": {
"recipes": [
"biomancy:bio_brewing/corrosive_additive_from_bio_brewing"
"biomancy:bio_brewing/decaying_additive_from_bio_brewing"
]
},
"sends_telemetry_event": false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{
"type": "biomancy:bio_brewing",
"ingredients": [
{
"item": "biomancy:nutrient_paste"
},
{
"item": "biomancy:nutrient_paste"
},
{
"item": "biomancy:mineral_fragment"
},
{
"item": "biomancy:corrosive_additive"
"item": "biomancy:decaying_additive"
}
],
"nutrientsCost": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "biomancy:bio_brewing",
"ingredients": [
{
"item": "biomancy:corrosive_additive"
"item": "biomancy:decaying_additive"
},
{
"item": "biomancy:healing_additive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"item": "biomancy:withering_ooze"
},
{
"item": "biomancy:bile"
"item": "biomancy:withering_ooze"
}
],
"nutrientsCost": 2,
Expand All @@ -14,6 +14,6 @@
"item": "biomancy:organic_compound"
},
"result": {
"item": "biomancy:corrosive_additive"
"item": "biomancy:decaying_additive"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"item": "biomancy:regenerative_fluid"
},
{
"item": "biomancy:bile"
"item": "biomancy:regenerative_fluid"
}
],
"nutrientsCost": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
"item": "biomancy:bile"
},
{
"item": "biomancy:nutrient_paste"
"item": "biomancy:bile"
},
{
"item": "biomancy:organic_matter"
},
{
"item": "biomancy:nutrients"
}
],
"nutrientsCost": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"item": "biomancy:nutrient_paste"
},
{
"item": "biomancy:corrosive_additive"
"item": "biomancy:decaying_additive"
}
],
"nutrientsCost": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"item": "biomancy:healing_additive"
},
{
"item": "biomancy:corrosive_additive"
"item": "biomancy:decaying_additive"
},
{
"item": "biomancy:corrosive_additive"
"item": "biomancy:decaying_additive"
}
],
"nutrientsCost": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class Tributes {
register(ModItems.HEALING_ADDITIVE.get(), SimpleTribute.builder().lifeEnergy(55).successModifier(1).diseaseModifier(-5).hostileModifier(-10).build());
register(ModItems.REGENERATIVE_FLUID.get(), SimpleTribute.builder().lifeEnergy(5).hostileModifier(-1).build());
register(ModItems.WITHERING_OOZE.get(), SimpleTribute.builder().biomass(-5).successModifier(-1).diseaseModifier(1).build());
register(ModItems.CORROSIVE_ADDITIVE.get(), SimpleTribute.builder().biomass(-20).successModifier(-5).diseaseModifier(5).build());
register(ModItems.DECAYING_ADDITIVE.get(), SimpleTribute.builder().biomass(-20).successModifier(-5).diseaseModifier(5).build());
register(ModItems.ORGANIC_COMPOUND.get(), SimpleTribute.builder().successModifier(10).build());
register(ModItems.EXOTIC_COMPOUND.get(), SimpleTribute.builder().successModifier(5).anomalyModifier(20).build());
register(ModItems.GENETIC_COMPOUND.get(), SimpleTribute.builder().successModifier(1).diseaseModifier(-10).build());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.elenterius.biomancy.crafting.recipe;

import com.mojang.datafixers.util.Pair;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;
import net.minecraft.world.item.ItemStack;
Expand All @@ -10,6 +11,7 @@
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.Nullable;

import java.util.Map;
import java.util.Optional;

public class SimpleRecipeType<T extends Recipe<?>> implements RecipeType<T> {
Expand Down Expand Up @@ -50,18 +52,36 @@ public Optional<R> getRecipeFromContainer(Level level, Container inputInventory)
return (R) recipe;
}

private boolean matches(R recipe, ItemStack stack) {
for (Ingredient ingredient : recipe.getIngredients()) {
if (ingredient.test(stack)) return true;
}
return false;
}

public Optional<R> getRecipeForIngredient(Level level, ItemStack stack) {
RecipeManager recipeManager = level.getRecipeManager();
return recipeManager.byType(this).values().stream()
.filter(recipe -> {
for (Ingredient ingredient : recipe.getIngredients()) {
if (ingredient.test(stack)) return true;
}
return false;
})
.filter(recipe -> matches(recipe, stack))
.findFirst().map(this::castRecipe);
}

public Optional<Pair<ResourceLocation, R>> getRecipeForIngredient(Level level, ItemStack stack, @Nullable ResourceLocation lastRecipeId) {
RecipeManager recipeManager = level.getRecipeManager();

Map<ResourceLocation, R> map = recipeManager.byType(this);
if (lastRecipeId != null) {
R recipe = map.get(lastRecipeId);
if (recipe != null && matches(recipe, stack)) {
return Optional.of(Pair.of(lastRecipeId, recipe));
}
}

return map.entrySet().stream()
.filter(entry -> matches(entry.getValue(), stack))
.findFirst()
.map(entry -> Pair.of(entry.getKey(), entry.getValue()));
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ public static void handleMissingItems(List<Mapping<Item>> mappings) {
case "digestate" -> mapping.remap(ModItems.ORGANIC_MATTER.get());
case "oxide_powder", "silicate_paste", "bio_minerals" -> mapping.remap(ModItems.MINERAL_FRAGMENT.get());
case "hormone_bile" -> mapping.remap(ModItems.HORMONE_SECRETION.get());
case "corrosive_additive" -> mapping.remap(ModItems.DECAYING_ADDITIVE.get());

default -> mapping.ignore();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public final class ModItems {
public static final RegistryObject<SimpleItem> GENETIC_COMPOUND = registerSimpleVialItem("genetic_compound");
public static final RegistryObject<SimpleItem> EXOTIC_COMPOUND = registerSimpleVialItem("exotic_compound");
public static final RegistryObject<SimpleItem> HEALING_ADDITIVE = registerSimpleVialItem("healing_additive");
public static final RegistryObject<SimpleItem> CORROSIVE_ADDITIVE = registerSimpleVialItem("corrosive_additive");
public static final RegistryObject<SimpleItem> DECAYING_ADDITIVE = registerSimpleVialItem("decaying_additive");
public static final RegistryObject<SerumItem> REJUVENATION_SERUM = registerSerumItem(ModSerums.REJUVENATION_SERUM);
public static final RegistryObject<SerumItem> AGEING_SERUM = registerSerumItem(ModSerums.AGEING_SERUM);
public static final RegistryObject<SerumItem> ENLARGEMENT_SERUM = registerSerumItem(ModSerums.ENLARGEMENT_SERUM);
Expand Down Expand Up @@ -306,7 +306,7 @@ private static <T extends EntityType<? extends Mob>> RegistryObject<ForgeSpawnEg
}

private static <T extends Serum> RegistryObject<SerumItem> registerSerumItem(RegistryObject<T> registryObject) {
return ITEMS.register(registryObject.getId().getPath(), () -> new SerumItem(createProperties().stacksTo(8).rarity(ModRarities.UNCOMMON), registryObject));
return ITEMS.register(registryObject.getId().getPath(), () -> new SerumItem(createProperties().stacksTo(16).rarity(ModRarities.UNCOMMON), registryObject));
}

private static RegistryObject<SimpleItem> registerSimpleVialItem(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.function.Predicate;
import java.util.function.UnaryOperator;

@Deprecated
public class BehavioralInventory<T extends IItemHandler & IItemHandlerModifiable & INBTSerializable<CompoundTag>> extends BaseInventory<T> {

private final T behavioralItemHandler;
Expand Down
Loading

0 comments on commit cbee4b5

Please sign in to comment.