Formatting

This commit is contained in:
Anuken
2021-01-15 12:43:37 -05:00
parent 6ec76409ef
commit 650d47991e
2 changed files with 15 additions and 14 deletions

View File

@@ -265,6 +265,7 @@ public class BaseAI{
if(spawn == null) return; if(spawn == null) return;
for(int wx = lastX; wx <= lastX + lastW; wx++){ for(int wx = lastX; wx <= lastX + lastW; wx++){
outer:
for(int wy = lastY; wy <= lastY + lastH; wy++){ for(int wy = lastY; wy <= lastY + lastH; wy++){
Tile tile = world.tile(wx, 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); Tile o = world.tile(tile.x + p.x, tile.y + p.y);
if(o != null && (o.block() instanceof PayloadAcceptor || o.block() instanceof PayloadConveyor)){ 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)){ if(o != null && o.team() == data.team && !(o.block() instanceof Wall)){

View File

@@ -201,21 +201,21 @@ public class StackConveyor extends Block implements Autotiler{
@Override @Override
public void updateTile(){ public void updateTile(){
// reel in crater //reel in crater
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta(), 0f, recharge); if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta(), 0f, recharge);
// indicates empty state //indicates empty state
if(link == -1) return; if(link == -1) return;
// crater needs to be centered //crater needs to be centered
if(cooldown > 0f) return; if(cooldown > 0f) return;
// get current item //get current item
if(lastItem == null || !items.has(lastItem)){ if(lastItem == null || !items.has(lastItem)){
lastItem = items.first(); 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(!enabled) return;
if(state == stateUnload){ //unload if(state == stateUnload){ //unload
@@ -225,12 +225,12 @@ public class StackConveyor extends Block implements Autotiler{
}else{ //transfer }else{ //transfer
if(state != stateLoad || (items.total() >= getMaximumAccepted(lastItem))){ if(state != stateLoad || (items.total() >= getMaximumAccepted(lastItem))){
if(front() instanceof StackConveyorBuild e && e.team == team){ if(front() instanceof StackConveyorBuild e && e.team == team){
// sleep if its occupied //sleep if its occupied
if(e.link == -1){ if(e.link == -1){
e.items.add(items); e.items.add(items);
e.lastItem = lastItem; e.lastItem = lastItem;
e.link = tile.pos(); e.link = tile.pos();
// ▲ to | from ▼ //▲ to | from ▼
link = -1; link = -1;
items.clear(); items.clear();
@@ -254,7 +254,7 @@ public class StackConveyor extends Block implements Autotiler{
@Override @Override
public boolean shouldAmbientSound(){ public boolean shouldAmbientSound(){
return false; // has no moving parts; return false; //has no moving parts;
} }
protected void poofIn(){ protected void poofIn(){
@@ -304,11 +304,11 @@ public class StackConveyor extends Block implements Autotiler{
@Override @Override
public boolean acceptItem(Building source, Item item){ public boolean acceptItem(Building source, Item item){
if(this == source) return true; // player threw items if(this == source) return true; //player threw items
if(cooldown > recharge - 1f) return false; // still cooling down if(cooldown > recharge - 1f) return false; //still cooling down
return !((state != stateLoad) // not a loading dock return !((state != stateLoad) //not a loading dock
|| (items.any() && !items.has(item)) // incompatible items || (items.any() && !items.has(item)) //incompatible items
|| (items.total() >= getMaximumAccepted(item)) // filled to capacity || (items.total() >= getMaximumAccepted(item)) //filled to capacity
|| (front() == source)); || (front() == source));
} }