コード例 #1
0
ファイル: Entity.java プロジェクト: randyzingle/javaalg
  public void c(int i) {
    if (!this.world.isStatic && !this.dead) {
      this.world.methodProfiler.a("changeDimension");
      MinecraftServer minecraftserver = MinecraftServer.getServer();
      int j = this.dimension;
      WorldServer worldserver = minecraftserver.getWorldServer(j);
      WorldServer worldserver1 = minecraftserver.getWorldServer(i);

      this.dimension = i;
      if (j == 1 && i == 1) {
        worldserver1 = minecraftserver.getWorldServer(0);
        this.dimension = 0;
      }

      this.world.kill(this);
      this.dead = false;
      this.world.methodProfiler.a("reposition");
      minecraftserver.getPlayerList().changeWorld(this, j, worldserver, worldserver1);
      this.world.methodProfiler.c("reloading");
      Entity entity = EntityTypes.createEntityByName(EntityTypes.b(this), worldserver1);

      if (entity != null) {
        entity.n(this);
        if (j == 1 && i == 1) {
          BlockPosition blockposition = this.world.r(worldserver1.getSpawn());

          entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
        }

        worldserver1.addEntity(entity);
      }

      this.dead = true;
      this.world.methodProfiler.b();
      worldserver.j();
      worldserver1.j();
      this.world.methodProfiler.b();
    }
  }
コード例 #2
0
ファイル: Entity.java プロジェクト: MadMockers/mc-dev
  public void m() {
    if (k != null && k.G) {
      k = null;
    }
    X++;
    K = L;
    m = p;
    n = q;
    o = r;
    y = w;
    x = v;
    if (r()) {
      if (!ab && !c) {
        float f1 =
            MathHelper.a(s * s * 0.20000000298023224D + t * t + u * u * 0.20000000298023224D)
                * 0.2F;

        if (f1 > 1.0F) {
          f1 = 1.0F;
        }
        l.a(this, "random.splash", f1, 1.0F + (W.nextFloat() - W.nextFloat()) * 0.4F);
        float f2 = MathHelper.b(z.b);

        for (int i1 = 0; (float) i1 < 1.0F + I * 20F; i1++) {
          float f3 = (W.nextFloat() * 2.0F - 1.0F) * I;
          float f5 = (W.nextFloat() * 2.0F - 1.0F) * I;

          l.a(
              "bubble",
              p + (double) f3,
              f2 + 1.0F,
              r + (double) f5,
              s,
              t - (double) (W.nextFloat() * 0.2F),
              u);
        }

        for (int j1 = 0; (float) j1 < 1.0F + I * 20F; j1++) {
          float f4 = (W.nextFloat() * 2.0F - 1.0F) * I;
          float f6 = (W.nextFloat() * 2.0F - 1.0F) * I;

          l.a("splash", p + (double) f4, f2 + 1.0F, r + (double) f6, s, t, u);
        }
      }
      N = 0.0F;
      ab = true;
      Z = 0;
    } else {
      ab = false;
    }
    if (l.z) {
      Z = 0;
    } else if (Z > 0) {
      if (ae) {
        Z -= 4;
        if (Z < 0) {
          Z = 0;
        }
      } else {
        if (Z % 20 == 0) {
          a(((Entity) (null)), 1);
        }
        Z--;
      }
    }
    if (t()) {
      n();
    }
    if (q < -64D) {
      o();
    }
    c = false;
  }