/**
* Overriding the method in BlockGenericPipe to fix localizations.
*/
@SuppressWarnings("rawtypes")
public static ItemPipe registerPipe(Class<? extends Pipe> clas, CreativeTabBuildCraft creativeTab) {
ItemPipe item = null;
try {
Constructor<ItemPipe> ctor = ItemPipe.class.getDeclaredConstructor(CreativeTabBuildCraft.class);
ctor.setAccessible(true);
item = ctor.newInstance(creativeTab);
} catch (Exception e) {
e.printStackTrace();
}
assert item != null : "The ItemPipe instance must not be null";
item.setUnlocalizedName(clas.getSimpleName());
GameRegistry.registerItem(item, item.getUnlocalizedName());
BlockGenericPipe.pipes.put(item, clas);
Pipe dummyPipe = BlockGenericPipe.createPipe(item);
if (dummyPipe != null) {
item.setPipeIconIndex(dummyPipe.getIconIndexForItem());
TransportProxy.proxy.setIconProviderFromPipe(item, dummyPipe);
}
return item;
}