use of com.builtbroken.mc.api.explosive.ITexturedExplosiveHandler in project Engine by VoltzEngine-Project.
the class ExplosiveRegistryClient method getCornerIconFor.
/**
* Gets the corner icon for the explosive item. Defaults
* to using {@link ITexturedExplosiveHandler} if the explosive
* handler implements the interface. If it doesn't then
* the map will be searched for the item.
*
* @param stack
* @return item or missing icon
*/
public static IIcon getCornerIconFor(final ItemStack stack, int pass) {
ItemStack item = stack;
if (item.getItem() instanceof IExplosiveContainerItem) {
item = ((IExplosiveContainerItem) item.getItem()).getExplosiveStack(stack);
}
if (item != null) {
IExplosiveHandler handler = ExplosiveRegistry.get(item);
if (handler instanceof ITexturedExplosiveHandler) {
IIcon icon = ((ITexturedExplosiveHandler) handler).getBottomLeftCornerIcon(item, pass);
if (icon != null) {
return icon;
}
}
ItemStackWrapper wrapper = new ItemStackWrapper(item);
if (EX_CORNER_ICONS.containsKey(wrapper)) {
return EX_CORNER_ICONS.get(wrapper);
}
}
return missing_corner_icon;
}
Aggregations