Example #1
0
 public void a(CrashReportSystemDetails crashreportsystemdetails) {
   crashreportsystemdetails.a("Name", (Callable) (new CrashReportTileEntityName(this)));
   if (this.world != null) {
     CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.w(), this.u());
     crashreportsystemdetails.a(
         "Actual block type", (Callable) (new CrashReportTileEntityType(this)));
     crashreportsystemdetails.a(
         "Actual block data value", (Callable) (new CrashReportTileEntityData(this)));
   }
 }
Example #2
0
 public void appendEntityCrashDetails(CrashReportSystemDetails crashreportsystemdetails) {
   crashreportsystemdetails.a("Entity Type", (Callable) (new CrashReportEntityType(this)));
   crashreportsystemdetails.a("Entity ID", (Object) Integer.valueOf(this.id));
   crashreportsystemdetails.a("Entity Name", (Callable) (new CrashReportEntityName(this)));
   crashreportsystemdetails.a(
       "Entity\'s Exact location",
       (Object)
           String.format(
               "%.2f, %.2f, %.2f",
               new Object[] {
                 Double.valueOf(this.locX), Double.valueOf(this.locY), Double.valueOf(this.locZ)
               }));
   crashreportsystemdetails.a(
       "Entity\'s Block location",
       (Object)
           CrashReportSystemDetails.a(
               (double) MathHelper.floor(this.locX),
               (double) MathHelper.floor(this.locY),
               (double) MathHelper.floor(this.locZ)));
   crashreportsystemdetails.a(
       "Entity\'s Momentum",
       (Object)
           String.format(
               "%.2f, %.2f, %.2f",
               new Object[] {
                 Double.valueOf(this.motX), Double.valueOf(this.motY), Double.valueOf(this.motZ)
               }));
   crashreportsystemdetails.a("Entity\'s Rider", (Callable) (new CrashReportEntityRider(this)));
   crashreportsystemdetails.a(
       "Entity\'s Vehicle", (Callable) (new CrashReportEntityVehicle(this)));
 }
Example #3
0
  protected void checkBlockCollisions() {
    BlockPosition blockposition =
        new BlockPosition(
            this.getBoundingBox().a + 0.001D,
            this.getBoundingBox().b + 0.001D,
            this.getBoundingBox().c + 0.001D);
    BlockPosition blockposition1 =
        new BlockPosition(
            this.getBoundingBox().d - 0.001D,
            this.getBoundingBox().e - 0.001D,
            this.getBoundingBox().f - 0.001D);

    if (this.world.areChunksLoadedBetween(blockposition, blockposition1)) {
      for (int i = blockposition.getX(); i <= blockposition1.getX(); ++i) {
        for (int j = blockposition.getY(); j <= blockposition1.getY(); ++j) {
          for (int k = blockposition.getZ(); k <= blockposition1.getZ(); ++k) {
            BlockPosition blockposition2 = new BlockPosition(i, j, k);
            IBlockData iblockdata = this.world.getType(blockposition2);

            try {
              iblockdata.getBlock().a(this.world, blockposition2, iblockdata, this);
            } catch (Throwable throwable) {
              CrashReport crashreport = CrashReport.a(throwable, "Colliding entity with block");
              CrashReportSystemDetails crashreportsystemdetails =
                  crashreport.a("Block being collided with");

              CrashReportSystemDetails.a(crashreportsystemdetails, blockposition2, iblockdata);
              throw new ReportedException(crashreport);
            }
          }
        }
      }
    }
  }
Example #4
0
  public void b() {
    for (int i = 0; i < this.c.size(); ++i) {
      PlayerConnection playerconnection = (PlayerConnection) this.c.get(i);

      try {
        playerconnection.e();
      } catch (Exception exception) {
        if (playerconnection.networkManager instanceof MemoryNetworkManager) {
          CrashReport crashreport =
              CrashReport.a((Throwable) exception, "Ticking memory connection");
          CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Ticking connection");

          crashreportsystemdetails.a(
              "Connection", (Callable) (new CallableConnection(this, playerconnection)));
          throw new ReportedException(crashreport);
        }

        this.b
            .getLogger()
            .warning(
                "Failed to handle packet for "
                    + playerconnection.player.getLocalizedName()
                    + "/"
                    + playerconnection.player.q()
                    + ": "
                    + exception,
                (Throwable) exception);
        playerconnection.disconnect("Internal server error");
      }

      if (playerconnection.disconnected) {
        this.c.remove(i--);
      }

      playerconnection.networkManager.a();
    }
  }
Example #5
0
 public void a(CrashReportSystemDetails crashreportsystemdetails) {
   crashreportsystemdetails.a("Name", new CrashReportTileEntityName(this));
   CrashReportSystemDetails.a(crashreportsystemdetails, x, y, z, q(), p());
   crashreportsystemdetails.a("Actual block type", new CrashReportTileEntityType(this));
   crashreportsystemdetails.a("Actual block data value", new CrashReportTileEntityData(this));
 }
Example #6
0
  public boolean a(boolean flag) {
    int i = this.M.size();

    if (i != this.L.size()) {
      throw new IllegalStateException("TickNextTick list out of synch");
    } else {
      if (i > 1000) {
        // CraftBukkit start - If the server has too much to process over time, try to alleviate
        // that
        if (i > 20 * 1000) {
          i = i / 20;
        } else {
          i = 1000;
        }
        // CraftBukkit end
      }

      this.methodProfiler.a("cleaning");

      NextTickListEntry nextticklistentry;

      for (int j = 0; j < i; ++j) {
        nextticklistentry = (NextTickListEntry) this.M.first();
        if (!flag && nextticklistentry.e > this.worldData.getTime()) {
          break;
        }

        this.M.remove(nextticklistentry);
        this.L.remove(nextticklistentry);
        this.U.add(nextticklistentry);
      }

      this.methodProfiler.b();
      this.methodProfiler.a("ticking");
      Iterator iterator = this.U.iterator();

      while (iterator.hasNext()) {
        nextticklistentry = (NextTickListEntry) iterator.next();
        iterator.remove();
        byte b0 = 0;

        if (this.e(
            nextticklistentry.a - b0,
            nextticklistentry.b - b0,
            nextticklistentry.c - b0,
            nextticklistentry.a + b0,
            nextticklistentry.b + b0,
            nextticklistentry.c + b0)) {
          int k = this.getTypeId(nextticklistentry.a, nextticklistentry.b, nextticklistentry.c);

          if (k > 0 && Block.b(k, nextticklistentry.d)) {
            try {
              Block.byId[k].a(
                  this, nextticklistentry.a, nextticklistentry.b, nextticklistentry.c, this.random);
            } catch (Throwable throwable) {
              CrashReport crashreport = CrashReport.a(throwable, "Exception while ticking a block");
              CrashReportSystemDetails crashreportsystemdetails =
                  crashreport.a("Block being ticked");

              int l;

              try {
                l = this.getData(nextticklistentry.a, nextticklistentry.b, nextticklistentry.c);
              } catch (Throwable throwable1) {
                l = -1;
              }

              CrashReportSystemDetails.a(
                  crashreportsystemdetails,
                  nextticklistentry.a,
                  nextticklistentry.b,
                  nextticklistentry.c,
                  k,
                  l);
              throw new ReportedException(crashreport);
            }
          }
        } else {
          this.a(
              nextticklistentry.a,
              nextticklistentry.b,
              nextticklistentry.c,
              nextticklistentry.d,
              0);
        }
      }

      this.methodProfiler.b();
      this.U.clear();
      return !this.M.isEmpty();
    }
  }