Require 4 loading docks to saturate a belt

Which encourages using them right from the factory, instead of simply connecting it up to a full titanium belt.
This commit is contained in:
Patrick 'Quezler' Mounier 2020-04-18 13:28:32 +02:00
parent 32e32ecae2
commit 16a1483f55
No known key found for this signature in database
GPG Key ID: 0D6CA7326C76D8EA
2 changed files with 6 additions and 3 deletions

View File

@ -914,6 +914,7 @@ public class Blocks implements ContentList{
requirements(Category.distribution, ItemStack.with(Items.plastanium, 1, Items.silicon, 1, Items.graphite, 1));
health = 75;
speed = 0.04f;
recharge = 4f;
}};
armoredConveyor = new ArmoredConveyor("armored-conveyor"){{

View File

@ -22,6 +22,7 @@ public class CraterConveyor extends Block implements Autotiler{
private TextureRegion[] regions = new TextureRegion[8];
public float speed = 0f;
public float recharge = 4f;
public CraterConveyor(String name){
super(name);
@ -114,7 +115,7 @@ public class CraterConveyor extends Block implements Autotiler{
@Override
public void updateTile(){
// reel in crater
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed, 0f, 1f);
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed, 0f, recharge);
// sleep when idle
if(link == -1){
@ -147,7 +148,8 @@ public class CraterConveyor extends Block implements Autotiler{
link = -1;
items.clear();
e.cooldown = cooldown = 1;
cooldown = recharge;
e.cooldown = 1;
e.noSleep();
bump();
}
@ -258,7 +260,7 @@ public class CraterConveyor extends Block implements Autotiler{
@Override
public boolean acceptItem(Tilec source, Item item){
if (this == source) return true; // player threw items
if (cooldown > 0f) return false; // still cooling down
if (cooldown > recharge - 1f) return false; // still cooling down
return!((blendbit2 != 5) // not a loading dock
|| (items.total() > 0 && !items.has(item)) // incompatible items
|| (items.total() >= getMaximumAccepted(item)) // filled to capacity