Merge pull request #1784 from undergroundminer3/6.0.x

Don't crash when I create new PipeTypes
This commit is contained in:
SpaceToad 2014-05-11 16:25:26 +02:00
commit 159eba4619

View file

@ -39,6 +39,7 @@ import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftCore.RenderMode;
import buildcraft.BuildCraftTransport;
import buildcraft.api.gates.IGateExpansion;
import buildcraft.api.transport.IPipeTile.PipeType;
import buildcraft.api.transport.PipeWire;
import buildcraft.core.CoreConstants;
import buildcraft.core.DefaultProps;
@ -287,20 +288,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) {