From 1b32e6e42aa0d377ee7556b504130e37e26463bf Mon Sep 17 00:00:00 2001 From: makamys Date: Sat, 2 Dec 2023 22:12:02 +0100 Subject: Remove unused comparators --- .../makamys/neodymium/renderer/Comparators.java | 49 ---------------------- 1 file changed, 49 deletions(-) (limited to 'src') diff --git a/src/main/java/makamys/neodymium/renderer/Comparators.java b/src/main/java/makamys/neodymium/renderer/Comparators.java index 61dc1bc..f72cad9 100644 --- a/src/main/java/makamys/neodymium/renderer/Comparators.java +++ b/src/main/java/makamys/neodymium/renderer/Comparators.java @@ -2,58 +2,9 @@ package makamys.neodymium.renderer; import java.util.Comparator; -import net.minecraft.entity.Entity; -import net.minecraft.world.ChunkCoordIntPair; - public class Comparators { public static final MeshDistanceComparator MESH_DISTANCE_COMPARATOR = new MeshDistanceComparator(); - public static class NeoChunkComparator implements Comparator { - Entity player; - - public NeoChunkComparator(Entity player) { - this.player = player; - } - - @Override - public int compare(NeoChunk p1, NeoChunk p2) { - int distSq1 = distSq(p1); - int distSq2 = distSq(p2); - return distSq1 < distSq2 ? -1 : distSq1 > distSq2 ? 1 : 0; - } - - int distSq(NeoChunk p) { - return (int)( - Math.pow(((p.x * 16) - player.chunkCoordX), 2) + - Math.pow(((p.z * 16) - player.chunkCoordZ), 2) - ); - } - } - - public static class ChunkCoordDistanceComparator implements Comparator { - double x, y, z; - - public ChunkCoordDistanceComparator(double x, double y, double z) { - this.x = x; - this.y = y; - this.z = z; - } - - @Override - public int compare(ChunkCoordIntPair p1, ChunkCoordIntPair p2) { - int distSq1 = distSq(p1); - int distSq2 = distSq(p2); - return distSq1 < distSq2 ? -1 : distSq1 > distSq2 ? 1 : 0; - } - - int distSq(ChunkCoordIntPair p) { - return (int)( - Math.pow(((p.chunkXPos * 16) - x), 2) + - Math.pow(((p.chunkZPos * 16) - z), 2) - ); - } - } - public static class MeshDistanceComparator implements Comparator { double x, y, z; boolean inverted; -- cgit