diff --git a/src/main/java/com/seibel/lod/builders/LodBuilder.java b/src/main/java/com/seibel/lod/builders/LodBuilder.java index c871e889c..1f8b3d4b2 100644 --- a/src/main/java/com/seibel/lod/builders/LodBuilder.java +++ b/src/main/java/com/seibel/lod/builders/LodBuilder.java @@ -29,7 +29,7 @@ import net.minecraft.world.gen.Heightmap; * (specifically: Lod World, Dimension, Region, and Chunk objects) * * @author James Seibel - * @version 6-13-2021 + * @version 6-19-2021 */ public class LodBuilder { @@ -404,7 +404,7 @@ public class LodBuilder continue; } - Color c = intToColor(ci); + Color c = LodUtils.intToColor(ci); red += c.getRed(); green += c.getGreen(); @@ -579,7 +579,7 @@ public class LodBuilder continue; } - Color c = intToColor(ci); + Color c = LodUtils.intToColor(ci); red += c.getRed(); green += c.getGreen(); @@ -658,28 +658,4 @@ public class LodBuilder - - /** - * Convert a BlockColors int into a Color object. - */ - private Color intToColor(int num) - { - int filter = 0b11111111; - - int red = (num >> 16 ) & filter; - int green = (num >> 8 ) & filter; - int blue = num & filter; - - return new Color(red, green, blue); - } - - /** - * Convert a Color into a BlockColors object. - */ - @SuppressWarnings("unused") - private int colorToInt(Color color) - { - return color.getRGB(); - } - } diff --git a/src/main/java/com/seibel/lod/util/LodUtils.java b/src/main/java/com/seibel/lod/util/LodUtils.java index e220d31b3..f0497add3 100644 --- a/src/main/java/com/seibel/lod/util/LodUtils.java +++ b/src/main/java/com/seibel/lod/util/LodUtils.java @@ -1,5 +1,7 @@ package com.seibel.lod.util; +import java.awt.Color; + import com.seibel.lod.objects.LodRegion; import com.seibel.lod.objects.RegionPos; @@ -18,7 +20,7 @@ import net.minecraft.world.server.ServerWorld; * This class holds methods that may be used in multiple places. * * @author James Seibel - * @version 04-01-2021 + * @version 06-19-2021 */ public class LodUtils { @@ -212,4 +214,26 @@ public class LodUtils } + + /** + * Convert a BlockColors int into a Color object. + */ + public static Color intToColor(int num) + { + int filter = 0b11111111; + + int red = (num >> 16 ) & filter; + int green = (num >> 8 ) & filter; + int blue = num & filter; + + return new Color(red, green, blue); + } + + /** + * Convert a Color into a BlockColors object. + */ + public static int colorToInt(Color color) + { + return color.getRGB(); + } }