resolved warnings. now more carefully.

This commit is contained in:
cola98765
2022-01-18 10:37:59 +01:00
parent bba7f34d46
commit 7bf54d20c0
18 changed files with 65 additions and 99 deletions
@@ -28,8 +28,6 @@ import com.seibel.lod.core.objects.opengl.LodBufferBuilder;
import com.seibel.lod.core.util.ColorUtil;
import com.seibel.lod.core.util.DataPointUtil;
import com.seibel.lod.core.util.LodUtil;
import com.seibel.lod.core.util.SingletonHandler;
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
import static com.seibel.lod.core.builders.lodBuilding.LodBuilder.MIN_WORLD_HEIGHT;
@@ -359,12 +359,10 @@ public class LodBufferBuilderFactory
if (!future.get())
{
ClientApi.LOGGER.error("LodBufferBuilder ran into trouble and had to start over.");
continue;
}
} catch (Exception e) {
ClientApi.LOGGER.error("LodBufferBuilder ran into trouble: ");
e.printStackTrace();
continue;
}
}
@@ -22,17 +22,13 @@ package com.seibel.lod.core.builders.lodBuilding;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.seibel.lod.core.api.ClientApi;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.config.HorizontalResolution;
import com.seibel.lod.core.objects.lod.LodDimension;
import com.seibel.lod.core.objects.lod.LodRegion;
import com.seibel.lod.core.objects.lod.LodWorld;
import com.seibel.lod.core.util.ColorUtil;
import com.seibel.lod.core.util.DataPointUtil;
import com.seibel.lod.core.util.DetailDistanceUtil;
import com.seibel.lod.core.util.LevelPosUtil;
import com.seibel.lod.core.util.LodThreadFactory;
import com.seibel.lod.core.util.LodUtil;
import com.seibel.lod.core.util.SingletonHandler;
@@ -173,7 +173,6 @@ public class LodDimensionFileHandler
+ ". File has been deleted.");
// This should not break, but be continue to see whether other detail levels can be loaded or updated
region.addLevelContainer(new VerticalLevelContainer(tempDetailLevel));
continue;
}
else if (fileVersion > LOD_SAVE_FILE_VERSION)
{
@@ -187,7 +186,6 @@ public class LodDimensionFileHandler
+ " this region will not be written to in order to protect the newer file.");
// This should not break, but be continue to see whether other detail levels can be loaded or updated
region.addLevelContainer(new VerticalLevelContainer(tempDetailLevel));
continue;
}
else if (fileVersion < LOD_SAVE_FILE_VERSION)
{
@@ -3,7 +3,6 @@ package com.seibel.lod.core.objects;
import com.seibel.lod.core.wrapperInterfaces.block.IBlockColorWrapper;
import com.seibel.lod.core.wrapperInterfaces.world.IBiomeWrapper;
import java.util.HashMap;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -30,7 +30,6 @@ import com.seibel.lod.core.util.ColorUtil;
import com.seibel.lod.core.util.DataPointUtil;
import com.seibel.lod.core.util.LodUtil;
import com.seibel.lod.core.util.SingletonHandler;
import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftWrapper;
@@ -21,7 +21,6 @@ package com.seibel.lod.core.objects.lod;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
/**
* A level container is a quad tree level
@@ -22,7 +22,6 @@ package com.seibel.lod.core.objects.lod;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -40,7 +39,6 @@ import com.seibel.lod.core.util.LevelPosUtil;
import com.seibel.lod.core.util.LodThreadFactory;
import com.seibel.lod.core.util.LodUtil;
import com.seibel.lod.core.util.SingletonHandler;
import com.seibel.lod.core.wrapperInterfaces.IWrapperFactory;
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftWrapper;
import com.seibel.lod.core.wrapperInterfaces.world.IDimensionTypeWrapper;
@@ -159,8 +157,8 @@ public class LodDimension
}
}
Arrays.sort(list, (a, b) -> {
RegionPos posA = (RegionPos)a;
RegionPos posB = (RegionPos)b;
RegionPos posA = a;
RegionPos posB = b;
double disSqrA = posA.x*posA.x+posA.z*posA.z;
double disSqrB = posB.x*posB.x+posB.z*posB.z;
return Double.compare(disSqrA, disSqrB);
@@ -22,13 +22,9 @@ package com.seibel.lod.core.objects.lod;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.LongBuffer;
import com.seibel.lod.core.api.ClientApi;
import com.seibel.lod.core.dataFormat.*;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.util.*;
@@ -21,7 +21,6 @@ package com.seibel.lod.core.objects.opengl;
import org.lwjgl.opengl.GL32;
import com.seibel.lod.core.api.ClientApi;
import com.seibel.lod.core.enums.rendering.GLProxyContext;
import com.seibel.lod.core.render.GLProxy;
@@ -40,7 +40,6 @@ import com.seibel.lod.core.api.ClientApi;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.rendering.DebugMode;
import com.seibel.lod.core.enums.rendering.GLProxyContext;
import com.seibel.lod.core.util.LodThreadFactory;
import com.seibel.lod.core.util.SingletonHandler;
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftWrapper;
@@ -105,54 +104,49 @@ public class GLProxy
private String getFailedVersionInfo(GLCapabilities c) {
StringBuilder str = new StringBuilder("Your supported OpenGL version:\n");
str.append("1.1: "+c.OpenGL11+"\n");
str.append("1.2: "+c.OpenGL12+"\n");
str.append("1.3: "+c.OpenGL13+"\n");
str.append("1.4: "+c.OpenGL14+"\n");
str.append("1.5: "+c.OpenGL15+"\n");
str.append("2.0: "+c.OpenGL20+"\n");
str.append("2.1: "+c.OpenGL21+"\n");
str.append("3.0: "+c.OpenGL30+"\n");
str.append("3.1: "+c.OpenGL31+"\n");
str.append("3.2: "+c.OpenGL32+" <- REQUIRED\n");
str.append("3.3: "+c.OpenGL33+"\n");
str.append("4.0: "+c.OpenGL40+"\n");
str.append("4.1: "+c.OpenGL41+"\n");
str.append("4.2: "+c.OpenGL42+"\n");
str.append("4.3: "+c.OpenGL43+" <- optional improvement\n");
str.append("4.4: "+c.OpenGL44+" <- optional improvement\n");
str.append("4.5: "+c.OpenGL45+"\n");
str.append("4.6: "+c.OpenGL46+"\n");
str.append("If you noticed that your computer supports higher OpenGL versions"
return "Your supported OpenGL version:\n" + "1.1: " + c.OpenGL11 + "\n" +
"1.2: " + c.OpenGL12 + "\n" +
"1.3: " + c.OpenGL13 + "\n" +
"1.4: " + c.OpenGL14 + "\n" +
"1.5: " + c.OpenGL15 + "\n" +
"2.0: " + c.OpenGL20 + "\n" +
"2.1: " + c.OpenGL21 + "\n" +
"3.0: " + c.OpenGL30 + "\n" +
"3.1: " + c.OpenGL31 + "\n" +
"3.2: " + c.OpenGL32 + " <- REQUIRED\n" +
"3.3: " + c.OpenGL33 + "\n" +
"4.0: " + c.OpenGL40 + "\n" +
"4.1: " + c.OpenGL41 + "\n" +
"4.2: " + c.OpenGL42 + "\n" +
"4.3: " + c.OpenGL43 + " <- optional improvement\n" +
"4.4: " + c.OpenGL44 + " <- optional improvement\n" +
"4.5: " + c.OpenGL45 + "\n" +
"4.6: " + c.OpenGL46 + "\n" +
"If you noticed that your computer supports higher OpenGL versions"
+ " but not the required version, try running the game in compatibility mode."
+ " (How you turn that on, I have no clue~)");
return str.toString();
+ " (How you turn that on, I have no clue~)";
}
private String getVersionInfo(GLCapabilities c) {
StringBuilder str = new StringBuilder("Your supported OpenGL version:\n");
str.append("1.1: "+c.OpenGL11+"\n");
str.append("1.2: "+c.OpenGL12+"\n");
str.append("1.3: "+c.OpenGL13+"\n");
str.append("1.4: "+c.OpenGL14+"\n");
str.append("1.5: "+c.OpenGL15+"\n");
str.append("2.0: "+c.OpenGL20+"\n");
str.append("2.1: "+c.OpenGL21+"\n");
str.append("3.0: "+c.OpenGL30+"\n");
str.append("3.1: "+c.OpenGL31+"\n");
str.append("3.2: "+c.OpenGL32+" <- REQUIRED\n");
str.append("3.3: "+c.OpenGL33+"\n");
str.append("4.0: "+c.OpenGL40+"\n");
str.append("4.1: "+c.OpenGL41+"\n");
str.append("4.2: "+c.OpenGL42+"\n");
str.append("4.3: "+c.OpenGL43+" <- optional improvement\n");
str.append("4.4: "+c.OpenGL44+" <- optional improvement\n");
str.append("4.5: "+c.OpenGL45+"\n");
str.append("4.6: "+c.OpenGL46+"\n");
return str.toString();
return "Your supported OpenGL version:\n" + "1.1: " + c.OpenGL11 + "\n" +
"1.2: " + c.OpenGL12 + "\n" +
"1.3: " + c.OpenGL13 + "\n" +
"1.4: " + c.OpenGL14 + "\n" +
"1.5: " + c.OpenGL15 + "\n" +
"2.0: " + c.OpenGL20 + "\n" +
"2.1: " + c.OpenGL21 + "\n" +
"3.0: " + c.OpenGL30 + "\n" +
"3.1: " + c.OpenGL31 + "\n" +
"3.2: " + c.OpenGL32 + " <- REQUIRED\n" +
"3.3: " + c.OpenGL33 + "\n" +
"4.0: " + c.OpenGL40 + "\n" +
"4.1: " + c.OpenGL41 + "\n" +
"4.2: " + c.OpenGL42 + "\n" +
"4.3: " + c.OpenGL43 + " <- optional improvement\n" +
"4.4: " + c.OpenGL44 + " <- optional improvement\n" +
"4.5: " + c.OpenGL45 + "\n" +
"4.6: " + c.OpenGL46 + "\n";
}
@@ -39,7 +39,6 @@ import com.seibel.lod.core.objects.math.Vec3f;
import com.seibel.lod.core.objects.opengl.LodVertexBuffer;
import com.seibel.lod.core.render.objects.LightmapTexture;
import com.seibel.lod.core.util.DetailDistanceUtil;
import com.seibel.lod.core.util.GridList;
import com.seibel.lod.core.util.LodUtil;
import com.seibel.lod.core.util.MovableGridList;
import com.seibel.lod.core.util.SingletonHandler;
@@ -107,44 +107,41 @@ public class BooleanMovableGridList {
}
public void flipBorder(boolean valueToBeFlipped) {
boolean t = valueToBeFlipped;
BoolTransformer tran = (v, x, y) -> {
if (v!=t) return v;
if (v!= valueToBeFlipped) return v;
boolean r = false;
r |= (isInBound(x-1,y) ? get(x-1,y)==!t : false);
r |= (isInBound(x,y-1) ? get(x,y-1)==!t : false);
r |= (isInBound(x+1,y) ? get(x+1,y)==!t : false);
r |= (isInBound(x,y+1) ? get(x,y+1)==!t : false);
return r ? !t : t;
r |= (isInBound(x - 1, y) && get(x - 1, y) == !valueToBeFlipped);
r |= (isInBound(x, y - 1) && get(x, y - 1) == !valueToBeFlipped);
r |= (isInBound(x + 1, y) && get(x + 1, y) == !valueToBeFlipped);
r |= (isInBound(x, y + 1) && get(x, y + 1) == !valueToBeFlipped);
return r != valueToBeFlipped;
};
twoStageTransform(tran);
}
public void flipBorderCorner(boolean valueToBeFlipped) {
boolean t = valueToBeFlipped;
BoolTransformer tran = (v, x, y) -> {
if (v!=t) return v;
if (v!= valueToBeFlipped) return v;
boolean r = false;
r |= (isInBound(x-1,y) ? get(x-1,y)==!t : false);
r |= (isInBound(x,y-1) ? get(x,y-1)==!t : false);
r |= (isInBound(x+1,y) ? get(x+1,y)==!t : false);
r |= (isInBound(x,y+1) ? get(x,y+1)==!t : false);
r |= (isInBound(x-1,y-1) ? get(x-1,y-1)==!t : false);
r |= (isInBound(x+1,y-1) ? get(x+1,y-1)==!t : false);
r |= (isInBound(x+1,y+1) ? get(x+1,y+1)==!t : false);
r |= (isInBound(x-1,y+1) ? get(x-1,y+1)==!t : false);
return r ? !t : t;
r |= (isInBound(x - 1, y) && get(x - 1, y) == !valueToBeFlipped);
r |= (isInBound(x, y - 1) && get(x, y - 1) == !valueToBeFlipped);
r |= (isInBound(x + 1, y) && get(x + 1, y) == !valueToBeFlipped);
r |= (isInBound(x, y + 1) && get(x, y + 1) == !valueToBeFlipped);
r |= (isInBound(x - 1, y - 1) && get(x - 1, y - 1) == !valueToBeFlipped);
r |= (isInBound(x + 1, y - 1) && get(x + 1, y - 1) == !valueToBeFlipped);
r |= (isInBound(x + 1, y + 1) && get(x + 1, y + 1) == !valueToBeFlipped);
r |= (isInBound(x - 1, y + 1) && get(x - 1, y + 1) == !valueToBeFlipped);
return r != valueToBeFlipped;
};
twoStageTransform(tran);
}
public void flipBorderCorner(boolean valueToBeFlipped, int range) {
boolean t = valueToBeFlipped;
BoolTransformer tran = (v, x, y) -> {
if (v!=t) return v;
if (v!= valueToBeFlipped) return v;
boolean r = false;
for (int dx=-range;dx<=range;dx++)
for (int dy=-range;dy<=range;dy++)
r |= (isInBound(x+dx,y+dy) ? get(x+dx,y+dy)==!t : false);
return r ? !t : t;
r |= (isInBound(x + dx, y + dy) && get(x + dx, y + dy) == !valueToBeFlipped);
return r != valueToBeFlipped;
};
twoStageTransform(tran);
}
@@ -198,7 +195,7 @@ public class BooleanMovableGridList {
}
}
}
else if (deltaX >= 0 && deltaY < 0)
else if (deltaX >= 0)// && deltaY < 0)
{
// move everything over to the left-down (as the center moves to the right-up)
for (int x = 0; x < gridSize; x++)
@@ -232,16 +229,16 @@ public class BooleanMovableGridList {
public String toDetailString() {
StringBuilder str = new StringBuilder("\n");
int i = 0;
str.append(toString());
str.append(this);
str.append("\n");
for (boolean t : b) {
str.append(t ? "#" : ".");
i++;
if (i % gridSize == 0) {
str.append("\n");
} else {
} //else {
//str.append(", ");
}
//}
}
return str.toString();
}
@@ -19,8 +19,6 @@
package com.seibel.lod.core.util;
import static com.seibel.lod.core.builders.bufferBuilding.LodBufferBuilderFactory.skyLightPlayer;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
@@ -266,7 +266,7 @@ public class MovableGridList<T> extends ArrayList<T> implements List<T> {
public String toDetailString() {
StringBuilder str = new StringBuilder("\n");
int i = 0;
str.append(toString());
str.append(this);
str.append("\n");
for (T t : this) {
@@ -19,7 +19,6 @@
package com.seibel.lod.core.wrapperInterfaces.chunk;
import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.block.IBlockColorWrapper;
import com.seibel.lod.core.wrapperInterfaces.block.IBlockShapeWrapper;
import com.seibel.lod.core.wrapperInterfaces.world.IBiomeWrapper;
@@ -437,7 +437,7 @@ public interface ILodConfigWrapperSingleton
static String multiOrSingleThreadText(IVersionConstants versionConstants, DistanceGenerationMode distanceGenerationMode)
{
return versionConstants.isWorldGeneratorSingleThreaded(distanceGenerationMode) ? "Singlethreaded" : "Multithreaded";
};
}
}
@@ -22,7 +22,6 @@ package com.seibel.lod.core.wrapperInterfaces.world;
import java.io.File;
import com.seibel.lod.core.enums.WorldType;
import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.chunk.AbstractChunkPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;