aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/core/util/item
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-07-27 00:26:22 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-07-27 00:26:22 +1000
commit926af00c0b3da2ba168f578eafb3ed8c7c2d9dba (patch)
treedc1a749573a9a9cc624671e9c63b785aae4fac40 /src/Java/miscutil/core/util/item
parent28c115270dc90e6b7358cc45b77242ce9cdc0372 (diff)
downloadGT5-Unofficial-926af00c0b3da2ba168f578eafb3ed8c7c2d9dba.tar.gz
GT5-Unofficial-926af00c0b3da2ba168f578eafb3ed8c7c2d9dba.tar.bz2
GT5-Unofficial-926af00c0b3da2ba168f578eafb3ed8c7c2d9dba.zip
+ Added a Plate Bender Recipe for Staballoy.
+ Added a Blast Furnace Recipe for Staballoy. + Added a Vacuum Freezer Recipe for Staballoy. + Added Some Raisin Bread for ImQ009. + Added a placeholder item for invalid recipes, so that broken recipes show up and hidden/unavailable stuff doesn't. + Added a handler for generating ingots & Hot ingots. % Changed Staballoy to generate from this new ingotHandler. % Changed getItemStackOfAmountFromOreDict to handle meta, thanks to Greg for pointing that out. % Changed Matter Fabricator to actually have an output (It was returning 0 previously, thought worked) - Removed pollution value from the Matter Fabricator.
Diffstat (limited to 'src/Java/miscutil/core/util/item')
-rw-r--r--src/Java/miscutil/core/util/item/UtilsItems.java88
1 files changed, 46 insertions, 42 deletions
diff --git a/src/Java/miscutil/core/util/item/UtilsItems.java b/src/Java/miscutil/core/util/item/UtilsItems.java
index f8bf9fc029..bda8849768 100644
--- a/src/Java/miscutil/core/util/item/UtilsItems.java
+++ b/src/Java/miscutil/core/util/item/UtilsItems.java
@@ -4,6 +4,7 @@ import gregtech.api.util.GT_OreDictUnificator;
import java.util.ArrayList;
+import miscutil.core.item.ModItems;
import miscutil.core.item.base.BasicSpawnEgg;
import miscutil.core.lib.CORE;
import miscutil.core.lib.LoadedMods;
@@ -44,7 +45,7 @@ public class UtilsItems {
public static ItemStack getSimpleStack(Item x){
return getSimpleStack(x, 1);
}
-
+
public static ItemStack getSimpleStack(Item x, int i){
try {
ItemStack r = new ItemStack(x, i);
@@ -100,49 +101,49 @@ public class UtilsItems {
}
return null;
}
-
+
@SuppressWarnings("unused")
public static ItemStack simpleMetaStack(String FQRN, int meta, int itemstackSize){
- try {
- Item em = null;
- Item em1 = getItem(FQRN);
- Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
- if (em1 != null){
- if (null == em){
- em = em1;
- }
- if (em != null){
- ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
- return metaStack;
- }
+ try {
+ Item em = null;
+ Item em1 = getItem(FQRN);
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ if (null == em){
+ em = em1;
}
- return null;
- } catch (NullPointerException e) {
- Utils.LOG_ERROR(FQRN+" not found. [NULL]");
- return null;
- }
+ if (em != null){
+ ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
+ return metaStack;
+ }
+ }
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(FQRN+" not found. [NULL]");
+ return null;
+ }
}
-
+
@SuppressWarnings("unused")
public static ItemStack simpleMetaStack(Item item, int meta, int itemstackSize){
- try {
- Item em = item;
- Item em1 = item;
- Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
- if (em1 != null){
- if (null == em){
- em = em1;
- }
- if (em != null){
- ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
- return metaStack;
- }
+ try {
+ Item em = item;
+ Item em1 = item;
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ if (null == em){
+ em = em1;
}
- return null;
- } catch (NullPointerException e) {
- Utils.LOG_ERROR(item.getUnlocalizedName()+" not found. [NULL]");
- return null;
- }
+ if (em != null){
+ ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
+ return metaStack;
+ }
+ }
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(item.getUnlocalizedName()+" not found. [NULL]");
+ return null;
+ }
}
public static ItemStack getCorrectStacktype(String fqrn, int stackSize){
@@ -158,7 +159,7 @@ public class UtilsItems {
temp = UtilsItems.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(fqrnSplit[2]), stackSize);
return temp;
}
-
+
public static ItemStack getCorrectStacktype(Object item_Input, int stackSize) {
if (item_Input instanceof String){
return getCorrectStacktype(item_Input, stackSize);
@@ -207,7 +208,7 @@ public class UtilsItems {
return null;
}
-
+
public static void generateSpawnEgg(String entityModID, String parSpawnName, int colourEgg, int colourOverlay){
Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay).setUnlocalizedName("spawn_egg_"+parSpawnName.toLowerCase()).setTextureName(CORE.MODID+":spawn_egg");
GameRegistry.registerItem(itemSpawnEgg, "spawnEgg"+parSpawnName);
@@ -215,9 +216,12 @@ public class UtilsItems {
public static ItemStack getItemStackOfAmountFromOreDict(String oredictName, int amount){
ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
- ItemStack temp = oreDictList.get(0);
- ItemStack returnValue = new ItemStack(temp.getItem(), amount);
+ if (!oreDictList.isEmpty()){
+ ItemStack returnValue = oreDictList.get(0).copy();
+ returnValue.stackSize = amount;
return returnValue;
+ }
+ return getSimpleStack(ModItems.AAA_Broken, amount);
}
-
+
}