Hide setMainGene, add setGene instead.

This commit is contained in:
libraryaddict 2022-05-06 23:06:36 +12:00
parent 1b33b03c90
commit cc86e130ea

View File

@ -20,11 +20,22 @@ public class PandaWatcher extends AgeableWatcher {
super(disguise); super(disguise);
if (DisguiseConfig.isRandomDisguises()) { if (DisguiseConfig.isRandomDisguises()) {
// We don't do 'setGene' here so it's just as random as it would be as if it was natural.
setMainGene(Panda.Gene.values()[new Random().nextInt(Panda.Gene.values().length)]); setMainGene(Panda.Gene.values()[new Random().nextInt(Panda.Gene.values().length)]);
setHiddenGene(Panda.Gene.values()[new Random().nextInt(Panda.Gene.values().length)]); setHiddenGene(Panda.Gene.values()[new Random().nextInt(Panda.Gene.values().length)]);
} }
} }
public Panda.Gene getGene() {
return getMainGene();
}
@RandomDefaultValue
public void setGene(Panda.Gene gene) {
setMainGene(gene);
setHiddenGene(gene);
}
public Panda.Gene getMainGene() { public Panda.Gene getMainGene() {
int id = getData(MetaIndex.PANDA_MAIN_GENE); int id = getData(MetaIndex.PANDA_MAIN_GENE);
@ -39,7 +50,7 @@ public class PandaWatcher extends AgeableWatcher {
return Panda.Gene.NORMAL; return Panda.Gene.NORMAL;
} }
@RandomDefaultValue @MethodOnlyUsedBy(value = {}) // Hide from command
public void setMainGene(Panda.Gene gene) { public void setMainGene(Panda.Gene gene) {
setData(MetaIndex.PANDA_MAIN_GENE, (byte) gene.ordinal()); setData(MetaIndex.PANDA_MAIN_GENE, (byte) gene.ordinal());
sendData(MetaIndex.PANDA_MAIN_GENE); sendData(MetaIndex.PANDA_MAIN_GENE);
@ -59,7 +70,6 @@ public class PandaWatcher extends AgeableWatcher {
return Panda.Gene.NORMAL; return Panda.Gene.NORMAL;
} }
@RandomDefaultValue
@MethodOnlyUsedBy(value = {}) // Hide from command @MethodOnlyUsedBy(value = {}) // Hide from command
public void setHiddenGene(Panda.Gene gene) { public void setHiddenGene(Panda.Gene gene) {
setData(MetaIndex.PANDA_HIDDEN_GENE, (byte) gene.ordinal()); setData(MetaIndex.PANDA_HIDDEN_GENE, (byte) gene.ordinal());