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
3 changed files with 16 additions and 2 deletions

No files matched your search

+2 -2
View File
@@ -3,9 +3,9 @@ name: Build and test
on:
pull_request:
branches: [ master, main ]
branches: [ master, main, release/** ]
push:
branches: [ master, main ]
branches: [ master, main, release/** ]
jobs:
build-and-test:
@@ -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);
}
}