Static field fix
This commit is contained in:
@@ -56,7 +56,7 @@ public class DirectionBridge extends Block{
|
|||||||
Draw.rect(dirRegion, plan.drawx(), plan.drawy(), plan.rotation * 90);
|
Draw.rect(dirRegion, plan.drawx(), plan.drawy(), plan.rotation * 90);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BuildPlan currentPlan, otherPlan;
|
private static BuildPlan currentPlan, otherPlan;
|
||||||
private Boolf<BuildPlan> planFinder = other -> {
|
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)){
|
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));
|
int dst = Math.max(Math.abs(other.x - currentPlan.x), Math.abs(other.y - currentPlan.y));
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ public class ItemBridge extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int currentFindX, currentFindY;
|
private static int currentFindX, currentFindY;
|
||||||
static BuildPlan currentPlan;
|
private static BuildPlan currentPlan;
|
||||||
static final Boolf<BuildPlan> planFinder = other -> other.block == currentPlan.block && currentPlan != other && currentFindX == other.x && currentFindY == other.y;
|
private static final Boolf<BuildPlan> planFinder = other -> other.block == currentPlan.block && currentPlan != other && currentFindX == other.x && currentFindY == other.y;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlanConfigTop(BuildPlan plan, Eachable<BuildPlan> list){
|
public void drawPlanConfigTop(BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
|
|||||||
@@ -315,9 +315,9 @@ public class PowerNode extends PowerBlock{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static int currentFindX, currentFindY;
|
private static int currentFindX, currentFindY;
|
||||||
static BuildPlan currentPlan;
|
private static BuildPlan currentPlan;
|
||||||
static final Boolf<BuildPlan> planFinder = other -> other.block != null
|
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)
|
&& (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;
|
&& other != currentPlan && other.block.hasPower;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user