aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java
index 0aa1f5dd98..c1e0095726 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java
@@ -40,7 +40,7 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE
aTier,
17,
new String[] { "Holds Data Orbs for the Elemental Duplicator", "Can insert/extract the circuit slot",
- "Use Circuit to select a slot (1-16)", CORE.GT_Tooltip.get() });
+ "A circuit must be used to select a slot (1-16)", CORE.GT_Tooltip.get() });
}
public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(String aName, int aTier, String aDescription,
@@ -164,6 +164,20 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE
return aContents;
}
+ public ItemStack getOrbByCircuit() {
+ ItemStack aCirc = getBaseMetaTileEntity().getStackInSlot(getCircuitSlot());
+ if (aCirc != null && ItemUtils.isControlCircuit(aCirc)) {
+ int slot = aCirc.getItemDamage() - 1; // slots are 0 indexed but there's no 0 circuit
+ if (slot < getBaseMetaTileEntity().getSizeInventory() - 1) {
+ return getBaseMetaTileEntity().getStackInSlot(slot);
+ } else {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
@Override
public boolean canInsertItem(int aIndex, ItemStack aStack, int ordinalSide) {
if (aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)