Display an error message in the console when a ghost pipe is detected instead of printing the StackTrace.
This commit is contained in:
parent
6ab4ad9044
commit
0224e57357
1 changed files with 7 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue