Static field fix

This commit is contained in:
Anuken
2026-03-12 16:40:02 -04:00
parent f62c344d7a
commit 9fa69c59f9
3 changed files with 7 additions and 7 deletions

View File

@@ -56,7 +56,7 @@ public class DirectionBridge extends Block{
Draw.rect(dirRegion, plan.drawx(), plan.drawy(), plan.rotation * 90);
}
private BuildPlan currentPlan, otherPlan;
private static BuildPlan currentPlan, otherPlan;
private Boolf<BuildPlan> planFinder = other -> {
if(other.block == this && currentPlan != other && Mathf.clamp(other.x - currentPlan.x, -1, 1) == Geometry.d4x(currentPlan.rotation) && Mathf.clamp(other.y - currentPlan.y, -1, 1) == Geometry.d4y(currentPlan.rotation)){
int dst = Math.max(Math.abs(other.x - currentPlan.x), Math.abs(other.y - currentPlan.y));

View File

@@ -74,9 +74,9 @@ public class ItemBridge extends Block{
}
}
static int currentFindX, currentFindY;
static BuildPlan currentPlan;
static final Boolf<BuildPlan> planFinder = other -> other.block == currentPlan.block && currentPlan != other && currentFindX == other.x && currentFindY == other.y;
private static int currentFindX, currentFindY;
private static BuildPlan currentPlan;
private static final Boolf<BuildPlan> planFinder = other -> other.block == currentPlan.block && currentPlan != other && currentFindX == other.x && currentFindY == other.y;
@Override
public void drawPlanConfigTop(BuildPlan plan, Eachable<BuildPlan> list){

View File

@@ -315,9 +315,9 @@ public class PowerNode extends PowerBlock{
});
}
static int currentFindX, currentFindY;
static BuildPlan currentPlan;
static final Boolf<BuildPlan> planFinder = other -> other.block != null
private static int currentFindX, currentFindY;
private static BuildPlan currentPlan;
private static final Boolf<BuildPlan> planFinder = other -> other.block != null
&& (currentFindX >= other.x - ((other.block.size - 1) / 2) && currentFindY >= other.y - ((other.block.size - 1) / 2) && currentFindX <= other.x + other.block.size / 2 && currentFindY <= other.y + other.block.size / 2)
&& other != currentPlan && other.block.hasPower;