Fixed bridges not linking when landing

This commit is contained in:
Anuken
2026-02-05 07:15:44 -05:00
parent 9ffc9cb4f4
commit dced8834b6
6 changed files with 16 additions and 5 deletions

View File

@@ -31,7 +31,6 @@ import mindustry.net.*;
import mindustry.type.*;
import mindustry.ui.dialogs.*;
import mindustry.world.*;
import mindustry.world.blocks.power.PowerNode.*;
import mindustry.world.blocks.storage.CoreBlock.*;
import java.io.*;
@@ -245,8 +244,8 @@ public class Control implements ApplicationListener, Loadable{
float maxDelay = 0f;
for(var build : state.rules.defaultTeam.data().buildings){
//power nodes need to be configured later once everything is built
if(build instanceof PowerNodeBuild){
//some blocks need to be configured later once everything is built
if(build.block.delayLandingConfig){
toBePlacedConfigs.add(new Object[]{build, build.config()});
}
}

View File

@@ -46,9 +46,7 @@ public class Scripts implements Disposable{
Object o = context.evaluateString(scope, text, "console.js", 1);
if(o instanceof NativeJavaObject n) o = n.unwrap();
if(o == null) o = "null";
else if(o instanceof Undefined) o = "undefined";
else if(o instanceof Object[] arr) o = Arrays.toString(arr);
else if(o instanceof int[] arr) o = Arrays.toString(arr);
else if(o instanceof float[] arr) o = Arrays.toString(arr);

View File

@@ -261,6 +261,8 @@ public class Block extends UnlockableContent implements Senseable{
public int selectionRows = 5, selectionColumns = 4;
/** If true, this block can be configured by logic. */
public boolean logicConfigurable = false;
/** If true, configuration is delayed when playing the landing block buildup animation. This may be removed in the future! */
public boolean delayLandingConfig;
/** Whether this block consumes touchDown events when tapped. */
public boolean consumesTap;
/** Whether to draw the glow of the liquid for this block, if it has one. */

View File

@@ -59,6 +59,7 @@ public class ItemBridge extends Block{
allowConfigInventory = false;
ignoreResizeConfig = true;
priority = TargetPriority.transport;
delayLandingConfig = true;
//point2 config is relative
config(Point2.class, (ItemBridgeBuild tile, Point2 i) -> tile.link = Point2.pack(i.x + tile.tileX(), i.y + tile.tileY()));

View File

@@ -50,6 +50,7 @@ public class PowerNode extends PowerBlock{
drawDisabled = false;
envEnabled |= Env.space;
destructible = true;
delayLandingConfig = true;
//nodes do not even need to update
update = false;