diff options
author | Antifluxfield <lyj_299792458@163.com> | 2017-10-30 16:24:09 +0800 |
---|---|---|
committer | Antifluxfield <lyj_299792458@163.com> | 2017-10-30 16:24:09 +0800 |
commit | 77c639c8fbbfd3e7865d1d016158b7afb4257fc4 (patch) | |
tree | 7882ae4bab66d23c4d303ee7d8a21d0c4b71e216 /src/main/java | |
parent | 7b0dc97594ab7cc2a2bf75385060bbecdcd16709 (diff) | |
download | GT5-Unofficial-77c639c8fbbfd3e7865d1d016158b7afb4257fc4.tar.gz GT5-Unofficial-77c639c8fbbfd3e7865d1d016158b7afb4257fc4.tar.bz2 GT5-Unofficial-77c639c8fbbfd3e7865d1d016158b7afb4257fc4.zip |
Fix ItemPipe tick time customization
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java index c471b2d242..a2332f0b8d 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java @@ -47,21 +47,21 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE } public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, boolean aIsRestrictive) { - super(aID, aName, aNameRegional, aInvSlotCount); - mIsRestrictive = aIsRestrictive; - mThickNess = aThickNess; - mMaterial = aMaterial; - mStepSize = aStepSize; - mTickTime = 20; + this(aID, aName, aNameRegional, aThickNess, aMaterial, aInvSlotCount, aStepSize, aIsRestrictive, 20); } + @Deprecated public GT_MetaPipeEntity_Item(String aName, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, boolean aIsRestrictive) { - super(aName, aInvSlotCount); + this(aName, aThickNess, aMaterial, aInvSlotCount, aStepSize, aIsRestrictive, 20); + } + + public GT_MetaPipeEntity_Item(String aName, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, boolean aIsRestrictive, int aTickTime) { + super(aName, aInvSlotCount); mIsRestrictive = aIsRestrictive; mThickNess = aThickNess; mMaterial = aMaterial; mStepSize = aStepSize; - mTickTime = 20; + mTickTime = aTickTime; } @Override @@ -71,7 +71,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaPipeEntity_Item(mName, mThickNess, mMaterial, mInventory.length, mStepSize, mIsRestrictive); + return new GT_MetaPipeEntity_Item(mName, mThickNess, mMaterial, mInventory.length, mStepSize, mIsRestrictive, mTickTime); } @Override @@ -180,7 +180,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE tPipeList.add(tTileEntity); while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity)) for (IMetaTileEntityItemPipe tPipe : tPipeList) - if (!tPipe.incrementTransferCounter(1)) temp = false; + if (!tPipe.incrementTransferCounter(1)) temp = true; } } } @@ -334,7 +334,12 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public String[] getDescription() { - return new String[]{"Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/sec", "Routing Value: %%%" + mStepSize}; + if (mTickTime == 20) + return new String[]{"Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/sec", "Routing Value: %%%" + mStepSize}; + else if (mTickTime % 20 == 0) + return new String[]{"Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + (mTickTime / 20) + "%%% sec", "Routing Value: %%%" + mStepSize}; + else + return new String[]{"Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + mTickTime + "%%% ticks", "Routing Value: %%%" + mStepSize}; } private boolean isInventoryEmpty() { |