public void usePortal() { System.out.println("Toggling dimension!!"); if (thePlayer.dimension == -1) { thePlayer.dimension = 0; } else { thePlayer.dimension = -1; } theWorld.setEntityDead(thePlayer); thePlayer.isDead = false; double d = thePlayer.posX; double d1 = thePlayer.posZ; double d2 = 8D; if (thePlayer.dimension == -1) { d /= d2; d1 /= d2; thePlayer.setLocationAndAngles( d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch); if (thePlayer.isEntityAlive()) { theWorld.updateEntityWithOptionalForce(thePlayer, false); } World world = null; world = new World(theWorld, WorldProvider.getProviderForDimension(-1)); changeWorld(world, "Entering the Nether", thePlayer); } else { d *= d2; d1 *= d2; thePlayer.setLocationAndAngles( d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch); if (thePlayer.isEntityAlive()) { theWorld.updateEntityWithOptionalForce(thePlayer, false); } World world1 = null; world1 = new World(theWorld, WorldProvider.getProviderForDimension(0)); changeWorld(world1, "Leaving the Nether", thePlayer); } thePlayer.worldObj = theWorld; if (thePlayer.isEntityAlive()) { thePlayer.setLocationAndAngles( d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch); theWorld.updateEntityWithOptionalForce(thePlayer, false); (new Teleporter()).func_4107_a(theWorld, thePlayer); } }
public WorldClient( NetClientHandler par1NetClientHandler, WorldSettings par2WorldSettings, int par3, int par4, Profiler par5Profiler) { super( new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler); this.sendQueue = par1NetClientHandler; this.difficultySetting = par4; this.setSpawnLocation(8, 64, 8); this.mapStorage = par1NetClientHandler.mapStorage; }
public WorldServer( MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler, ILogAgent par7ILogAgent) { super( par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler, par7ILogAgent); this.mcServer = par1MinecraftServer; this.theEntityTracker = new EntityTracker(this); this.thePlayerManager = new PlayerManager(this, par1MinecraftServer.getConfigurationManager().getViewDistance()); if (this.entityIdMap == null) { this.entityIdMap = new IntHashMap(); } if (this.pendingTickListEntriesHashSet == null) { this.pendingTickListEntriesHashSet = new HashSet(); } if (this.pendingTickListEntriesTreeSet == null) { this.pendingTickListEntriesTreeSet = new TreeSet(); } this.field_85177_Q = new Teleporter(this); this.worldScoreboard = new ServerScoreboard(par1MinecraftServer); ScoreboardSaveData var8 = (ScoreboardSaveData) this.mapStorage.loadData(ScoreboardSaveData.class, "scoreboard"); if (var8 == null) { var8 = new ScoreboardSaveData(); this.mapStorage.setData("scoreboard", var8); } var8.func_96499_a(this.worldScoreboard); ((ServerScoreboard) this.worldScoreboard).func_96547_a(var8); }