diff options
| author | Martin Robertz <dream-master@gmx.net> | 2021-07-30 11:54:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-30 11:54:50 +0200 |
| commit | 0f7a5c79f0941195d078b1877cd876b1d73b2b33 (patch) | |
| tree | 7029c33c0ffb93a1b911ae3395af424ceb7e7743 /src/main/java/gregtech/api/enums | |
| parent | 2bff27eca61fd5d19f64969f67442c3a55175d3e (diff) | |
| parent | ea5c515f4769fa83f4eb6268f0b8048f76fbb0ac (diff) | |
| download | GT5-Unofficial-0f7a5c79f0941195d078b1877cd876b1d73b2b33.tar.gz GT5-Unofficial-0f7a5c79f0941195d078b1877cd876b1d73b2b33.tar.bz2 GT5-Unofficial-0f7a5c79f0941195d078b1877cd876b1d73b2b33.zip | |
Merge pull request #551 from GTNewHorizons/structurelib-integration
StructureLib integration
Diffstat (limited to 'src/main/java/gregtech/api/enums')
| -rw-r--r-- | src/main/java/gregtech/api/enums/HeatingCoilLevel.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/enums/HeatingCoilLevel.java b/src/main/java/gregtech/api/enums/HeatingCoilLevel.java index d4446e31d0..06ceedff53 100644 --- a/src/main/java/gregtech/api/enums/HeatingCoilLevel.java +++ b/src/main/java/gregtech/api/enums/HeatingCoilLevel.java @@ -23,6 +23,8 @@ public enum HeatingCoilLevel { MAX, ; + private static final HeatingCoilLevel[] VALUES = values(); + /** * @return the Coils Tier Name */ @@ -61,9 +63,17 @@ public enum HeatingCoilLevel { } public static HeatingCoilLevel getFromTier(byte tier){ - if (tier < 0 || tier > HeatingCoilLevel.values().length -1) + if (tier < 0 || tier > getMaxTier()) return HeatingCoilLevel.None; - return HeatingCoilLevel.values()[tier+2]; + return VALUES[tier+2]; + } + + public static int size() { + return VALUES.length; + } + + public static int getMaxTier() { + return VALUES.length - 1 - 2; } } |
