diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-02-28 20:06:01 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-02-28 20:06:01 +0000 |
commit | 4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a (patch) | |
tree | f9707c4551b6134030374580cacfd1aec4b0c9d7 /src/Java/gtPlusPlus/core/material/Material.java | |
parent | 1c20e21e7678f9a546fff9bf873c80c35a841cf8 (diff) | |
download | GT5-Unofficial-4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a.tar.gz GT5-Unofficial-4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a.tar.bz2 GT5-Unofficial-4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a.zip |
+ Added a new debug tool.
+ Added support for Crops++.
+ Added Custom Crops & framework to support more in future.
+ Added basic support for all GT++ Materials within Tinkers Construct. [WIP]
+ Moderately bad attempt at generating custom Plasma Cooling recipes in the Adv. Vacuum Freezer. [WIP #424]
% Reworked logic for Material.java handling Durability, Tool Quality & Harvest Level.
% Adjusted frequency of structural checks on the Cyclotron, Now 100x less frequent.
% Cleaned up ReflectionUtils.java and made all getters cache their results, for much faster access.
% Attempted to adjust logic of FFPP, but I probably broke it. [WIP]
% Moved static array of Element Names from IonParticles.java -> ELEMENT.java.
$ Greatly improved reflective performance across the mod.
Diffstat (limited to 'src/Java/gtPlusPlus/core/material/Material.java')
-rw-r--r-- | src/Java/gtPlusPlus/core/material/Material.java | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 03e50aa7dd..d996bed128 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.material; import static gregtech.api.enums.GT_Values.M; +import static gtPlusPlus.core.util.math.MathUtils.safeCast_LongToInt; import java.util.ArrayList; import java.util.HashMap; @@ -317,28 +318,13 @@ public class Material { this.vDurability = durability; } else { - if (inputs != null){ - long durabilityTemp = 0; - int counterTemp = 0; - for (final MaterialStack m : inputs){ - if (m.getStackMaterial() != null){ - if (m.getStackMaterial().vDurability != 0){ - durabilityTemp = (durabilityTemp+m.getStackMaterial().vDurability); - counterTemp++; - - } - } + long aTempDura = 0; + for (MaterialStack g : this.getComposites()) { + if (g != null) { + aTempDura += safeCast_LongToInt(g.getStackMaterial().getMass() * 2000); } - if ((durabilityTemp != 0) && (counterTemp != 0)){ - this.vDurability = (durabilityTemp/counterTemp); - } - else { - this.vDurability = 8196; - } - } - else { - this.vDurability = 0; } + this.vDurability = aTempDura > 0 ? aTempDura : (this.getComposites().isEmpty() ? 51200 : 32000 * this.getComposites().size()); } if ((this.vDurability >= 0) && (this.vDurability < 64000)){ @@ -362,8 +348,8 @@ public class Material { this.vHarvestLevel = 4; } else { - this.vToolQuality = 0; - this.vHarvestLevel = 0; + this.vToolQuality = 1; + this.vHarvestLevel = 1; } //Sets the Rad level |