mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 13:24:17 -07:00
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* Represents the art on a painting
|
||||
*/
|
||||
public enum Art {
|
||||
public enum Art implements Keyed {
|
||||
KEBAB(0, 1, 1),
|
||||
AZTEC(1, 1, 1),
|
||||
ALBAN(2, 1, 1),
|
||||
@@ -39,7 +39,8 @@ public enum Art {
|
||||
SKELETON(24, 4, 3),
|
||||
DONKEY_KONG(25, 4, 3);
|
||||
|
||||
private int id, width, height;
|
||||
private final int id, width, height;
|
||||
private final NamespacedKey key;
|
||||
private static final HashMap<String, Art> BY_NAME = Maps.newHashMap();
|
||||
private static final HashMap<Integer, Art> BY_ID = Maps.newHashMap();
|
||||
|
||||
@@ -47,6 +48,7 @@ public enum Art {
|
||||
this.id = id;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.key = NamespacedKey.minecraft(name().toLowerCase(java.util.Locale.ENGLISH));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,6 +80,12 @@ public enum Art {
|
||||
return id;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a painting by its numeric ID
|
||||
*
|
||||
|
Reference in New Issue
Block a user