Visual server respawning fix

This commit is contained in:
Anuken
2019-04-28 10:51:14 -04:00
parent 4c17b56e28
commit 3b2aa92eb7
3 changed files with 22 additions and 16 deletions

View File

@@ -794,10 +794,12 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
if(spawner != null && spawner.isValid()){
spawner.updateSpawning(this);
}else if(!netServer.isWaitingForPlayers()){
if(lastSpawner != null && lastSpawner.isValid()){
this.spawner = lastSpawner;
}else if(getClosestCore() != null){
this.spawner = (SpawnerTrait)getClosestCore();
if(!Net.client()){
if(lastSpawner != null && lastSpawner.isValid()){
this.spawner = lastSpawner;
}else if(getClosestCore() != null){
this.spawner = (SpawnerTrait)getClosestCore();
}
}
}else if(getClosestCore() != null){
set(getClosestCore().getX(), getClosestCore().getY());
@@ -898,12 +900,13 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
}else{
mining = world.tile(mine);
isBoosting = boosting;
Tile tile = world.tile(spawner);
if(tile != null && tile.entity instanceof SpawnerTrait){
this.spawner = (SpawnerTrait)tile.entity;
}else{
this.spawner = null;
}
}
Tile tile = world.tile(spawner);
if(tile != null && tile.entity instanceof SpawnerTrait){
this.spawner = (SpawnerTrait)tile.entity;
}else{
this.spawner = null;
}
}