Fix ItemPipe tick time customization

This commit is contained in:
Antifluxfield 2017-10-30 16:24:09 +08:00
parent 7b0dc97594
commit 77c639c8fb

View file

@ -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) {
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() {
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() {