aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
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
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')
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java67
-rw-r--r--src/Java/gtPlusPlus/core/config/ConfigHandler.java1
-rw-r--r--src/Java/gtPlusPlus/core/container/box/LunchBoxContainer.java13
-rw-r--r--src/Java/gtPlusPlus/core/container/box/MagicBagContainer.java13
-rw-r--r--src/Java/gtPlusPlus/core/container/box/ToolBoxContainer.java15
-rw-r--r--src/Java/gtPlusPlus/core/gui/item/box/GuiBaseBox.java116
-rw-r--r--src/Java/gtPlusPlus/core/gui/item/box/LunchBoxGui.java11
-rw-r--r--src/Java/gtPlusPlus/core/gui/item/box/MagicBagGui.java11
-rw-r--r--src/Java/gtPlusPlus/core/gui/item/box/ToolBoxGui.java11
-rw-r--r--src/Java/gtPlusPlus/core/handler/GuiHandler.java40
-rw-r--r--src/Java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java15
-rw-r--r--src/Java/gtPlusPlus/core/inventories/box/MagicBagInventory.java15
-rw-r--r--src/Java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java16
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java37
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java1
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java31
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java52
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java15
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java11
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/box/BaseBoxItem.java59
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/box/ContainerBoxBase.java328
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/box/CustomBoxInventory.java243
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java11
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java13
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java1
-rw-r--r--src/Java/gtPlusPlus/core/material/ELEMENT.java2
-rw-r--r--src/Java/gtPlusPlus/core/material/Material.java52
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java13
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java54
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_General.java130
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java4
-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
-rw-r--r--src/Java/gtPlusPlus/core/util/Utils.java42
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/FoodUtils.java60
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java648
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java31
39 files changed, 1968 insertions, 388 deletions
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
index b089688193..8310fa3c23 100644
--- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
+++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -1,14 +1,19 @@
package gtPlusPlus.core.block.base;
+import java.util.HashMap;
+import java.util.Map;
+
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TextureSet;
import gregtech.api.util.GT_OreDictUnificator;
-
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.base.itemblock.ItemBlockGtBlock;
import gtPlusPlus.core.item.base.itemblock.ItemBlockGtFrameBox;
import gtPlusPlus.core.lib.CORE;
@@ -34,6 +39,7 @@ public class BlockBaseModular extends BasicBlock {
this(material.getUnlocalizedName(), material.getLocalizedName(), net.minecraft.block.material.Material.iron,
blockType, colour, Math.min(Math.max(material.vTier, 1), 6));
blockMaterial = material;
+ registerComponent();
}
protected BlockBaseModular(final String unlocalizedName, final String blockMaterial,
@@ -47,8 +53,8 @@ public class BlockBaseModular extends BasicBlock {
this.thisBlockMaterial = blockMaterial;
this.thisBlockType = blockType.name().toUpperCase();
this.setBlockName(this.GetProperName());
-
- if (this.thisBlockType.equals(BlockTypes.STANDARD.name().toUpperCase())) {
+ int fx = getBlockTypeMeta();
+ if (fx == 0) {
GameRegistry.registerBlock(this, ItemBlockGtBlock.class,
Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
GT_OreDictUnificator.registerOre(
@@ -56,7 +62,7 @@ public class BlockBaseModular extends BasicBlock {
.replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""),
ItemUtils.getSimpleStack(this));
}
- else if (this.thisBlockType.equals(BlockTypes.FRAME.name().toUpperCase())) {
+ else if (fx == 1) {
GameRegistry.registerBlock(this, ItemBlockGtBlock.class,
Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
GT_OreDictUnificator.registerOre(
@@ -64,7 +70,7 @@ public class BlockBaseModular extends BasicBlock {
.replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""),
ItemUtils.getSimpleStack(this));
}
- else if (this.thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())) {
+ else if (fx == 2) {
GameRegistry.registerBlock(this, ItemBlockGtBlock.class,
Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
GT_OreDictUnificator.registerOre(
@@ -72,7 +78,47 @@ public class BlockBaseModular extends BasicBlock {
.replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""),
ItemUtils.getSimpleStack(this));
}
-
+ }
+
+ public boolean registerComponent() {
+ Logger.MATERIALS("Attempting to register "+this.getUnlocalizedName()+".");
+ if (this.blockMaterial == null) {
+ Logger.MATERIALS("Tried to register "+this.getUnlocalizedName()+" but the material was null.");
+ return false;
+ }
+ String aName = blockMaterial.getUnlocalizedName();
+ //Register Component
+ Map<String, ItemStack> aMap = Material.mComponentMap.get(aName);
+ if (aMap == null) {
+ aMap = new HashMap<String, ItemStack>();
+ }
+ int fx = getBlockTypeMeta();
+ String aKey = (fx == 0 ? OrePrefixes.block.name() : ( fx == 1 ? OrePrefixes.frameGt.name() : OrePrefixes.ore.name()));
+ ItemStack x = aMap.get(aKey);
+ if (x == null) {
+ aMap.put(aKey, ItemUtils.getSimpleStack(this));
+ Logger.MATERIALS("Registering a material component. Item: ["+aName+"] Map: ["+aKey+"]");
+ Material.mComponentMap.put(aName, aMap);
+ return true;
+ }
+ else {
+ //Bad
+ Logger.MATERIALS("Tried to double register a material component.");
+ return false;
+ }
+ }
+
+ public int getBlockTypeMeta() {
+ if (this.thisBlockType.equals(BlockTypes.STANDARD.name().toUpperCase())) {
+ return 0;
+ }
+ else if (this.thisBlockType.equals(BlockTypes.FRAME.name().toUpperCase())) {
+ return 1;
+ }
+ else if (this.thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())) {
+ return 2;
+ }
+ return 0;
}
/**
@@ -153,4 +199,13 @@ public class BlockBaseModular extends BasicBlock {
return this.blockColour;
}
+ @Override
+ public int getBlockColor() {
+ if (this.blockColour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/config/ConfigHandler.java b/src/Java/gtPlusPlus/core/config/ConfigHandler.java
index 4c992ed8f4..d5a43ab883 100644
--- a/src/Java/gtPlusPlus/core/config/ConfigHandler.java
+++ b/src/Java/gtPlusPlus/core/config/ConfigHandler.java
@@ -66,6 +66,7 @@ public class ConfigHandler {
"Adds GT6 recipes for Sulfuric Acid. Should remove all pre-existing recipes.");
enableAnimatedTurbines = config.getBoolean("enableAnimatedTurbines", "gregtech", true,
"Gives GT Gas/Steam turbines animated textures while running.");
+ turbineCutoffBase = config.getInt("turbineCutoffBase", "gregtech", 75000, 0, Integer.MAX_VALUE, "Rotors below this durability will be removed, prevents NEI clutter. Minimum Durability is N * x, where N is the new value set and x is the turbine size, where 1 is Tiny and 4 is Huge. Set to 0 to disable.");
// Pipes & Cables
enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true,
diff --git a/src/Java/gtPlusPlus/core/container/box/LunchBoxContainer.java b/src/Java/gtPlusPlus/core/container/box/LunchBoxContainer.java
new file mode 100644
index 0000000000..8e56c661f2
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/container/box/LunchBoxContainer.java
@@ -0,0 +1,13 @@
+package gtPlusPlus.core.container.box;
+
+import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
+import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
+import gtPlusPlus.core.slots.SlotLunchBox;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class LunchBoxContainer extends ContainerBoxBase {
+ public LunchBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, CustomBoxInventory CustomBoxInventory) {
+ super(par1Player, inventoryPlayer, CustomBoxInventory, SlotLunchBox.class, gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/container/box/MagicBagContainer.java b/src/Java/gtPlusPlus/core/container/box/MagicBagContainer.java
new file mode 100644
index 0000000000..7820d56814
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/container/box/MagicBagContainer.java
@@ -0,0 +1,13 @@
+package gtPlusPlus.core.container.box;
+
+import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
+import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
+import gtPlusPlus.core.slots.SlotMagicToolBag;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class MagicBagContainer extends ContainerBoxBase {
+ public MagicBagContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, CustomBoxInventory CustomBoxInventory) {
+ super(par1Player, inventoryPlayer, CustomBoxInventory, SlotMagicToolBag.class, gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/container/box/ToolBoxContainer.java b/src/Java/gtPlusPlus/core/container/box/ToolBoxContainer.java
new file mode 100644
index 0000000000..49719aa9ba
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/container/box/ToolBoxContainer.java
@@ -0,0 +1,15 @@
+package gtPlusPlus.core.container.box;
+
+import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
+import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
+import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox;
+import gtPlusPlus.core.slots.SlotToolBox;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class ToolBoxContainer extends ContainerBoxBase {
+ public ToolBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer,
+ CustomBoxInventory CustomBoxInventory) {
+ super(par1Player, inventoryPlayer, CustomBoxInventory, SlotToolBox.class, UniversalToolBox.SLOTS);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/gui/item/box/GuiBaseBox.java b/src/Java/gtPlusPlus/core/gui/item/box/GuiBaseBox.java
new file mode 100644
index 0000000000..97ec58bfa4
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/item/box/GuiBaseBox.java
@@ -0,0 +1,116 @@
+package gtPlusPlus.core.gui.item.box;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
+import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.util.ResourceLocation;
+
+public class GuiBaseBox extends GuiContainer {
+ /**
+ * x and y size of the inventory window in pixels. Defined as float, passed as
+ * int These are used for drawing the player model.
+ */
+ private float xSize_lo;
+ private float ySize_lo;
+
+ /**
+ * ResourceLocation takes 2 parameters: ModId, path to texture at the location:
+ * "src/minecraft/assets/modid/"
+ *
+ * I have provided a sample texture file that works with this tutorial. Download
+ * it from Forge_Tutorials/textures/gui/
+ */
+ private final ResourceLocation iconLocation;
+
+ /** The inventory to render on screen */
+ private final CustomBoxInventory inventory;
+
+ public GuiBaseBox(ContainerBoxBase containerItem, ResourceLocation aGuiTexture) {
+ super(containerItem);
+ this.inventory = containerItem.getInventoryObject();
+ this.iconLocation = aGuiTexture;
+ }
+
+ /**
+ * Draws the screen and all the components in it.
+ */
+ public void drawScreen(int par1, int par2, float par3) {
+ super.drawScreen(par1, par2, par3);
+ this.xSize_lo = (float) par1;
+ this.ySize_lo = (float) par2;
+ }
+
+ /**
+ * Draw the foreground layer for the GuiContainer (everything in front of the
+ * items)
+ */
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ String s = this.inventory.hasCustomInventoryName() ? this.inventory.getInventoryName()
+ : I18n.format(this.inventory.getInventoryName());
+ this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 0, 4210752);
+ this.fontRendererObj.drawString(I18n.format("container.inventory"), 26, this.ySize - 96 + 4, 4210752);
+ }
+
+ /**
+ * Draw the background layer for the GuiContainer (everything behind the items)
+ */
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(iconLocation);
+ int k = (this.width - this.xSize) / 2;
+ int l = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
+ int i1;
+ drawPlayerModel(k + 51, l + 75, 30, (float) (k + 51) - this.xSize_lo, (float) (l + 75 - 50) - this.ySize_lo,
+ this.mc.thePlayer);
+ }
+
+ /**
+ * This renders the player model in standard inventory position (in later
+ * versions of Minecraft / Forge, you can simply call
+ * GuiInventory.drawEntityOnScreen directly instead of copying this code)
+ */
+ public static void drawPlayerModel(int x, int y, int scale, float yaw, float pitch, EntityLivingBase entity) {
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(x, y, 50.0F);
+ GL11.glScalef(-scale, scale, scale);
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ float f2 = entity.renderYawOffset;
+ float f3 = entity.rotationYaw;
+ float f4 = entity.rotationPitch;
+ float f5 = entity.prevRotationYawHead;
+ float f6 = entity.rotationYawHead;
+ GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
+ entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F;
+ entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F;
+ entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F;
+ entity.rotationYawHead = entity.rotationYaw;
+ entity.prevRotationYawHead = entity.rotationYaw;
+ GL11.glTranslatef(0.0F, entity.yOffset, 0.0F);
+ RenderManager.instance.playerViewY = 180.0F;
+ RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
+ entity.renderYawOffset = f2;
+ entity.rotationYaw = f3;
+ entity.rotationPitch = f4;
+ entity.prevRotationYawHead = f5;
+ entity.rotationYawHead = f6;
+ GL11.glPopMatrix();
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/item/box/LunchBoxGui.java b/src/Java/gtPlusPlus/core/gui/item/box/LunchBoxGui.java
new file mode 100644
index 0000000000..28e3913ac8
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/item/box/LunchBoxGui.java
@@ -0,0 +1,11 @@
+package gtPlusPlus.core.gui.item.box;
+
+import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.util.ResourceLocation;
+
+public class LunchBoxGui extends GuiBaseBox {
+ public LunchBoxGui(ContainerBoxBase containerItem) {
+ super(containerItem, new ResourceLocation(CORE.MODID, "textures/gui/schematic_rocket_GS1.png"));
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/gui/item/box/MagicBagGui.java b/src/Java/gtPlusPlus/core/gui/item/box/MagicBagGui.java
new file mode 100644
index 0000000000..958cdd3c70
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/item/box/MagicBagGui.java
@@ -0,0 +1,11 @@
+package gtPlusPlus.core.gui.item.box;
+
+import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.util.ResourceLocation;
+
+public class MagicBagGui extends GuiBaseBox {
+ public MagicBagGui(ContainerBoxBase containerItem) {
+ super(containerItem, new ResourceLocation(CORE.MODID, "textures/gui/schematic_rocket_GS1.png"));
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/gui/item/box/ToolBoxGui.java b/src/Java/gtPlusPlus/core/gui/item/box/ToolBoxGui.java
new file mode 100644
index 0000000000..c440c017e9
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/item/box/ToolBoxGui.java
@@ -0,0 +1,11 @@
+package gtPlusPlus.core.gui.item.box;
+
+import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.util.ResourceLocation;
+
+public class ToolBoxGui extends GuiBaseBox {
+ public ToolBoxGui(ContainerBoxBase containerItem) {
+ super(containerItem, new ResourceLocation(CORE.MODID, "textures/gui/schematic_rocket_GS1.png"));
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java
index 816b35ea4b..c02425afbf 100644
--- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java
@@ -11,14 +11,25 @@ import net.minecraft.world.World;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.container.*;
+import gtPlusPlus.core.container.box.LunchBoxContainer;
+import gtPlusPlus.core.container.box.MagicBagContainer;
+import gtPlusPlus.core.container.box.ToolBoxContainer;
import gtPlusPlus.core.gui.beta.Gui_ID_Registry;
import gtPlusPlus.core.gui.beta.MU_GuiId;
import gtPlusPlus.core.gui.item.GuiBaseBackpack;
import gtPlusPlus.core.gui.item.GuiBaseGrindle;
+import gtPlusPlus.core.gui.item.box.LunchBoxGui;
+import gtPlusPlus.core.gui.item.box.MagicBagGui;
+import gtPlusPlus.core.gui.item.box.ToolBoxGui;
import gtPlusPlus.core.gui.machine.*;
import gtPlusPlus.core.interfaces.IGuiManager;
import gtPlusPlus.core.inventories.BaseInventoryBackpack;
import gtPlusPlus.core.inventories.BaseInventoryGrindle;
+import gtPlusPlus.core.inventories.box.LunchBoxInventory;
+import gtPlusPlus.core.inventories.box.MagicBagInventory;
+import gtPlusPlus.core.inventories.box.ToolBoxInventory;
+import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
+import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
import gtPlusPlus.core.tileentities.base.TileEntityBase;
import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer;
import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
@@ -35,6 +46,9 @@ public class GuiHandler implements IGuiHandler {
public static final int GUI7 = 6; // Trade table
public static final int GUI8 = 7; // Circuit Programmer
public static final int GUI9 = 8; // Grindle
+ public static final int GUI10 = 9; // Universal Toolbox
+ public static final int GUI11 = 10; // Auto Lunchbox
+ public static final int GUI12 = 11; // Bag for Magic Tools
public static void init() {
@@ -83,6 +97,16 @@ public class GuiHandler implements IGuiHandler {
if (ID == GUI9) {
return new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem()));
}
+ //Tool, lunch, magic
+ if (ID == GUI10) {
+ return new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem()));
+ }
+ if (ID == GUI11) {
+ return new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem()));
+ }
+ if (ID == GUI12) {
+ return new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem()));
+ }
return null;
}
@@ -125,9 +149,21 @@ public class GuiHandler implements IGuiHandler {
}
if (ID == GUI9) {
- return new GuiBaseGrindle(
- new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem())));
+ return new GuiBaseGrindle(new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem())));
+ }
+
+
+ //Tool, lunch, magic
+ if (ID == GUI10) {
+ return new ToolBoxGui(new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem())));
+ }
+ if (ID == GUI11) {
+ return new LunchBoxGui(new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem())));
+ }
+ if (ID == GUI12) {
+ return new MagicBagGui(new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem())));
}
+
return null;
}
diff --git a/src/Java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java b/src/Java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java
new file mode 100644
index 0000000000..03350a3c18
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java
@@ -0,0 +1,15 @@
+package gtPlusPlus.core.inventories.box;
+
+import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
+import gtPlusPlus.core.slots.SlotLunchBox;
+import net.minecraft.item.ItemStack;
+
+public class LunchBoxInventory extends CustomBoxInventory {
+ public LunchBoxInventory(ItemStack stack) {
+ super(stack, "Lunch Box", gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
+ }
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
+ return SlotLunchBox.isItemValid_STATIC(itemstack);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/inventories/box/MagicBagInventory.java b/src/Java/gtPlusPlus/core/inventories/box/MagicBagInventory.java
new file mode 100644
index 0000000000..56b1835113
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/inventories/box/MagicBagInventory.java
@@ -0,0 +1,15 @@
+package gtPlusPlus.core.inventories.box;
+
+import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
+import gtPlusPlus.core.slots.SlotMagicToolBag;
+import net.minecraft.item.ItemStack;
+
+public class MagicBagInventory extends CustomBoxInventory {
+ public MagicBagInventory(ItemStack stack) {
+ super(stack, "Mystic Bag", gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
+ }
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
+ return SlotMagicToolBag.isItemValid_STATIC(itemstack);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java b/src/Java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java
new file mode 100644
index 0000000000..30893aeb4b
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java
@@ -0,0 +1,16 @@
+package gtPlusPlus.core.inventories.box;
+
+import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
+import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox;
+import gtPlusPlus.core.slots.SlotToolBox;
+import net.minecraft.item.ItemStack;
+
+public class ToolBoxInventory extends CustomBoxInventory {
+ public ToolBoxInventory(ItemStack stack) {
+ super(stack, "Tool Box", UniversalToolBox.SLOTS);
+ }
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
+ return SlotToolBox.isItemValid_STATIC(itemstack);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index c86c10bb53..cc0b4325f3 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -49,6 +49,9 @@ import gtPlusPlus.core.item.init.ItemsFoods;
import gtPlusPlus.core.item.init.ItemsMultiTools;
import gtPlusPlus.core.item.materials.DustDecayable;
import gtPlusPlus.core.item.tool.misc.SandstoneHammer;
+import gtPlusPlus.core.item.tool.misc.box.AutoLunchBox;
+import gtPlusPlus.core.item.tool.misc.box.MagicToolBag;
+import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox;
import gtPlusPlus.core.item.tool.misc.GregtechPump;
import gtPlusPlus.core.item.tool.staballoy.*;
import gtPlusPlus.core.item.wearable.WearableLoader;
@@ -282,6 +285,10 @@ public final class ModItems {
public static Fluid fluidZrF4;
+ public static Item boxTools;
+ public static Item boxFood;
+ public static Item boxMagic;
+
static {
Logger.INFO("Items!");
//Default item used when recipes fail, handy for debugging. Let's make sure they exist when this class is called upon.
@@ -348,6 +355,12 @@ public final class ModItems {
backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128));
backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20));
backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240));
+
+
+ //Load Custom Box/bags
+ boxTools = new UniversalToolBox("Tool Box");
+ boxFood = new AutoLunchBox("Eatotron-9000");
+ boxMagic = new MagicToolBag("Mystic Bag");
itemBlueprintBase = new ItemBlueprint("itemBlueprint");
@@ -365,19 +378,19 @@ public final class ModItems {
* Try generate dusts for missing rare earth materials if they don't exist
*/
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGadolinium", 1) == null){
+ if (ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGadolinium", 1))){
ItemUtils.generateSpecialUseDusts("Gadolinium", "Gadolinium", Materials.Gadolinium.mElement.name(), Utils.rgbtoHexValue(226, 172, 9));
}
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustYtterbium", 1) == null){
+ if (ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustYtterbium", 1))){
ItemUtils.generateSpecialUseDusts("Ytterbium", "Ytterbium", Materials.Ytterbium.mElement.name(), Utils.rgbtoHexValue(Materials.Yttrium.mRGBa[0]-60, Materials.Yttrium.mRGBa[1]-60, Materials.Yttrium.mRGBa[2]-60));
}
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSamarium", 1) == null){
+ if (ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSamarium", 1))){
ItemUtils.generateSpecialUseDusts(