Fixed render wire server crash

This commit is contained in:
Calclavia 2013-10-14 16:24:06 +08:00
parent 7a65a88735
commit 417c5858d8
2 changed files with 4 additions and 3 deletions

View file

@ -46,6 +46,7 @@ public class RenderPartWire
public static FloatBuffer specular = BufferUtils.createFloatBuffer(4); public static FloatBuffer specular = BufferUtils.createFloatBuffer(4);
public static FloatBuffer zero = BufferUtils.createFloatBuffer(4); public static FloatBuffer zero = BufferUtils.createFloatBuffer(4);
public static FloatBuffer defaultAmbient = BufferUtils.createFloatBuffer(4); public static FloatBuffer defaultAmbient = BufferUtils.createFloatBuffer(4);
public static final RenderPartWire INSTANCE = new RenderPartWire();
static static
{ {

View file

@ -54,7 +54,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
public static final int DEFAULT_COLOR = 16; public static final int DEFAULT_COLOR = 16;
public int dyeID = DEFAULT_COLOR; public int dyeID = DEFAULT_COLOR;
public boolean isInsulated = false; public boolean isInsulated = false;
public static RenderPartWire renderer = new RenderPartWire();
public static IndexedCuboid6[] sides = new IndexedCuboid6[7]; public static IndexedCuboid6[] sides = new IndexedCuboid6[7];
public static IndexedCuboid6[] insulatedSides = new IndexedCuboid6[7]; public static IndexedCuboid6[] insulatedSides = new IndexedCuboid6[7];
public EnumWireMaterial material = EnumWireMaterial.COPPER; public EnumWireMaterial material = EnumWireMaterial.COPPER;
@ -251,7 +251,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
public void renderStatic(codechicken.lib.vec.Vector3 pos, LazyLightMatrix olm, int pass) public void renderStatic(codechicken.lib.vec.Vector3 pos, LazyLightMatrix olm, int pass)
{ {
if (pass == 0) if (pass == 0)
renderer.renderStatic(this); RenderPartWire.INSTANCE.renderStatic(this);
} }
@Override @Override
@ -259,7 +259,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
public void renderDynamic(codechicken.lib.vec.Vector3 pos, float frame, int pass) public void renderDynamic(codechicken.lib.vec.Vector3 pos, float frame, int pass)
{ {
if (ResonantInduction.SHINY_SILVER && this.getMaterial() == EnumWireMaterial.SILVER) if (ResonantInduction.SHINY_SILVER && this.getMaterial() == EnumWireMaterial.SILVER)
renderer.renderShine(this, pos.x, pos.y, pos.z, frame); RenderPartWire.INSTANCE.renderShine(this, pos.x, pos.y, pos.z, frame);
} }
@Override @Override