public org.box2d.proto.Box2D.PbWorld buildPartial() {
        org.box2d.proto.Box2D.PbWorld result = new org.box2d.proto.Box2D.PbWorld(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.tag_ = tag_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        if (gravityBuilder_ == null) {
          result.gravity_ = gravity_;
        } else {
          result.gravity_ = gravityBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.allowSleep_ = allowSleep_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        result.autoClearForces_ = autoClearForces_;
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000010;
        }
        result.warmStarting_ = warmStarting_;
        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
          to_bitField0_ |= 0x00000020;
        }
        result.continuousPhysics_ = continuousPhysics_;
        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
          to_bitField0_ |= 0x00000040;
        }
        result.subStepping_ = subStepping_;
        if (bodiesBuilder_ == null) {
          if (((bitField0_ & 0x00000080) == 0x00000080)) {
            bodies_ = java.util.Collections.unmodifiableList(bodies_);
            bitField0_ = (bitField0_ & ~0x00000080);
          }
          result.bodies_ = bodies_;
        } else {
          result.bodies_ = bodiesBuilder_.build();
        }
        if (jointsBuilder_ == null) {
          if (((bitField0_ & 0x00000100) == 0x00000100)) {
            joints_ = java.util.Collections.unmodifiableList(joints_);
            bitField0_ = (bitField0_ & ~0x00000100);
          }
          result.joints_ = joints_;
        } else {
          result.joints_ = jointsBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }