Telesphoreo 2022-05-11 15:56:09 -05:00
commit 62fb33547f
No known key found for this signature in database
GPG Key ID: 5ACFFC4682CF849B
2 changed files with 16 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import me.libraryaddict.disguise.DisguiseConfig;
import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.MetaIndex;
import me.libraryaddict.disguise.utilities.parser.RandomDefaultValue;
import me.libraryaddict.disguise.utilities.reflection.annotations.MethodOnlyUsedBy;
import me.libraryaddict.disguise.utilities.reflection.annotations.NmsAddedIn;
import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
import org.bukkit.entity.Panda;
@ -19,11 +20,22 @@ public class PandaWatcher extends AgeableWatcher {
super(disguise);
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)]);
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() {
int id = getData(MetaIndex.PANDA_MAIN_GENE);
@ -38,7 +50,7 @@ public class PandaWatcher extends AgeableWatcher {
return Panda.Gene.NORMAL;
}
@RandomDefaultValue
@MethodOnlyUsedBy(value = {}) // Hide from command
public void setMainGene(Panda.Gene gene) {
setData(MetaIndex.PANDA_MAIN_GENE, (byte) gene.ordinal());
sendData(MetaIndex.PANDA_MAIN_GENE);
@ -58,7 +70,7 @@ public class PandaWatcher extends AgeableWatcher {
return Panda.Gene.NORMAL;
}
@RandomDefaultValue
@MethodOnlyUsedBy(value = {}) // Hide from command
public void setHiddenGene(Panda.Gene gene) {
setData(MetaIndex.PANDA_HIDDEN_GENE, (byte) gene.ordinal());
sendData(MetaIndex.PANDA_HIDDEN_GENE);

View File

@ -681,6 +681,8 @@ public class DisguiseParser {
Entry<DisguisePerm, String> customDisguise = DisguiseConfig.getRawCustomDisguise(args[0]);
if (customDisguise != null) {
// TODO Doesn't this mean we can't add args to our custom disguise on /disguise?
// Need to add user defined args for the custom disguise
args = DisguiseUtilities.split(customDisguise.getValue());
name = customDisguise.getKey().toReadable();
customName = true;