diff --git a/src/main/java/ebf/tim/blocks/RailTileEntity.java b/src/main/java/ebf/tim/blocks/RailTileEntity.java index 33ca88b30b..b669533cba 100644 --- a/src/main/java/ebf/tim/blocks/RailTileEntity.java +++ b/src/main/java/ebf/tim/blocks/RailTileEntity.java @@ -10,6 +10,7 @@ import ebf.tim.render.models.Model1x1Rail; import ebf.tim.utility.ClientProxy; import ebf.tim.utility.CommonUtil; +import ebf.tim.utility.DebugUtil; import fexcraft.tmt.slim.TextureManager; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -36,7 +37,7 @@ public class RailTileEntity extends TileEntity { //todo public int timer=0; //todo public int overgrowth=0; //public Integer railGLID=null; - public static Map displayListMap = new HashMap<>(); + public static Map displayListMap = new HashMap<>(); private int meta=0; private XmlBuilder data = new XmlBuilder(); private Integer glID=null; @@ -80,15 +81,15 @@ public void func_145828_a(@Nullable CrashReportCategory report) { } else if(data !=null && data.floatArrayMap.size()>0){ RailShapeCore route =new RailShapeCore().fromXML(data); - if(displayListMap.containsKey(data)){ - glID=displayListMap.get(data); + if(displayListMap.containsKey(data.toXMLString().hashCode())){ + glID=displayListMap.get(data.toXMLString().hashCode()); org.lwjgl.opengl.GL11.glCallList(glID); } else if (route.activePath!=null) { if(!ClientProxy.disableCache) { - displayListMap.put(data, - net.minecraft.client.renderer.GLAllocation.generateDisplayLists(1)); - org.lwjgl.opengl.GL11.glNewList(displayListMap.get(data), org.lwjgl.opengl.GL11.GL_COMPILE); + glID=net.minecraft.client.renderer.GLAllocation.generateDisplayLists(1); + displayListMap.put(data.toXMLString().hashCode(), glID); + org.lwjgl.opengl.GL11.glNewList(glID, org.lwjgl.opengl.GL11.GL_COMPILE); Model1x1Rail.Model3DRail(worldObj, xCoord, yCoord, zCoord, route); diff --git a/src/main/java/ebf/tim/render/models/Model1x1Rail.java b/src/main/java/ebf/tim/render/models/Model1x1Rail.java index c92c295c6c..c87f737de1 100644 --- a/src/main/java/ebf/tim/render/models/Model1x1Rail.java +++ b/src/main/java/ebf/tim/render/models/Model1x1Rail.java @@ -57,7 +57,7 @@ private static void rotateVertexPoint(float x, float y, float z, float pitch, fl public static void addVertexWithOffset(Vec6f p, float width, float height, float depth){ rotateVertexPoint(depth,height,width-Math.copySign(p.w,width),p.u,p.v); - Tessellator.getInstance().addVertexWithUV(vert[0]+p.xCoord,vert[1]+p.yCoord, vert[2]+p.zCoord,0,0); + Tessellator.getInstance().addVertex(vert[0]+p.xCoord,vert[1]+p.yCoord, vert[2]+p.zCoord); } public static void addVertexWithOffsetAndUV(Vec5f p, float width, float height, float depth, float U, float V){ @@ -106,7 +106,7 @@ public static void Model3DRail(World world, int xPos, int yPos, int zPos, RailSh if(colors==null){return;} //DebugUtil.println(ClientProxy.railLoD); //renders the rails, also defines min and max width - GL11.glEnable(GL11.GL_NORMALIZE); + //GL11.glEnable(GL11.GL_NORMALIZE); GL11.glPushMatrix(); GL11.glColor4f(1,1,1,1); GL11.glDisable(GL_TEXTURE_2D);