aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/slots
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-12-24 03:59:59 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-12-24 03:59:59 +0000
commit12dab5d109ac81034fd0a8fe18317024a996af61 (patch)
treec08e9a305f081fef24df556126be744d19f4c0f8 /src/Java/gtPlusPlus/core/slots
parentc1606dd2997151dbf09797092a04294230d42059 (diff)
downloadGT5-Unofficial-12dab5d109ac81034fd0a8fe18317024a996af61.tar.gz
GT5-Unofficial-12dab5d109ac81034fd0a8fe18317024a996af61.tar.bz2
GT5-Unofficial-12dab5d109ac81034fd0a8fe18317024a996af61.zip
+ Added a config option to adjust the Turbine Rotor removal cut-off point.
+ Added some new Bags/Packs for various things. An Automatic Lunchbox, a Tool Box and a Magicians Satchel. + Added full compound of Eglin Steel to ABS. Closes #392. - Removed all Multi-Tools. $ Rewrote and Fixed the recipe system. All recipes are queued regardless of when called, then created during the end of the POST_INIT load phase. Fixes too many bugs to list. (Few more to do before tomorrow) $ Fixed COFH Hard requirement. Closes #398. % Adjusted the internal map type of the AutoMap. Should improve performance, if only in single digit cpu cycles. > To-Do) Fix Recipes pertaining to compound materials made from using fluids. State may be detected wrong after recipe system changes.
Diffstat (limited to 'src/Java/gtPlusPlus/core/slots')
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotLunchBox.java30
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotMagicToolBag.java29
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotToolBox.java113
3 files changed, 172 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/slots/SlotLunchBox.java b/src/Java/gtPlusPlus/core/slots/SlotLunchBox.java
new file mode 100644
index 0000000000..bb82a28936
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotLunchBox.java
@@ -0,0 +1,30 @@
+package gtPlusPlus.core.slots;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemFood;
+import net.minecraft.item.ItemStack;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.FoodUtils;
+
+public class SlotLunchBox extends SlotGtTool {
+
+ public SlotLunchBox(final IInventory base, final int x, final int y, final int z) {
+ super(base, x, y, z);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValid_STATIC(itemstack);
+ }
+
+ public static boolean isItemValid_STATIC(final ItemStack itemstack) {
+ if ((itemstack.getItem() instanceof ItemFood) || (FoodUtils.isFood(itemstack))) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid food.");
+ return true;
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid food.");
+ return false;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotMagicToolBag.java b/src/Java/gtPlusPlus/core/slots/SlotMagicToolBag.java
new file mode 100644
index 0000000000..d555f10a44
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotMagicToolBag.java
@@ -0,0 +1,29 @@
+package gtPlusPlus.core.slots;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemFood;
+import net.minecraft.item.ItemStack;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.FoodUtils;
+
+public class SlotMagicToolBag extends SlotGtTool {
+
+ public SlotMagicToolBag(final IInventory base, final int x, final int y, final int z) {
+ super(base, x, y, z);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValid_STATIC(itemstack);
+ }
+
+ public static boolean isItemValid_STATIC(final ItemStack itemstack) {
+ if ((itemstack.getItem() instanceof ItemFood) || (FoodUtils.isFood(itemstack))) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid food.");
+ return true;
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid food.");
+ return false;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotToolBox.java b/src/Java/gtPlusPlus/core/slots/SlotToolBox.java
new file mode 100644
index 0000000000..c6d025fd21
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotToolBox.java
@@ -0,0 +1,113 @@
+package gtPlusPlus.core.slots;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.ItemTool;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+
+public class SlotToolBox extends SlotGtTool {
+
+ private static final AutoMap<Class> mSupportedCustomTools = new AutoMap<Class>();
+
+ static {
+ //Look for Supported custom tool types
+ Class temp;
+
+ //IHL Pumps
+ temp = ReflectionUtils.getClassByName("ihl.handpump.IHLHandPump");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+ //IC2 Electrics
+ temp = ReflectionUtils.getClassByName("ic2.api.item.IElectricItem");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+ //IC2 Boxables
+ temp = ReflectionUtils.getClassByName(" ic2.api.item.IBoxable");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+ //Tinkers Tools
+ temp = ReflectionUtils.getClassByName("tconstruct.library.tools.Weapon");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+ //BattleGear Weapons
+ temp = ReflectionUtils.getClassByName("mods.battlegear2.api.weapons.IBattlegearWeapon");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+
+ //OpenMods
+ String[] OpenModsContent = new String[] {"openblocks.common.item.ItemDevNull", "openblocks.common.item.ItemHangGlider", "openblocks.common.item.ItemWrench", "openblocks.common.item.ItemSleepingBag"};
+ for (String t : OpenModsContent) {
+ temp = ReflectionUtils.getClassByName(t);
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+ }
+
+ //GC Wrench
+ temp = ReflectionUtils.getClassByName("micdoodle8.mods.galacticraft.core.items.ItemUniversalWrench");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+ //EIO
+ String[] EioContent = new String[] {"crazypants.enderio.api.tool.ITool", "crazypants.enderio.item.ItemMagnet", "crazypants.enderio.item.ItemConduitProbe"};
+ for (String t : EioContent) {
+ temp = ReflectionUtils.getClassByName(t);
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+ }
+
+ //Forestry
+ temp = ReflectionUtils.getClassByName("forestry.core.items.ItemForestryTool");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+ }
+
+ public SlotToolBox(final IInventory base, final int x, final int y, final int z) {
+ super(base, x, y, z);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValid_STATIC(itemstack);
+ }
+
+ public static boolean isItemValid_STATIC(final ItemStack itemstack) {
+ if ((itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof ItemTool)) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool.");
+ return true;
+ }
+ for (Class C : mSupportedCustomTools) {
+ if (C.isInstance(itemstack.getItem())) {
+ return true;
+ }
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid Tool.");
+ return false;
+ }
+
+}