Randomize Axolotl variant

This commit is contained in:
libraryaddict 2024-08-27 13:29:31 +12:00
parent da4da54d3a
commit 746e1ddb62

View File

@ -1,13 +1,20 @@
package me.libraryaddict.disguise.disguisetypes.watchers;
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.ReflectionManager;
import me.libraryaddict.disguise.utilities.reflection.annotations.MethodDescription;
import org.bukkit.entity.Axolotl;
public class AxolotlWatcher extends AgeableWatcher {
public AxolotlWatcher(Disguise disguise) {
super(disguise);
if (DisguiseConfig.isRandomDisguises()) {
setVariant(ReflectionManager.randomEnum(Axolotl.Variant.class));
}
}
public boolean isPlayingDead() {
@ -23,6 +30,7 @@ public class AxolotlWatcher extends AgeableWatcher {
return getData(MetaIndex.AXOLOTL_VARIANT);
}
@RandomDefaultValue
@MethodDescription("What variant of Axolotl is this?")
public void setVariant(Axolotl.Variant variant) {
sendData(MetaIndex.AXOLOTL_VARIANT, variant);