aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/util
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-10-20 20:04:45 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-10-20 20:04:45 +1000
commitd6c2e9fd582594f9e19f732398d1c16d20d3b38e (patch)
treec17148e3f11fccd715b6196b0af8d8774ea77097 /src/Java/gtPlusPlus/core/util
parent5496d90210fdb56f1b7c4b07295a90b130aed7a3 (diff)
downloadGT5-Unofficial-d6c2e9fd582594f9e19f732398d1c16d20d3b38e.tar.gz
GT5-Unofficial-d6c2e9fd582594f9e19f732398d1c16d20d3b38e.tar.bz2
GT5-Unofficial-d6c2e9fd582594f9e19f732398d1c16d20d3b38e.zip
+ Added the Advanced workbench.
+ Added custom slots for the Adv. Workbench, that take either tools or IElectricItems. % Swapped the textures on most multiblocks/casings.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
-rw-r--r--src/Java/gtPlusPlus/core/util/item/UtilsItems.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
index 64f06a078c..62162e596d 100644
--- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
+++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
@@ -244,6 +244,17 @@ public class UtilsItems {
return null;
}
+
+ public static ItemStack getItemStackInPlayersHand(){
+ Minecraft mc = Minecraft.getMinecraft();
+ ItemStack heldItem = null;
+ try{heldItem = mc.thePlayer.getHeldItem();
+ }catch(NullPointerException e){return null;}
+ if (heldItem != null){
+ return heldItem;
+ }
+ 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");
@@ -279,6 +290,32 @@ public class UtilsItems {
Utils.LOG_INFO(oredictName+" was not valid.");
return null;
}
+
+ public static ItemStack getItemStackOfAmountFromOreDictNoBrokenExcluding(String excludeModName, String oredictName, int amount){
+ ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount);
+
+ if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass() || returnValue.getItem() != ModItems.AAA_Broken){
+ if (returnValue.getClass().toString().toLowerCase().contains(excludeModName.toLowerCase())){
+ ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ if (!oreDictList.isEmpty()){
+ returnValue = oreDictList.get(1).copy();
+ returnValue.stackSize = amount;
+ return returnValue;
+ }
+ }
+ else {
+ ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ if (!oreDictList.isEmpty()){
+ returnValue = oreDictList.get(1).copy();
+ returnValue.stackSize = amount;
+ return returnValue;
+ }
+ }
+ return returnValue;
+ }
+ Utils.LOG_INFO(oredictName+" was not valid.");
+ return null;
+ }
public static void generateItemsFromMaterial(Material matInfo){