Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

This commit is contained in:
Anuken
2021-10-15 17:10:30 -04:00
4 changed files with 10 additions and 11 deletions

View File

@@ -68,7 +68,7 @@ public class BuilderAI extends AIController{
//approach request if building //approach request if building
BuildPlan req = unit.buildPlan(); BuildPlan req = unit.buildPlan();
//clear break plan if another player is breaking something. //clear break plan if another player is breaking something
if(!req.breaking && timer.get(timerTarget2, 40f)){ if(!req.breaking && timer.get(timerTarget2, 40f)){
for(Player player : Groups.player){ for(Player player : Groups.player){
if(player.isBuilder() && player.unit().activelyBuilding() && player.unit().buildPlan().samePos(req) && player.unit().buildPlan().breaking){ if(player.isBuilder() && player.unit().activelyBuilding() && player.unit().buildPlan().samePos(req) && player.unit().buildPlan().breaking){
@@ -131,16 +131,15 @@ public class BuilderAI extends AIController{
//check if it's already been placed //check if it's already been placed
if(world.tile(block.x, block.y) != null && world.tile(block.x, block.y).block().id == block.block){ if(world.tile(block.x, block.y) != null && world.tile(block.x, block.y).block().id == block.block){
blocks.removeFirst(); blocks.removeFirst();
}else if(Build.validPlace(content.block(block.block), unit.team(), block.x, block.y, block.rotation)){ //it's valid. }else if(Build.validPlace(content.block(block.block), unit.team(), block.x, block.y, block.rotation)){ //it's valid
lastPlan = block; lastPlan = block;
//add build request. //add build request
unit.addBuild(new BuildPlan(block.x, block.y, block.rotation, content.block(block.block), block.config)); unit.addBuild(new BuildPlan(block.x, block.y, block.rotation, content.block(block.block), block.config));
//shift build plan to tail so next unit builds something else. //shift build plan to tail so next unit builds something else
blocks.addLast(blocks.removeFirst()); blocks.addLast(blocks.removeFirst());
}else{ }else{
//shift head of queue to tail, try something else next time //shift head of queue to tail, try something else next time
blocks.removeFirst(); blocks.addLast(blocks.removeFirst());
blocks.addLast(block);
} }
} }
} }

View File

@@ -250,10 +250,7 @@ public class Blocks implements ContentList{
canShadow = false; canShadow = false;
}}; }};
empty = new EmptyFloor("empty"){{ empty = new EmptyFloor("empty");
placeableOn = false;
solid = true;
}};
stone = new Floor("stone"); stone = new Floor("stone");

View File

@@ -38,11 +38,11 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
boolean admin; boolean admin;
String name = "frog"; String name = "frog";
Color color = new Color(); Color color = new Color();
//locale should not be synced.
transient String locale = "en"; transient String locale = "en";
transient float deathTimer; transient float deathTimer;
transient String lastText = ""; transient String lastText = "";
transient float textFadeTime; transient float textFadeTime;
transient private Unit lastReadUnit = Nulls.unit; transient private Unit lastReadUnit = Nulls.unit;
transient private int wrongReadUnits; transient private int wrongReadUnits;
transient @Nullable Unit justSwitchFrom, justSwitchTo; transient @Nullable Unit justSwitchFrom, justSwitchTo;

View File

@@ -3,12 +3,15 @@ package mindustry.world.blocks.environment;
import mindustry.content.*; import mindustry.content.*;
import mindustry.world.*; import mindustry.world.*;
/** Empty floor is *not* equivalent to air. Unlike air, it is solid, and still draws neighboring tile edges. */
public class EmptyFloor extends Floor{ public class EmptyFloor extends Floor{
public EmptyFloor(String name){ public EmptyFloor(String name){
super(name); super(name);
variants = 0; variants = 0;
canShadow = false; canShadow = false;
placeableOn = false;
solid = true;
} }
@Override @Override