Improved build sync

This commit is contained in:
Anuken
2018-08-15 15:16:56 -04:00
parent 02f95c0ed4
commit d07fd1bbfe
5 changed files with 18 additions and 93 deletions
@@ -108,6 +108,8 @@ public interface BuilderTrait extends Entity{
if(applyChanges){
getPlaceQueue().addLast(request);
}else if(isBuilding()){
getCurrentRequest().progress = progress;
}
}
}
@@ -149,6 +151,10 @@ public interface BuilderTrait extends Entity{
return;
}
}
Tile tile = world.tile(place.x, place.y);
if(tile != null && tile.entity instanceof BuildEntity){
place.progress = tile.<BuildEntity>entity().progress;
}
getPlaceQueue().addLast(place);
}
}
@@ -226,6 +232,8 @@ public interface BuilderTrait extends Entity{
}
current.progress = entity.progress();
}else{
entity.progress = current.progress;
}
}