couple more warnings
This commit is contained in:
+4
-4
@@ -385,7 +385,7 @@ public class LodBufferBuilderFactory
|
||||
|
||||
|
||||
// We render every vertical lod present in this position
|
||||
// We only stop when we find a block that is void or non existing block
|
||||
// We only stop when we find a block that is void or non-existing block
|
||||
long data;
|
||||
for (int verticalIndex = 0; verticalIndex < lodDim.getMaxVerticalData(detailLevel, posX, posZ); verticalIndex++)
|
||||
{
|
||||
@@ -406,7 +406,7 @@ public class LodBufferBuilderFactory
|
||||
//We extract the data to render
|
||||
data = lodDim.getData(detailLevel, posX, posZ, verticalIndex);
|
||||
|
||||
//If the data is not renderable (Void or non existing) we stop since there is no data left in this position
|
||||
//If the data is not renderable (Void or non-existing) we stop since there is no data left in this position
|
||||
if (DataPointUtil.isVoid(data) || !DataPointUtil.doesItExist(data))
|
||||
break;
|
||||
|
||||
@@ -800,7 +800,7 @@ public class LodBufferBuilderFactory
|
||||
lodDim.setRegenRegionBufferByArrayIndex(x, z, false);
|
||||
|
||||
|
||||
// upload buffers over a extended period of time
|
||||
// upload buffers over an extended period of time
|
||||
// to hopefully prevent stuttering.
|
||||
if (uploadTimeoutInMS != 0)
|
||||
Thread.sleep(uploadTimeoutInMS);
|
||||
@@ -811,7 +811,7 @@ public class LodBufferBuilderFactory
|
||||
}
|
||||
|
||||
// make sure all of the uploads finish before continuing
|
||||
GL45.glClientWaitSync(fence, GL45.GL_SYNC_FLUSH_COMMANDS_BIT, 5 * 1000000000); // wait up to 5 seconds
|
||||
GL45.glClientWaitSync(fence, GL45.GL_SYNC_FLUSH_COMMANDS_BIT, 5L * 1000000000); // wait up to 5 seconds
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ import com.seibel.lod.core.wrapperInterfaces.world.IWorldWrapper;
|
||||
* @author James Seibel
|
||||
* @version 10-22-2021
|
||||
*/
|
||||
public class LodBuilder
|
||||
@SuppressWarnings("GrazieInspection") public class LodBuilder
|
||||
{
|
||||
private static final IMinecraftWrapper MC = SingletonHandler.get(IMinecraftWrapper.class);
|
||||
private static final IBlockColorSingletonWrapper BLOCK_COLOR = SingletonHandler.get(IBlockColorSingletonWrapper.class);
|
||||
@@ -109,6 +109,7 @@ public class LodBuilder
|
||||
|
||||
Thread thread = new Thread(() ->
|
||||
{
|
||||
//noinspection GrazieInspection
|
||||
try
|
||||
{
|
||||
// we need a loaded client world in order to
|
||||
|
||||
@@ -84,7 +84,7 @@ public class LodGenWorker
|
||||
// to queue up a bunch of generation requests,
|
||||
// because MC's internal server (as of 1.16.5) only
|
||||
// responds with a single thread. And we don't
|
||||
// want to cause more lag then necessary or queue up
|
||||
// want to cause more lag than necessary or queue up
|
||||
// requests that may end up being unneeded.
|
||||
thread.run();
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ public class Box
|
||||
adjDepth.get(lodDirection)[0] = minY;
|
||||
adjHeight.get(lodDirection)[1] = VOID_FACE;
|
||||
adjDepth.get(lodDirection)[1] = VOID_FACE;
|
||||
skyLights.get(lodDirection)[0] = 15; //in void set full sky light
|
||||
skyLights.get(lodDirection)[0] = 15; //in void set full skylight
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,41 +161,11 @@ public class Mat4f
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder stringbuilder = new StringBuilder();
|
||||
stringbuilder.append("Matrix4f:\n");
|
||||
stringbuilder.append(this.m00);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m01);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m02);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m03);
|
||||
stringbuilder.append("\n");
|
||||
stringbuilder.append(this.m10);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m11);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m12);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m13);
|
||||
stringbuilder.append("\n");
|
||||
stringbuilder.append(this.m20);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m21);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m22);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m23);
|
||||
stringbuilder.append("\n");
|
||||
stringbuilder.append(this.m30);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m31);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m32);
|
||||
stringbuilder.append(" ");
|
||||
stringbuilder.append(this.m33);
|
||||
stringbuilder.append("\n");
|
||||
return stringbuilder.toString();
|
||||
return "Matrix4f:\n" +
|
||||
this.m00 + " " + this.m01 + " " + this.m02 + " " + this.m03 + "\n" +
|
||||
this.m10 + " " + this.m11 + " " + this.m12 + " " + this.m13 + "\n" +
|
||||
this.m20 + " " + this.m21 + " " + this.m22 + " " + this.m23 + "\n" +
|
||||
this.m30 + " " + this.m31 + " " + this.m32 + " " + this.m33 + "\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -97,9 +97,9 @@ public class LodBufferBuilder
|
||||
int j = i + roundUp(vertexSizeInBytes);
|
||||
//LOGGER.debug("Needed to grow BufferBuilder buffer: Old size {} bytes, new size {} bytes.", i, j);
|
||||
ByteBuffer bytebuffer = allocateByteBuffer(j);
|
||||
((Buffer) this.buffer).position(0);
|
||||
this.buffer.position(0);
|
||||
bytebuffer.put(this.buffer);
|
||||
((Buffer) bytebuffer).rewind();
|
||||
bytebuffer.rewind();
|
||||
this.buffer = bytebuffer;
|
||||
}
|
||||
}
|
||||
@@ -272,7 +272,7 @@ public class LodBufferBuilder
|
||||
this.switchFormat(LodVertexFormat);
|
||||
this.currentElement = LodVertexFormat.getElements().get(0);
|
||||
this.elementIndex = 0;
|
||||
((Buffer) this.buffer).clear();
|
||||
this.buffer.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,9 +438,9 @@ public class LodBufferBuilder
|
||||
public ByteBuffer getCleanedByteBuffer()
|
||||
{
|
||||
LodBufferBuilder.DrawState bufferbuilder$drawstate = this.vertexCounts.get(this.lastRenderedCountIndex++);
|
||||
((Buffer) this.buffer).position(this.totalUploadedBytes);
|
||||
this.buffer.position(this.totalUploadedBytes);
|
||||
this.totalUploadedBytes += bufferbuilder$drawstate.vertexCount() * bufferbuilder$drawstate.format().getVertexSize();
|
||||
((Buffer) this.buffer).limit(this.totalUploadedBytes);
|
||||
this.buffer.limit(this.totalUploadedBytes);
|
||||
if (this.lastRenderedCountIndex == this.vertexCounts.size() && this.vertices == 0)
|
||||
{
|
||||
this.clear();
|
||||
@@ -448,7 +448,7 @@ public class LodBufferBuilder
|
||||
|
||||
ByteBuffer bytebuffer = this.buffer.slice();
|
||||
bytebuffer.order(this.buffer.order()); // FORGE: Fix incorrect byte order
|
||||
((Buffer) this.buffer).clear();
|
||||
this.buffer.clear();
|
||||
return bytebuffer; // the original method also returned bufferbuilder$drawstate
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ public class LodBufferBuilder
|
||||
public void putBulkData(ByteBuffer buffer)
|
||||
{
|
||||
ensureCapacity(buffer.limit() + this.format.getVertexSize());
|
||||
((Buffer) this.buffer).position(this.vertices * this.format.getVertexSize());
|
||||
this.buffer.position(this.vertices * this.format.getVertexSize());
|
||||
this.buffer.put(buffer);
|
||||
this.vertices += buffer.limit() / this.format.getVertexSize();
|
||||
this.nextElementByte += buffer.limit();
|
||||
|
||||
@@ -380,7 +380,7 @@ public class GLProxy
|
||||
// make sure this is a legacy OpenGL context
|
||||
if (minecraftGlCapabilities.glFogf != 0)
|
||||
{
|
||||
// glFogf should only have a address if the current OpenGL
|
||||
// glFogf should only have an address if the current OpenGL
|
||||
// context can call it, and it should only be able to call it in
|
||||
// legacy OpenGL contexts; since it is disabled in Modern
|
||||
// OpenGL.
|
||||
|
||||
@@ -100,7 +100,7 @@ public class LodShader
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles the shader and checks it's status afterwards.
|
||||
* Compiles the shader and checks its status afterwards.
|
||||
* @throws Exception if the shader fails to compile
|
||||
*/
|
||||
public void compile() throws Exception
|
||||
|
||||
@@ -143,7 +143,7 @@ public class LodShaderProgram
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location of an uniform variable with specified name.
|
||||
* Gets the location of a uniform variable with specified name.
|
||||
* Calls GL20.glGetUniformLocation(id, name)
|
||||
*
|
||||
* @param name Uniform name
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ package com.seibel.lod.core.wrapperInterfaces.block;
|
||||
import com.seibel.lod.core.enums.LodDirection;
|
||||
|
||||
/**
|
||||
* BlockPos needs to be abstract instead of a interfaces
|
||||
* BlockPos needs to be abstract instead of an interfaces
|
||||
* so that we can define its constructors.
|
||||
*
|
||||
* @author James Seibel
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
|
||||
|
||||
|
||||
/**
|
||||
* This is abstract instead of a interface so
|
||||
* This is abstract instead of an interface, so
|
||||
* we can define its constructors.
|
||||
*
|
||||
* @author James Seibel
|
||||
|
||||
@@ -46,8 +46,8 @@ public interface IWorldWrapper
|
||||
|
||||
boolean hasSkyLight();
|
||||
|
||||
// Pls dont use this
|
||||
// If the world is null then this cant be called and gives an error
|
||||
// Pls don't use this
|
||||
// If the world is null then this can't be called and gives an error
|
||||
boolean isEmpty();
|
||||
|
||||
int getHeight();
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import com.seibel.lod.core.wrapperInterfaces.world.IWorldWrapper;
|
||||
* This is used for generating chunks
|
||||
* in a variety of detail and threading levels.
|
||||
* <p>
|
||||
* Abstract instead of a interface so
|
||||
* Abstract instead of an interface, so
|
||||
* we can define its constructors.
|
||||
*
|
||||
* @author James Seibel
|
||||
|
||||
Reference in New Issue
Block a user