mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-14 09:14:50 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29d8fed2a3 | ||
|
|
9b05c7e7d2 |
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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user