mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 15:23:06 +00:00
Adding gitignore
This commit is contained in:
1 parent
a2b006105e
commit
ecf0a7912e
1084 files changed
+90178
-3
No files matched your search
+49
@@ -0,0 +1,49 @@
|
||||
package WayofTime.alchemicalWizardry.client.renderer;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* This class is a utility class that was created by bspkrs.
|
||||
* https://github.com/bspkrs/bspkrsCore/blob/master/src/main/java/bspkrs/client/util/ColorThreshold.java
|
||||
*/
|
||||
public class ColourThreshold implements Comparable<ColourThreshold>
|
||||
{
|
||||
public int threshold;
|
||||
public String colorCode;
|
||||
|
||||
public ColourThreshold(int t, String c)
|
||||
{
|
||||
threshold = t;
|
||||
colorCode = c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.valueOf(threshold) + ", " + colorCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ColourThreshold o)
|
||||
{
|
||||
if (this.threshold > o.threshold)
|
||||
return 1;
|
||||
else if (this.threshold < o.threshold)
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the colorCode attached to the first threshold in the list that is
|
||||
* >= value. Expects that the list has been sorted by threshold ascending.
|
||||
*/
|
||||
public static String getColorCode(List<ColourThreshold> colorList, int value)
|
||||
{
|
||||
for (ColourThreshold ct : colorList)
|
||||
if (value <= ct.threshold)
|
||||
return ct.colorCode;
|
||||
|
||||
return "f";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user