Search in sources :

Example 6 with RecipeBook

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);
    }
}
Also used : RecipeBook(net.minecraft.stats.RecipeBook) StatisticsManager(net.minecraft.stats.StatisticsManager) GuiGameOver(net.minecraft.client.gui.GuiGameOver) MovementInputFromOptions(net.minecraft.util.MovementInputFromOptions) TextComponentString(net.minecraft.util.text.TextComponentString) NBTTagString(net.minecraft.nbt.NBTTagString) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP)

Aggregations

RecipeBook (net.minecraft.stats.RecipeBook)6 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)4 GuiGameOver (net.minecraft.client.gui.GuiGameOver)4 Nullable (javax.annotation.Nullable)3 ItemStack (net.minecraft.item.ItemStack)3 IRecipe (net.minecraft.item.crafting.IRecipe)3 Maps (com.google.common.collect.Maps)2 FutureCallback (com.google.common.util.concurrent.FutureCallback)2 Futures (com.google.common.util.concurrent.Futures)2 GameProfile (com.mojang.authlib.GameProfile)2 Unpooled (io.netty.buffer.Unpooled)2 File (java.io.File)2 IOException (java.io.IOException)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 URLDecoder (java.net.URLDecoder)2 StandardCharsets (java.nio.charset.StandardCharsets)2 Arrays (java.util.Arrays)2 Collection (java.util.Collection)2