Geyser/connector/src/main/java/org/geysermc/connector/utils/EntityUtils.java

24 lines
623 B
Java
Raw Normal View History

2019-08-03 03:38:09 +00:00
package org.geysermc.connector.utils;
import com.github.steveice10.mc.protocol.data.game.entity.type.MobType;
import org.geysermc.connector.entity.type.EntityType;
public class EntityUtils {
public static MobType toJavaEntity(EntityType type) {
try {
return MobType.valueOf(type.name());
} catch (IllegalArgumentException ex) {
return null;
}
}
public static EntityType toBedrockEntity(MobType type) {
try {
return EntityType.valueOf(type.name());
} catch (IllegalArgumentException ex) {
return null;
}
}
}