diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-10-23 20:32:22 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-10-23 20:32:22 +1000 |
commit | 4e22125d6ddc878853cc3cadcec272a1a92e5135 (patch) | |
tree | bfab2239a40f54937ab7443e4f8ed896b37516da /src/Java/gtPlusPlus/core/material/MaterialStack.java | |
parent | 6754387bca14ef3c2bdc5e69d0f4920ca7568553 (diff) | |
download | GT5-Unofficial-4e22125d6ddc878853cc3cadcec272a1a92e5135.tar.gz GT5-Unofficial-4e22125d6ddc878853cc3cadcec272a1a92e5135.tar.bz2 GT5-Unofficial-4e22125d6ddc878853cc3cadcec272a1a92e5135.zip |
- Disabled generation of Deci/Centi dusts for now.
+ Added a check for Growthcraft versioning, newer versions past 2.3.1 will not have extra support loaded.
+ Improved Chemical Compound tooltip generation on dusts.
Diffstat (limited to 'src/Java/gtPlusPlus/core/material/MaterialStack.java')
-rw-r--r-- | src/Java/gtPlusPlus/core/material/MaterialStack.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/material/MaterialStack.java b/src/Java/gtPlusPlus/core/material/MaterialStack.java index 3682b73cfe..5e076e6e70 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialStack.java +++ b/src/Java/gtPlusPlus/core/material/MaterialStack.java @@ -5,6 +5,7 @@ import net.minecraft.item.ItemStack; public class MaterialStack { + final int vAmount; final Material stackMaterial; final double percentageToUse; @@ -12,6 +13,7 @@ public class MaterialStack { this.stackMaterial = inputs; this.percentageToUse = percentage; + this.vAmount = getDustCount(); } @@ -60,6 +62,26 @@ public class MaterialStack { } + public int getDustCount(){ + int amount = 0; + if (percentageToUse >= 0 && percentageToUse <= 0.99){ + amount = (int) (1/percentageToUse); + } + else if (percentageToUse >= 1 && percentageToUse <= 9.99){ + amount = (int) (percentageToUse); + } + else if (percentageToUse >= 10 && percentageToUse <= 99.99){ + amount = (int) (percentageToUse/10); + } + else if (percentageToUse == 100){ + amount = 10; + } + else { + amount = 0; + } + return amount; + } + public ItemStack[] getValidItemStacks(){ return UtilsItems.validItemsForOreDict(stackMaterial.unlocalizedName); } |