diff options
author | Alkalus <draknyte1@hotmail.com> | 2016-10-03 23:33:28 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-03 23:33:28 +1000 |
commit | e3f4a410ef0867359cab3ade72a20c3679aaad06 (patch) | |
tree | 2f008c251c080a216b0fcf3d03667f7233edceca /src/Java/gtPlusPlus/core/material | |
parent | 10aee9adf7a1ab793a05fd9327cec6fcc1b267d2 (diff) | |
parent | bdb6fc4a5410d68cf517dbe90fa49cec45bbda5a (diff) | |
download | GT5-Unofficial-e3f4a410ef0867359cab3ade72a20c3679aaad06.tar.gz GT5-Unofficial-e3f4a410ef0867359cab3ade72a20c3679aaad06.tar.bz2 GT5-Unofficial-e3f4a410ef0867359cab3ade72a20c3679aaad06.zip |
Merge pull request #19 from draknyte1/DesktopPC
+ Added some Buttons to the workbench (WIP)
$ Workbench now uses the vanilla recipe handler.
$ Fixed the tool slots on the Workbench accepting the wrong items in certain cases.
+ Added hundreds of new machine recipes for all of the materials, due to below.
$ Rewrote recipe generation classes, things like plate bending and extrusion recipes now fall in line with GT tiering.
+ Added more functions to Materials.java, now you can get any item from them. (getDustSmall(5))
% Changed tool handling to better support older versions of Gregtech that don't allow Wrenchs to work as a BC/EIO wrench.
% Moved more GT related content to HANDLER_GT.
+ Added a basic re-implementation of the Meta Tile Entity system for GT Machines, using my own blocks as a base. In a feeble attempt to store NBT data to Itemblocks on drop/break.
% Changed lots of debug logging to only show in debug mode, if I missed anything, let me know.
Diffstat (limited to 'src/Java/gtPlusPlus/core/material')
-rw-r--r-- | src/Java/gtPlusPlus/core/material/Material.java | 78 |
1 files changed, 70 insertions, 8 deletions
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 2939016798..0902bf62f9 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -23,9 +23,11 @@ public class Material { final long vProtons; final long vNeutrons; final long vMass; + public final int vTier; + public final int vVoltageMultiplier; public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs){ - + this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; this.RGBA = rgba; @@ -39,7 +41,43 @@ public class Material { this.vProtons = protons; this.vNeutrons = neutrons; this.vMass = getMass(); + + if (getMeltingPoint_K() >= 0 && getMeltingPoint_K() <= 750){ + this.vTier = 1; + } + else if(getMeltingPoint_K() >= 751 && getMeltingPoint_K() <= 1250){ + this.vTier = 2; + } + else if(getMeltingPoint_K() >= 1251 && getMeltingPoint_K() <= 1750){ + this.vTier = 3; + } + else if(getMeltingPoint_K() >= 1751 && getMeltingPoint_K() <= 2250){ + this.vTier = 4; + } + else if(getMeltingPoint_K() >= 2251 && getMeltingPoint_K() <= 2750){ + this.vTier = 5; + } + else if(getMeltingPoint_K() >= 2751 && getMeltingPoint_K() <= 3250){ + this.vTier = 6; + } + else if(getMeltingPoint_K() >= 3251 && getMeltingPoint_K() <= 3750){ + this.vTier = 7; + } + else if(getMeltingPoint_K() >= 3751 && getMeltingPoint_K() <= 4250){ + this.vTier = 8; + } + else if(getMeltingPoint_K() >= 4251 && getMeltingPoint_K() <= 4750){ + this.vTier = 9; + } + else if(getMeltingPoint_K() >= 4751 && getMeltingPoint_K() <= 9999){ + this.vTier = 10; + } + else { + this.vTier = 0; + } + this.usesBlastFurnace = blastFurnace; + this.vVoltageMultiplier = this.getMeltingPoint_K() >= 2800 ? 64 : 16; if (inputs == null){ this.materialInput = null; @@ -72,6 +110,10 @@ public class Material { public short[] getRGBA(){ return RGBA; } + + public int getRgbAsHex(){ + return Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]); + } public long getProtons() { return vProtons; @@ -93,6 +135,14 @@ public class Material { return boilingPointC; } + public int getMeltingPoint_K() { + return meltingPointK; + } + + public int getBoilingPoint_K() { + return boilingPointK; + } + public boolean requiresBlastFurnace(){ return usesBlastFurnace; } @@ -100,11 +150,11 @@ public class Material { public ItemStack getDust(int stacksize){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); } - + public ItemStack getSmallDust(int stacksize){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize); } - + public ItemStack getTinyDust(int stacksize){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize); } @@ -113,6 +163,18 @@ public class Material { return UtilsItems.validItemsForOreDict(unlocalizedName); } + public ItemStack getIngot(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("ingot"+unlocalizedName, stacksize); + } + + public ItemStack getPlate(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plate"+unlocalizedName, stacksize); + } + + public ItemStack getPlateDouble(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize); + } + public ItemStack[] getMaterialComposites(){ //Utils.LOG_INFO("Something requested the materials needed for "+localizedName); if (materialInput != null && materialInput.length >= 1){ @@ -121,16 +183,16 @@ public class Material { //Utils.LOG_INFO("i:"+i); ItemStack testNull = null; try { - testNull = materialInput[i].getDustStack(); + testNull = materialInput[i].getDustStack(); } catch (Throwable r){ Utils.LOG_INFO("Failed gathering material stack for "+localizedName+"."); Utils.LOG_INFO("What Failed: Length:"+materialInput.length+" current:"+i); } try { - if (testNull != null){ - //Utils.LOG_INFO("not null"); - temp[i] = materialInput[i].getDustStack(); - } + if (testNull != null){ + //Utils.LOG_INFO("not null"); + temp[i] = materialInput[i].getDustStack(); + } } catch (Throwable r){ Utils.LOG_INFO("Failed setting slot "+i+", using "+localizedName); } |