use of net.minecraft.stats.RecipeBook in project CumServerPro by MCUmbrella.
the class Minecraft method setDimensionAndSpawnPlayer.
public void setDimensionAndSpawnPlayer(int dimension) {
this.world.setInitialSpawnLocation();
this.world.removeAllEntities();
int i = 0;
String s = null;
if (this.player != null) {
i = this.player.getEntityId();
this.world.removeEntity(this.player);
s = this.player.getServerBrand();
}
this.renderViewEntity = null;
EntityPlayerSP entityplayersp = this.player;
this.player = this.playerController.createPlayer(this.world, this.player == null ? new StatisticsManager() : this.player.getStatFileWriter(), this.player == null ? new RecipeBook() : this.player.getRecipeBook());
this.player.getDataManager().setEntryValues(entityplayersp.getDataManager().getAll());
// Forge: fix MC-10657
this.player.updateSyncFields(entityplayersp);
this.player.dimension = dimension;
this.renderViewEntity = this.player;
this.player.preparePlayerToSpawn();
this.player.setServerBrand(s);
this.world.spawnEntity(this.player);
this.playerController.flipPlayer(this.player);
this.player.movementInput = new MovementInputFromOptions(this.gameSettings);
this.player.setEntityId(i);
this.playerController.setPlayerCapabilities(this.player);
this.player.setReducedDebug(entityplayersp.hasReducedDebug());
if (this.currentScreen instanceof GuiGameOver) {
this.displayGuiScreen((GuiScreen) null);
}
}
Aggregations