mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +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);
|
super(entity, metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo variant enum
|
public Variant getVariant() {
|
||||||
public int getVariant() {
|
return Variant.VALUES[super.metadata.getIndex(OFFSET, 0)];
|
||||||
return metadata.getIndex(OFFSET, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVariant(int variant) {
|
public void setVariant(Variant variant) {
|
||||||
metadata.setIndex(variant, Metadata.VarInt(variant));
|
metadata.setIndex(OFFSET, Metadata.VarInt(variant.ordinal()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPlayingDead() {
|
public boolean isPlayingDead() {
|
||||||
@ -36,4 +35,14 @@ public class AxolotlMeta extends WaterAnimalMeta {
|
|||||||
public void setFromBucket(boolean fromBucket) {
|
public void setFromBucket(boolean fromBucket) {
|
||||||
metadata.setIndex(OFFSET + 2, Metadata.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