Implemented standalone server, fixed breaking bugs
This commit is contained in:
@@ -15,6 +15,9 @@ import io.anuke.ucore.function.Consumer;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static io.anuke.mindustry.Vars.headless;
|
||||
import static io.anuke.mindustry.Vars.ui;
|
||||
|
||||
public class Net{
|
||||
public static final int version = 13;
|
||||
|
||||
@@ -29,6 +32,15 @@ public class Net{
|
||||
|
||||
private static IntMap<StreamBuilder> streams = new IntMap<>();
|
||||
|
||||
/**Display a network error.*/
|
||||
public static void showError(String text){
|
||||
if(!headless){
|
||||
ui.showError(text);
|
||||
}else{
|
||||
UCore.log(text);
|
||||
}
|
||||
}
|
||||
|
||||
/**Sets the client loaded status, or whether it will recieve normal packets from the server.*/
|
||||
public static void setClientLoaded(boolean loaded){
|
||||
clientLoaded = loaded;
|
||||
|
||||
@@ -266,7 +266,7 @@ public class NetworkIO {
|
||||
world.loadMap(world.maps().getMap(mapid), seed);
|
||||
renderer.clearTiles();
|
||||
|
||||
player.set(world.getCore().worldx(), world.getCore().worldy());
|
||||
player.set(world.getSpawnX(), world.getSpawnY());
|
||||
|
||||
for(int x = 0; x < world.width(); x ++){
|
||||
for(int y = 0; y < world.height(); y ++){
|
||||
|
||||
Reference in New Issue
Block a user