diff options
| author | miozune <miozune@gmail.com> | 2023-05-17 00:01:01 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-16 17:01:01 +0200 |
| commit | 04514282c08ebefdb3e68a46db34092f72be2316 (patch) | |
| tree | 0c9bc99f480f7e7f45a99a55a5b6619ebb5b014b /src/main/java/gtPlusPlus/core/slots | |
| parent | cd58ff7cd4dc4b5ffe917a24a4b4c6da577f462d (diff) | |
| download | GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.tar.gz GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.tar.bz2 GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.zip | |
Remove a lot of unused classes (#629)
Diffstat (limited to 'src/main/java/gtPlusPlus/core/slots')
5 files changed, 0 insertions, 277 deletions
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/main/java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java deleted file mode 100644 index 246e7f7495..0000000000 --- a/src/main/java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java +++ /dev/null @@ -1,45 +0,0 @@ -package gtPlusPlus.core.slots; - -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; - -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gregtech.api.util.GT_Recipe; - -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 = GTPP_Recipe_Map.sChemicalPlantRecipes.containsInput(aStack); - if (!validItem) { - for (GT_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.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; - } -} diff --git a/src/main/java/gtPlusPlus/core/slots/SlotFrame.java b/src/main/java/gtPlusPlus/core/slots/SlotFrame.java deleted file mode 100644 index 9ee2a0d341..0000000000 --- a/src/main/java/gtPlusPlus/core/slots/SlotFrame.java +++ /dev/null @@ -1,24 +0,0 @@ -package gtPlusPlus.core.slots; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import forestry.api.apiculture.IHiveFrame; - -public class SlotFrame extends Slot { - - public SlotFrame(final IInventory inventory, final int x, final int y, final int z) { - super(inventory, x, y, z); - } - - @Override - public boolean isItemValid(final ItemStack itemstack) { - return itemstack.getItem() instanceof IHiveFrame; - } - - @Override - public int getSlotStackLimit() { - return 1; - } -} diff --git a/src/main/java/gtPlusPlus/core/slots/SlotGtToolElectric.java b/src/main/java/gtPlusPlus/core/slots/SlotGtToolElectric.java deleted file mode 100644 index 8b57926193..0000000000 --- a/src/main/java/gtPlusPlus/core/slots/SlotGtToolElectric.java +++ /dev/null @@ -1,92 +0,0 @@ -package gtPlusPlus.core.slots; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -import gregtech.api.items.GT_MetaGenerated_Tool; -import gtPlusPlus.api.objects.Logger; -import ic2.api.info.Info; -import ic2.api.item.ElectricItem; -import ic2.api.item.IElectricItem; - -public class SlotGtToolElectric extends SlotGtTool { - - public int tier; - private ItemStack content; - - public SlotGtToolElectric(final IInventory base, final int x, final int y, final int z, final int tier, - final boolean allowRedstoneDust) { - super(base, x, y, z); - this.tier = tier; - this.allowRedstoneDust = allowRedstoneDust; - } - - public boolean accepts(final ItemStack stack) { - if (stack == null) { - return false; - } - if ((stack.getItem() == Items.redstone) && (!this.allowRedstoneDust)) { - return false; - } - return (Info.itemEnergy.getEnergyValue(stack) > 0.0D) - || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), this.tier, true, true, true) > 0.0D); - } - - public double discharge(final double amount, final boolean ignoreLimit) { - if (amount <= 0.0D) { - throw new IllegalArgumentException("Amount must be > 0."); - } - final ItemStack stack = this.get(0); - if (stack == null) { - return 0.0D; - } - double realAmount = ElectricItem.manager.discharge(stack, amount, this.tier, ignoreLimit, true, false); - if (realAmount <= 0.0D) { - realAmount = Info.itemEnergy.getEnergyValue(stack); - if (realAmount <= 0.0D) { - return 0.0D; - } - stack.stackSize -= 1; - if (stack.stackSize <= 0) { - this.put(0, null); - } - } - return realAmount; - } - - public void setTier(final int tier1) { - this.tier = tier1; - } - - public boolean allowRedstoneDust = true; - - public ItemStack get() { - return this.get(0); - } - - public ItemStack get(final int index) { - return this.content; - } - - public void put(final ItemStack content) { - this.put(0, content); - } - - public void put(final int index, final ItemStack content) { - this.content = content; - this.onChanged(); - } - - public void onChanged() {} - - @Override - public boolean isItemValid(final ItemStack itemstack) { - if ((itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof IElectricItem)) { - Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool."); - return true; - } - Logger.WARNING(itemstack.getDisplayName() + " is not a valid Tool."); - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/slots/SlotOutput.java b/src/main/java/gtPlusPlus/core/slots/SlotOutput.java deleted file mode 100644 index 1948b9aa17..0000000000 --- a/src/main/java/gtPlusPlus/core/slots/SlotOutput.java +++ /dev/null @@ -1,92 +0,0 @@ -package gtPlusPlus.core.slots; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; - -import cpw.mods.fml.common.FMLCommonHandler; - -public class SlotOutput extends SlotCrafting { - - private final IInventory craftMatrix; - private final EntityPlayer thePlayer; - private int amountCrafted; - - public SlotOutput(final EntityPlayer player, final InventoryCrafting craftingInventory, - final IInventory p_i45790_3_, final int slotIndex, final int xPosition, final int yPosition) { - super(player, craftingInventory, p_i45790_3_, slotIndex, xPosition, yPosition); - this.thePlayer = player; - this.craftMatrix = craftingInventory; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(final ItemStack par1ItemStack) { - return false; - } - - /** - * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new - * stack. - */ - @Override - public ItemStack decrStackSize(final int par1) { - if (this.getHasStack()) { - this.amountCrafted += Math.min(par1, this.getStack().stackSize); - } - return super.decrStackSize(par1); - } - - /** - * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an - * internal count then calls onCrafting(item). - */ - @Override - protected void onCrafting(final ItemStack par1ItemStack, final int par2) { - this.amountCrafted += par2; - this.onCrafting(par1ItemStack); - } - - /** - * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. - */ - @Override - protected void onCrafting(final ItemStack stack) { - stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); - this.amountCrafted = 0; - } - - @Override - public void onPickupFromSlot(final EntityPlayer playerIn, final ItemStack stack) { - { - FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, this.craftMatrix); - this.onCrafting(stack); - for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) { - final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); - if (itemstack1 != null) { - this.craftMatrix.decrStackSize(i, 1); - if (itemstack1.getItem().hasContainerItem(itemstack1)) { - ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); - if (itemstack2.isItemStackDamageable() - && (itemstack2.getItemDamage() > itemstack2.getMaxDamage())) { - MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2)); - itemstack2 = null; - } - if (!this.thePlayer.inventory.addItemStackToInventory(itemstack2)) { - if (this.craftMatrix.getStackInSlot(i) == null) { - this.craftMatrix.setInventorySlotContents(i, itemstack2); - } else { - this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false); - } - } - } - } - } - } - } -} diff --git a/src/main/java/gtPlusPlus/core/slots/SlotRTG.java b/src/main/java/gtPlusPlus/core/slots/SlotRTG.java deleted file mode 100644 index ef226e99ca..0000000000 --- a/src/main/java/gtPlusPlus/core/slots/SlotRTG.java +++ /dev/null @@ -1,24 +0,0 @@ -package gtPlusPlus.core.slots; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import ic2.core.Ic2Items; - -public class SlotRTG extends Slot { - - public SlotRTG(final IInventory inventory, final int x, final int y, final int z) { - super(inventory, x, y, z); - } - - @Override - public boolean isItemValid(final ItemStack itemstack) { - return itemstack.getItem().getClass() == Ic2Items.RTGPellets.getItem().getClass(); - } - - @Override - public int getSlotStackLimit() { - return 1; - } -} |
