From 650d47991e71f3fef8fa5e938e0dd712890fc8c0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 15 Jan 2021 12:43:37 -0500 Subject: [PATCH] Formatting --- core/src/mindustry/ai/BaseAI.java | 3 ++- .../blocks/distribution/StackConveyor.java | 26 +++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/core/src/mindustry/ai/BaseAI.java b/core/src/mindustry/ai/BaseAI.java index 85e6656d28..6a1e43b172 100644 --- a/core/src/mindustry/ai/BaseAI.java +++ b/core/src/mindustry/ai/BaseAI.java @@ -265,6 +265,7 @@ public class BaseAI{ if(spawn == null) return; for(int wx = lastX; wx <= lastX + lastW; wx++){ + outer: for(int wy = lastY; wy <= lastY + lastH; wy++){ Tile tile = world.tile(wx, wy); @@ -279,7 +280,7 @@ public class BaseAI{ Tile o = world.tile(tile.x + p.x, tile.y + p.y); if(o != null && (o.block() instanceof PayloadAcceptor || o.block() instanceof PayloadConveyor)){ - break; + continue outer; } if(o != null && o.team() == data.team && !(o.block() instanceof Wall)){ diff --git a/core/src/mindustry/world/blocks/distribution/StackConveyor.java b/core/src/mindustry/world/blocks/distribution/StackConveyor.java index d68365a4d3..ceb9339635 100644 --- a/core/src/mindustry/world/blocks/distribution/StackConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/StackConveyor.java @@ -201,21 +201,21 @@ public class StackConveyor extends Block implements Autotiler{ @Override public void updateTile(){ - // reel in crater + //reel in crater if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta(), 0f, recharge); - // indicates empty state + //indicates empty state if(link == -1) return; - // crater needs to be centered + //crater needs to be centered if(cooldown > 0f) return; - // get current item + //get current item if(lastItem == null || !items.has(lastItem)){ lastItem = items.first(); } - // do not continue if disabled, will still allow one to be reeled in to prevent visual stacking + //do not continue if disabled, will still allow one to be reeled in to prevent visual stacking if(!enabled) return; if(state == stateUnload){ //unload @@ -225,12 +225,12 @@ public class StackConveyor extends Block implements Autotiler{ }else{ //transfer if(state != stateLoad || (items.total() >= getMaximumAccepted(lastItem))){ if(front() instanceof StackConveyorBuild e && e.team == team){ - // sleep if its occupied + //sleep if its occupied if(e.link == -1){ e.items.add(items); e.lastItem = lastItem; e.link = tile.pos(); - // ▲ to | from ▼ + //▲ to | from ▼ link = -1; items.clear(); @@ -254,7 +254,7 @@ public class StackConveyor extends Block implements Autotiler{ @Override public boolean shouldAmbientSound(){ - return false; // has no moving parts; + return false; //has no moving parts; } protected void poofIn(){ @@ -304,11 +304,11 @@ public class StackConveyor extends Block implements Autotiler{ @Override public boolean acceptItem(Building source, Item item){ - if(this == source) return true; // player threw items - if(cooldown > recharge - 1f) return false; // still cooling down - return !((state != stateLoad) // not a loading dock - || (items.any() && !items.has(item)) // incompatible items - || (items.total() >= getMaximumAccepted(item)) // filled to capacity + if(this == source) return true; //player threw items + if(cooldown > recharge - 1f) return false; //still cooling down + return !((state != stateLoad) //not a loading dock + || (items.any() && !items.has(item)) //incompatible items + || (items.total() >= getMaximumAccepted(item)) //filled to capacity || (front() == source)); }