aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
diff options
context:
space:
mode:
authorbotn365 <42187820+botn365@users.noreply.github.com>2019-12-30 03:55:42 +0100
committerGitHub <noreply@github.com>2019-12-30 03:55:42 +0100
commitfa1a1f4a6cd8dee8011a8f04fa6afbcc71d8db89 (patch)
treeb9f75736d90eb228de26ad8dcf9956bd1e6bd7e8 /src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
parenta731e939c6b9a70ac9fd444dbf06243f63f29c06 (diff)
parentd2ab710218628d51cd2ede566d50492238d797cf (diff)
downloadGT5-Unofficial-fa1a1f4a6cd8dee8011a8f04fa6afbcc71d8db89.tar.gz
GT5-Unofficial-fa1a1f4a6cd8dee8011a8f04fa6afbcc71d8db89.tar.bz2
GT5-Unofficial-fa1a1f4a6cd8dee8011a8f04fa6afbcc71d8db89.zip
Merge pull request #5 from alkcorp/master
sync fork
Diffstat (limited to 'src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java')
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
new file mode 100644
index 0000000000..6cd13dc209
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
@@ -0,0 +1,45 @@
+package gtPlusPlus.core.slots;
+
+import gregtech.api.util.Recipe_GT;
+import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class SlotChemicalPlantInput extends Slot {
+
+ public SlotChemicalPlantInput(final IInventory inventory, final int index, final int x, final int y) {
+ super(inventory, index, x, y);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValidForChemicalPlantSlot(itemstack);
+ }
+
+ public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) {
+ boolean validItem = Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.containsInput(aStack);
+ if (!validItem) {
+ for (Recipe_GT f : Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) {
+ if (f.mFluidInputs.length > 0) {
+ for (FluidStack g : f.mFluidInputs) {
+ if (g != null) {
+ if (FluidContainerRegistry.containsFluid(aStack, g)) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return validItem;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 64;
+ }
+
+}