Exemple #1
0
 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 netclienthandler, WorldSettings worldsettings, int i, int j) {
   super(new SaveHandlerMP(), "MpServer", WorldProvider.func_4101_a(i), worldsettings);
   field_1057_z = new LinkedList();
   field_1055_D = new IntHashMap();
   field_20914_E = new HashSet();
   field_1053_F = new HashSet();
   field_1052_A = netclienthandler;
   field_1039_l = j;
   func_22143_a(new ChunkCoordinates(8, 64, 8));
   field_28108_z = netclienthandler.field_28118_b;
 }
Exemple #3
0
 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;
 }
Exemple #4
0
  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);
  }
 public WorldClient(
     NetClientHandler p_i11015_1_,
     WorldSettings p_i11015_2_,
     int p_i11015_3_,
     int p_i11015_4_,
     Profiler p_i11015_5_,
     ILogAgent p_i11015_6_) {
   super(
       new SaveHandlerMP(),
       "MpServer",
       WorldProvider.func_76570_a(p_i11015_3_),
       p_i11015_2_,
       p_i11015_5_,
       p_i11015_6_);
   this.field_73035_a = p_i11015_1_;
   this.field_73013_u = p_i11015_4_;
   this.func_72950_A(8, 64, 8);
   this.field_72988_C = p_i11015_1_.field_72558_b;
 }