Bridge fixes

This commit is contained in:
Anuken
2020-09-11 13:36:10 -04:00
parent 83d9bd7d81
commit 3d8fb1b6ca
7 changed files with 11 additions and 9 deletions

View File

@@ -1162,7 +1162,7 @@ public class Blocks implements ContentList{
requirements(Category.power, with(Items.lead, 100, Items.silicon, 75, Items.phasefabric, 25, Items.plastanium, 75, Items.thorium, 50));
size = 2;
powerProduction = 4.5f;
itemDuration = 500f;
itemDuration = 60 * 15f;
}};
solarPanel = new SolarGenerator("solar-panel"){{

View File

@@ -812,7 +812,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
/** Called after the block is placed by this client. */
@CallSuper
public void playerPlaced(){
public void playerPlaced(Object config){
}

View File

@@ -39,7 +39,7 @@ public class CoreItemsDisplay extends Table{
for(Item item : content.items()){
if(usedItems.contains(item)){
image(item.icon(Cicon.small)).padRight(3);
label(() -> core == null ? "0" : UI.formatAmount(core.items.get(item))).padRight(3);
label(() -> core == null ? "0" : UI.formatAmount(core.items.get(item))).padRight(3).left();
if(++i % 4 == 0){
row();

View File

@@ -75,7 +75,7 @@ public class ConstructBlock extends Block{
//last builder was this local client player, call placed()
if(tile.build != null && !headless && builder == player.unit()){
tile.build.playerPlaced();
tile.build.playerPlaced(config);
}
Fx.placeBlock.at(tile.drawx(), tile.drawy(), block.size);

View File

@@ -133,8 +133,10 @@ public class ItemBridge extends Block{
public float cycleSpeed = 1f;
@Override
public void playerPlaced(){
super.playerPlaced();
public void playerPlaced(Object config){
super.playerPlaced(config);
if(config != null) return;
Tile link = findLink(tile.x, tile.y);
if(linkValid(tile, link)){
@@ -265,7 +267,7 @@ public class ItemBridge extends Block{
Item item = items.take();
if(item != null && other.acceptItem(this, item)){
other.handleItem(this, item);
cycleSpeed = Mathf.lerpDelta(cycleSpeed, 4f, 0.05f);
cycleSpeed = Mathf.lerpDelta(cycleSpeed, 4f, 0.05f); //TODO this is kinda broken, because lerping only happens on a timer
}else{
cycleSpeed = Mathf.lerpDelta(cycleSpeed, 1f, 0.01f);
if(item != null) items.add(item, 1);

View File

@@ -6,7 +6,7 @@ import mindustry.type.*;
import mindustry.world.blocks.distribution.*;
import mindustry.world.meta.*;
import static mindustry.Vars.world;
import static mindustry.Vars.*;
public class LiquidExtendingBridge extends ExtendingItemBridge{
@@ -42,7 +42,7 @@ public class LiquidExtendingBridge extends ExtendingItemBridge{
if(moveLiquid(other, liquids.current()) > 0.1f){
cycleSpeed = Mathf.lerpDelta(cycleSpeed, 4f, 0.05f);
}else{
cycleSpeed = Mathf.lerpDelta(cycleSpeed, 1f, 0.01f);
cycleSpeed = Mathf.lerpDelta(cycleSpeed, 0f, 0.01f);
}
}
}