remove some old code

This commit is contained in:
James Seibel
2020-08-31 14:40:52 -05:00
parent 7633d21a05
commit b510e1470d
@@ -17,7 +17,6 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.biome.Biome;
/** /**
* @author James Seibel * @author James Seibel
@@ -195,97 +194,79 @@ public class CustomRenderer
int chunkX = ((squareSideLength * j) + startX) / 16; int chunkX = ((squareSideLength * j) + startX) / 16;
int chunkZ = ((squareSideLength * i) + startZ) / 16; int chunkZ = ((squareSideLength * i) + startZ) / 16;
// if (distanceToPlayer(chunkX * 16, 70, chunkZ * 16, cameraX, 70, cameraZ) < farPlaneDistance * 2) Color c = null;
// Biome biome = null;
// try
// { // {
// // near to player // biome = Biome.getBiome(biomes[chunkX+32][chunkZ+32]);
// c = black;
// } // }
// else // catch(IndexOutOfBoundsException e)
// { // {
// // far from player
// c = white; // c = white;
//// System.out.println("loading");
//// mc.world.getChunkProvider().loadChunk(chunkX, chunkZ);
// } // }
//
Color c;
Biome biome = null;
try
{
biome = Biome.getBiome(biomes[chunkX+32][chunkZ+32]);
}
catch(IndexOutOfBoundsException e)
{
c = white;
}
double yoffset = -cameraY + mc.world.provider.getAverageGroundLevel(); double yoffset = -cameraY + mc.world.provider.getAverageGroundLevel();
// if (i == (numbOfBoxesWide / 2) && j == i)
// System.out.println("\nx " + (int)cameraX + " z " + (int)cameraZ + "\nx " + chunkX * 16 + " z " + chunkZ * 16 + "\t" + biome.getBiomeName());
// TODO fix this so that chunks outside of the view distance are loaded and the biomes are read // TODO fix this so that chunks outside of the view distance are loaded and the biomes are read
// TODO fix so that the chunks within view distance aren't always plains // TODO fix so that the chunks within view distance aren't always plains
if(biome != null) // if(biome != null)
{ // {
// add the color // // add the color
switch (Biome.getIdForBiome(biome)) // switch (Biome.getIdForBiome(biome))
{ // {
case -1: // unloaded // case -1: // unloaded
c = red; // c = red;
break; // break;
case 0: // ocean // case 0: // ocean
c = water; // c = water;
break; // break;
case 24: // deep ocean // case 24: // deep ocean
c = water; // c = water;
break; // break;
case 7: // river // case 7: // river
c = water; // c = water;
break; // break;
case 1: // plains // case 1: // plains
// c = invisible; //// c = invisible;
c = grass; // c = grass;
break; // break;
case 6: // swamp // case 6: // swamp
c = swamp; // c = swamp;
break; // break;
case 3: //extreme hills // case 3: //extreme hills
c = mountain; // c = mountain;
break; // break;
case 34: // extreme hills with trees // case 34: // extreme hills with trees
c = mountain; // c = mountain;
break; // break;
default: // default:
c = error; // c = error;
break; // break;
} // }
} // }
else // else
{ // {
c = black; // c = black;
} // }
// if debugging draw the squares as a black and white checker board // if debugging draw the squares as a black and white checker board
// if (debugging) if (debugging)
// { {
// if (alternateColor) if (alternateColor)
// c = white; c = white;
// else else
// c = black; c = black;
// // draw the first square as red // draw the first square as red
// if (i == 0 && j == 0) if (i == 0 && j == 0)
// c = Color.RED; c = Color.RED;
//
// colorArray[i + (j * numbOfBoxesWide)] = c; colorArray[i + (j * numbOfBoxesWide)] = c;
//
// alternateColor = !alternateColor; alternateColor = !alternateColor;
// } }
// add the color to the array // add the color to the array
colorArray[i + (j * numbOfBoxesWide)] = c; colorArray[i + (j * numbOfBoxesWide)] = c;
@@ -337,10 +318,8 @@ public class CustomRenderer
GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_2D);
// 7 - 5 ms // This is about how long this should take
// 16 ms = 60 hz // 16 ms = 60 hz
long endTime = System.nanoTime();
// System.out.println((endTime - startTime) + " :ns");
// end of profiler tracking // end of profiler tracking
mc.world.profiler.endSection(); mc.world.profiler.endSection();