Compare commits

..
2 Commits
Author SHA1 Message Date
UltraProdigy 29d8fed2a3 ci: run build and test on release branches 2026-11-09 01:42:09 -05:00
Marlo Greisser 9b05c7e7d2 Edit lifespan changes health too (#122) 2026-11-04 08:03:13 +01:00
2 changed files with 14 additions and 0 deletions

No files matched your search

@@ -39,6 +39,13 @@ public class Inoculator {
NBTTagList chromosomes = genomeNBT.getTagList("Chromosomes", 10);
NBTTagCompound chromosomeNBT = chromosomes.getCompoundTagAt(chromosomeID);
chromosomeNBT.setString("UID" + chromoN, gene.getAllele().getUID());
if (gene.getChromosome() == EnumBeeChromosome.LIFESPAN && gene.getSpeciesRoot() instanceof IBeeRoot beeRoot) {
int lifespan = beeRoot.getMember(target).getGenome().getLifespan();
beeNBT.setInteger(
"Health",
Math.max(0, beeNBT.getInteger("Health") + lifespan - beeNBT.getInteger("MaxH")));
beeNBT.setInteger("MaxH", lifespan);
}
target.setTagCompound(beeNBT);
}
}
@@ -37,6 +37,13 @@ public class Splicer {
NBTTagList chromosomes = genomeNBT.getTagList("Chromosomes", 10);
NBTTagCompound chromosomeNBT = chromosomes.getCompoundTagAt(chromosomeID);
chromosomeNBT.setString("UID" + chromoN, gene.getAllele().getUID());
if (gene.getChromosome() == EnumBeeChromosome.LIFESPAN && gene.getSpeciesRoot() instanceof IBeeRoot beeRoot) {
int lifespan = beeRoot.getMember(target).getGenome().getLifespan();
beeNBT.setInteger(
"Health",
Math.max(0, beeNBT.getInteger("Health") + lifespan - beeNBT.getInteger("MaxH")));
beeNBT.setInteger("MaxH", lifespan);
}
target.setTagCompound(beeNBT);
}
}