From 028aed53f8735638bcb551a9e315013dd3a1c130 Mon Sep 17 00:00:00 2001 From: cola98765 Date: Thu, 7 Oct 2021 11:17:02 +0200 Subject: [PATCH] resolved some more warnings and applied autoformat in affected files --- .../lod/handlers/LodDimensionFileHandler.java | 2 +- .../lod/handlers/ReflectionHandler.java | 15 +++++----- .../seibel/lod/objects/LevelContainer.java | 29 +++++++++---------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/seibel/lod/handlers/LodDimensionFileHandler.java b/src/main/java/com/seibel/lod/handlers/LodDimensionFileHandler.java index dd5f9cdc7..480145d72 100644 --- a/src/main/java/com/seibel/lod/handlers/LodDimensionFileHandler.java +++ b/src/main/java/com/seibel/lod/handlers/LodDimensionFileHandler.java @@ -74,7 +74,7 @@ public class LodDimensionFileHandler * Allow saving asynchronously, but never try to save multiple regions * at a time */ - private ExecutorService fileWritingThreadPool = Executors.newSingleThreadExecutor(new LodThreadFactory(this.getClass().getSimpleName())); + private final ExecutorService fileWritingThreadPool = Executors.newSingleThreadExecutor(new LodThreadFactory(this.getClass().getSimpleName())); diff --git a/src/main/java/com/seibel/lod/handlers/ReflectionHandler.java b/src/main/java/com/seibel/lod/handlers/ReflectionHandler.java index cf61c965a..a6f54899e 100644 --- a/src/main/java/com/seibel/lod/handlers/ReflectionHandler.java +++ b/src/main/java/com/seibel/lod/handlers/ReflectionHandler.java @@ -15,15 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.seibel.lod.handlers; -import java.lang.reflect.Field; -import java.lang.reflect.Method; +package com.seibel.lod.handlers; import com.seibel.lod.enums.FogQuality; import com.seibel.lod.proxy.ClientProxy; import com.seibel.lod.wrappers.MinecraftWrapper; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + /** * This object is used to get variables from methods * where they are private. Specifically the fog setting @@ -35,7 +36,7 @@ import com.seibel.lod.wrappers.MinecraftWrapper; public class ReflectionHandler { public static final ReflectionHandler INSTANCE = new ReflectionHandler(); - private MinecraftWrapper mc = MinecraftWrapper.INSTANCE; + private final MinecraftWrapper mc = MinecraftWrapper.INSTANCE; public Field ofFogField = null; public Method vertexBufferUploadMethod = null; @@ -106,9 +107,9 @@ public class ReflectionHandler // optifine's "default" option, // it should never be called in this case return FogQuality.FAST; - - - // normal options + + + // normal options case 1: return FogQuality.FAST; case 2: diff --git a/src/main/java/com/seibel/lod/objects/LevelContainer.java b/src/main/java/com/seibel/lod/objects/LevelContainer.java index 763e6f1cd..4eb1f048f 100644 --- a/src/main/java/com/seibel/lod/objects/LevelContainer.java +++ b/src/main/java/com/seibel/lod/objects/LevelContainer.java @@ -2,9 +2,6 @@ package com.seibel.lod.objects; public interface LevelContainer { - public static final char VERTICAL_DATA_DELIMITER = '\t'; - public static final char DATA_DELIMITER = ' '; - /**With this you can add data to the level container * * @param data actual data to add in a array of long format. @@ -13,7 +10,7 @@ public interface LevelContainer * @param index z position in the detail level * @return true if correctly added, false otherwise */ - public boolean addData(long data, int posX, int posZ, int index); + boolean addData(long data, int posX, int posZ, int index); /**With this you can add data to the level container * @@ -22,7 +19,7 @@ public interface LevelContainer * @param posZ z position in the detail level * @return true if correctly added, false otherwise */ - public boolean addSingleData(long data, int posX, int posZ); + boolean addSingleData(long data, int posX, int posZ); /**With this you can get data from the level container * @@ -30,7 +27,7 @@ public interface LevelContainer * @param posZ z position in the detail level * @return the data in long array format */ - public long getData(int posX, int posZ, int index); + long getData(int posX, int posZ, int index); /**With this you can get data from the level container * @@ -38,31 +35,31 @@ public interface LevelContainer * @param posZ z position in the detail level * @return the data in long array format */ - public long getSingleData(int posX, int posZ); + long getSingleData(int posX, int posZ); /** * @param posX x position in the detail level * @param posZ z position in the detail level * @return true only if the data exist */ - public boolean doesItExist(int posX, int posZ); + boolean doesItExist(int posX, int posZ); /** * @return return the deatilLevel of this level container */ - public byte getDetailLevel(); + byte getDetailLevel(); - public int getMaxVerticalData(); + int getMaxVerticalData(); /** Clears the dataPoint at the given array index */ - public void clear(int posX, int posZ); + void clear(int posX, int posZ); /**This return a level container with detail level lower than the current level. * The new level container may use information of this level. * @return the new level container */ - public LevelContainer expand(); + LevelContainer expand(); /** * @@ -70,24 +67,24 @@ public interface LevelContainer * @param posX x position in the detail level to update * @param posZ z position in the detail level to update */ - public void updateData(LevelContainer lowerLevelContainer, int posX, int posZ); + void updateData(LevelContainer lowerLevelContainer, int posX, int posZ); /** * This will give the data to save in the file * @return data as a String */ - public byte[] toDataString(); + byte[] toDataString(); /** * This will give the data to save in the file * @return data as a String */ - public int getMaxNumberOfLods(); + int getMaxNumberOfLods(); /** * This will give the data to save in the file * @return data as a String */ - public int getMaxMemoryUse(); + int getMaxMemoryUse(); }