package com.minelittlepony.unicopia.entity; import java.util.Optional; import org.jetbrains.annotations.Nullable; import net.minecraft.entity.Entity; public interface PonyContainer> { Equine create(); T get(); @SuppressWarnings("unchecked") static > Optional> of(@Nullable Entity entity) { if (entity instanceof PonyContainer) { return Optional.of(((PonyContainer)entity)); } return Optional.empty(); } }