Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/upstream/mc1.20.1/dev' int…
Browse files Browse the repository at this point in the history
…o mc1.20.1/feat/acid-digests-things

# Conflicts:
#	src/main/resources/mixins.biomancy.json
  • Loading branch information
kd8lvt committed Oct 9, 2024
2 parents 5a54692 + 7c384f7 commit 2d83925
Show file tree
Hide file tree
Showing 186 changed files with 2,433 additions and 695 deletions.
112 changes: 32 additions & 80 deletions CHANGELOG.md

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ minecraft {
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"

property 'geckolib.disable_examples', 'true'

// Hot-Swapping via JBR, includes schema changes
// https://forge.gemwire.uk/wiki/Hotswap#Applying_schema_changes
jvmArgs '-XX:+IgnoreUnrecognizedVMOptions', '-XX:+AllowEnhancedClassRedefinition'
Expand All @@ -93,6 +95,7 @@ minecraft {
}

client {
workingDirectory project.file('run/client')
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', mod_id
}
Expand All @@ -103,7 +106,7 @@ minecraft {
}

server {
workingDirectory project.file('run-server')
workingDirectory project.file('run/server')

property 'forge.enabledGameTestNamespaces', mod_id
args '--nogui'
Expand All @@ -117,7 +120,7 @@ minecraft {
}

data {
workingDirectory project.file('run-data')
workingDirectory project.file('run/data')

// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
Expand Down Expand Up @@ -210,12 +213,12 @@ dependencies {
implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}")
implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")

runtimeOnly fg.deobf("maven.modrinth:alexs-mobs:1.22.7")
runtimeOnly fg.deobf("maven.modrinth:alexs-caves:1.0.9")
runtimeOnly fg.deobf("maven.modrinth:citadel:2.4.9")
datagenImplementation fg.deobf("maven.modrinth:alexs-mobs:1.22.7")
datagenImplementation fg.deobf("maven.modrinth:alexs-caves:1.0.9")
datagenImplementation fg.deobf("maven.modrinth:citadel:2.4.9")
runtimeOnly fg.deobf("maven.modrinth:alexs-mobs:1.22.9")
runtimeOnly fg.deobf("maven.modrinth:alexs-caves:1.1.5")
runtimeOnly fg.deobf("maven.modrinth:citadel:2.6.0")
datagenImplementation fg.deobf("maven.modrinth:alexs-mobs:1.22.9")
datagenImplementation fg.deobf("maven.modrinth:alexs-caves:1.1.5")
datagenImplementation fg.deobf("maven.modrinth:citadel:2.6.0")

compileOnly fg.deobf("maven.modrinth:pehkui:3.7.12+1.20.1-forge")
//needs to be compileOnly for datagen to work -> temporarily change to implementation for gameplay testing
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.daemon=false
## Environment Properties
minecraft_version=1.20.1
minecraft_version_range=[1.20.1,1.20.2)
forge_version=47.2.19
forge_version=47.3.10
forge_version_range=[47,)
loader_version_range=[47,)
mapping_channel=parchment
Expand All @@ -22,14 +22,14 @@ mod_credits=RhinoW, The Shroome, Shorepion, Kitteh6660, ZeoMaddox, ItsLumine, Ru
mod_description=Biopunk and Flesh Magic inspired tech-magic mod that has a fleshy art theme.
## Dependencies
### Geckolib Mod
geckolib_version=4.4.7
geckolib_version=4.4.9
geckolib_version_range=[4.4,)
### Modonomicon
modonomicon_version=1.54.4
modonomicon_version=1.77.0
### "Create" Mod
create_version=0.5.1.e-22
create_version_range=[0.5.1.e,)
flywheel_version=0.6.10-7
create_version=0.5.1.h-48
create_version_range=[0.5.1.h,)
flywheel_version=0.6.11-13
registrate_version=MC1.20-1.3.3
### Just Enough Items (JEI) Mod
jei_version=15.2.0.27
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
2 changes: 1 addition & 1 deletion mod_version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"major": "2",
"semantic": "8.12.0"
"semantic": "8.15.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ private void addItemTranslations() {
addItem(ModItems.ELASTIC_FIBERS, "Elastic Fibers", "Fibrous tissue that is sturdy, while still being flexible and stretchy. It appears to be a good material to imitate muscles.");
addItem(ModItems.MINERAL_FRAGMENT, "Mineral Fragment", "Component only obtained in Decomposer.\nUsed to toughen and harden fibers.");
addItem(ModItems.GEM_FRAGMENTS, "Gem Fragments", "Bedazzle your fleshy creations!\nUsed to enhance hardened fibers to their maximum resilience, but they're very expensive.");
addItem(ModItems.BIO_LUMENS, "Bioluminescent Goo", "A basic component only obtained via the Decomposer, usually alongside biotic matter.\n\nUsed as a cosmetic upgrade to make things glow.");
addItem(ModItems.BIO_LUMENS, "Bioluminescent Goo", "A basic component only obtained via the Decomposer, usually alongside biotic matter.\n\nUsed as a cosmetic upgrade to make things glow, like the text on signs.");
addItem(ModItems.ORGANIC_MATTER, "Biotic Matter", "Moist organic material, extracted from plants. With its dark and fibrous texture, it almost seems like humus.");
addItem(ModItems.EXOTIC_DUST, "Exotic Dust", "Exotic substance, perhaps the very essence of magic itself.\nAn uncommon byproduct obtained by decomposing magical things.");
addItem(ModItems.STONE_POWDER, "Lithic Powder", "A very basic crafting component, usually obtained as a byproduct from decomposing things.");
Expand Down Expand Up @@ -489,7 +489,15 @@ private void addItemTranslations() {
Can be enchanted with:
- Piercing: Increases the chance to pierce through armor
- Anesthetic Touch: Nullifies the damage from the needle""");
addItem(ModItems.FERTILIZER, "Bio-Alchemical Fertilizer", "Fertilizer that induces hyper-growth in plants, even for reeds, cactus, nether wart and chorus.");
addItem(ModItems.FERTILIZER, "Bio-Alchemical Fertilizer", """
The Fertilizer induces hyper-growth in plants maturing them fully. It even affects bone-meal resistant plants such as:
- sugarcane
- cactus
- nether wart
- chorus
Furthermore it has the ability to convert patches of dirt into grass or force spread mycelium.
""");
addItem(ModItems.GIFT_SAC, "Gift Sac", """
Looks like some objects are wrapped in an organic layer of skin. Might be filled with items or toxin if your language is set to German.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,40 +153,43 @@ protected void add(EntityType<?> entityType, Consumer<LootTable.Builder> consume
protected LootTable.Builder createLootTable(EntityType<?> entityType) {
LootTable.Builder lootTable = LootTable.lootTable();

createCommonPool(entityType).ifPresent(lootTable::withPool);
createSpecialPool(entityType).ifPresent(lootTable::withPool);
//noinspection unchecked
EntityType<? extends LivingEntity> livingEntityType = (EntityType<? extends LivingEntity>) entityType;

createCommonPool(livingEntityType).ifPresent(lootTable::withPool);
createSpecialPool(livingEntityType).ifPresent(lootTable::withPool);

return lootTable;
}

protected Optional<LootPool.Builder> createCommonPool(EntityType<?> entityType) {
protected Optional<LootPool.Builder> createCommonPool(EntityType<? extends LivingEntity> entityType) {
LootPool.Builder builder = LootPool.lootPool().setRolls(ConstantValue.exactly(1));
boolean hasLoot = false;

EntityType<? extends LivingEntity> livingEntityType = (EntityType<? extends LivingEntity>) entityType;
AttributeSupplier baseAttributes = DefaultAttributes.getSupplier(livingEntityType);
AttributeSupplier baseAttributes = DefaultAttributes.getSupplier(entityType);
final double attackDamage = baseAttributes.hasAttribute(Attributes.ATTACK_DAMAGE) ? baseAttributes.getValue(Attributes.ATTACK_DAMAGE) : 0;

float volume = entityType.getWidth() * entityType.getHeight() * entityType.getWidth();
float fangMultiplier = 0.825f;
float clawMultiplier = 7f;
float marrowMultiplier = 2.9f;
float sinewMultiplier = 7f;
float bileGlandMultiplier = 0.5f;
final float volume = entityType.getWidth() * entityType.getHeight() * entityType.getWidth();
final float fangMultiplier = 0.825f;
final float clawMultiplier = 7f;
final float marrowMultiplier = 2.9f;
final float sinewMultiplier = 7f;
final float bileGlandMultiplier = 0.5f;

boolean hasToxinGland = TOXIC_MOBS.contains(entityType);
boolean hasVolatileGland = VOLATILE_MOBS.contains(entityType);
final boolean hasToxinGland = TOXIC_MOBS.contains(entityType);
final boolean hasVolatileGland = VOLATILE_MOBS.contains(entityType);

if (SHARP_FANG_MOBS.contains(entityType)) {
int minCount = 1;
int maxCount = Mth.ceil(Math.log(volume * fangMultiplier + 1));

if (baseAttributes.hasAttribute(Attributes.ATTACK_DAMAGE) && baseAttributes.getValue(Attributes.ATTACK_DAMAGE) >= 5d) {
maxCount += 1;
}
if (attackDamage >= 5d) minCount += 1;
if (attackDamage >= 3d) maxCount += 1;

NumberProvider countProvider = maxCount > 1 ? UniformGenerator.between(1, maxCount) : ConstantValue.exactly(1);
NumberProvider countProvider = maxCount > minCount ? UniformGenerator.between(minCount, maxCount) : ConstantValue.exactly(minCount);

builder.add(
LootItem.lootTableItem(ModItems.MOB_FANG.get()).setWeight(140)
LootItem.lootTableItem(ModItems.MOB_FANG.get()).setWeight(144)
.apply(SetItemCountFunction.setCount(countProvider))
.apply(LootingEnchantFunction.lootingMultiplier(UniformGenerator.between(0, 1)))
);
Expand All @@ -195,13 +198,13 @@ protected Optional<LootPool.Builder> createCommonPool(EntityType<?> entityType)
}

if (SHARP_CLAW_MOBS.contains(entityType)) {
int minCount = 1;
int maxCount = Mth.ceil(Math.log(volume * clawMultiplier + 1));

if (baseAttributes.hasAttribute(Attributes.ATTACK_DAMAGE) && baseAttributes.getValue(Attributes.ATTACK_DAMAGE) >= 5d) {
maxCount += 1;
}
if (attackDamage >= 5d) minCount += 1;
if (attackDamage >= 3d) maxCount += 1;

NumberProvider countProvider = maxCount > 1 ? UniformGenerator.between(1, maxCount) : ConstantValue.exactly(1);
NumberProvider countProvider = maxCount > minCount ? UniformGenerator.between(minCount, maxCount) : ConstantValue.exactly(minCount);

builder.add(
LootItem.lootTableItem(ModItems.MOB_CLAW.get()).setWeight(150)
Expand Down Expand Up @@ -258,13 +261,13 @@ protected Optional<LootPool.Builder> createCommonPool(EntityType<?> entityType)
return Optional.of(builder);
}

protected Optional<LootPool.Builder> createSpecialPool(EntityType<?> entityType) {
protected Optional<LootPool.Builder> createSpecialPool(EntityType<? extends LivingEntity> entityType) {
LootPool.Builder builder = LootPool.lootPool().setRolls(ConstantValue.exactly(1));
boolean hasLoot = false;

float volume = entityType.getWidth() * entityType.getHeight() * entityType.getWidth();
float organMultiplier = 0.9f;
float witheredMarrowMultiplier = 3f;
final float volume = entityType.getWidth() * entityType.getHeight() * entityType.getWidth();
final float organMultiplier = 0.9f;
final float witheredMarrowMultiplier = 3f;

boolean hasToxinGland = TOXIC_MOBS.contains(entityType);
boolean hasVolatileGland = VOLATILE_MOBS.contains(entityType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
import com.github.elenterius.biomancy.datagen.recipes.builder.ItemData;
import com.github.elenterius.biomancy.init.ModBioForgeTabs;
import com.github.elenterius.biomancy.init.ModItems;
import com.github.elenterius.biomancy.item.EssenceItem;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraftforge.common.crafting.PartialNBTIngredient;

import java.util.function.Consumer;

Expand All @@ -25,6 +30,22 @@ protected BioForgeRecipeProvider(PackOutput output) {
super(output);
}

private static <T extends Item & NutrientsContainerItem> ItemStack withMaxNutrients(T item) {
ItemStack itemStack = item.getDefaultInstance();
item.setNutrients(itemStack, Integer.MAX_VALUE);
return itemStack;
}

private static Ingredient createMobEssenceIngredient(EntityType<?> entityType) {
CompoundTag essenceTag = new CompoundTag();
essenceTag.putString(EssenceItem.ENTITY_TYPE_KEY, EntityType.getKey(entityType).toString());
essenceTag.putString(EssenceItem.ENTITY_NAME_KEY, entityType.getDescriptionId());
CompoundTag tag = new CompoundTag();
tag.put(EssenceItem.ESSENCE_DATA_KEY, essenceTag);
tag.putInt(EssenceItem.ESSENCE_TIER_KEY, 1);
return PartialNBTIngredient.of(ModItems.ESSENCE.get(), tag);
}

@Override
protected void buildRecipes(Consumer<FinishedRecipe> consumer) {
buildMachineRecipes(consumer);
Expand Down Expand Up @@ -150,12 +171,6 @@ private void buildBlockRecipes(Consumer<FinishedRecipe> consumer) {
.unlockedBy(ModItems.BONE_FRAGMENTS.get()).save(consumer);
}

private <T extends Item & NutrientsContainerItem> ItemStack withMaxNutrients(T item) {
ItemStack itemStack = item.getDefaultInstance();
item.setNutrients(itemStack, Integer.MAX_VALUE);
return itemStack;
}

private void buildToolRecipes(Consumer<FinishedRecipe> consumer) {
BioForgeRecipeBuilder.create(withMaxNutrients(ModItems.RAVENOUS_CLAWS.get()))
.addIngredient(ModItems.LIVING_FLESH.get())
Expand Down Expand Up @@ -257,16 +272,18 @@ private void buildComponentRecipes(Consumer<FinishedRecipe> consumer) {
.addIngredient(ModItems.FLESH_BITS.get(), 4)
.addIngredient(ModItems.BONE_FRAGMENTS.get(), 3)
.addIngredient(ModItems.EXOTIC_DUST.get(), 2)
.addIngredient(ModItems.NUTRIENT_PASTE.get(), 3)
.addIngredient(ModItems.NUTRIENTS.get(), 15)
.setCategory(ModBioForgeTabs.COMPONENTS)
.unlockedBy(ModItems.EXOTIC_DUST.get()).save(consumer);

BioForgeRecipeBuilder.create(ModItems.FERTILIZER.get())
.addIngredient(ModItems.NUTRIENT_PASTE.get(), 4)
.addIngredient(ModItems.NUTRIENTS.get(), 30)
.addIngredient(ModItems.ORGANIC_MATTER.get(), 4)
.addIngredient(ModItems.AGEING_SERUM.get())
.addIngredient(ModItems.HORMONE_SECRETION.get(), 6)
.addIngredient(ModItems.MINERAL_FRAGMENT.get(), 4)
.addIngredient(ModItems.REGENERATIVE_FLUID.get(), 4)
.setCategory(ModBioForgeTabs.COMPONENTS)
.unlockedBy(ModItems.AGEING_SERUM.get()).save(consumer);
.unlockedBy(ModItems.HORMONE_SECRETION.get()).save(consumer);

BioForgeRecipeBuilder.create(ModItems.MOB_FANG.get())
.addIngredient(ModItems.MINERAL_FRAGMENT.get(), 6)
Expand Down Expand Up @@ -320,6 +337,44 @@ private void buildComponentRecipes(Consumer<FinishedRecipe> consumer) {
.addIngredient(ModItems.STONE_POWDER.get(), 1)
.setCategory(ModBioForgeTabs.COMPONENTS)
.unlockedBy(Items.NAUTILUS_SHELL).save(consumer);

BioForgeRecipeBuilder.create(Items.SKELETON_SKULL)
.setCraftingCost(4)
.addIngredient(ModItems.BONE_FRAGMENTS.get(), 48 + 2)
.addIngredient(ModItems.MINERAL_FRAGMENT.get(), 7 + 2)
.setCategory(ModBioForgeTabs.COMPONENTS)
.unlockedBy(Items.SKELETON_SKULL).save(consumer);

BioForgeRecipeBuilder.create(Items.WITHER_SKELETON_SKULL)
.setCraftingCost(4)
.addIngredient(ModItems.BONE_FRAGMENTS.get(), 48 + 2)
.addIngredient(ModItems.MINERAL_FRAGMENT.get(), 7 + 2)
.addIngredient(ModItems.WITHERING_OOZE.get(), 16 + 2)
.setCategory(ModBioForgeTabs.COMPONENTS)
.unlockedBy(Items.WITHER_SKELETON_SKULL).save(consumer);

BioForgeRecipeBuilder.create(Items.PLAYER_HEAD)
.setCraftingCost(4)
.addIngredient(Items.SKELETON_SKULL)
.addIngredient(createMobEssenceIngredient(EntityType.PLAYER))
.addIngredient(ModItems.FLESH_BITS.get(), 32 + 2)
.addIngredient(ModItems.ELASTIC_FIBERS.get(), 9 + 2)
.setCategory(ModBioForgeTabs.COMPONENTS)
.unlockedBy(Items.SKELETON_SKULL).save(consumer);

BioForgeRecipeBuilder.create(Items.PIGLIN_HEAD)
.setCraftingCost(4)
.addIngredient(Items.SKELETON_SKULL)
.addIngredient(createMobEssenceIngredient(EntityType.PIGLIN))
.addIngredient(ModItems.FLESH_BITS.get(), 36 + 2)
.addIngredient(ModItems.ELASTIC_FIBERS.get(), 12 + 2)
.setCategory(ModBioForgeTabs.COMPONENTS)
.unlockedBy(Items.SKELETON_SKULL).save(consumer);

// DecomposerRecipeBuilder.create().setIngredient(Items.ZOMBIE_HEAD).addOutput(ModItems.FLESH_BITS.get(), 14, 24).addOutput(ModItems.ELASTIC_FIBERS.get(), 5, 9).addOutput(Items.SKELETON_SKULL, 1).unlockedBy(Items.ZOMBIE_HEAD).save(consumer);
// DecomposerRecipeBuilder.create().setIngredient(Items.CREEPER_HEAD).addOutput(ModItems.FLESH_BITS.get(), 19, 32).addOutput(ModItems.ELASTIC_FIBERS.get(), 5, 9).addOutput(Items.SKELETON_SKULL, 1).unlockedBy(Items.CREEPER_HEAD).save(consumer);
// DecomposerRecipeBuilder.create().setIngredient(Items.DRAGON_HEAD).addOutput(ModItems.FLESH_BITS.get(), 50).addOutput(ModItems.EXOTIC_DUST.get(), 50).addOutput(ModItems.TOUGH_FIBERS.get(), 25).addOutput(ModItems.MINERAL_FRAGMENT.get(), 20).addOutput(ModItems.BONE_FRAGMENTS.get(), 50).unlockedBy(Items.DRAGON_HEAD).save(consumer);

}

private void buildMiscRecipes(Consumer<FinishedRecipe> consumer) {
Expand Down
Loading

0 comments on commit 2d83925

Please sign in to comment.