Don't crash when I create new PipeTypes

I am using reflection to "hack in" new PipeTypes for myself.
(Yes, that IS possible, but very "aggressive")

Don't cause an ArrayIndexOutOfBounds exception when I do that.
(at least when rendering, just don't place a gate on my pipes)

This is also another step towards
the ability to create new PipeTypes.
This commit is contained in:
undergroundminer3 2014-05-11 10:10:08 -04:00
parent 986390babc
commit ecff97c2ef

View file

@ -287,20 +287,18 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
renderGatesWires(pipe, x, y, z);
switch (pipe.getPipeType()) {
case ITEM:
renderSolids(pipe.pipe, x, y, z);
break;
case FLUID:
renderFluids(pipe.pipe, x, y, z);
break;
case POWER:
renderPower(pipe.pipe, x, y, z);
break;
case STRUCTURE:
// no object to render in a structure pipe;
break;
}
PipeType pipeType = pipe.getPipeType();
// do not use switch. we will be transitioning away from the enum
if (pipeType == PipeType.ITEM) {
renderSolids(pipe.pipe, x, y, z);
} else if (pipeType == PipeType.FLUID) {
renderFluids(pipe.pipe, x, y, z);
} else if (pipeType == PipeType.POWER) {
renderPower(pipe.pipe, x, y, z);
} /* else if (pipeType == PipeType.STRUCTURE) {
// no object to render in a structure pipe;
} */
}
private void renderGatesWires(TileGenericPipe pipe, double x, double y, double z) {