From 0427ab89f1753a44b30cbc35ce021cbbdc845109 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Thu, 10 Aug 2017 18:52:45 +0300 Subject: fix missing source folder --- .../automation/GT_MetaTileEntity_ChestBuffer.java | 86 ++++++++++++ .../automation/GT_MetaTileEntity_Filter.java | 101 ++++++++++++++ .../automation/GT_MetaTileEntity_Regulator.java | 120 +++++++++++++++++ .../automation/GT_MetaTileEntity_SuperBuffer.java | 54 ++++++++ .../automation/GT_MetaTileEntity_TypeFilter.java | 145 +++++++++++++++++++++ 5 files changed, 506 insertions(+) create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java (limited to 'src/main/java/gregtech/common/tileentities/automation') diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java new file mode 100644 index 0000000..b31f32d --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java @@ -0,0 +1,86 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +/* 9: */ import gregtech.api.util.GT_Utility; +/* 10: */ import gregtech.common.gui.GT_Container_ChestBuffer; +/* 11: */ import gregtech.common.gui.GT_GUIContainer_ChestBuffer; +/* 12: */ import net.minecraft.entity.player.InventoryPlayer; +/* 13: */ +/* 14: */ public class GT_MetaTileEntity_ChestBuffer +/* 15: */ extends GT_MetaTileEntity_Buffer +/* 16: */ { +/* 17: */ public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier) +/* 18: */ { +/* 19:16 */ super(aID, aName, aNameRegional, aTier, 28, "Buffering lots of incoming Items"); +/* 20: */ } +/* 21: */ +/* 22: */ public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) +/* 23: */ { +/* 24:20 */ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); +/* 25: */ } +/* 26: */ +/* 27: */ public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 28: */ { +/* 29:24 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 30: */ } +/* 31: */ +/* 32: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 33: */ { +/* 34:29 */ return new GT_MetaTileEntity_ChestBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public ITexture getOverlayIcon() +/* 38: */ { +/* 39:34 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_CHESTBUFFER); +/* 40: */ } +/* 41: */ +/* 42: */ @Override +public boolean isValidSlot(int aIndex) +/* 43: */ { +/* 44:37 */ return aIndex < this.mInventory.length - 1; +/* 45: */ } +/* 46: */ +/* 47: */ @Override +protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) +/* 48: */ { +/* 49:41 */ fillStacksIntoFirstSlots(); +/* 50:42 */ super.moveItems(aBaseMetaTileEntity, aTimer); +/* 51:43 */ fillStacksIntoFirstSlots(); +/* 52: */ } +/* 53: */ +/* 54: */ protected void fillStacksIntoFirstSlots() +/* 55: */ { +/* 56:47 */ for (int i = 0; i < this.mInventory.length - 1; i++) { +/* 57:47 */ for (int j = i + 1; j < this.mInventory.length - 1; j++) { +/* 58:47 */ if ((this.mInventory[j] != null) && ((this.mInventory[i] == null) || (GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j])))) { +/* 59:48 */ GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte)64, (byte)1, (byte)64, (byte)1); +/* 60: */ } +/* 61: */ } +/* 62: */ } +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 66: */ { +/* 67:54 */ return new GT_Container_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity); +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 71: */ { +/* 72:59 */ return new GT_GUIContainer_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity); +/* 73: */ } +/* 74: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_ChestBuffer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java new file mode 100644 index 0000000..6e6fcdc --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java @@ -0,0 +1,101 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +/* 9: */ import gregtech.api.util.GT_Utility; +/* 10: */ import gregtech.common.gui.GT_Container_Filter; +/* 11: */ import gregtech.common.gui.GT_GUIContainer_Filter; +/* 12: */ import net.minecraft.entity.player.InventoryPlayer; +/* 13: */ import net.minecraft.item.ItemStack; +/* 14: */ import net.minecraft.nbt.NBTTagCompound; +/* 15: */ +/* 16: */ public class GT_MetaTileEntity_Filter +/* 17: */ extends GT_MetaTileEntity_Buffer +/* 18: */ { +/* 19:17 */ public boolean bIgnoreNBT = false; +/* 20:17 */ public boolean bInvertFilter = false; +/* 21: */ +/* 22: */ public GT_MetaTileEntity_Filter(int aID, String aName, String aNameRegional, int aTier) +/* 23: */ { +/* 24:20 */ super(aID, aName, aNameRegional, aTier, 19, "Filtering incoming Items"); +/* 25: */ } +/* 26: */ +/* 27: */ public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 28: */ { +/* 29:24 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 30: */ } +/* 31: */ +/* 32: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 33: */ { +/* 34:29 */ return new GT_MetaTileEntity_Filter(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public ITexture getOverlayIcon() +/* 38: */ { +/* 39:34 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_FILTER); +/* 40: */ } +/* 41: */ +/* 42: */ @Override +public boolean isValidSlot(int aIndex) +/* 43: */ { +/* 44:37 */ return aIndex < 9; +/* 45: */ } +/* 46: */ +/* 47: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 48: */ { +/* 49:41 */ return new GT_Container_Filter(aPlayerInventory, aBaseMetaTileEntity); +/* 50: */ } +/* 51: */ +/* 52: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 53: */ { +/* 54:46 */ return new GT_GUIContainer_Filter(aPlayerInventory, aBaseMetaTileEntity); +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void saveNBTData(NBTTagCompound aNBT) +/* 58: */ { +/* 59:51 */ super.saveNBTData(aNBT); +/* 60:52 */ aNBT.setBoolean("bInvertFilter", this.bInvertFilter); +/* 61:53 */ aNBT.setBoolean("bIgnoreNBT", this.bIgnoreNBT); +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public void loadNBTData(NBTTagCompound aNBT) +/* 65: */ { +/* 66:58 */ super.loadNBTData(aNBT); +/* 67:59 */ this.bInvertFilter = aNBT.getBoolean("bInvertFilter"); +/* 68:60 */ this.bIgnoreNBT = aNBT.getBoolean("bIgnoreNBT"); +/* 69: */ } +/* 70: */ +/* 71: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 72: */ { +/* 73:65 */ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { +/* 74:65 */ return false; +/* 75: */ } +/* 76:66 */ if (this.bInvertFilter) +/* 77: */ { +/* 78:67 */ for (byte i = 9; i < 18; i = (byte)(i + 1)) { +/* 79:67 */ if (GT_Utility.areStacksEqual(this.mInventory[i], aStack, this.bIgnoreNBT)) { +/* 80:67 */ return false; +/* 81: */ } +/* 82: */ } +/* 83:68 */ return true; +/* 84: */ } +/* 85:70 */ return GT_Utility.areStacksEqual(this.mInventory[(aIndex + 9)], aStack, this.bIgnoreNBT); +/* 86: */ } +/* 87: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_Filter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java new file mode 100644 index 0000000..c03c2e1 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java @@ -0,0 +1,120 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 12: */ import java.util.Arrays; + +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +/* 9: */ import gregtech.api.util.GT_Utility; +/* 10: */ import gregtech.common.gui.GT_Container_Regulator; +/* 11: */ import gregtech.common.gui.GT_GUIContainer_Regulator; +/* 13: */ import net.minecraft.entity.player.InventoryPlayer; +/* 14: */ import net.minecraft.item.ItemStack; +/* 15: */ import net.minecraft.nbt.NBTTagCompound; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_Regulator +/* 18: */ extends GT_MetaTileEntity_Buffer +/* 19: */ { +/* 20:20 */ public int[] mTargetSlots = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +/* 21: */ +/* 22: */ public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier) +/* 23: */ { +/* 24:23 */ super(aID, aName, aNameRegional, aTier, 19, "Regulating incoming Items"); +/* 25: */ } +/* 26: */ +/* 27: */ public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 28: */ { +/* 29:27 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 30: */ } +/* 31: */ +/* 32: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 33: */ { +/* 34:32 */ return new GT_MetaTileEntity_Regulator(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public ITexture getOverlayIcon() +/* 38: */ { +/* 39:37 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_REGULATOR); +/* 40: */ } +/* 41: */ +/* 42: */ @Override +public boolean isValidSlot(int aIndex) +/* 43: */ { +/* 44:40 */ return aIndex < 9; +/* 45: */ } +/* 46: */ +/* 47: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 48: */ { +/* 49:44 */ return new GT_Container_Regulator(aPlayerInventory, aBaseMetaTileEntity); +/* 50: */ } +/* 51: */ +/* 52: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 53: */ { +/* 54:49 */ return new GT_GUIContainer_Regulator(aPlayerInventory, aBaseMetaTileEntity); +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void saveNBTData(NBTTagCompound aNBT) +/* 58: */ { +/* 59:54 */ super.saveNBTData(aNBT); +/* 60:55 */ aNBT.setInteger("mTargetSlot1", this.mTargetSlots[0]); +/* 61:56 */ aNBT.setInteger("mTargetSlot2", this.mTargetSlots[1]); +/* 62:57 */ aNBT.setInteger("mTargetSlot3", this.mTargetSlots[2]); +/* 63:58 */ aNBT.setInteger("mTargetSlot4", this.mTargetSlots[3]); +/* 64:59 */ aNBT.setInteger("mTargetSlot5", this.mTargetSlots[4]); +/* 65:60 */ aNBT.setInteger("mTargetSlot6", this.mTargetSlots[5]); +/* 66:61 */ aNBT.setInteger("mTargetSlot7", this.mTargetSlots[6]); +/* 67:62 */ aNBT.setInteger("mTargetSlot8", this.mTargetSlots[7]); +/* 68:63 */ aNBT.setInteger("mTargetSlot9", this.mTargetSlots[8]); +/* 69: */ } +/* 70: */ +/* 71: */ @Override +public void loadNBTData(NBTTagCompound aNBT) +/* 72: */ { +/* 73:68 */ super.loadNBTData(aNBT); +/* 74:69 */ this.mTargetSlots[0] = aNBT.getInteger("mTargetSlot1"); +/* 75:70 */ this.mTargetSlots[1] = aNBT.getInteger("mTargetSlot2"); +/* 76:71 */ this.mTargetSlots[2] = aNBT.getInteger("mTargetSlot3"); +/* 77:72 */ this.mTargetSlots[3] = aNBT.getInteger("mTargetSlot4"); +/* 78:73 */ this.mTargetSlots[4] = aNBT.getInteger("mTargetSlot5"); +/* 79:74 */ this.mTargetSlots[5] = aNBT.getInteger("mTargetSlot6"); +/* 80:75 */ this.mTargetSlots[6] = aNBT.getInteger("mTargetSlot7"); +/* 81:76 */ this.mTargetSlots[7] = aNBT.getInteger("mTargetSlot8"); +/* 82:77 */ this.mTargetSlots[8] = aNBT.getInteger("mTargetSlot9"); +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) +/* 86: */ { +/* 87:82 */ int i = 0; +/* 88:82 */ for (int tCosts = 0; i < 9; i++) { +/* 89:82 */ if (this.mInventory[(i + 9)] != null) +/* 90: */ { +/* 91:83 */ tCosts = GT_Utility.moveOneItemStackIntoSlot(getBaseMetaTileEntity(), getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), this.mTargetSlots[i], Arrays.asList(new ItemStack[] { this.mInventory[(i + 9)] }), false, (byte)this.mInventory[(i + 9)].stackSize, (byte)this.mInventory[(i + 9)].stackSize, (byte)64, (byte)1) * 3; +/* 92:84 */ if (tCosts > 0) +/* 93: */ { +/* 94:84 */ this.mSuccess = 50;getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCosts, true); break; +/* 95: */ } +/* 96: */ } +/* 97: */ } +/* 98: */ } +/* 99: */ +/* :0: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* :1: */ { +/* :2:90 */ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)])); +/* :3: */ } +/* :4: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_Regulator + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java new file mode 100644 index 0000000..c5fc5a2 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java @@ -0,0 +1,54 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.objects.GT_RenderedTexture; +/* 8: */ import gregtech.common.gui.GT_Container_SuperBuffer; +/* 9: */ import gregtech.common.gui.GT_GUIContainer_SuperBuffer; +/* 10: */ import net.minecraft.entity.player.InventoryPlayer; +/* 11: */ +/* 12: */ public class GT_MetaTileEntity_SuperBuffer +/* 13: */ extends GT_MetaTileEntity_ChestBuffer +/* 14: */ { +/* 15: */ public GT_MetaTileEntity_SuperBuffer(int aID, String aName, String aNameRegional, int aTier) +/* 16: */ { +/* 17:14 */ super(aID, aName, aNameRegional, aTier, 257, "Buffering up to 256 Stacks"); +/* 18: */ } +/* 19: */ +/* 20: */ public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 21: */ { +/* 22:18 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 23: */ } +/* 24: */ +/* 25: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 26: */ { +/* 27:23 */ return new GT_MetaTileEntity_SuperBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public ITexture getOverlayIcon() +/* 31: */ { +/* 32:28 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_SUPERBUFFER); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 36: */ { +/* 37:33 */ return new GT_Container_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 41: */ { +/* 42:38 */ return new GT_GUIContainer_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity); +/* 43: */ } +/* 44: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_SuperBuffer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java new file mode 100644 index 0000000..8c42649 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java @@ -0,0 +1,145 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 2: */ +/* 3: */ import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.interfaces.ITexture; +/* 6: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +/* 9: */ import gregtech.api.objects.GT_RenderedTexture; +/* 10: */ import gregtech.api.util.GT_Utility; +/* 11: */ import gregtech.common.gui.GT_Container_TypeFilter; +/* 12: */ import gregtech.common.gui.GT_GUIContainer_TypeFilter; +/* 14: */ import net.minecraft.entity.player.InventoryPlayer; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ import net.minecraft.nbt.NBTTagCompound; +/* 17: */ +/* 18: */ public class GT_MetaTileEntity_TypeFilter +/* 19: */ extends GT_MetaTileEntity_Buffer +/* 20: */ { +/* 21: 19 */ public boolean bNBTAllowed = false; +/* 22: 19 */ public boolean bInvertFilter = false; +/* 23: 20 */ public int mRotationIndex = 0; +/* 24: 21 */ public OrePrefixes mPrefix = OrePrefixes.ore; +/* 25: */ +/* 26: */ public GT_MetaTileEntity_TypeFilter(int aID, String aName, String aNameRegional, int aTier) +/* 27: */ { +/* 28: 24 */ super(aID, aName, aNameRegional, aTier, 11, "Filtering incoming Items by Type"); +/* 29: */ } +/* 30: */ +/* 31: */ public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 32: */ { +/* 33: 28 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 34: */ } +/* 35: */ +/* 36: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 37: */ { +/* 38: 33 */ return new GT_MetaTileEntity_TypeFilter(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 39: */ } +/* 40: */ +/* 41: */ @Override +public ITexture getOverlayIcon() +/* 42: */ { +/* 43: 38 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_TYPEFILTER); +/* 44: */ } +/* 45: */ +/* 46: */ @Override +public boolean isValidSlot(int aIndex) +/* 47: */ { +/* 48: 41 */ return aIndex < 9; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 52: */ { +/* 53: 45 */ return new GT_Container_TypeFilter(aPlayerInventory, aBaseMetaTileEntity); +/* 54: */ } +/* 55: */ +/* 56: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 57: */ { +/* 58: 50 */ return new GT_GUIContainer_TypeFilter(aPlayerInventory, aBaseMetaTileEntity); +/* 59: */ } +/* 60: */ +/* 61: */ public void clickTypeIcon(boolean aRightClick) +/* 62: */ { +/* 63: 54 */ if (getBaseMetaTileEntity().isServerSide()) +/* 64: */ { +/* 65: 55 */ for (int i = 0; i < OrePrefixes.values().length; i++) { +/* 66: 56 */ if (this.mPrefix == OrePrefixes.values()[i]) { +/* 67: 57 */ for (this.mPrefix = null; this.mPrefix == null; this.mPrefix = OrePrefixes.values()[i]) +/* 68: */ { +/* 70: 59 */ if (aRightClick) +/* 71: */ { +/* 72: 60 */ i--; +/* 73: 60 */ if (i < 0) { +/* 74: 60 */ i = OrePrefixes.values().length - 1; +/* 75: */ } +/* 76: */ } +/* 77: */ else +/* 78: */ { +/* 79: 62 */ i++; +/* 80: 62 */ if (i >= OrePrefixes.values().length) { +/* 81: 62 */ i = 0; +/* 82: */ } +/* 83: */ } +/* 84: 64 */ if(!OrePrefixes.values()[i].mPrefixedItems.isEmpty() && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i]) + mPrefix = OrePrefixes.values()[i]; +/* 87: */ } +/* 88: */ } +/* 89: */ } +/* 90: 69 */ this.mRotationIndex = 0; +/* 91: */ } +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) +/* 95: */ { +/* 96: 75 */ super.onPreTick(aBaseMetaTileEntity, aTick); +/* 97: 76 */ if ((getBaseMetaTileEntity().isServerSide()) && (aTick % 8L == 0L)) { +/* 98: 77 */ if (this.mPrefix.mPrefixedItems.isEmpty()) +/* 99: */ { +/* 100: 78 */ this.mInventory[9] = null; +/* 101: */ } +/* 102: */ else +/* 103: */ { +/* 104: 80 */ Object[] tmp63_60 = new Object[1]; int tmp90_89 = ((this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size());this.mRotationIndex = tmp90_89;tmp63_60[0] = this.mPrefix.mPrefixedItems.get(tmp90_89);this.mInventory[9] = GT_Utility.copyAmount(1L, tmp63_60); +/* 105: 81 */ if (this.mInventory[9].getItemDamage() == 32767) { +/* 106: 81 */ this.mInventory[9].setItemDamage(0); +/* 107: */ } +/* 108: 82 */ this.mInventory[9].setStackDisplayName(this.mPrefix.toString()); +/* 109: */ } +/* 110: */ } +/* 111: */ } +/* 112: */ +/* 113: */ @Override +public void saveNBTData(NBTTagCompound aNBT) +/* 114: */ { +/* 115: 89 */ super.saveNBTData(aNBT); +/* 116: 90 */ aNBT.setString("mPrefix", this.mPrefix.toString()); +/* 117: 91 */ aNBT.setBoolean("bInvertFilter", this.bInvertFilter); +/* 118: 92 */ aNBT.setBoolean("bNBTAllowed", this.bNBTAllowed); +/* 119: */ } +/* 120: */ +/* 121: */ @Override +public void loadNBTData(NBTTagCompound aNBT) +/* 122: */ { +/* 123: 97 */ super.loadNBTData(aNBT); +/* 124: 98 */ this.mPrefix = OrePrefixes.getPrefix(aNBT.getString("mPrefix"), this.mPrefix); +/* 125: 99 */ this.bInvertFilter = aNBT.getBoolean("bInvertFilter"); +/* 126:100 */ this.bNBTAllowed = aNBT.getBoolean("bNBTAllowed"); +/* 127: */ } +/* 128: */ +/* 129: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 130: */ { +/* 131:105 */ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && ((this.bNBTAllowed) || (!aStack.hasTagCompound())) && (this.mPrefix.contains(aStack) != this.bInvertFilter); +/* 132: */ } +/* 133: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_TypeFilter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file -- cgit v1.2.3