Throw exception if an action/trigger does not return an IIconProvider
This commit is contained in:
parent
b2854f18d1
commit
57073f71a0
1 changed files with 7 additions and 2 deletions
|
@ -6,6 +6,7 @@ import net.minecraft.client.renderer.texture.IconRegister;
|
|||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import buildcraft.api.core.IIconProvider;
|
||||
import buildcraft.api.gates.ActionManager;
|
||||
import buildcraft.api.gates.IAction;
|
||||
import buildcraft.api.gates.ITrigger;
|
||||
|
@ -116,12 +117,16 @@ public class ItemGate extends ItemBuildCraft {
|
|||
|
||||
for (IAction action : ActionManager.actions){
|
||||
if (action == null) continue;
|
||||
action.getIconProvider().registerIcons(iconRegister);
|
||||
IIconProvider ip = action.getIconProvider();
|
||||
if (ip == null) throw new RuntimeException("Action " + action.getClass().toString() + " does not return a IIconProvider. This is not a buildcraft bug");
|
||||
ip.registerIcons(iconRegister);
|
||||
}
|
||||
|
||||
for (ITrigger trigger : ActionManager.triggers){
|
||||
if (trigger == null) continue;
|
||||
trigger.getIconProvider().registerIcons(iconRegister);
|
||||
IIconProvider ip = trigger.getIconProvider();
|
||||
if (ip == null) throw new RuntimeException("Trigger " + trigger.getClass().toString() + " does not return a IIconProvider. This is not a buildcraft bug");
|
||||
ip.registerIcons(iconRegister);
|
||||
}
|
||||
|
||||
icons = new Icon[ItemGate.MAX];
|
||||
|
|
Loading…
Reference in a new issue