aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/slots
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2022-11-26 01:56:28 +0900
committerGitHub <noreply@github.com>2022-11-25 17:56:28 +0100
commitcd2ba914a6b5b980ff56347455fcf43a9e3eea3b (patch)
tree9dfba22762592ee292edd9a6c2eb6e4c3d9c6e96 /src/main/java/gtPlusPlus/core/slots
parent921527ce3cc5f92b067f180295fa55dae718461f (diff)
downloadGT5-Unofficial-cd2ba914a6b5b980ff56347455fcf43a9e3eea3b.tar.gz
GT5-Unofficial-cd2ba914a6b5b980ff56347455fcf43a9e3eea3b.tar.bz2
GT5-Unofficial-cd2ba914a6b5b980ff56347455fcf43a9e3eea3b.zip
Rewrite GUIs with ModularUI (#440)
* Update GT * NEI migration & cleanup Deprecate GTPP_Recipe_Map_Internal#sMappingsEx and delegate to GT_Recipe_Map#sMappings instead Remove recipe modification check * Boiler * Programmed Circuit & Super Bus * Lower the number of fluid slots for multi mixer NEI * Solar Generator * Crop Manager * Bronze Workbench & Advanced Workbench * Turbine Housing & Rotor Assembly * Iron Plated Blast Furnace * Player Safe * Advanced Muffler Hatch * spotlessApply * Auto Workbench * Breaker, Control Core, RTG Hatch, Steam Bus, some cleanup * Fix crash when removing Breaker * Data Orb Repository * Charging/Discharging Bus * Pollution Scrubber * Storage Crate, Shelf, TieredChest They're just broken in the first place, don't blame me * cleanup * Steam Condenser It's broken in the first place, never blame me! * Catalyst Housing, Ball Housing * Fluid Tank, generators, custom hatches, cleanup * Computer Cube MKII Many things are broken in the first place, I swear * Inventory Manager * Migrate multiblock dehydrator recipemap to ModularUI * Overflow cover * Redstone Circuit Block * Multiblock * cleanup * Update GT
Diffstat (limited to 'src/main/java/gtPlusPlus/core/slots')
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotAirFilter.java29
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotBlueprint.java29
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotElectric.java48
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotLockedInput.java53
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotNoInputLogging.java34
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotPollutionScrubber.java67
6 files changed, 0 insertions, 260 deletions
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotAirFilter.java b/src/main/java/gtPlusPlus/core/slots/SlotAirFilter.java
deleted file mode 100644
index 8ad0b000bc..0000000000
--- a/src/main/java/gtPlusPlus/core/slots/SlotAirFilter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import gtPlusPlus.core.item.general.ItemAirFilter;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class SlotAirFilter extends Slot {
-
- public SlotAirFilter(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (itemstack == null) {
- return false;
- }
- if (itemstack.getItem() instanceof ItemAirFilter) {
- return true;
- }
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotBlueprint.java b/src/main/java/gtPlusPlus/core/slots/SlotBlueprint.java
deleted file mode 100644
index 56d39233e7..0000000000
--- a/src/main/java/gtPlusPlus/core/slots/SlotBlueprint.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.interfaces.IItemBlueprint;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class SlotBlueprint extends Slot {
-
- public SlotBlueprint(final IInventory inventory, final int x, final int y, final int z) {
- super(inventory, x, y, z);
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (itemstack.getItem() instanceof IItemBlueprint) {
- Logger.WARNING(itemstack.getDisplayName() + " is a valid Blueprint.");
- return true;
- }
- Logger.WARNING(itemstack.getDisplayName() + " is not a valid Blueprint.");
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotElectric.java b/src/main/java/gtPlusPlus/core/slots/SlotElectric.java
deleted file mode 100644
index 9c14afc6cc..0000000000
--- a/src/main/java/gtPlusPlus/core/slots/SlotElectric.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import ic2.api.info.Info;
-import ic2.api.item.ElectricItem;
-import ic2.api.item.IElectricItem;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class SlotElectric extends Slot {
-
- public SlotElectric(final IInventory inventory, final int x, final int y, final int z) {
- super(inventory, x, y, z);
- }
-
- public SlotElectric(IGregTechTileEntity mTileEntity, int i, int j, int k) {
- this(
- mTileEntity.getIInventory(mTileEntity.getXCoord(), mTileEntity.getYCoord(), mTileEntity.getZCoord()),
- i,
- j,
- k);
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if ((accepts(itemstack))
- || (itemstack.getItem() instanceof GT_MetaGenerated_Tool)
- || (itemstack.getItem() instanceof IElectricItem)) {
- return true;
- }
- return false;
- }
-
- public boolean accepts(final ItemStack stack) {
- if (stack == null) {
- return false;
- }
- return (Info.itemEnergy.getEnergyValue(stack) > 0.0D)
- || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), 4, true, true, true) > 0.0D);
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotLockedInput.java b/src/main/java/gtPlusPlus/core/slots/SlotLockedInput.java
deleted file mode 100644
index 41a3236275..0000000000
--- a/src/main/java/gtPlusPlus/core/slots/SlotLockedInput.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class SlotLockedInput extends Slot {
-
- private ItemStack mLockStack;
- private final IGregTechTileEntity mEntity;
- private boolean mChecked = false;
-
- public SlotLockedInput(
- final IGregTechTileEntity inventory, final int index, final int x, final int y, ItemStack lockStack) {
- super(inventory, index, x, y);
- mLockStack = lockStack;
- mEntity = inventory;
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (mEntity == null) {
- return false;
- } else {
- if (!mChecked) {
- try {
- mLockStack = (ItemStack) ReflectionUtils.getField(
- this.mEntity.getMetaTileEntity().getClass(), "mItemStack")
- .get(this.mEntity.getMetaTileEntity());
- } catch (Throwable t) {
- t.printStackTrace();
- mLockStack = null;
- }
- mChecked = true;
- }
- }
-
- if (mLockStack == null) {
- return true;
- } else {
- if (ItemStack.areItemStacksEqual(itemstack, mLockStack)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return mLockStack == null ? 64 : mLockStack.getMaxStackSize();
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotNoInputLogging.java b/src/main/java/gtPlusPlus/core/slots/SlotNoInputLogging.java
deleted file mode 100644
index 230a299d41..0000000000
--- a/src/main/java/gtPlusPlus/core/slots/SlotNoInputLogging.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import net.minecraft.block.Block;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-
-public class SlotNoInputLogging extends SlotNoInput {
-
- private final int aSlotIndex;
-
- public SlotNoInputLogging(final IInventory inventory, final int index, final int x, final int y) {
- super(inventory, index, x, y);
- aSlotIndex = index;
- Logger.INFO("Slot " + index + " is doing logging");
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (ItemUtils.checkForInvalidItems(itemstack)) {
- Logger.INFO("Tried Inserting " + ItemUtils.getItemName(itemstack) + " into slot " + aSlotIndex);
- Block b = Block.getBlockFromItem(itemstack.getItem());
- Logger.INFO("" + itemstack.getUnlocalizedName());
- if (b != null) {
- Logger.INFO("" + b.getLocalizedName());
- Logger.INFO("" + b.getUnlocalizedName());
- }
- } else {
- Logger.INFO("Bad Itemstack");
- }
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotPollutionScrubber.java b/src/main/java/gtPlusPlus/core/slots/SlotPollutionScrubber.java
deleted file mode 100644
index 7025943908..0000000000
--- a/src/main/java/gtPlusPlus/core/slots/SlotPollutionScrubber.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.item.general.ItemAirFilter;
-import gtPlusPlus.core.item.general.ItemBasicScrubberTurbine;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.recipe.common.CI;
-import java.util.HashMap;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class SlotPollutionScrubber extends Slot {
-
- private final int mType;
- private final int mTier;
-
- private static HashMap<Integer, ItemStack> mConveyorMap = new HashMap<Integer, ItemStack>();
-
- static {
- for (int i = 0; i < (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? 9 : 5); i++) {
- mConveyorMap.put(i, CI.getConveyor(i, 1));
- }
- }
-
- public SlotPollutionScrubber(
- final int aType, final int aTier, final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
- mType = aType;
- mTier = aTier;
- }
-
- @Override
- public synchronized boolean isItemValid(final ItemStack itemstack) {
- return isItemValidForSlot(this, itemstack);
- }
-
- public static synchronized boolean isItemValidForSlot(
- final SlotPollutionScrubber aSlot, final ItemStack itemstack) {
- if (aSlot.mType == 0) {
- if (itemstack.getItem() instanceof ItemBasicScrubberTurbine) {
- return true;
- }
- if (itemstack.getItem() instanceof GT_MetaGenerated_Tool
- && itemstack.getItemDamage() >= 170
- && itemstack.getItemDamage() <= 179) {
- return true;
- }
- } else if (aSlot.mType == 1) {
- if (itemstack.getItem() instanceof ItemAirFilter) {
- return true;
- }
- } else if (aSlot.mType == 2) {
- ItemStack aConveyorStack = mConveyorMap.get(aSlot.mTier);
- if (GT_Utility.areStacksEqual(itemstack, aConveyorStack, true)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
-}