aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-15 13:29:00 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-15 13:29:00 +0000
commit860bded5892357e4575595c71ccce5a0351abe12 (patch)
treea05a86e185c6ef2a0401344329eb671f43ff8281 /src/main/java/gtPlusPlus
parentd3c655a124b349fa7f78b52ca9651c2c4140198a (diff)
downloadGT5-Unofficial-860bded5892357e4575595c71ccce5a0351abe12.tar.gz
GT5-Unofficial-860bded5892357e4575595c71ccce5a0351abe12.tar.bz2
GT5-Unofficial-860bded5892357e4575595c71ccce5a0351abe12.zip
Added ability for GT++ Plates and Foils to be used as covers.
Added missing foil recipes.
Diffstat (limited to 'src/main/java/gtPlusPlus')
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java9
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java14
3 files changed, 39 insertions, 2 deletions
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
index 3b0b868553..af03fd2b83 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -7,15 +7,16 @@ import java.util.Map;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TextureSet;
+import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.data.StringUtils;
import gtPlusPlus.core.util.math.MathUtils;
@@ -117,6 +118,12 @@ public class BaseItemComponent extends Item{
aMap.put(aKey, ItemUtils.getSimpleStack(this));
Logger.MATERIALS("Registering a material component. Item: ["+componentMaterial.getUnlocalizedName()+"] Map: ["+aKey+"]");
Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap);
+ if (componentType == ComponentTypes.PLATE) {
+ GregTech_API.registerCover(componentMaterial.getPlate(1), new GT_RenderedTexture(componentMaterial.getTextureSet().mTextures[71], componentMaterial.getRGBA(), false), null);
+ }
+ else if (componentType == ComponentTypes.PLATEDOUBLE) {
+ GregTech_API.registerCover(componentMaterial.getPlateDouble(1), new GT_RenderedTexture(componentMaterial.getTextureSet().mTextures[72], componentMaterial.getRGBA(), false), null);
+ }
return true;
}
else {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java
index 56d11520d0..6b512f4b3a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java
@@ -6,6 +6,8 @@ import java.util.Set;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
@@ -93,7 +95,7 @@ public class RecipeGen_Plates extends RecipeGen_Base {
Logger.WARNING("Cutting Machine Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Logger.WARNING("ACutting Machine Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("Cutting Machine Recipe: "+material.getLocalizedName()+" - Failed");
}
@@ -121,6 +123,20 @@ public class RecipeGen_Plates extends RecipeGen_Base {
else {
Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed");
}
+
+ //Bender
+ if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getFoil(1)))
+ if (addBenderRecipe(
+ material.getPlate(1),
+ material.getFoil(4),
+ (int) Math.max(material.getMass(), 1L),
+ material.vVoltageMultiplier)){
+ GregTech_API.registerCover(material.getFoil(1), new GT_RenderedTexture(material.getTextureSet().mTextures[70], material.getRGBA(), false), null);
+ Logger.WARNING("Bender Foil Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("Bender Foil Recipe: "+material.getLocalizedName()+" - Failed");
+ }
}
public static boolean addBenderRecipe(final ItemStack aInput1, final ItemStack aOutput1, int aDuration, final int aEUt) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
index 7a596c3c42..1a6221b09e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
@@ -192,6 +192,20 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
Logger.WARNING("Fine Wire Recipe: "+material.getLocalizedName()+" - Failed");
}
}
+
+ //Shaped Recipe - Foil
+ if (ItemUtils.checkForInvalidItems(material.getFoil(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1))) {
+ if (RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard, material.getPlate(1), null,
+ null, null, null,
+ null, null, null,
+ material.getFoil(2))){
+ Logger.WARNING("Foil Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("Foil Recipe: "+material.getLocalizedName()+" - Failed");
+ }
+ }
//Shaped Recipe - Ingot to Rod