Display an error message in the console when a ghost pipe is detected instead of printing the StackTrace.

This commit is contained in:
psxlover 2012-06-15 20:34:43 +03:00
parent 6ab4ad9044
commit 0224e57357

View file

@ -489,7 +489,13 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, ITex
public static Pipe createPipe(int key) {
try {
return pipes.get(key).getConstructor(int.class).newInstance(key);
Class<? extends Pipe> pipe = pipes.get(key);
if (pipe != null) {
return pipe.getConstructor(int.class).newInstance(key);
} else {
System.err.printf("Detected pipe with unknown key. Did you remove a buildcraft addon?\n");
}
} catch (Throwable t) {
t.printStackTrace();
}