aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/core/item/base
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-07-31 02:12:12 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-07-31 02:12:12 +1000
commitcf7c25052d94a2fd2758babec9995aab318dc3e3 (patch)
tree140ed8c508a9b1fd0afd74324606dde83df1824b /src/Java/miscutil/core/item/base
parentd8c84e1d4515d956a2ab6c30e777dcdcbd96b660 (diff)
downloadGT5-Unofficial-cf7c25052d94a2fd2758babec9995aab318dc3e3.tar.gz
GT5-Unofficial-cf7c25052d94a2fd2758babec9995aab318dc3e3.tar.bz2
GT5-Unofficial-cf7c25052d94a2fd2758babec9995aab318dc3e3.zip
+ Added long Rods for all Materials
+ Added Tungsten Carbide, Silicon Carbide, Talonite, Stellite, Maraging Steel 250/300/350, Zeron-100. + Added more recipes for everything in general.
Diffstat (limited to 'src/Java/miscutil/core/item/base')
-rw-r--r--src/Java/miscutil/core/item/base/dusts/BaseItemDust.java88
-rw-r--r--src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java29
-rw-r--r--src/Java/miscutil/core/item/base/itemblock/ItemBlockGtBlock.java22
-rw-r--r--src/Java/miscutil/core/item/base/rods/BaseItemRod.java2
-rw-r--r--src/Java/miscutil/core/item/base/rods/BaseItemRodLong.java86
5 files changed, 213 insertions, 14 deletions
diff --git a/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java b/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java
index 9e98fbb821..de84c739bb 100644
--- a/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java
+++ b/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java
@@ -2,12 +2,15 @@ package miscutil.core.item.base.dusts;
import static miscutil.core.creative.AddToCreativeTab.tabMisc;
import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import java.util.List;
import miscutil.core.lib.CORE;
+import miscutil.core.lib.MaterialInfo;
import miscutil.core.util.Utils;
import miscutil.core.util.item.UtilsItems;
import miscutil.core.util.recipe.UtilsRecipe;
@@ -25,8 +28,9 @@ public class BaseItemDust extends Item{
protected boolean useBlastFurnace;
String name = "";
private int mTier;
+ private MaterialInfo dustInfo;
- public BaseItemDust(String unlocalizedName, String materialName, int colour, String pileSize, boolean blastFurnaceRequired, int tier) {
+ public BaseItemDust(String unlocalizedName, String materialName, MaterialInfo matInfo, int colour, String pileSize, boolean blastFurnaceRequired, int tier) {
setUnlocalizedName(unlocalizedName);
this.setUnlocalizedName(unlocalizedName);
this.setMaxStackSize(64);
@@ -40,6 +44,7 @@ public class BaseItemDust extends Item{
this.mTier = tier;
this.materialName = materialName;
this.useBlastFurnace = blastFurnaceRequired;
+ this.dustInfo = matInfo;
GameRegistry.registerItem(this, unlocalizedName);
String temp = "";
@@ -66,6 +71,7 @@ public class BaseItemDust extends Item{
if (temp != null && temp != ""){
GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this));
}
+ addMixerRecipe();
addFurnaceRecipe();
addMacerationRecipe();
}
@@ -114,6 +120,8 @@ public class BaseItemDust extends Item{
private void addMixerRecipe(){
ItemStack tempStack = UtilsItems.getSimpleStack(this);
ItemStack tempOutput = null;
+ ItemStack[] inputStacks = dustInfo.getInputs();
+ ItemStack[] outputStacks = dustInfo.getOutputs();
String temp = "";
Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
if (getUnlocalizedName().contains("item.")){
@@ -136,7 +144,21 @@ public class BaseItemDust extends Item{
Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
if (temp != null && temp != ""){
- tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
+
+ if (getUnlocalizedName().contains("DustTiny") || getUnlocalizedName().contains("DustSmall")){
+ tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
+ }
+ else {
+ if (outputStacks[0] != null){
+ Utils.LOG_INFO("Getting output dusts for mixer recipe. Checking ENUM, got: "+outputStacks[0].toString());
+ tempOutput = outputStacks[0];
+ }
+ else {
+ Utils.LOG_INFO("Getting output dusts for mixer recipe. Enum check failed, failback item is: "+temp);
+ tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
+ }
+ }
+
}
if (tempOutput != null){
@@ -155,11 +177,14 @@ public class BaseItemDust extends Item{
null, null, null);
}
else {
- Utils.LOG_WARNING("Generating a shapeless Dust recipe for "+materialName);
- UtilsRecipe.addShapelessGregtechRecipe(tempOutput,
- "dustTungsten", "dustTantalum", "dustTantalum",
- "dustTantalum", "dustTantalum", "dustTantalum",
- "dustTantalum", "dustTantalum", "dustTantalum");
+ Utils.LOG_WARNING("Generating a shapeless Dust recipe for "+materialName);
+
+ GT_Values.RA.addMixerRecipe(
+ inputStacks[0], inputStacks[1],
+ inputStacks[2], inputStacks[3],
+ null, null,
+ tempOutput,
+ 8*mTier*20, 8*mTier*2);
}
}
@@ -188,14 +213,21 @@ public class BaseItemDust extends Item{
tempIngot = tempIngot.replace("itemDust", "ingot");
Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot);
-
+ ItemStack[] outputStacks = dustInfo.getOutputs();
+ if (tempIngot != null && tempIngot != "" && outputStacks[1] != null){
+ tempInputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempDust, 1);
+ if (null != tempOutputStack && null != tempInputStack){
+ GT_ModHandler.addPulverisationRecipe(tempInputStack, outputStacks[0], outputStacks[1], mTier*10/Utils.randInt(10, 20));
+ }
+ }
if (tempIngot != null && tempIngot != ""){
tempInputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempDust, 1);
if (null != tempOutputStack && null != tempInputStack){
GT_ModHandler.addPulverisationRecipe(tempInputStack, tempOutputStack);
}
- }
+ }
}
private void addFurnaceRecipe(){
@@ -227,13 +259,32 @@ public class BaseItemDust extends Item{
ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
Utils.LOG_INFO("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp);
if (null != tempOutputStack){
- GT_ModHandler.addSmeltingAndAlloySmeltingRecipe(UtilsItems.getSimpleStack(this), tempOutputStack);
- }
+ if (mTier < 5){
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ addSmeltingAndAlloySmeltingRecipe(UtilsItems.getSimpleStack(this), tempOutputStack, false);
+ }
+ else {
+ GT_ModHandler.addSmeltingAndAlloySmeltingRecipe(UtilsItems.getSimpleStack(this), tempOutputStack);
+ }
+ }
+ else if (mTier >= 5){
+ Utils.LOG_INFO("Adding recipe for "+materialName+" Ingots in a Blast furnace.");
+ Utils.LOG_INFO("This will produce "+tempOutputStack.getDisplayName());
+ if (null != tempOutputStack){
+ addBlastFurnaceRecipe(UtilsItems.getSimpleStack(this), null, tempOutputStack, null, 350*mTier);
+ }
+ return;
+ }
+ }
+
}
}
private void addBlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tempRequired){
- //Utils.LOG_INFO("Adding Blast Furnace recipe for a Hot Ingot of "+materialName+".");
+ //Special Cases
+ if (input1.getUnlocalizedName().toLowerCase().contains("tantalloy61")){
+ input2 = UtilsItems.getItemStackOfAmountFromOreDict("dustTantalloy60", 2);
+ }
GT_Values.RA.addBlastRecipe(
input1,
input2,
@@ -243,6 +294,19 @@ public class BaseItemDust extends Item{
250*mTier*20,
mTier*64,
tempRequired);
+
+
+
+ }
+
+ private boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput, boolean hidden) {
+ if (aInput == null || aOutput == null) return false;
+ boolean temp = false;
+ if (aInput.stackSize == 1 && GT_ModHandler.addSmeltingRecipe(aInput, aOutput)) temp = true;
+ if (GT_Values.RA.addAlloySmelterRecipe(aInput, OrePrefixes.ingot.contains(aOutput) ? ItemList.Shape_Mold_Ingot.get(0) : OrePrefixes.block.contains(aOutput) ? ItemList.Shape_Mold_Block.get(0) : OrePrefixes.nugget.contains(aOutput) ? ItemList.Shape_Mold_Nugget.get(0) : null, aOutput, 130, 3))
+ temp = true;
+ if (GT_ModHandler.addInductionSmelterRecipe(aInput, null, aOutput, null, aOutput.stackSize * 1600, 0)) temp = true;
+ return temp;
}
}
diff --git a/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java b/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java
index bd66c3a6bb..8915b155bd 100644
--- a/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java
+++ b/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java
@@ -1,5 +1,6 @@
package miscutil.core.item.base.ingots;
+import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import java.util.List;
@@ -41,7 +42,7 @@ public class BaseItemIngot extends Item{
if (temp != null && temp != ""){
GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this));
}
- //addBendingRecipe();
+ generateCompressorRecipe();
}
@Override
@@ -74,4 +75,30 @@ public class BaseItemIngot extends Item{
}
+ private void generateCompressorRecipe(){
+ if (unlocalName.contains("itemIngot")){
+ ItemStack tempStack = UtilsItems.getSimpleStack(this, 9);
+ ItemStack tempOutput = null;
+ String temp = getUnlocalizedName().replace("item.itemIngot", "block");
+ Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ temp = temp.replace("itemIngot", "block");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ if (temp != null && temp != ""){
+ tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
+ if (tempOutput != null){
+ GT_ModHandler.addCompressionRecipe(tempStack, tempOutput);
+ }
+
+ }
+ }
+ else if (unlocalName.contains("itemHotIngot")){
+ return;
+ }
+
+
+ }
}
diff --git a/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtBlock.java
new file mode 100644
index 0000000000..0bd051928e
--- /dev/null
+++ b/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtBlock.java
@@ -0,0 +1,22 @@
+package miscutil.core.item.base.itemblock;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import miscutil.core.util.item.UtilsItems;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemBlock;
+
+public class ItemBlockGtBlock extends ItemBlock{
+
+ protected int blockColour;
+
+ public ItemBlockGtBlock(Block block) {
+ super(block);
+ this.blockColour = block.getBlockColor();
+ GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), UtilsItems.getSimpleStack(this));
+ }
+
+ public int getRenderColor(int aMeta) {
+ return blockColour;
+ }
+
+}
diff --git a/src/Java/miscutil/core/item/base/rods/BaseItemRod.java b/src/Java/miscutil/core/item/base/rods/BaseItemRod.java
index 6d7424c96d..853e6dde70 100644
--- a/src/Java/miscutil/core/item/base/rods/BaseItemRod.java
+++ b/src/Java/miscutil/core/item/base/rods/BaseItemRod.java
@@ -35,7 +35,7 @@ public class BaseItemRod extends Item{
this.mTier = tier;
this.materialName = materialName;
GameRegistry.registerItem(this, unlocalizedName);
- GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this));
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this));
addExtruderRecipe();
}
diff --git a/src/Java/miscutil/core/item/base/rods/BaseItemRodLong.java b/src/Java/miscutil/core/item/base/rods/BaseItemRodLong.java
new file mode 100644
index 0000000000..64b7d7f2bb
--- /dev/null
+++ b/src/Java/miscutil/core/item/base/rods/BaseItemRodLong.java
@@ -0,0 +1,86 @@
+package miscutil.core.item.base.rods;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_OreDictUnificator;
+
+import java.util.List;
+
+import miscutil.core.creative.AddToCreativeTab;
+import miscutil.core.lib.CORE;
+import miscutil.core.util.Utils;
+import miscutil.core.util.item.UtilsItems;
+import miscutil.core.util.recipe.UtilsRecipe;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemRodLong extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+ private int mTier;
+
+ public BaseItemRodLong(String unlocalizedName, String materialName, int colour, int tier) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setTextureName(CORE.MODID + ":" + "itemRodLong");
+ this.setMaxStackSize(64);
+ this.colour = colour;
+ this.mTier = tier;
+ this.materialName = materialName;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this));
+ addExtruderRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return ("Long "+materialName+ " Rod");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A 80cm Rod of " + materialName + ".");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return Utils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ private void addExtruderRecipe(){
+ Utils.LOG_INFO("Adding recipe for Long "+materialName+" Rods");
+ String tempIngot = unlocalName.replace("itemRodLong", "stick");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 2);
+ if (null != tempOutputStack){
+ GT_Values.RA.addForgeHammerRecipe(tempOutputStack,
+ UtilsItems.getSimpleStack(this, 1),
+ 12*mTier*20, 24*mTier);
+ }
+ ItemStack rods = UtilsItems.getSimpleStack(this, 1);
+ ItemStack tempOutputStack2 = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ UtilsRecipe.addShapedGregtechRecipe(
+ tempOutputStack2, "craftingToolHardHammer", tempOutputStack2,
+ null, null, null,
+ null, null, null,
+ rods);
+ }
+
+}