mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Use enum for AxolotlMeta
This commit is contained in:
parent
2976be947b
commit
29bac6fe24
@ -12,13 +12,12 @@ public class AxolotlMeta extends WaterAnimalMeta {
|
||||
super(entity, metadata);
|
||||
}
|
||||
|
||||
//todo variant enum
|
||||
public int getVariant() {
|
||||
return metadata.getIndex(OFFSET, 0);
|
||||
public Variant getVariant() {
|
||||
return Variant.VALUES[super.metadata.getIndex(OFFSET, 0)];
|
||||
}
|
||||
|
||||
public void setVariant(int variant) {
|
||||
metadata.setIndex(variant, Metadata.VarInt(variant));
|
||||
public void setVariant(Variant variant) {
|
||||
metadata.setIndex(OFFSET, Metadata.VarInt(variant.ordinal()));
|
||||
}
|
||||
|
||||
public boolean isPlayingDead() {
|
||||
@ -36,4 +35,14 @@ public class AxolotlMeta extends WaterAnimalMeta {
|
||||
public void setFromBucket(boolean fromBucket) {
|
||||
metadata.setIndex(OFFSET + 2, Metadata.Boolean(fromBucket));
|
||||
}
|
||||
|
||||
public enum Variant {
|
||||
LUCY,
|
||||
WILD,
|
||||
GOLD,
|
||||
CYAN,
|
||||
BLUE;
|
||||
|
||||
private final static AxolotlMeta.Variant[] VALUES = values();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user