#940: Create registry for banner pattern and cat type

By: Jishuna <joshl5324@gmail.com>
This commit is contained in:
Bukkit/Spigot
2023-12-08 19:24:14 +11:00
parent 0c336e76ce
commit 460ea2aff9
3 changed files with 101 additions and 56 deletions

View File

@@ -1,6 +1,8 @@
package org.bukkit.entity;
import org.bukkit.DyeColor;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.NotNull;
/**
@@ -41,17 +43,29 @@ public interface Cat extends Tameable, Sittable {
/**
* Represents the various different cat types there are.
*/
public enum Type {
TABBY,
BLACK,
RED,
SIAMESE,
BRITISH_SHORTHAIR,
CALICO,
PERSIAN,
RAGDOLL,
WHITE,
JELLIE,
ALL_BLACK;
public enum Type implements Keyed {
TABBY("tabby"),
BLACK("black"),
RED("red"),
SIAMESE("siamese"),
BRITISH_SHORTHAIR("british_shorthair"),
CALICO("calico"),
PERSIAN("persian"),
RAGDOLL("ragdoll"),
WHITE("white"),
JELLIE("jellie"),
ALL_BLACK("all_black");
private final NamespacedKey key;
private Type(String key) {
this.key = NamespacedKey.minecraft(key);
}
@Override
@NotNull
public NamespacedKey getKey() {
return key;
}
}
}