mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-20 03:14:23 +01:00
14 lines
465 B
Java
14 lines
465 B
Java
package com.minelittlepony.pony.data;
|
|
|
|
public interface ITriggerPixelMapped<T extends Enum<T> & ITriggerPixelMapped<T>> {
|
|
|
|
int getTriggerPixel();
|
|
|
|
@SuppressWarnings("unchecked")
|
|
public static <T extends Enum<T> & ITriggerPixelMapped<T>> T getByTriggerPixel(T type, int pixelValue) {
|
|
for (T i : (T[])type.getClass().getEnumConstants()) {
|
|
if (i.getTriggerPixel() == pixelValue) return i;
|
|
}
|
|
return type;
|
|
}
|
|
}
|